Mercurial > hg > LGServices
annotate src/main/java/de/mpiwg/web/jsp/FullTextSearchPage.java @ 59:bc0219c2600b
new: minor improvements
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Mon, 09 May 2016 16:02:32 +0200 |
| parents | b8ad346e39a0 |
| children | 0a9937b06cc3 |
| 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 |
| 390 public void save() { | |
| 391 logger.debug("saving table..."); | |
| 392 logger.debug(this.getFileName() + ", " + this.getSearchTerm() + ", userId= "+ getSessionBean().getUser().getId()); | |
| 393 | |
| 394 //logger.debug(this.getFilteredList()); | |
| 395 | |
| 396 if (StringUtils.equals(this.getFileName(), "") ) { | |
| 397 addMsg("Save failed. Table name cannot be empty."); | |
| 398 return; | |
| 399 } | |
| 400 | |
| 401 | |
| 402 /* Update db table `LGFullTextSearchFile`: new row with userId, file name, ...*/ | |
| 403 | |
| 404 Long userId = getSessionBean().getUser().getId(); | |
| 405 | |
| 406 LGFullTextSearchFile file; | |
| 407 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
|
408 |
|
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
|
409 // 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
|
410 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
|
411 |
|
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
|
412 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
|
413 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
|
414 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
|
415 break; |
| 39 | 416 } |
| 417 } | |
| 418 | |
|
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
|
419 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
|
420 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
|
421 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
|
422 } |
|
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
|
423 |
|
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
|
424 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
|
425 |
|
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
426 //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
|
427 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
|
428 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
429 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
430 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
|
431 |
|
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
|
432 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
|
433 |
| 39 | 434 addMsg("The table has been saved!"); |
| 435 | |
| 436 | |
| 437 } catch (Exception e) { | |
| 438 addMsg("Saving fails!"); | |
| 439 e.printStackTrace(); | |
| 440 internalError(e); | |
| 441 } | |
| 442 | |
|
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
443 this.forceSetFileLists(); |
|
54
a00efd5d9e77
new: adding delete saved table function
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
444 |
| 39 | 445 } |
| 446 | |
| 447 | |
| 448 | |
| 449 public void filter(){ | |
| 450 this.filteredList = new ArrayList<DBContents>(); | |
| 451 for(DBContents content : this.completeList){ | |
| 452 if(!this.filteredList.contains(content)){ | |
| 453 | |
| 454 if( (StringUtils.isEmpty(dynastyFilter) || StringUtils.startsWith(content.getSection().getBook().getDynasty(), dynastyFilter)) && | |
| 455 (StringUtils.isEmpty(level1Filter) || StringUtils.startsWith(content.getSection().getBook().getLevel1(), level1Filter)) && | |
| 456 (StringUtils.isEmpty(level2Filter) || StringUtils.startsWith(content.getSection().getBook().getLevel2(), level2Filter)) && | |
| 457 (StringUtils.isEmpty(adminTypeFilter) || StringUtils.startsWith(content.getSection().getBook().getAdmin_type(), adminTypeFilter)) && | |
| 458 (StringUtils.isEmpty(bookIdFilter) || StringUtils.startsWith(content.getBookId(), bookIdFilter)) && | |
| 459 (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
|
460 (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
|
461 (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
|
462 |
| 39 | 463 ){ |
| 464 this.filteredList.add(content); | |
| 465 } | |
| 466 } | |
| 467 } | |
|
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
|
468 |
| 39 | 469 if(completeList.size() > 0){ |
| 470 this.searchMessage = completeList.size() + " section(s) found for the term(s): " + this.searchTerm; | |
| 471 this.filteringMessage = this.filteredList.size() + " section(s) listed after the filtering"; | |
| 472 | |
| 473 this.paginator.setCurrentPage(0); | |
| 474 this.paginator.resetNumberOfPages(filteredList.size()); | |
| 475 | |
| 476 }else{ | |
| 477 this.searchMessage = "No sections found for the term(s): " + this.searchTerm; | |
| 478 this.filteredList = null; | |
| 479 this.filteringMessage = ""; | |
| 480 | |
| 481 this.paginator.setCurrentPage(0); | |
| 482 this.paginator.resetNumberOfPages(0); | |
| 483 } | |
| 484 | |
| 485 this.updateCurrentSections(); | |
| 486 | |
| 487 } | |
| 488 | |
| 489 | |
| 490 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
|
491 |
| 39 | 492 this.paginator.initCount(); |
| 493 int startRecord = this.paginator.getCurrentPage() | |
| 494 * this.paginator.getItemsPerPage(); | |
| 495 if(this.paginator.getNumberOfPages() == 0){ | |
| 496 this.displayList = new ArrayList<DBContents>(); | |
| 497 }else if((this.paginator.getCurrentPage() + 1) == this.paginator.getNumberOfPages()){ | |
| 498 int mod = this.filteredList.size() % paginator.getItemsPerPage(); | |
| 499 if(mod == 0){ | |
| 500 this.displayList = filteredList.subList(startRecord, startRecord + this.paginator.getItemsPerPage()); | |
| 501 }else{ | |
| 502 this.displayList = filteredList.subList(startRecord, startRecord + mod); | |
| 503 } | |
| 504 | |
| 505 }else{ | |
| 506 this.displayList = filteredList.subList(startRecord, startRecord + this.paginator.getItemsPerPage()); | |
| 507 } | |
| 508 | |
| 509 } | |
| 510 | |
| 511 | |
|
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
|
512 |
|
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
|
513 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
|
514 |
|
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
|
515 // 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
|
516 // 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
|
517 // 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
|
518 |
|
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
|
519 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
|
520 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
|
521 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
|
522 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
|
523 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
|
524 } |
|
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
|
525 } |
|
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
|
526 |
|
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
|
527 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
|
528 |
|
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
|
529 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
|
530 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
|
531 |
|
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
|
532 // 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
|
533 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
|
534 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
|
535 } 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
|
536 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
|
537 } |
|
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
|
538 |
|
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
|
539 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
|
540 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
|
541 |
|
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
|
542 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
|
543 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
|
544 |
|
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
|
545 |
|
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
|
546 |
|
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
|
547 } |
|
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
|
548 |
|
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
|
549 |
|
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
|
550 |
|
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
|
551 |
|
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
|
552 |
|
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
553 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
|
554 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
|
555 |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
556 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
|
557 |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
558 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
|
559 tmp = tmp.replace(" ", ""); |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
560 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
|
561 rs.add(tmp); |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
562 } |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
563 } |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
564 return rs; |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
565 } |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
566 |
| 39 | 567 private List<String> splitTerms(){ |
| 568 List<String> rs = new ArrayList<String>(); | |
| 569 | |
| 570 String[] array = this.searchTerm.split(","); | |
| 571 | |
| 572 for(String tmp : array){ | |
| 573 tmp = tmp.replace(" ", ""); | |
| 574 if(StringUtils.isNotEmpty(tmp)){ | |
| 575 rs.add(tmp); | |
| 576 } | |
| 577 } | |
| 578 return rs; | |
| 579 } | |
|
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
580 |
| 39 | 581 |
|
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
582 public List<String> suggestBookName(String term, int limit){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
583 List<String> list = new ArrayList<String>(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
584 for(DBContents content : this.completeList){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
585 String bookName = content.getSection().getBook().getName(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
586 if(!list.contains(bookName) && bookName.startsWith(term)){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
587 list.add(bookName); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
588 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
589 if(limit == list.size()){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
590 break; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
591 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
592 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
593 return list; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
594 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
595 |
| 39 | 596 public List<String> suggestDynasty(String term, int limit){ |
| 597 List<String> list = new ArrayList<String>(); | |
| 598 for(DBContents content : this.completeList){ | |
| 599 String dynasty = content.getSection().getBook().getDynasty(); | |
| 600 if(!list.contains(dynasty) && dynasty.startsWith(term)){ | |
| 601 list.add(dynasty); | |
| 602 } | |
| 603 if(limit == list.size()){ | |
| 604 break; | |
| 605 } | |
| 606 } | |
| 607 return list; | |
| 608 } | |
| 609 | |
| 610 public List<String> suggestLevel1(String term, int limit){ | |
| 611 List<String> list = new ArrayList<String>(); | |
| 612 for(DBContents content : this.completeList){ | |
| 613 String level1 = content.getSection().getBook().getLevel1(); | |
| 614 if(!list.contains(level1) && level1.startsWith(term)){ | |
| 615 list.add(level1); | |
| 616 } | |
| 617 if(limit == list.size()){ | |
| 618 break; | |
| 619 } | |
| 620 } | |
| 621 return list; | |
| 622 } | |
| 623 | |
|
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
624 public List<String> suggestLevel2(String term, int limit){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
625 List<String> list = new ArrayList<String>(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
626 for(DBContents content : this.completeList){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
627 String level2 = content.getSection().getBook().getLevel2(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
628 if(!list.contains(level2) && level2.startsWith(term)){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
629 list.add(level2); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
630 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
631 if(limit == list.size()){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
632 break; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
633 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
634 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
635 return list; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
636 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
637 |
| 39 | 638 public List<String> suggestAdminType(String term, int limit){ |
| 639 List<String> list = new ArrayList<String>(); | |
| 640 for(DBContents content : this.completeList){ | |
| 641 String adminType = content.getSection().getBook().getAdmin_type(); | |
| 642 if(!list.contains(adminType) && adminType.startsWith(term)){ | |
| 643 list.add(adminType); | |
| 644 } | |
| 645 if(limit == list.size()){ | |
| 646 break; | |
| 647 } | |
| 648 } | |
| 649 return list; | |
| 650 } | |
| 651 | |
|
59
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
652 public List<String> suggestPeriod(String term, int limit){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
653 List<String> list = new ArrayList<String>(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
654 for(DBContents content : this.completeList){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
655 String period = content.getSection().getBook().getPeriod(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
656 if(!list.contains(period) && period.startsWith(term)){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
657 list.add(period); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
658 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
659 if(limit == list.size()){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
660 break; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
661 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
662 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
663 return list; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
664 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
665 public List<String> suggestSectionName(String term, int limit){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
666 List<String> list = new ArrayList<String>(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
667 for(DBContents content : this.completeList){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
668 String sectionName = content.getSection().getName(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
669 if(!list.contains(sectionName) && sectionName.startsWith(term)){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
670 list.add(sectionName); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
671 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
672 if(limit == list.size()){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
673 break; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
674 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
675 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
676 return list; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
677 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
678 public List<String> suggestBookId(String term, int limit){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
679 List<String> list = new ArrayList<String>(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
680 for(DBContents content : this.completeList){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
681 String bookId = content.getSection().getBook().getId(); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
682 if(!list.contains(bookId) && bookId.startsWith(term)){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
683 list.add(bookId); |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
684 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
685 if(limit == list.size()){ |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
686 break; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
687 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
688 } |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
689 return list; |
|
bc0219c2600b
new: minor improvements
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
690 } |
| 39 | 691 |
| 692 | |
| 693 public List<LGFullTextSearchFile> getFileList() { | |
| 694 return fileList; | |
| 695 } | |
| 696 | |
| 697 public void setFileList(List<LGFullTextSearchFile> fileList) { | |
| 698 this.fileList = fileList; | |
| 699 } | |
| 700 | |
| 701 | |
| 702 | |
| 703 public List<DBContents> getCompleteList() { | |
| 704 return completeList; | |
| 705 } | |
| 706 | |
| 707 | |
| 708 | |
| 709 public void setCompleteList(List<DBContents> completeList) { | |
| 710 this.completeList = completeList; | |
| 711 } | |
| 712 | |
| 713 | |
|
48
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
714 public String getBatchSearchTerm() { |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
715 return batchSearchTerm; |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
716 } |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
717 |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
718 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
|
719 this.batchSearchTerm = batchSearchTerm; |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
720 } |
|
13555aff1f88
new: multiple full text searching. topics and tasks improvement.
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
721 |
| 39 | 722 public String getSearchTerm() { |
| 723 return searchTerm; | |
| 724 } | |
| 725 | |
| 726 | |
| 727 public void setSearchTerm(String searchTerm) { | |
| 728 this.searchTerm = searchTerm; | |
| 729 } | |
| 730 | |
| 731 public List<DBContents> getFilteredList() { | |
| 732 return filteredList; | |
| 733 } | |
| 734 | |
| 735 public void setFilteredList(List<DBContents> filteredList) { | |
| 736 this.filteredList = filteredList; | |
| 737 } | |
| 738 | |
| 739 | |
| 740 public List<DBContents> getDisplayList() { | |
| 741 return displayList; | |
| 742 } | |
| 743 | |
| 744 public void setDisplayList(List<DBContents> displayList) { | |
| 745 this.displayList = displayList; | |
| 746 } | |
| 747 | |
| 748 | |
| 749 public DataPaginator getPaginator() { | |
| 750 return paginator; | |
| 751 } | |
| 752 | |
| 753 public void setPaginator(DataPaginator paginator) { | |
| 754 this.paginator = paginator; | |
| 755 } | |
| 756 | |
| 757 public void firstPage() { | |
| 758 this.paginator.first(); | |
| 759 this.updateCurrentSections(); | |
| 760 } | |
| 761 | |
| 762 public void lastPage() { | |
| 763 this.paginator.last(); | |
| 764 this.updateCurrentSections(); | |
| 765 } | |
| 766 | |
| 767 public void fastForward() { | |
| 768 this.paginator.fastForward(); | |
| 769 this.updateCurrentSections(); | |
| 770 } | |
| 771 | |
| 772 public void fastRewind() { | |
| 773 this.paginator.fastRewind(); | |
| 774 this.updateCurrentSections(); | |
| 775 } | |
| 776 | |
| 777 public void previousPage() { | |
| 778 this.paginator.previous(); | |
| 779 this.updateCurrentSections(); | |
| 780 } | |
| 781 | |
| 782 public void nextPage() { | |
| 783 this.paginator.next(); | |
| 784 this.updateCurrentSections(); | |
| 785 } | |
| 786 | |
| 787 public String getSearchMessage() { | |
| 788 return searchMessage; | |
| 789 } | |
| 790 | |
| 791 public void setSearchMessage(String searchMessage) { | |
| 792 this.searchMessage = searchMessage; | |
| 793 } | |
| 794 | |
| 795 public String getFilteringMessage() { | |
| 796 return filteringMessage; | |
| 797 } | |
| 798 | |
| 799 public void setFilteringMessage(String filteringMessage) { | |
| 800 this.filteringMessage = filteringMessage; | |
| 801 } | |
| 802 | |
|
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
|
803 |
|
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
|
804 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
|
805 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
|
806 } |
|
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
|
807 |
|
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
|
808 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
|
809 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
|
810 } |
|
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
|
811 |
| 39 | 812 public String getFileName() { |
| 813 return fileName; | |
| 814 } | |
| 815 | |
| 816 public void setFileName(String fileName) { | |
| 817 this.fileName = fileName; | |
| 818 } | |
| 819 | |
| 820 public String getDynastyFilter() { | |
| 821 return dynastyFilter; | |
| 822 } | |
| 823 | |
| 824 public void setDynastyFilter(String dynastyFilter) { | |
| 825 this.dynastyFilter = dynastyFilter; | |
| 826 } | |
| 827 | |
| 828 public String getAdminTypeFilter() { | |
| 829 return adminTypeFilter; | |
| 830 } | |
| 831 | |
| 832 public void setAdminTypeFilter(String adminTypeFilter) { | |
| 833 this.adminTypeFilter = adminTypeFilter; | |
| 834 } | |
| 835 | |
| 836 public String getLevel1Filter() { | |
| 837 return level1Filter; | |
| 838 } | |
| 839 | |
| 840 public void setLevel1Filter(String level1Filter) { | |
| 841 this.level1Filter = level1Filter; | |
| 842 } | |
|
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
843 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
|
844 return contentFilter; |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
845 } |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
846 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
847 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
|
848 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
|
849 } |
| 39 | 850 |
| 851 public String getFocusedContentId() { | |
| 852 return focusedContentId; | |
| 853 } | |
| 854 | |
| 855 public void setFocusedContentId(String focusedContentId) { | |
| 856 this.focusedContentId = focusedContentId; | |
| 857 } | |
| 858 | |
| 859 public String getBookIdFilter() { | |
| 860 return bookIdFilter; | |
| 861 } | |
| 862 | |
| 863 public void setBookIdFilter(String bookIdFilter) { | |
| 864 this.bookIdFilter = bookIdFilter; | |
| 865 } | |
| 866 | |
| 867 public String getBookNameFilter() { | |
| 868 return bookNameFilter; | |
| 869 } | |
| 870 | |
| 871 public void setBookNameFilter(String bookNameFilter) { | |
| 872 this.bookNameFilter = bookNameFilter; | |
| 873 } | |
| 874 | |
| 875 public String getLevel2Filter() { | |
| 876 return level2Filter; | |
| 877 } | |
| 878 | |
| 879 public void setLevel2Filter(String level2Filter) { | |
| 880 this.level2Filter = level2Filter; | |
| 881 } | |
| 882 | |
| 883 public String getPeriodFilter() { | |
| 884 return periodFilter; | |
| 885 } | |
| 886 | |
| 887 public void setPeriodFilter(String periodFilter) { | |
| 888 this.periodFilter = periodFilter; | |
| 889 } | |
| 890 | |
| 891 public String getSectionNameFilter() { | |
| 892 return sectionNameFilter; | |
| 893 } | |
| 894 | |
| 895 public void setSectionNameFilter(String sectionNameFilter) { | |
| 896 this.sectionNameFilter = sectionNameFilter; | |
| 897 } | |
| 898 | |
|
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
|
899 |
|
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
|
900 |
|
55
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
901 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
|
902 return weekFileList; |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
903 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
904 |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
905 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
|
906 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
|
907 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
908 |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
909 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
|
910 return monthFileList; |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
911 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
912 |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
913 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
|
914 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
|
915 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
916 |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
917 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
|
918 return olderFileList; |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
919 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
920 |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
921 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
|
922 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
|
923 } |
|
95bf4ac726e6
Topic synchronization with extraction-interface. new tables in LGService database
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
924 |
|
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
|
925 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
|
926 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
|
927 } |
|
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
|
928 |
|
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
|
929 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
|
930 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
|
931 } |
|
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
|
932 |
|
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
|
933 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
|
934 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
|
935 } |
|
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
|
936 |
|
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
|
937 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
|
938 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
|
939 } |
|
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
|
940 |
|
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
|
941 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
|
942 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
|
943 } |
|
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
|
944 |
|
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
|
945 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
|
946 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
|
947 } |
|
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
|
948 |
|
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
|
949 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
|
950 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
|
951 } |
|
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
|
952 |
|
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
|
953 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
|
954 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
|
955 } |
|
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
|
956 |
|
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
957 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
958 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
959 /////// Sorting |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
960 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
961 |
| 39 | 962 public void sortByBookNameUp(){ |
| 963 Collections.sort(this.completeList, new SortContentByBookName()); | |
| 964 filter(); | |
| 965 } | |
| 966 | |
| 967 public void sortByBookNameDown(){ | |
| 968 Collections.sort(this.completeList, new SortContentByBookName()); | |
| 969 Collections.reverse(this.completeList); | |
| 970 filter(); | |
| 971 } | |
| 972 | |
| 973 public void sortBySectionNameUp(){ | |
| 974 Collections.sort(this.completeList); | |
| 975 filter(); | |
| 976 } | |
| 977 | |
| 978 public void sortBySectionNameDown(){ | |
| 979 Collections.sort(this.completeList); | |
| 980 Collections.reverse(this.completeList); | |
| 981 filter(); | |
| 982 } | |
| 983 | |
| 984 | |
| 985 public void sortByPeriodUp(){ | |
| 986 Collections.sort(this.completeList, new SortContentByPeriod()); | |
| 987 filter(); | |
| 988 } | |
| 989 | |
| 990 public void sortByPeriodDown(){ | |
| 991 Collections.sort(this.completeList, new SortContentByPeriod()); | |
| 992 Collections.reverse(this.completeList); | |
| 993 filter(); | |
| 994 } | |
| 995 | |
| 996 | |
| 997 | |
| 998 public void sortByIdUp(){ | |
| 999 Collections.sort(this.completeList, new SortContentById()); | |
| 1000 this.filter(); | |
| 1001 } | |
| 1002 | |
| 1003 public void sortByIdDown(){ | |
| 1004 Collections.sort(this.completeList, new SortContentById()); | |
| 1005 Collections.reverse(completeList); | |
| 1006 this.filter(); | |
| 1007 } | |
| 1008 | |
| 1009 | |
| 1010 public void sortByDynastyUp(){ | |
| 1011 Collections.sort(this.completeList, new SortContentByDynasty()); | |
| 1012 filter(); | |
| 1013 } | |
| 1014 | |
| 1015 public void sortByDynastyDown(){ | |
| 1016 Collections.sort(this.completeList, new SortContentByDynasty()); | |
| 1017 Collections.reverse(completeList); | |
| 1018 filter(); | |
| 1019 } | |
| 1020 | |
| 1021 public void sortByBookIdUp(){ | |
| 1022 Collections.sort(this.completeList, new SortContentByBookId()); | |
| 1023 filter(); | |
| 1024 } | |
| 1025 | |
| 1026 public void sortByBookIdDown(){ | |
| 1027 Collections.sort(this.completeList, new SortContentByBookId()); | |
| 1028 Collections.reverse(completeList); | |
| 1029 filter(); | |
| 1030 } | |
| 1031 | |
| 1032 public void sortByLevel1Up(){ | |
| 1033 Collections.sort(this.completeList, new SortContentByLevel1()); | |
| 1034 filter(); | |
| 1035 } | |
| 1036 | |
| 1037 public void sortByLevel1Down(){ | |
| 1038 Collections.sort(this.completeList, new SortContentByLevel1()); | |
| 1039 Collections.reverse(completeList); | |
| 1040 filter(); | |
| 1041 } | |
| 1042 public void sortByLevel2Up(){ | |
| 1043 Collections.sort(this.completeList, new SortContentByLevel2()); | |
| 1044 filter(); | |
| 1045 } | |
| 1046 | |
| 1047 public void sortByLevel2Down(){ | |
| 1048 Collections.sort(this.completeList, new SortContentByLevel2()); | |
| 1049 Collections.reverse(completeList); | |
| 1050 filter(); | |
| 1051 } | |
| 1052 | |
| 1053 public void sortByAdminTypeUp(){ | |
| 1054 Collections.sort(this.completeList, new SortContentByAdminType()); | |
| 1055 filter(); | |
| 1056 } | |
| 1057 | |
| 1058 public void sortByAdminTypeDown(){ | |
| 1059 Collections.sort(this.completeList, new SortContentByAdminType()); | |
| 1060 Collections.reverse(completeList); | |
| 1061 filter(); | |
| 1062 } | |
| 1063 | |
| 1064 public void sortByStartPageUp(){ | |
| 1065 Collections.sort(this.completeList, new SortContentByStartPage()); | |
| 1066 filter(); | |
| 1067 } | |
| 1068 | |
| 1069 public void sortByStartPageDown(){ | |
| 1070 Collections.sort(this.completeList, new SortContentByStartPage()); | |
| 1071 Collections.reverse(completeList); | |
| 1072 filter(); | |
| 1073 } | |
| 1074 public void sortByInxUp(){ | |
| 1075 Collections.sort(this.completeList, new SortContentByInx()); | |
| 1076 filter(); | |
| 1077 } | |
| 1078 | |
| 1079 public void sortByInxDown(){ | |
| 1080 Collections.sort(this.completeList, new SortContentByInx()); | |
| 1081 Collections.reverse(completeList); | |
| 1082 filter(); | |
| 1083 } | |
|
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1084 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1085 |
| 39 | 1086 |
|
49
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1087 |
|
7c2e1b14b77d
new: load existing full text searching result into searching table
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
1088 |
| 39 | 1089 |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 } |
