Mercurial > hg > LGServices
annotate src/main/java/de/mpiwg/web/jsp/FullTextSearchPage.java @ 67:0a9937b06cc3
save full text search table (filtered)
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 04 Aug 2016 14:50:58 +0200 |
parents | bc0219c2600b |
children | 7e161f2e6660 |
rev | line source |
---|---|
39 | 1 package de.mpiwg.web.jsp; |
2 | |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
3 import java.io.IOException; |
39 | 4 import java.util.ArrayList; |
5 import java.util.Collections; | |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
6 import java.util.Date; |
39 | 7 import java.util.List; |
8 | |
9 import javax.servlet.http.HttpServletRequest; | |
10 import javax.servlet.http.HttpServletResponse; | |
11 | |
12 import org.apache.commons.lang.StringUtils; | |
13 import org.apache.log4j.Logger; | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
14 import org.jsoup.Jsoup; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
15 import org.jsoup.nodes.Document; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
16 import org.jsoup.nodes.Element; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
17 import org.jsoup.select.Elements; |
39 | 18 |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
19 import de.mpiwg.gazetteer.bo.LGBranch; |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
20 import de.mpiwg.gazetteer.bo.LGFile; |
39 | 21 import de.mpiwg.gazetteer.bo.LGFullTextSearchFile; |
22 import de.mpiwg.gazetteer.db.DBContents; | |
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
23 import de.mpiwg.gazetteer.db.DBSection; |
39 | 24 import de.mpiwg.gazetteer.utils.DBService; |
25 import de.mpiwg.gazetteer.utils.DataProvider; | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
26 import de.mpiwg.gazetteer.utils.FileManager; |
39 | 27 import de.mpiwg.web.fullTextSearch.SortContentByAdminType; |
28 import de.mpiwg.web.fullTextSearch.SortContentByBookId; | |
29 import de.mpiwg.web.fullTextSearch.SortContentByBookName; | |
30 import de.mpiwg.web.fullTextSearch.SortContentByDynasty; | |
31 import de.mpiwg.web.fullTextSearch.SortContentById; | |
32 import de.mpiwg.web.fullTextSearch.SortContentByInx; | |
33 import de.mpiwg.web.fullTextSearch.SortContentByLevel1; | |
34 import de.mpiwg.web.fullTextSearch.SortContentByLevel2; | |
35 import de.mpiwg.web.fullTextSearch.SortContentByPeriod; | |
36 import de.mpiwg.web.fullTextSearch.SortContentByStartPage; | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
37 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
38 |
39 | 39 |
40 public class FullTextSearchPage extends AbstractJSPPage{ | |
41 | |
42 private static Logger logger = Logger.getLogger(FullTextSearchPage.class); | |
43 | |
44 public static String bean = "fullTextSearchBean"; | |
45 public static String page = "pages/fullTextSearch.jsp"; | |
46 | |
47 | |
48 private List<DBContents> completeList; | |
49 private List<DBContents> filteredList; | |
50 private List<DBContents> displayList; | |
51 | |
52 private String searchTerm = new String(); | |
53 | |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
54 private String batchSearchTerm = new String(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
55 |
39 | 56 private String dynastyFilter = new String(); |
57 private String adminTypeFilter = new String(); | |
58 private String level1Filter = new String(); | |
59 | |
60 private DataPaginator paginator = new DataPaginator(); | |
61 private String searchMessage; | |
62 private String filteringMessage; | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
63 private String selectedContentMessage; |
39 | 64 |
65 private String bookIdFilter = new String(); | |
66 private String bookNameFilter = new String(); | |
67 private String level2Filter = new String(); | |
68 private String periodFilter = new String(); | |
69 private String sectionNameFilter = new String(); | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
70 private String contentFilter = new String(); |
39 | 71 |
72 private List<LGFullTextSearchFile> fileList = null; | |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
73 private List<LGFullTextSearchFile> weekFileList = null; // files modified within the past week |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
74 private List<LGFullTextSearchFile> monthFileList = null; // files modified within the past month |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
75 private List<LGFullTextSearchFile> olderFileList = null; // files modified before one month ago |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
76 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
77 |
39 | 78 private String fileName = new String(); |
79 | |
80 private String focusedContentId = new String(); | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
81 private Integer selectedNumOfContent = 0; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
82 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
83 private String mouseX; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
84 private String mouseY; |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
85 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
86 private LGFullTextSearchFile file = null; |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
87 |
39 | 88 |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
89 |
39 | 90 @Override |
91 public void init(){ | |
92 super.init(); | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
93 |
39 | 94 } |
95 | |
96 public void loadParameters(HttpServletRequest request, HttpServletResponse response){ | |
97 this.request = request; | |
98 this.response = response; | |
99 | |
100 this.searchTerm = getParameter("searchTerm"); | |
101 | |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
102 this.batchSearchTerm = getParameter("batchSearchTerm"); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
103 |
39 | 104 this.bookIdFilter = getParameter("bookIdFilter"); |
105 this.bookNameFilter = getParameter("bookNameFilter"); | |
106 | |
107 this.dynastyFilter = getParameter("dynastyFilter"); | |
108 this.adminTypeFilter = getParameter("adminTypeFilter"); | |
109 this.level1Filter = getParameter("level1Filter"); | |
110 this.level2Filter = getParameter("level2Filter"); | |
111 | |
112 this.periodFilter = getParameter("periodFilter"); | |
113 this.sectionNameFilter = getParameter("sectionNameFilter"); | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
114 this.contentFilter = getParameter("contentFilter"); |
39 | 115 |
116 this.fileName = getParameter("fileName"); | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
117 |
39 | 118 this.focusedContentId = getParameter("focusedContentId"); |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
119 this.mouseX = getParameter("mouseX"); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
120 this.mouseY = getParameter("mouseY"); |
39 | 121 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
122 |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
123 this.paginator.setItemsPerPage(20); |
39 | 124 } |
125 | |
126 | |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
127 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
128 public void searchBatch() { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
129 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
130 logger.debug("Batch Searching: " + this.batchSearchTerm); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
131 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
132 this.dynastyFilter = new String(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
133 this.level1Filter = new String(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
134 this.adminTypeFilter = new String(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
135 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
136 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
137 if(StringUtils.isNotEmpty(this.batchSearchTerm)){ |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
138 try { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
139 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
140 // parse different keyword set by delimiter ";" |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
141 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
142 List<String> batchSearchKeywords = splitBatchSearchTerm(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
143 logger.debug("batchSearchKeywords: " + batchSearchKeywords); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
144 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
145 String countingMessage = new String(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
146 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
147 for (String aKeywordSet: batchSearchKeywords) { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
148 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
149 this.setSearchTerm(aKeywordSet); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
150 List<String> terms = splitTerms(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
151 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
152 System.out.println("Full Text Search: " + terms.toString()); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
153 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
154 this.completeList = DBService.searchFullText(terms); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
155 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
156 if (this.completeList.size() != 0 ){ |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
157 // save none zero result |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
158 Collections.sort(this.completeList); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
159 this.filter(); |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
160 this.calSelectedContentInCompleteList(); |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
161 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
162 this.setFileName(this.getSearchTerm()); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
163 this.save(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
164 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
165 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
166 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
167 countingMessage += this.completeList.size() + "\t" + terms + "<br>"; |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
168 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
169 this.setSearchMessage(countingMessage); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
170 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
171 } catch (Exception e) { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
172 internalError(e); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
173 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
174 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
175 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
176 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
177 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
178 |
39 | 179 public void search(){ |
180 logger.debug("Searching: " + this.searchTerm); | |
181 | |
182 this.dynastyFilter = new String(); | |
183 this.level1Filter = new String(); | |
184 this.adminTypeFilter = new String(); | |
185 | |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
186 this.setFile(null); |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
187 |
39 | 188 if(StringUtils.isNotEmpty(this.searchTerm)){ |
189 try { | |
190 List<String> terms = splitTerms(); | |
191 System.out.println("Full Text Search: " + terms.toString()); | |
192 | |
193 this.completeList = DBService.searchFullText(terms); | |
194 | |
195 if (this.completeList != null ){ | |
196 Collections.sort(this.completeList); | |
197 filter(); | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
198 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
199 this.calSelectedContentInCompleteList(); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
200 |
39 | 201 } |
202 | |
203 } catch (Exception e) { | |
204 internalError(e); | |
205 } | |
206 } | |
207 } | |
208 | |
209 | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
210 private void calSelectedContentInCompleteList() { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
211 // calculate selectedContent |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
212 this.selectedNumOfContent = 0; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
213 for (DBContents content: this.completeList) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
214 if (!content.isRemoved()) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
215 this.selectedNumOfContent += 1; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
216 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
217 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
218 this.setSelectedContentMessage(this.selectedNumOfContent.toString() + " section(s) selected"); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
219 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
220 |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
221 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
222 private void dispatchFileListByTime() { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
223 // set this.weekFileList, this.monthFileList, this.olderFileList from this.fileList |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
224 this.weekFileList = new ArrayList<LGFullTextSearchFile>(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
225 this.monthFileList = new ArrayList<LGFullTextSearchFile>(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
226 this.olderFileList = new ArrayList<LGFullTextSearchFile>(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
227 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
228 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
229 // TODO |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
230 for (LGFullTextSearchFile aFile: this.getFileList()) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
231 Date todayDate = new Date(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
232 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
233 long DAY_IN_MS = 1000 * 60 * 60 * 24; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
234 Date oneWeekAgo = new Date(todayDate.getTime() - (7 * DAY_IN_MS)); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
235 Date oneMonthAgo = new Date(todayDate.getTime() - (30 * DAY_IN_MS)); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
236 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
237 if ( aFile.getLastChangeDate().after(oneWeekAgo)) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
238 this.weekFileList.add(aFile); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
239 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
240 } else if (aFile.getLastChangeDate().after(oneMonthAgo)) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
241 this.monthFileList.add(aFile); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
242 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
243 } else { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
244 this.olderFileList.add(aFile); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
245 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
246 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
247 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
248 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
249 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
250 |
39 | 251 public void forceLoadFileList(){ |
252 logger.debug("forceLoadFileList"); | |
253 logger.debug(this.getSearchTerm()); | |
254 | |
255 if(getSessionBean().getUser() != null){ | |
256 //logger.debug("userId="+ getSessionBean().getUser().getId()); | |
257 | |
258 // set FileList for the user | |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
259 this.forceSetFileLists(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
260 |
39 | 261 } |
262 | |
263 } | |
264 | |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
265 private void forceSetFileLists() { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
266 // set FileList for the user |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
267 DataProvider.getInstance().setFullTextSearchFileMap(null); // set fullTextSearchFileMap to null, to force reload |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
268 this.setFileList(DataProvider.getInstance().getSearchFileList4User(getSessionBean().getUser().getId())); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
269 this.dispatchFileListByTime(); |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
270 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
271 |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
272 public void deleteFile() throws IOException { |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
273 |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
274 Long fileId = getLongParameter("fileId"); |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
275 logger.debug("deleting fileId=" + fileId); |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
276 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
277 if(fileId != null){ |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
278 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
279 LGFullTextSearchFile file = DataProvider.getInstance().getFullTextSearchFile(fileId); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
280 if(file != null){ |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
281 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
282 DataProvider.getInstance().deleteLGFullTextSearchFile(file); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
283 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
284 // update FileList |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
285 this.forceSetFileLists(); |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
286 |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
287 addMsg("The file " + file.getFileName() + " has been deleted."); |
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
288 } |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
289 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
290 } |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
291 |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
292 } |
39 | 293 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
294 public void loadFile() { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
295 Long fileId = getLongParameter("fileId"); |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
296 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
297 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
298 logger.debug("loading fileId=" + fileId); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
299 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
300 if(fileId != null){ |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
301 // load from html file into searching result table |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
302 LGFullTextSearchFile file = DataProvider.getInstance().getFullTextSearchFile(fileId); |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
303 if(file != null) { |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
304 this.setFile(file); |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
305 String html; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
306 try { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
307 html = FileManager.getFullTextSearchHtmlFileText(file); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
308 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
309 Document doc = Jsoup.parse(html); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
310 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
311 Element body = doc.body(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
312 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
313 this.setSearchTerm(body.getElementById("searchTerm").text()); |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
314 this.setFileName(file.getFileName()); |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
315 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
316 Element pageTableBody = body.getElementsByTag("tbody").first(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
317 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
318 Elements rows = pageTableBody.children(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
319 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
320 // set completeList by parsing html file |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
321 List<DBContents> completListFromParsedFile = new ArrayList<DBContents>(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
322 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
323 for (Element row : rows) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
324 // make complteListFromParsedFile... |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
325 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
326 Elements cols = row.children(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
327 //logger.debug(cols.size()); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
328 if (cols.size() < 13) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
329 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
330 } else if (StringUtils.equals("#", cols.get(0).text())) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
331 // the table header |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
332 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
333 } else { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
334 DBContents content = new DBContents(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
335 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
336 String bookId = cols.get(1).text(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
337 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
338 Integer contentPage = Integer.parseInt(cols.get(9).text()); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
339 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
340 String contentText = cols.get(10).text(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
341 Long contentId = Long.parseLong(cols.get(11).text()); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
342 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
343 boolean isRemoved = true; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
344 if (StringUtils.equals(cols.get(12).text(), "false")) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
345 isRemoved = false; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
346 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
347 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
348 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
349 content.setInx(Integer.parseInt(cols.get(0).text())); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
350 content.setId(contentId); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
351 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
352 content.setBookId(cols.get(1).text()); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
353 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
354 // set this.section by bookId and page |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
355 content.setSection(DBService.getInstance().getSectionByBookIdAndPage(bookId, contentPage)); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
356 // set this.coordinatesBook by bookId |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
357 content.setCoordinatesBook(DBService.getInstance().getCoordinatesBook(bookId)); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
358 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
359 content.setContent(contentText); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
360 content.setPage(contentPage); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
361 content.setRemoved(isRemoved); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
362 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
363 completListFromParsedFile.add(content); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
364 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
365 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
366 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
367 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
368 this.setCompleteList(completListFromParsedFile); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
369 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
370 if (this.completeList != null ){ |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
371 Collections.sort(this.completeList); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
372 filter(); |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
373 this.calSelectedContentInCompleteList(); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
374 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
375 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
376 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
377 } catch (Exception e) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
378 logger.debug("getFullTextSearchHtmlFileText failed."); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
379 e.printStackTrace(); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
380 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
381 |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
382 } else { |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
383 this.setFile(null); |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
384 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
385 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
386 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
387 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
388 |
39 | 389 |
67
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
390 public void saveFilteredList() { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
391 logger.debug("saving filtered table..."); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
392 logger.debug(this.getFileName() + ", " + this.getSearchTerm() + ", userId= "+ getSessionBean().getUser().getId()); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
393 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
394 //logger.debug(this.getFilteredList()); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
395 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
396 if (StringUtils.equals(this.getFileName(), "") ) { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
397 addMsg("Filtered Save failed. Table name cannot be empty."); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
398 return; |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
399 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
400 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
401 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
402 /* Update db table `LGFullTextSearchFile`: new row with userId, file name, ...*/ |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
403 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
404 Long userId = getSessionBean().getUser().getId(); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
405 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
406 LGFullTextSearchFile file; |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
407 try { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
408 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
409 // check if record with (userId, fileName) already existed, update it; otherwise, create one |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
410 LGFullTextSearchFile searchFile = new LGFullTextSearchFile(); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
411 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
412 for (LGFullTextSearchFile aFile: this.getFileList()) { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
413 if ( StringUtils.equals(aFile.getFileName(), fileName) && aFile.getUserId().equals(userId)) { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
414 searchFile = aFile; |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
415 break; |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
416 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
417 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
418 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
419 if (searchFile.isEmpty() ) { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
420 searchFile.setFileName(fileName); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
421 searchFile.setUserId(userId); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
422 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
423 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
424 searchFile.setSearchTerms(this.searchTerm); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
425 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
426 file = DataProvider.getInstance().saveLGFullTextSearchFile(this.getFilteredList(), userId, searchFile); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
427 //file = DataProvider.getInstance().saveLGFullTextSearchFile(this.getCompleteList(), userId, searchFile); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
428 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
429 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
430 logger.debug("file: " + file.getInfo()); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
431 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
432 this.setFile(file); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
433 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
434 addMsg("The table has been saved!"); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
435 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
436 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
437 } catch (Exception e) { |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
438 addMsg("Saving fails!"); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
439 e.printStackTrace(); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
440 internalError(e); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
441 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
442 |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
443 this.forceSetFileLists(); |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
444 } |
0a9937b06cc3
save full text search table (filtered)
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
445 |
39 | 446 public void save() { |
447 logger.debug("saving table..."); | |
448 logger.debug(this.getFileName() + ", " + this.getSearchTerm() + ", userId= "+ getSessionBean().getUser().getId()); | |
449 | |
450 //logger.debug(this.getFilteredList()); | |
451 | |
452 if (StringUtils.equals(this.getFileName(), "") ) { | |
453 addMsg("Save failed. Table name cannot be empty."); | |
454 return; | |
455 } | |
456 | |
457 | |
458 /* Update db table `LGFullTextSearchFile`: new row with userId, file name, ...*/ | |
459 | |
460 Long userId = getSessionBean().getUser().getId(); | |
461 | |
462 LGFullTextSearchFile file; | |
463 try { | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
464 |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
465 // check if record with (userId, fileName) already existed, update it; otherwise, create one |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
466 LGFullTextSearchFile searchFile = new LGFullTextSearchFile(); |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
467 |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
468 for (LGFullTextSearchFile aFile: this.getFileList()) { |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
469 if ( StringUtils.equals(aFile.getFileName(), fileName) && aFile.getUserId().equals(userId)) { |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
470 searchFile = aFile; |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
471 break; |
39 | 472 } |
473 } | |
474 | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
475 if (searchFile.isEmpty() ) { |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
476 searchFile.setFileName(fileName); |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
477 searchFile.setUserId(userId); |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
478 } |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
479 |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
480 searchFile.setSearchTerms(this.searchTerm); |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
481 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
482 //file = DataProvider.getInstance().saveLGFullTextSearchFile(this.getFilteredList(), userId, searchFile); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
483 file = DataProvider.getInstance().saveLGFullTextSearchFile(this.getCompleteList(), userId, searchFile); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
484 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
485 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
486 logger.debug("file: " + file.getInfo()); |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
487 |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
488 this.setFile(file); |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
489 |
39 | 490 addMsg("The table has been saved!"); |
491 | |
492 | |
493 } catch (Exception e) { | |
494 addMsg("Saving fails!"); | |
495 e.printStackTrace(); | |
496 internalError(e); | |
497 } | |
498 | |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
499 this.forceSetFileLists(); |
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
500 |
39 | 501 } |
502 | |
503 | |
504 | |
505 public void filter(){ | |
506 this.filteredList = new ArrayList<DBContents>(); | |
507 for(DBContents content : this.completeList){ | |
508 if(!this.filteredList.contains(content)){ | |
509 | |
510 if( (StringUtils.isEmpty(dynastyFilter) || StringUtils.startsWith(content.getSection().getBook().getDynasty(), dynastyFilter)) && | |
511 (StringUtils.isEmpty(level1Filter) || StringUtils.startsWith(content.getSection().getBook().getLevel1(), level1Filter)) && | |
512 (StringUtils.isEmpty(level2Filter) || StringUtils.startsWith(content.getSection().getBook().getLevel2(), level2Filter)) && | |
513 (StringUtils.isEmpty(adminTypeFilter) || StringUtils.startsWith(content.getSection().getBook().getAdmin_type(), adminTypeFilter)) && | |
514 (StringUtils.isEmpty(bookIdFilter) || StringUtils.startsWith(content.getBookId(), bookIdFilter)) && | |
515 (StringUtils.isEmpty(bookNameFilter) || StringUtils.startsWith(content.getSection().getBook().getName(), bookNameFilter)) && | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
516 (StringUtils.isEmpty(sectionNameFilter) || StringUtils.startsWith(content.getSection().getName(), sectionNameFilter)) && |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
517 (StringUtils.isEmpty(contentFilter) || StringUtils.contains(content.getContent(), contentFilter)) |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
518 |
39 | 519 ){ |
520 this.filteredList.add(content); | |
521 } | |
522 } | |
523 } | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
524 |
39 | 525 if(completeList.size() > 0){ |
526 this.searchMessage = completeList.size() + " section(s) found for the term(s): " + this.searchTerm; | |
527 this.filteringMessage = this.filteredList.size() + " section(s) listed after the filtering"; | |
528 | |
529 this.paginator.setCurrentPage(0); | |
530 this.paginator.resetNumberOfPages(filteredList.size()); | |
531 | |
532 }else{ | |
533 this.searchMessage = "No sections found for the term(s): " + this.searchTerm; | |
534 this.filteredList = null; | |
535 this.filteringMessage = ""; | |
536 | |
537 this.paginator.setCurrentPage(0); | |
538 this.paginator.resetNumberOfPages(0); | |
539 } | |
540 | |
541 this.updateCurrentSections(); | |
542 | |
543 } | |
544 | |
545 | |
546 private void updateCurrentSections() { | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
547 |
39 | 548 this.paginator.initCount(); |
549 int startRecord = this.paginator.getCurrentPage() | |
550 * this.paginator.getItemsPerPage(); | |
551 if(this.paginator.getNumberOfPages() == 0){ | |
552 this.displayList = new ArrayList<DBContents>(); | |
553 }else if((this.paginator.getCurrentPage() + 1) == this.paginator.getNumberOfPages()){ | |
554 int mod = this.filteredList.size() % paginator.getItemsPerPage(); | |
555 if(mod == 0){ | |
556 this.displayList = filteredList.subList(startRecord, startRecord + this.paginator.getItemsPerPage()); | |
557 }else{ | |
558 this.displayList = filteredList.subList(startRecord, startRecord + mod); | |
559 } | |
560 | |
561 }else{ | |
562 this.displayList = filteredList.subList(startRecord, startRecord + this.paginator.getItemsPerPage()); | |
563 } | |
564 | |
565 } | |
566 | |
567 | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
568 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
569 public void removeFocusedContent(boolean status) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
570 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
571 // set isRemove for the content with id=this.focusedContentId |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
572 // status is true: remove; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
573 // status is false: recover (unremove) |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
574 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
575 for (DBContents content: this.completeList) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
576 if (StringUtils.equals(content.getId().toString(), this.focusedContentId)) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
577 content.setRemoved(status); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
578 logger.debug("set remove content id=" + content.getId().toString()); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
579 break; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
580 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
581 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
582 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
583 int currentPage = this.getPaginator().getCurrentPage(); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
584 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
585 Collections.sort(this.completeList); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
586 filter(); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
587 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
588 // update the selectedNumOfContent to selectedMessage |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
589 if (status) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
590 this.selectedNumOfContent -= 1; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
591 } else { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
592 this.selectedNumOfContent += 1; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
593 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
594 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
595 selectedContentMessage = this.selectedNumOfContent.toString() + " section(s) selected"; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
596 this.setSelectedContentMessage(selectedContentMessage); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
597 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
598 this.getPaginator().setCurrentPage(currentPage); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
599 this.updateCurrentSections(); |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
600 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
601 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
602 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
603 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
604 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
605 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
606 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
607 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
608 |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
609 private List<String> splitBatchSearchTerm() { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
610 List<String> rs = new ArrayList<String>(); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
611 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
612 String[] array = this.batchSearchTerm.split(";"); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
613 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
614 for(String tmp : array){ |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
615 tmp = tmp.replace(" ", ""); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
616 if(StringUtils.isNotEmpty(tmp)){ |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
617 rs.add(tmp); |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
618 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
619 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
620 return rs; |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
621 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
622 |
39 | 623 private List<String> splitTerms(){ |
624 List<String> rs = new ArrayList<String>(); | |
625 | |
626 String[] array = this.searchTerm.split(","); | |
627 | |
628 for(String tmp : array){ | |
629 tmp = tmp.replace(" ", ""); | |
630 if(StringUtils.isNotEmpty(tmp)){ | |
631 rs.add(tmp); | |
632 } | |
633 } | |
634 return rs; | |
635 } | |
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
636 |
39 | 637 |
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
638 public List<String> suggestBookName(String term, int limit){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
639 List<String> list = new ArrayList<String>(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
640 for(DBContents content : this.completeList){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
641 String bookName = content.getSection().getBook().getName(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
642 if(!list.contains(bookName) && bookName.startsWith(term)){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
643 list.add(bookName); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
644 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
645 if(limit == list.size()){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
646 break; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
647 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
648 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
649 return list; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
650 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
651 |
39 | 652 public List<String> suggestDynasty(String term, int limit){ |
653 List<String> list = new ArrayList<String>(); | |
654 for(DBContents content : this.completeList){ | |
655 String dynasty = content.getSection().getBook().getDynasty(); | |
656 if(!list.contains(dynasty) && dynasty.startsWith(term)){ | |
657 list.add(dynasty); | |
658 } | |
659 if(limit == list.size()){ | |
660 break; | |
661 } | |
662 } | |
663 return list; | |
664 } | |
665 | |
666 public List<String> suggestLevel1(String term, int limit){ | |
667 List<String> list = new ArrayList<String>(); | |
668 for(DBContents content : this.completeList){ | |
669 String level1 = content.getSection().getBook().getLevel1(); | |
670 if(!list.contains(level1) && level1.startsWith(term)){ | |
671 list.add(level1); | |
672 } | |
673 if(limit == list.size()){ | |
674 break; | |
675 } | |
676 } | |
677 return list; | |
678 } | |
679 | |
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
680 public List<String> suggestLevel2(String term, int limit){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
681 List<String> list = new ArrayList<String>(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
682 for(DBContents content : this.completeList){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
683 String level2 = content.getSection().getBook().getLevel2(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
684 if(!list.contains(level2) && level2.startsWith(term)){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
685 list.add(level2); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
686 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
687 if(limit == list.size()){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
688 break; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
689 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
690 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
691 return list; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
692 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
693 |
39 | 694 public List<String> suggestAdminType(String term, int limit){ |
695 List<String> list = new ArrayList<String>(); | |
696 for(DBContents content : this.completeList){ | |
697 String adminType = content.getSection().getBook().getAdmin_type(); | |
698 if(!list.contains(adminType) && adminType.startsWith(term)){ | |
699 list.add(adminType); | |
700 } | |
701 if(limit == list.size()){ | |
702 break; | |
703 } | |
704 } | |
705 return list; | |
706 } | |
707 | |
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
708 public List<String> suggestPeriod(String term, int limit){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
709 List<String> list = new ArrayList<String>(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
710 for(DBContents content : this.completeList){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
711 String period = content.getSection().getBook().getPeriod(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
712 if(!list.contains(period) && period.startsWith(term)){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
713 list.add(period); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
714 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
715 if(limit == list.size()){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
716 break; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
717 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
718 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
719 return list; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
720 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
721 public List<String> suggestSectionName(String term, int limit){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
722 List<String> list = new ArrayList<String>(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
723 for(DBContents content : this.completeList){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
724 String sectionName = content.getSection().getName(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
725 if(!list.contains(sectionName) && sectionName.startsWith(term)){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
726 list.add(sectionName); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
727 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
728 if(limit == list.size()){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
729 break; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
730 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
731 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
732 return list; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
733 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
734 public List<String> suggestBookId(String term, int limit){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
735 List<String> list = new ArrayList<String>(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
736 for(DBContents content : this.completeList){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
737 String bookId = content.getSection().getBook().getId(); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
738 if(!list.contains(bookId) && bookId.startsWith(term)){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
739 list.add(bookId); |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
740 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
741 if(limit == list.size()){ |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
742 break; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
743 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
744 } |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
745 return list; |
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
746 } |
39 | 747 |
748 | |
749 public List<LGFullTextSearchFile> getFileList() { | |
750 return fileList; | |
751 } | |
752 | |
753 public void setFileList(List<LGFullTextSearchFile> fileList) { | |
754 this.fileList = fileList; | |
755 } | |
756 | |
757 | |
758 | |
759 public List<DBContents> getCompleteList() { | |
760 return completeList; | |
761 } | |
762 | |
763 | |
764 | |
765 public void setCompleteList(List<DBContents> completeList) { | |
766 this.completeList = completeList; | |
767 } | |
768 | |
769 | |
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
770 public String getBatchSearchTerm() { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
771 return batchSearchTerm; |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
772 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
773 |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
774 public void setBatchSearchTerm(String batchSearchTerm) { |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
775 this.batchSearchTerm = batchSearchTerm; |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
776 } |
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
777 |
39 | 778 public String getSearchTerm() { |
779 return searchTerm; | |
780 } | |
781 | |
782 | |
783 public void setSearchTerm(String searchTerm) { | |
784 this.searchTerm = searchTerm; | |
785 } | |
786 | |
787 public List<DBContents> getFilteredList() { | |
788 return filteredList; | |
789 } | |
790 | |
791 public void setFilteredList(List<DBContents> filteredList) { | |
792 this.filteredList = filteredList; | |
793 } | |
794 | |
795 | |
796 public List<DBContents> getDisplayList() { | |
797 return displayList; | |
798 } | |
799 | |
800 public void setDisplayList(List<DBContents> displayList) { | |
801 this.displayList = displayList; | |
802 } | |
803 | |
804 | |
805 public DataPaginator getPaginator() { | |
806 return paginator; | |
807 } | |
808 | |
809 public void setPaginator(DataPaginator paginator) { | |
810 this.paginator = paginator; | |
811 } | |
812 | |
813 public void firstPage() { | |
814 this.paginator.first(); | |
815 this.updateCurrentSections(); | |
816 } | |
817 | |
818 public void lastPage() { | |
819 this.paginator.last(); | |
820 this.updateCurrentSections(); | |
821 } | |
822 | |
823 public void fastForward() { | |
824 this.paginator.fastForward(); | |
825 this.updateCurrentSections(); | |
826 } | |
827 | |
828 public void fastRewind() { | |
829 this.paginator.fastRewind(); | |
830 this.updateCurrentSections(); | |
831 } | |
832 | |
833 public void previousPage() { | |
834 this.paginator.previous(); | |
835 this.updateCurrentSections(); | |
836 } | |
837 | |
838 public void nextPage() { | |
839 this.paginator.next(); | |
840 this.updateCurrentSections(); | |
841 } | |
842 | |
843 public String getSearchMessage() { | |
844 return searchMessage; | |
845 } | |
846 | |
847 public void setSearchMessage(String searchMessage) { | |
848 this.searchMessage = searchMessage; | |
849 } | |
850 | |
851 public String getFilteringMessage() { | |
852 return filteringMessage; | |
853 } | |
854 | |
855 public void setFilteringMessage(String filteringMessage) { | |
856 this.filteringMessage = filteringMessage; | |
857 } | |
858 | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
859 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
860 public String getSelectedContentMessage() { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
861 return selectedContentMessage; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
862 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
863 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
864 public void setSelectedContentMessage(String selectedContentMessage) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
865 this.selectedContentMessage = selectedContentMessage; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
866 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
867 |
39 | 868 public String getFileName() { |
869 return fileName; | |
870 } | |
871 | |
872 public void setFileName(String fileName) { | |
873 this.fileName = fileName; | |
874 } | |
875 | |
876 public String getDynastyFilter() { | |
877 return dynastyFilter; | |
878 } | |
879 | |
880 public void setDynastyFilter(String dynastyFilter) { | |
881 this.dynastyFilter = dynastyFilter; | |
882 } | |
883 | |
884 public String getAdminTypeFilter() { | |
885 return adminTypeFilter; | |
886 } | |
887 | |
888 public void setAdminTypeFilter(String adminTypeFilter) { | |
889 this.adminTypeFilter = adminTypeFilter; | |
890 } | |
891 | |
892 public String getLevel1Filter() { | |
893 return level1Filter; | |
894 } | |
895 | |
896 public void setLevel1Filter(String level1Filter) { | |
897 this.level1Filter = level1Filter; | |
898 } | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
899 public String getContentFilter() { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
900 return contentFilter; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
901 } |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
902 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
903 public void setContentFilter(String contentFilter) { |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
904 this.contentFilter = contentFilter; |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
905 } |
39 | 906 |
907 public String getFocusedContentId() { | |
908 return focusedContentId; | |
909 } | |
910 | |
911 public void setFocusedContentId(String focusedContentId) { | |
912 this.focusedContentId = focusedContentId; | |
913 } | |
914 | |
915 public String getBookIdFilter() { | |
916 return bookIdFilter; | |
917 } | |
918 | |
919 public void setBookIdFilter(String bookIdFilter) { | |
920 this.bookIdFilter = bookIdFilter; | |
921 } | |
922 | |
923 public String getBookNameFilter() { | |
924 return bookNameFilter; | |
925 } | |
926 | |
927 public void setBookNameFilter(String bookNameFilter) { | |
928 this.bookNameFilter = bookNameFilter; | |
929 } | |
930 | |
931 public String getLevel2Filter() { | |
932 return level2Filter; | |
933 } | |
934 | |
935 public void setLevel2Filter(String level2Filter) { | |
936 this.level2Filter = level2Filter; | |
937 } | |
938 | |
939 public String getPeriodFilter() { | |
940 return periodFilter; | |
941 } | |
942 | |
943 public void setPeriodFilter(String periodFilter) { | |
944 this.periodFilter = periodFilter; | |
945 } | |
946 | |
947 public String getSectionNameFilter() { | |
948 return sectionNameFilter; | |
949 } | |
950 | |
951 public void setSectionNameFilter(String sectionNameFilter) { | |
952 this.sectionNameFilter = sectionNameFilter; | |
953 } | |
954 | |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
955 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
956 |
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
957 public List<LGFullTextSearchFile> getWeekFileList() { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
958 return weekFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
959 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
960 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
961 public void setWeekFileList(List<LGFullTextSearchFile> weekFileList) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
962 this.weekFileList = weekFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
963 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
964 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
965 public List<LGFullTextSearchFile> getMonthFileList() { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
966 return monthFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
967 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
968 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
969 public void setMonthFileList(List<LGFullTextSearchFile> monthFileList) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
970 this.monthFileList = monthFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
971 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
972 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
973 public List<LGFullTextSearchFile> getOlderFileList() { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
974 return olderFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
975 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
976 |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
977 public void setOlderFileList(List<LGFullTextSearchFile> olderFileList) { |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
978 this.olderFileList = olderFileList; |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
979 } |
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
980 |
51
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
981 public String getMouseX() { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
982 return mouseX; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
983 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
984 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
985 public void setMouseX(String mouseX) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
986 this.mouseX = mouseX; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
987 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
988 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
989 public String getMouseY() { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
990 return mouseY; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
991 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
992 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
993 public void setMouseY(String mouseY) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
994 this.mouseY = mouseY; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
995 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
996 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
997 public Integer getSelectedNumOfContent() { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
998 return selectedNumOfContent; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
999 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
1000 |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
1001 public void setSelectedNumOfContent(Integer selectedNumOfContent) { |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
1002 this.selectedNumOfContent = selectedNumOfContent; |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
1003 } |
cf747a960516
new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
49
diff
changeset
|
1004 |
58
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1005 public LGFullTextSearchFile getFile() { |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1006 return file; |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1007 } |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1008 |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1009 public void setFile(LGFullTextSearchFile file) { |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1010 this.file = file; |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1011 } |
b8ad346e39a0
new: modify based on doc 'Improving LGServices interface.docx': user workflow improvement, functions like adding task into a topic and search suggestions.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
1012 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1013 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1014 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1015 /////// Sorting |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1016 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1017 |
39 | 1018 public void sortByBookNameUp(){ |
1019 Collections.sort(this.completeList, new SortContentByBookName()); | |
1020 filter(); | |
1021 } | |
1022 | |
1023 public void sortByBookNameDown(){ | |
1024 Collections.sort(this.completeList, new SortContentByBookName()); | |
1025 Collections.reverse(this.completeList); | |
1026 filter(); | |
1027 } | |
1028 | |
1029 public void sortBySectionNameUp(){ | |
1030 Collections.sort(this.completeList); | |
1031 filter(); | |
1032 } | |
1033 | |
1034 public void sortBySectionNameDown(){ | |
1035 Collections.sort(this.completeList); | |
1036 Collections.reverse(this.completeList); | |
1037 filter(); | |
1038 } | |
1039 | |
1040 | |
1041 public void sortByPeriodUp(){ | |
1042 Collections.sort(this.completeList, new SortContentByPeriod()); | |
1043 filter(); | |
1044 } | |
1045 | |
1046 public void sortByPeriodDown(){ | |
1047 Collections.sort(this.completeList, new SortContentByPeriod()); | |
1048 Collections.reverse(this.completeList); | |
1049 filter(); | |
1050 } | |
1051 | |
1052 | |
1053 | |
1054 public void sortByIdUp(){ | |
1055 Collections.sort(this.completeList, new SortContentById()); | |
1056 this.filter(); | |
1057 } | |
1058 | |
1059 public void sortByIdDown(){ | |
1060 Collections.sort(this.completeList, new SortContentById()); | |
1061 Collections.reverse(completeList); | |
1062 this.filter(); | |
1063 } | |
1064 | |
1065 | |
1066 public void sortByDynastyUp(){ | |
1067 Collections.sort(this.completeList, new SortContentByDynasty()); | |
1068 filter(); | |
1069 } | |
1070 | |
1071 public void sortByDynastyDown(){ | |
1072 Collections.sort(this.completeList, new SortContentByDynasty()); | |
1073 Collections.reverse(completeList); | |
1074 filter(); | |
1075 } | |
1076 | |
1077 public void sortByBookIdUp(){ | |
1078 Collections.sort(this.completeList, new SortContentByBookId()); | |
1079 filter(); | |
1080 } | |
1081 | |
1082 public void sortByBookIdDown(){ | |
1083 Collections.sort(this.completeList, new SortContentByBookId()); | |
1084 Collections.reverse(completeList); | |
1085 filter(); | |
1086 } | |
1087 | |
1088 public void sortByLevel1Up(){ | |
1089 Collections.sort(this.completeList, new SortContentByLevel1()); | |
1090 filter(); | |
1091 } | |
1092 | |
1093 public void sortByLevel1Down(){ | |
1094 Collections.sort(this.completeList, new SortContentByLevel1()); | |
1095 Collections.reverse(completeList); | |
1096 filter(); | |
1097 } | |
1098 public void sortByLevel2Up(){ | |
1099 Collections.sort(this.completeList, new SortContentByLevel2()); | |
1100 filter(); | |
1101 } | |
1102 | |
1103 public void sortByLevel2Down(){ | |
1104 Collections.sort(this.completeList, new SortContentByLevel2()); | |
1105 Collections.reverse(completeList); | |
1106 filter(); | |
1107 } | |
1108 | |
1109 public void sortByAdminTypeUp(){ | |
1110 Collections.sort(this.completeList, new SortContentByAdminType()); | |
1111 filter(); | |
1112 } | |
1113 | |
1114 public void sortByAdminTypeDown(){ | |
1115 Collections.sort(this.completeList, new SortContentByAdminType()); | |
1116 Collections.reverse(completeList); | |
1117 filter(); | |
1118 } | |
1119 | |
1120 public void sortByStartPageUp(){ | |
1121 Collections.sort(this.completeList, new SortContentByStartPage()); | |
1122 filter(); | |
1123 } | |
1124 | |
1125 public void sortByStartPageDown(){ | |
1126 Collections.sort(this.completeList, new SortContentByStartPage()); | |
1127 Collections.reverse(completeList); | |
1128 filter(); | |
1129 } | |
1130 public void sortByInxUp(){ | |
1131 Collections.sort(this.completeList, new SortContentByInx()); | |
1132 filter(); | |
1133 } | |
1134 | |
1135 public void sortByInxDown(){ | |
1136 Collections.sort(this.completeList, new SortContentByInx()); | |
1137 Collections.reverse(completeList); | |
1138 filter(); | |
1139 } | |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1140 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1141 |
39 | 1142 |
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1143 |
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1144 |
39 | 1145 |
1146 | |
1147 | |
1148 | |
1149 } |