comparison src/main/webapp/methods/addSectionToTopic.jsp @ 43:9dbbbfd474f4

new: 1.existing topic in search result. 2.difference-set of book for topic
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 23 Dec 2015 16:03:32 +0100
parents ba9515f22897
children b8ad346e39a0
comparison
equal deleted inserted replaced
42:815cd86bb9ec 43:9dbbbfd474f4
1 <%@page import="de.mpiwg.gazetteer.bo.LGTopic"%> 1 <%@page import="de.mpiwg.gazetteer.bo.LGTopic"%>
2 <%@page import="de.mpiwg.gazetteer.db.DBSection"%> 2 <%@page import="de.mpiwg.gazetteer.db.DBSection"%>
3 <%@page import="de.mpiwg.gazetteer.utils.DBService"%> 3 <%@page import="de.mpiwg.gazetteer.utils.DBService"%>
4 <%@page import="de.mpiwg.gazetteer.utils.DataProvider"%> 4 <%@page import="de.mpiwg.gazetteer.utils.DataProvider"%>
5 5
6
6 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" /> 7 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
7 8
8 <% 9 <%
9 if(request.getParameter("sectionId") != null){ 10 if (sessionBean == null || sessionBean.getUser() == null) { %>
10 Long sectionId = Long.parseLong(request.getParameter("sectionId")); 11 <form name="timeoutForm"
12 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
13 method="post">
14 <input name="bean" type="hidden" value="loginBean" />
15
16 <h3>Timeout or Logout at another page! Please Login again.</h3>
17 <input type="image" width="40" height="40"
18 onclick="setAction('logout', 'timeoutForm');"
19 src="<%=sessionBean.getApplicationBean().getOkImage() %>"/>
11 20
12 if(sectionId != 0){ 21 </form>
13 22 <% } else if (sessionBean.getTopicListPage().getCompleteTopicList() == null) {
14 if (sessionBean.getTopicListPage().getCompleteTopicList() == null) { 23 sessionBean.getTopicListPage().loadParameters(request, response);
15 sessionBean.getTopicListPage().loadParameters(request, response); 24 sessionBean.getTopicListPage().reloadTopics();
16 sessionBean.getTopicListPage().reloadTopics();
17 }
18
19
20 %>
21
22 <form name="addSectionToTopicForm" id="addSectionToTopicForm"
23 action="<%= sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
24 method="post">
25 <input name="bean" type="hidden" value="topicBean" />
26
27 <!-- TODO add section to selected topic -->
28 <input name="selectedSectionId" type="hidden" value="<%=request.getParameter("sectionId") %>" />
29
30 <table class="dialogTable">
31 <tr>
32 <td><label style="font-weight: bold;">Topic Id</label></td>
33 <td><label style="font-weight: bold;">Name</label></td>
34 </tr>
35
36 <% for (LGTopic topic : sessionBean.getTopicListPage().getCompleteTopicList() ) {%>
37 <tr>
38 <td><%=topic.getId() %></td>
39 <td>
40 <%=topic.getNameEn() %>(<%=topic.getNameCh() %>)
41
42 <input type="image"
43 onclick="setAction0('addSectionToTopic', 'addSectionToTopicForm', 'selectedTopicId', '<%=topic.getId() %>');"
44 src="<%=sessionBean.getApplicationBean().getPlusImage() %>" width="20" height="20"/>
45 </td>
46 </tr>
47 <% } %>
48 </table>
49
50 </form>
51
52 <%
53 }
54 } 25 }
55 %> 26 %>
27
28 <form name="addSectionToTopicForm" id="addSectionToTopicForm"
29 action="<%= sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
30 method="post">
31 <input name="bean" type="hidden" value="topicBean" />
32
33
34 <table class="dialogTable">
35 <tr>
36 <td><label style="font-weight: bold;">Topic Id</label></td>
37 <td><label style="font-weight: bold;">Name</label></td>
38 </tr>
39
40 <% for (LGTopic topic : sessionBean.getTopicListPage().getCompleteTopicList() ) {%>
41 <tr>
42 <td><%=topic.getId() %></td>
43 <td>
44 <%=topic.getNameEn() %>(<%=topic.getNameCh() %>)
45
46 <% if(request.getParameter("sectionId") != null) {
47 Long sectionId = Long.parseLong(request.getParameter("sectionId"));
48 %>
49 <!-- add section to selected topic -->
50 <input name="selectedSectionId" type="hidden" value="<%=request.getParameter("sectionId") %>" />
51
52 <input type="image"
53 onclick="setAction0('addSection', 'addSectionToTopicForm', 'selectedTopicId', '<%=topic.getId() %>');"
54 src="<%=sessionBean.getApplicationBean().getPlusImage() %>" width="20" height="20"/>
55
56 <% } else if (request.getParameter("addAllSections") != null) { %>
57 <input type="image"
58 onclick="setAction0('addAllSections', 'addSectionToTopicForm', 'selectedTopicId', '<%=topic.getId() %>');"
59 src="<%=sessionBean.getApplicationBean().getPlusImage() %>" width="20" height="20"/>
60
61 <% } %>
62
63 </td>
64 </tr>
65 <% } %>
66 </table>
67
68 </form>
69
70
71