diff src/main/webapp/methods/addSectionToTopic.jsp @ 41:ba9515f22897

new: topic management and adding sections from searching result into topic
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 17 Dec 2015 13:44:08 +0100
parents
children 9dbbbfd474f4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/methods/addSectionToTopic.jsp	Thu Dec 17 13:44:08 2015 +0100
@@ -0,0 +1,55 @@
+<%@page import="de.mpiwg.gazetteer.bo.LGTopic"%>
+<%@page import="de.mpiwg.gazetteer.db.DBSection"%>
+<%@page import="de.mpiwg.gazetteer.utils.DBService"%>
+<%@page import="de.mpiwg.gazetteer.utils.DataProvider"%>
+
+<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
+	
+<%
+	if(request.getParameter("sectionId") != null){
+		Long sectionId = Long.parseLong(request.getParameter("sectionId"));
+		
+		if(sectionId != 0){
+			
+			if (sessionBean.getTopicListPage().getCompleteTopicList() == null) {
+				sessionBean.getTopicListPage().loadParameters(request, response);
+				sessionBean.getTopicListPage().reloadTopics();
+			}
+			
+			
+%>
+	
+	<form name="addSectionToTopicForm" id="addSectionToTopicForm"
+		action="<%= sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
+		method="post">
+		<input name="bean" type="hidden" value="topicBean" /> 
+
+		<!-- TODO add section to selected topic -->
+		<input name="selectedSectionId" type="hidden" value="<%=request.getParameter("sectionId") %>" />
+				
+		<table class="dialogTable">
+			<tr>
+				<td><label style="font-weight: bold;">Topic Id</label></td>
+				<td><label style="font-weight: bold;">Name</label></td>
+			</tr>
+			
+			<% for (LGTopic topic : sessionBean.getTopicListPage().getCompleteTopicList() ) {%>
+			<tr>	
+				<td><%=topic.getId() %></td>
+				<td>
+					<%=topic.getNameEn() %>(<%=topic.getNameCh() %>)
+ 
+					<input type="image"
+							onclick="setAction0('addSectionToTopic', 'addSectionToTopicForm', 'selectedTopicId', '<%=topic.getId() %>');"
+							src="<%=sessionBean.getApplicationBean().getPlusImage() %>" width="20" height="20"/>
+				</td>						
+			</tr>
+			<% } %>
+		</table>
+	
+	</form>
+	
+<%
+		}
+	}
+%>
\ No newline at end of file