diff src/main/webapp/pages/fullTextSearch.jsp @ 58:b8ad346e39a0

new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 02 May 2016 12:03:30 +0200
parents 5cbe567a9c52
children bc0219c2600b
line wrap: on
line diff
--- a/src/main/webapp/pages/fullTextSearch.jsp	Wed Feb 17 14:58:19 2016 +0100
+++ b/src/main/webapp/pages/fullTextSearch.jsp	Mon May 02 12:03:30 2016 +0200
@@ -46,6 +46,8 @@
 				dialogSave.dialog( "open" );
 			});
 			
+		
+			
 			var dialogViewSavedResult = $("#dialogViewSavedResult").dialog(
 				{
 					autoOpen: false,
@@ -194,12 +196,19 @@
 									target="_blank">
 							<img title="Show text in html" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>	
 						</a>
+						
+						<!-- download csv file -->
+						<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFullTextSearchCsvFile?file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv"
+							target="_blank">
+							<img title="Download CSV" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
+						</a>
+						
 						<!-- view on LGMap -->
 						<a href="<%=sessionBean.getApplicationBean().getLGMapUrl() %>&file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv&name=<%=aFile.getSearchTerms() %>"
 									target="_blank">
 							<img title="View on LGMap" src="<%=sessionBean.getApplicationBean().getViewOnMap()%>"/>	
 						</a>
-					
+						
 						<input type="image" title="Delete it"
 							onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteFile', 'fullTextSearchForm', 'fileId','<%=aFile.getId() %>'); document.getElementById('fullTextSearchForm').submit();" 
 							src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
@@ -226,13 +235,18 @@
 							<img title="Show text in html" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>	
 						</a>
 					
+						<!-- download csv file -->
+						<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFullTextSearchCsvFile?file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv"
+							target="_blank">
+							<img title="Download CSV" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
+						</a>
 			
 						<!-- view on LGMap -->
 						<a href="<%=sessionBean.getApplicationBean().getLGMapUrl() %>&file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv&name=<%=aFile.getSearchTerms() %>"
 									target="_blank">
 							<img title="View on LGMap" src="<%=sessionBean.getApplicationBean().getViewOnMap()%>"/>	
 						</a>
-					
+							 
 						<input type="image" title="Delete it"
 							onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> setAction0('deleteFile', 'fullTextSearchForm', 'fileId','<%=aFile.getId() %>'); document.getElementById('fullTextSearchForm').submit();" 
 							src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
@@ -259,8 +273,14 @@
 							<img title="Show text in html" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>	
 						</a>
 					
-			
+						<!-- download csv file -->
+						<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFullTextSearchCsvFile?file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv"
+							target="_blank">
+							<img title="Download CSV" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
+						</a>
+						
 						<!-- view on LGMap -->
+						
 						<a href="<%=sessionBean.getApplicationBean().getLGMapUrl() %>&file=<%=aFile.getUserId().toString()%>_<%=aFile.getFileName()%>.csv&name=<%=aFile.getSearchTerms() %>"
 									target="_blank">
 							<img title="View on LGMap" src="<%=sessionBean.getApplicationBean().getViewOnMap()%>"/>	
@@ -356,7 +376,7 @@
 				
 				<!-- batching querying -->
 				<!-- for batching, query keyword sets separated by ";" and within each keyword set, keywords separated by "," -->
-				<% if (StringUtils.equals(sessionBean.getUserName(), "zhong") || StringUtils.equals(sessionBean.getUserName(), "silk")) { %>
+				<% if (StringUtils.equals(sessionBean.getUserName(), "zhong")) { // || StringUtils.equals(sessionBean.getUserName(), "silk")) { %>
 				<tr>
 					<td>
 						<input
@@ -385,12 +405,31 @@
 				<tr><td>
 					<button id="saveResult" type="button" class="lgButton">Save Table</button>								
 					<button id="viewSavedResult" type="button" class="lgButton">View/Load Saved Table(s)</button>
+					
+					
 				</td></tr>
+				<tr><td>
+					<!-- for view on LGMap, prompt to save if it's not saved. After saving, it could be shown on LGMap -->
+					<% if (sessionBean.getFullTextSearchPage().getFile() != null) { 
+						LGFullTextSearchFile theFile = sessionBean.getFullTextSearchPage().getFile(); %>
+						<a href="<%=sessionBean.getApplicationBean().getLGMapUrl() %>&file=<%=theFile.getUserId().toString()%>_<%=theFile.getFileName()%>.csv&name=<%=theFile.getSearchTerms() %>"
+								target="_blank">View on LGMap
+						</a>
+						
+						<!-- download csv file -->
+						<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/rest/text/downloadFullTextSearchCsvFile?file=<%=theFile.getUserId().toString()%>_<%=theFile.getFileName()%>.csv"
+							target="_blank">
+							<img title="Download CSV" src="<%=sessionBean.getApplicationBean().getDownloadImage()%>"/>
+						</a>
 					
+					<% } else { %>
+						<!-- prompt to save -->
+						<label class="label">(save table first to view on LGMap)</label>
+					<% } %>
+				</td></tr>	
 				
 				</table>
-		
-		
+	
 	
 			<%
 				if (sessionBean.getFullTextSearchPage().getCompleteList() != null) {
@@ -676,6 +715,8 @@
 									</tr>
 								</table>	
 							</th>
+							
+							<!-- 
 							<th>
 								<table class="sortTable">
 									<tr>
@@ -697,7 +738,8 @@
 									</tr>
 								</table>	
 							</th>
-							<th><label class="tableTitle">View Text</label></th>
+							-->
+							<th><label class="tableTitle">Load Text</label></th>
 							<th>
 								<table class="sortTable">
 									<tr>
@@ -764,8 +806,7 @@
 							<td><%=content.getSection().getBook().getPeriod()%></td>
 							<td><%=content.getSection().getBook().getAdmin_type() %></td>
 							<td><%=content.getSection().getName() %></td>
-							<td><%=content.getSection().getPages()%></td>
-					
+							
 							<!-- View text in Ext-Interface -->
 							<td>
 								<a href="#"