diff src/main/webapp/pages/branchPage.jsp @ 95:b27a99201cbe

New feature: new full text search with MySQL ngram parser (5.7.6 above)
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Mon, 03 Jul 2017 23:48:53 +0200
parents 824b808a7481
children e24e7cfe337e
line wrap: on
line diff
--- a/src/main/webapp/pages/branchPage.jsp	Mon Jul 03 23:43:44 2017 +0200
+++ b/src/main/webapp/pages/branchPage.jsp	Mon Jul 03 23:48:53 2017 +0200
@@ -9,7 +9,7 @@
 <html>
 <head>
 
-	<jsp:include page="../componentes/headContent.jsp"/>	
+	<jsp:include page="../componentes/headContent.jsp"/>
 	<%
 		sessionBean.getBranchPage().loadParameters(request, response);
 		if(request.getParameter("branchId") != null){
@@ -18,7 +18,7 @@
 	%>
 	<script>
 		  $(function() {
-			  
+
 			    $( "#dialogDataverse" ).dialog({
 			        autoOpen: false,
 			        modal: true,
@@ -28,11 +28,11 @@
 			          effect: "explode",
 			          duration: 1000
 			        }
-				});			
-				
+				});
+
 				$( ".get-studies" ).click(function() {
 					var fileId = $( this ).data('file-id');
-					
+
 					var url0 = "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/getDataverseForm.jsp?fileId=" + fileId;
 
 					$.ajax( url0 )
@@ -43,52 +43,52 @@
 				  	.fail(function() {
 				    	console.error("Error calling: " + query);
 				  	})
-					
-			    });					  
-			  
-			  
+
+			    });
+
+
 			 var dialog = $( "#dialogAddContributors" ).dialog(
 					{autoOpen: false}
-		  	);	  
-			 
+		  	);
+
 			$( "#addContributors" ).button().on( "click", function() {
 			        dialog.dialog( "open" );
-			});	 
+			});
 		  });
-		  
-		  
+
+
 		  function updatePage() {
 				var text = getCookie();
-			    
+
 			    if (text == "1") {
 			        setCookie("0");
 			        setAction('forceReloadBranch', 'branchForm');
 
 			        document.forms['branchForm'].submit();
 			    }
-				
+
 			    setTimeout(updatePage, 1000);
 			}
 			updatePage();
-			
-		  
+
+
 	</script>
-	
+
 </head>
 
 <body>
-	<jsp:include page="../componentes/template.jsp"/>
-	
+	<jsp:include page="../componentes/template2.jsp"/>
+
 	<div id="dialogDataverse" title="Select a Dataset to publish your File" >
 	  <div id="dialogDataverseTable"></div>
-	</div>		
+	</div>
 
 	<div id="page">
