Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/web/jsp/BooksPage.java @ 15:d81a5401b9af
new: sorting in books page
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 01 Jun 2015 14:35:35 +0200 |
parents | 3387d855a194 |
children | 372dab740f15 |
comparison
equal
deleted
inserted
replaced
14:3387d855a194 | 15:d81a5401b9af |
---|---|
1 package de.mpiwg.web.jsp; | 1 package de.mpiwg.web.jsp; |
2 | 2 |
3 | 3 |
4 import java.util.ArrayList; | 4 import java.util.ArrayList; |
5 import java.util.Collections; | |
5 import java.util.HashMap; | 6 import java.util.HashMap; |
6 import java.util.List; | 7 import java.util.List; |
7 import java.util.Map; | 8 import java.util.Map; |
8 | 9 |
9 import javax.servlet.http.HttpServletRequest; | 10 import javax.servlet.http.HttpServletRequest; |
12 import org.apache.log4j.Logger; | 13 import org.apache.log4j.Logger; |
13 | 14 |
14 import de.mpiwg.gazetteer.db.DBBook; | 15 import de.mpiwg.gazetteer.db.DBBook; |
15 import de.mpiwg.gazetteer.db.DBSectionVersion; | 16 import de.mpiwg.gazetteer.db.DBSectionVersion; |
16 import de.mpiwg.gazetteer.utils.DBService; | 17 import de.mpiwg.gazetteer.utils.DBService; |
18 import de.mpiwg.web.books.SortBooksByAdminType; | |
19 import de.mpiwg.web.books.SortBooksByBookId; | |
20 import de.mpiwg.web.books.SortBooksByDate; | |
21 import de.mpiwg.web.books.SortBooksByDynasty; | |
22 import de.mpiwg.web.books.SortBooksByEdition; | |
23 import de.mpiwg.web.books.SortBooksByEditor; | |
24 import de.mpiwg.web.books.SortBooksByLevel1; | |
25 import de.mpiwg.web.books.SortBooksByLevel2; | |
26 import de.mpiwg.web.books.SortBooksByName; | |
27 import de.mpiwg.web.books.SortBooksByPeriod; | |
28 import de.mpiwg.web.books.SortBooksByStartYear; | |
29 import de.mpiwg.web.books.SortBooksByTocCorrection; | |
17 | 30 |
18 public class BooksPage extends AbstractJSPPage{ | 31 public class BooksPage extends AbstractJSPPage{ |
19 | 32 |
20 private static Logger logger = Logger.getLogger(BooksPage.class); | 33 private static Logger logger = Logger.getLogger(BooksPage.class); |
21 | 34 |
129 } | 142 } |
130 | 143 |
131 | 144 |
132 } | 145 } |
133 | 146 |
134 | 147 public void sortByBookIdUp() { |
135 | 148 Collections.sort(this.completeBookList, new SortBooksByBookId()); |
149 //filter(); | |
150 } | |
151 | |
152 public void sortByBookIdDown() { | |
153 Collections.sort(this.completeBookList, new SortBooksByBookId()); | |
154 Collections.reverse(completeBookList); | |
155 //filter(); | |
156 } | |
157 | |
158 public void sortByBookNameUp(){ | |
159 Collections.sort(this.completeBookList, new SortBooksByName()); | |
160 //filter(); | |
161 } | |
162 | |
163 public void sortByBookNameDown(){ | |
164 Collections.sort(this.completeBookList, new SortBooksByName()); | |
165 Collections.reverse(completeBookList); | |
166 //filter(); | |
167 } | |
168 | |
169 public void sortByLevel1Up(){ | |
170 Collections.sort(this.completeBookList, new SortBooksByLevel1()); | |
171 //filter(); | |
172 } | |
173 | |
174 public void sortByLevel1Down(){ | |
175 Collections.sort(this.completeBookList, new SortBooksByLevel1()); | |
176 Collections.reverse(completeBookList); | |
177 //filter(); | |
178 } | |
179 public void sortByLevel2Up(){ | |
180 Collections.sort(this.completeBookList, new SortBooksByLevel2()); | |
181 //filter(); | |
182 } | |
183 | |
184 public void sortByLevel2Down(){ | |
185 Collections.sort(this.completeBookList, new SortBooksByLevel2()); | |
186 Collections.reverse(completeBookList); | |
187 //filter(); | |
188 } | |
189 | |
190 public void sortByPeriodUp(){ | |
191 Collections.sort(this.completeBookList, new SortBooksByPeriod()); | |
192 //filter(); | |
193 } | |
194 | |
195 public void sortByPeriodDown(){ | |
196 Collections.sort(this.completeBookList, new SortBooksByPeriod()); | |
197 Collections.reverse(completeBookList); | |
198 //filter(); | |
199 } | |
200 | |
201 public void sortByAdminTypeUp(){ | |
202 Collections.sort(this.completeBookList, new SortBooksByAdminType()); | |
203 //filter(); | |
204 } | |
205 | |
206 public void sortByAdminTypeDown(){ | |
207 Collections.sort(this.completeBookList, new SortBooksByAdminType()); | |
208 Collections.reverse(completeBookList); | |
209 //filter(); | |
210 } | |
211 | |
212 public void sortByStartYearUp(){ | |
213 Collections.sort(this.completeBookList, new SortBooksByStartYear()); | |
214 //filter(); | |
215 } | |
216 | |
217 public void sortByStartYearDown(){ | |
218 Collections.sort(this.completeBookList, new SortBooksByStartYear()); | |
219 Collections.reverse(completeBookList); | |
220 //filter(); | |
221 } | |
222 | |
223 public void sortByDynastyUp(){ | |
224 Collections.sort(this.completeBookList, new SortBooksByDynasty()); | |
225 //filter(); | |
226 } | |
227 | |
228 public void sortByDynastyDown(){ | |
229 Collections.sort(this.completeBookList, new SortBooksByDynasty()); | |
230 Collections.reverse(completeBookList); | |
231 //filter(); | |
232 } | |
233 public void sortByEditionUp(){ | |
234 Collections.sort(this.completeBookList, new SortBooksByEdition()); | |
235 //filter(); | |
236 } | |
237 | |
238 public void sortByEditionDown(){ | |
239 Collections.sort(this.completeBookList, new SortBooksByEdition()); | |
240 Collections.reverse(completeBookList); | |
241 //filter(); | |
242 } | |
243 | |
244 | |
245 | |
246 public void sortByEditorUp(){ | |
247 Collections.sort(this.completeBookList, new SortBooksByEditor()); | |
248 //filter(); | |
249 } | |
250 | |
251 public void sortByEditorDown(){ | |
252 Collections.sort(this.completeBookList, new SortBooksByEditor()); | |
253 Collections.reverse(completeBookList); | |
254 //filter(); | |
255 } | |
256 | |
257 public void sortByDateUp(){ | |
258 Collections.sort(this.completeBookList, new SortBooksByDate()); | |
259 //filter(); | |
260 } | |
261 | |
262 public void sortByDateDown(){ | |
263 Collections.sort(this.completeBookList, new SortBooksByDate()); | |
264 Collections.reverse(completeBookList); | |
265 //filter(); | |
266 } | |
267 | |
268 public void sortByTocCorrectionUp(){ | |
269 Collections.sort(this.completeBookList, new SortBooksByTocCorrection()); | |
270 //filter(); | |
271 } | |
272 | |
273 public void sortByTocCorrectionDown(){ | |
274 Collections.sort(this.completeBookList, new SortBooksByTocCorrection()); | |
275 Collections.reverse(completeBookList); | |
276 //filter(); | |
277 } | |
278 | |
279 | |
280 | |
281 | |
136 } | 282 } |