diff src/main/webapp/pages/home.jsp @ 0:3e62083dbcbf

First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 23 Apr 2015 15:46:01 +0200
parents
children 3b3e2963c8f7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/webapp/pages/home.jsp	Thu Apr 23 15:46:01 2015 +0200
@@ -0,0 +1,106 @@
+<%@page import="de.mpiwg.gazetteer.bo.LGBranch"%>
+<%@page import="org.apache.commons.lang.StringUtils"%>
+<%@page import="de.mpiwg.gazetteer.db.DBSection"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+
+<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
+
+<html>
+
+<head>
+	<jsp:include page="../componentes/headContent.jsp"/>	
+</head>
+
+<body>
+
+	<jsp:include page="../componentes/template.jsp"/>
+
+	<div id="page">
+		
+		<% if(sessionBean.getUser() == null) { %>
+			<label>You must login!</label>
+		<% } else { 
+			sessionBean.getHomePage().loadParameters(request, response);
+			sessionBean.getHomePage().reloadBranches();
+		%>
+		<label class="subTitel">User's Branches</label>
+		
+		<% if(sessionBean.getHomePage().getBranches().isEmpty()) { %>
+			<label>You do not have branches!</label>
+		<% } else { %>
+				
+			<form
+				name="homeForm"
+				action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
+				method="post">
+				
+				<input name="bean" type="hidden" value="homeBean" /> 
+				
+				<table style="width: 90%; margin-left: auto;margin-right: auto;"  class="pageTable">
+					<tr>
+						<td><label class="tableTitle">Branch ID</label></td>
+						<td><label class="tableTitle">Book ID</label></td>
+						<td><label class="tableTitle">Book Name</label></td>
+						<td><label class="tableTitle">Section Name</label></td>
+						<td><label class="tableTitle">Label</label></td>
+						<td><label class="tableTitle">Contributors</label></td>
+						<td><label class="tableTitle">Last Modified</label></td>
+						<td><label class="tableTitle">Extraction Interface</label></td>
+						<td><label class="tableTitle">Published in Dataverse</label></td>
+						<td><label class="tableTitle">Manage</label></td>
+						<td><label class="tableTitle">Delete</label></td>
+					</tr>	
+					
+					<% for(LGBranch branch : sessionBean.getHomePage().getBranches()) { %>
+					
+					<tr>
+						<td><%=branch.getId() %></td>
+						<td><%=branch.getBook().getId() %></td>
+						<td><%=branch.getBook().getName() %></td>
+						<td><%=branch.getSection().getName() %></td>
+						<td><%=branch.getLabel() %></td>
+						<td>
+							<table style="width:120px;">
+							<% for(String contributor : branch.getContributorsNameList()) { %>
+								<tr><td><label><%= contributor %></label></td></tr>
+							<% } %>
+							</table>
+						</td>
+						<td><%=branch.getFomattedLastChange() %></td>
+						<td>
+							<a onclick="branchInExtractionInterface('<%=branch.getId() %>', '<%=branch.getCurrentLastFileId() %>', '<%=branch.getSectionId() %>', '<%=branch.getSection().getName() %>', '<%=branch.getBook().getId() %>', '<%=branch.getBook().getName() %>', '<%=sessionBean.getUser().getId() %>', '<%=sessionBean.getApplicationBean().getExtractionInterfaceUrl()%>');">
+								<img alt="Show Branch in Extraction Interface" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>
+							</a>
+						</td>
+						<!-- Dataverse -->
+						<td>
+							<%=branch.isPublished() %>
+						</td>
+						<td>
+							<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/branchPage.jsp?branchId=<%=branch.getId() %>" >
+								<img alt="Manage Branch" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/>
+							</a>
+						</td>
+						<td>
+							<input type="image" 
+								onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> deleteBranch('deleteBranch', 'homeForm', '<%=branch.getId() %>');" 
+								src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
+						</td>
+						
+					</tr>
+					
+					<% } %>
+				</table>
+				<!-- 
+				<table>
+					<tr>
+						<td><input type="submit" value="Reload" onclick="setAction('reloadBranches', 'homeForm');"/> </td>
+					</tr>
+				</table>
+				 -->
+			</form>
+		<% } %>
+		<% } %>
+	</div>
+	
+</body>
\ No newline at end of file