-		
+
 		<% if(sessionBean.getUser() == null) { %>
-			<label class="subTitel">You must login!</label>
+        <label class="subTitel">Please login or create a new account above</label>
 		<% } else { %>
-		
+
 			<% if(sessionBean.getBranchPage().getBranch() != null) { %>
 			<div class="subTitel">Task Details
 				<form name="branchForm" action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
@@ -97,16 +97,16 @@
 					<input type="image"
 						onclick="setAction('forceReloadBranch', 'branchForm')"
 						src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
-											
+
 				</form>
-				
-			</div>		
-						
-			<div id="dialogAddContributors" title="Select a new Contributors:">
+
+			</div>
+
+			<div id="dialogAddContributors" title="Select a new Contributors:" style="display:none;">
 				<form name="contributorsForm" id="contributorsForm"
 						action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
 						method="post">
-						<input name="bean" type="hidden" value="branchBean" /> 
+						<input name="bean" type="hidden" value="branchBean" />
 					<table>
 						<% for(VDCUser user : sessionBean.getBranchPage().getSuggestionUserList()) { %>
 							<tr>
@@ -115,13 +115,13 @@
 						<% } %>
 					</table>
 				</form>
-			</div>		
+			</div>
 			<% } %>
-		
+
 				<% if(sessionBean.getBranchPage().getBranch() == null) { %>
 					<label>Task not found!</label>
 				<% } else { %>
-				
+
 					<table>
 						<tr>
 							<td><label class="subTitel">General Information</label></td>
@@ -139,14 +139,14 @@
 												method="post">
 												<input name="bean" type="hidden" value="branchBean" />
 												<input type="text" name="branchLabel" size="60" maxlength="250" value="<%=sessionBean.getBranchPage().getBranch().getLabel() %>" />
-												<input type="image" onclick="setAction('updateLabel', 'branchForm1');" 
-													src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="15" height="15"/>	
-											
+												<input type="image" onclick="setAction('updateLabel', 'branchForm1');"
+													src="<%=sessionBean.getApplicationBean().getSaveImage()%>" width="15" height="15"/>
+
 											</form>
-											
+
 										</td>
 									</tr>
-									
+
 									<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 									<tr>
 										<td><label>Book Id</label></td>
@@ -188,7 +188,7 @@
 										<td><label>Edition</label></td>
 										<td><label><%=sessionBean.getBranchPage().getBranch().getBook().getEdition() %></label></td>
 									</tr>
-									
+
 									<!-- %%%%%%%%%%%%%%%%%%%%%%%% -->
 									<tr>
 										<td><label>Section Id</label></td>
@@ -202,8 +202,8 @@
 										<td><label>Pages</label></td>
 										<td><label><%=sessionBean.getBranchPage().getBranch().getSection().getPages()%></label></td>
 									</tr>
-									
-									
+
+
 									<tr>
 										<td><label>Created</label></td>
 										<td><label><%=sessionBean.getBranchPage().getBranch().getFomattedCreation() %></label></td>
@@ -220,15 +220,15 @@
 														<form name="contributorForm"
 															action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
 															method="post">
-															<input name="bean" type="hidden" value="branchBean" /> 
+															<input name="bean" type="hidden" value="branchBean" />
 															<table style="width: 300px;" class="pageTable">
 																<% for(VDCUser contr : sessionBean.getBranchPage().getContributors()) { %>
 																	<tr>
 																		<td><label><%=contr.getUserName() %></label></td>
 																		<td>
-																			<input type="image" 
-																				onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('removeContributor', 'contributorForm', 'userId',  <%=contr.getId() %>);" 
-																				src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>																	
+																			<input type="image"
+																				onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('removeContributor', 'contributorForm', 'userId',  <%=contr.getId() %>);"
+																				src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
 																		</td>
 																	</tr>
 																<% } %>
@@ -268,24 +268,24 @@
 									<tr>
 										<td><label>Created</label></td>
 										<td><label><%=sessionBean.getBranchPage().getLastFile().getFomattedCreation() %></label></td>
-									</tr>									
+									</tr>
 									<tr>
 										<td><label>Tagged Text</label>
 											<% LGBranch branch = sessionBean.getBranchPage().getBranch(); %>
 											<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 title="Show Task in Extraction Interface" src="<%=sessionBean.getApplicationBean().getEditImage()%>"/>
 											</a>
-										
+
 										</td>
-										
+
 										<td>
 											<textarea rows=20" cols="70">
 												<%=sessionBean.getBranchPage().getText() %>
-											</textarea>	
+											</textarea>
 											<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFileText?fileId=<%=branch.getCurrentLastFileId() %>"
 														target="_blank">
 													<img title="Download text (XML)" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
-											</a>											
+											</a>
 										</td>
 									</tr>
 								</table>
@@ -297,9 +297,9 @@
 								<form name="filesForm"
 									action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
 									method="post">
-									<input name="bean" type="hidden" value="branchBean" /> 							
-							
-								
+									<input name="bean" type="hidden" value="branchBean" />
+
+
 									<table class="pageTable tableComponent">
 										<tr>
 											<th><label class="tableTitle">File Id</label></th>
@@ -310,24 +310,24 @@
 											<th><label class="tableTitle">View table</label></th>
 											<th><label class="tableTitle">Table in CSV (tab-delimited)</label></th>
 											<th><label class="tableTitle">Upload to LGDataverse</label><br>
-												
+
 												<% LGFile lastFile = sessionBean.getBranchPage().getLastFile();
 													if(lastFile.getDvId() == null) {%>
 														<button type="button" class="get-studies" data-file-id="<%=lastFile.getId()%>">Upload the latest version</button>
 													<% } else if (lastFile.getFileIdInDv() == null) { %>
-														<label><i>Uploaded, but it's been deleted from <a href="<%=lastFile.getDatasetUrl() %>" target="_blank"><%= lastFile.getDatasetTitle() %></a></i></label>	
+														<label><i>Uploaded, but it's been deleted from <a href="<%=lastFile.getDatasetUrl() %>" target="_blank"><%= lastFile.getDatasetTitle() %></a></i></label>
 														<button type="button" class="get-studies" data-file-id="<%=lastFile.getId()%>">Re-upload it</button>
-													
-													<% } else { %>		
-														<label>Already uploaded in <a href="<%=lastFile.getDatasetUrl() %>" target="_blank"><%= lastFile.getDatasetTitle() %></a></label>	
-														
-													<% } %>		
-		
+
+													<% } else { %>
+														<label>Already uploaded in <a href="<%=lastFile.getDatasetUrl() %>" target="_blank"><%= lastFile.getDatasetTitle() %></a></label>
+
+													<% } %>
+
 											</th>
-											
+
 											<th><label class="tableTitle">Delete</label></th>
-										</tr>	
-										
+										</tr>
+
 										<% for(LGFile file : sessionBean.getBranchPage().getAllFiles()) { %>
 											<tr>
 												<td><label><%= file.getId() %></label></td>
@@ -336,12 +336,12 @@
 												<td><label><%= file.getFomattedCreation() %></label></td>
 												<td>
 													<!-- action change to download the file, instead of open file in a new tab -->
-													
+
 													<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFileText?fileId=<%=file.getId() %>"
 														target="_blank">
 														<img title="Download XML file" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
 													</a>
-													<!-- 
+													<!--
 													<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/getFileText?fileId=<%=file.getId() %>"
 														target="_blank">
 														<img title="Show text" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>
@@ -352,9 +352,9 @@
 													<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/getTable4File?fileId=<%=file.getId() %>"
 														target="_blank">
 														<img title="Show table (html)" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>
-													</a>												
-												</td>	
-												
+													</a>
+												</td>
+
 												<!-- add to get tab-delimited file -->
 												<!-- Taction change to download the csv file, instead of open file in a new tab -->
 												<td>
@@ -362,45 +362,45 @@
 														target="_blank">
 														<img title="Download CSV file (tab-delimited)" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
 													</a>
-													<!-- 
+													<!--
 													<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/getTabDelimited4File?fileId=<%=file.getId() %>"
 														target="_blank">
 														<img title="Show text" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>
 													</a>
-													 -->												
-												</td>	
-														
+													 -->
+												</td>
+
 												<td>
 													<% if(file.getDvId() == null) {%>
-														
+
 													<% } else if (file.getFileIdInDv() == null) { %>
-														<label><i>(uploaded, then deleted)</i></label>	
-														
-													<% } else { %>		
-														<label>uploaded in <a href="<%=file.getDatasetUrl() %>" target="_blank"><%= file.getDatasetTitle() %></a></label>	
-														
-													<% } %>		
-												</td>												
+														<label><i>(uploaded, then deleted)</i></label>
+
+													<% } else { %>
+														<label>uploaded in <a href="<%=file.getDatasetUrl() %>" target="_blank"><%= file.getDatasetTitle() %></a></label>
+
+													<% } %>
+												</td>
 												<td>
 													<input type="image" title="Delete this version"
-														onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteFile', 'filesForm', 'fileId', <%=file.getId() %>);" 
+														onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteFile', 'filesForm', 'fileId', <%=file.getId() %>);"
 														src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
 												</td>
 											</tr>
-										<% } %>				
+										<% } %>
 									</table>
-									
+
 								</form>
 							</td>
 						</tr>
-					
+
 					</table>
-				
+
 				<% } %>
-				
-		
+
+
 		<% } %>
-	
+
 	</div>
-	
-</body>
\ No newline at end of file
+
+</body>