# HG changeset patch # User Zoe Hong # Date 1435222432 -7200 # Node ID 07f7594ba56eaf35546fb878853b3178f3949417 # Parent dcc160f7db388c4beee2d96261af2eb44a5d5c4f add filters to lastEditor and editTime in books page diff -r dcc160f7db38 -r 07f7594ba56e src/main/java/de/mpiwg/web/jsp/BooksPage.java --- a/src/main/java/de/mpiwg/web/jsp/BooksPage.java Tue Jun 23 16:21:59 2015 +0200 +++ b/src/main/java/de/mpiwg/web/jsp/BooksPage.java Thu Jun 25 10:53:52 2015 +0200 @@ -55,7 +55,12 @@ private String level2Filter = new String(); private String periodFilter = new String(); private String editionFilter = new String(); + private String lastEditorFilter = new String(); + private String editTimeFilter = new String(); + + + private String filteringMessage; @@ -71,6 +76,8 @@ this.level2Filter = getParameter("level2Filter"); this.periodFilter = getParameter("periodFilter"); this.editionFilter = getParameter("editionFilter"); + this.lastEditorFilter = getParameter("lastEditorFilter"); + this.editTimeFilter = getParameter("editTimeFilter"); } @@ -83,14 +90,29 @@ if(!this.filteredBookList.contains(book)){ if( (StringUtils.isEmpty(dynastyFilter) || StringUtils.startsWith(book.getDynasty(), dynastyFilter)) && - (StringUtils.isEmpty(level1Filter) || StringUtils.startsWith(book.getLevel1(), level1Filter)) && - (StringUtils.isEmpty(level2Filter) || StringUtils.startsWith(book.getLevel2(), level2Filter)) && - (StringUtils.isEmpty(periodFilter) || StringUtils.startsWith(book.getPeriod(), periodFilter)) && - (StringUtils.isEmpty(editionFilter) || StringUtils.startsWith(book.getEdition(), editionFilter)) && - (StringUtils.isEmpty(bookNameFilter) || StringUtils.startsWith(book.getName(), bookNameFilter)) && - (StringUtils.isEmpty(adminTypeFilter) || StringUtils.startsWith(book.getAdmin_type(), adminTypeFilter)) - ){ - this.filteredBookList.add(book); + (StringUtils.isEmpty(level1Filter) || StringUtils.startsWith(book.getLevel1(), level1Filter)) && + (StringUtils.isEmpty(level2Filter) || StringUtils.startsWith(book.getLevel2(), level2Filter)) && + (StringUtils.isEmpty(periodFilter) || StringUtils.startsWith(book.getPeriod(), periodFilter)) && + (StringUtils.isEmpty(editionFilter) || StringUtils.startsWith(book.getEdition(), editionFilter)) && + (StringUtils.isEmpty(bookNameFilter) || StringUtils.startsWith(book.getName(), bookNameFilter)) && + (StringUtils.isEmpty(adminTypeFilter) || StringUtils.startsWith(book.getAdmin_type(), adminTypeFilter)) + ){ + String lastEditor = new String(); + String editTime = new String(); + if ( book.getCurrentSectionVersion() != null) { + lastEditor = book.getCurrentSectionVersion().getEditor(); + editTime = book.getCurrentSectionVersion().getDate(); + } + + if( (StringUtils.isEmpty(lastEditorFilter) || StringUtils.startsWith(lastEditor, lastEditorFilter)) && + (StringUtils.isEmpty(editTimeFilter) || StringUtils.startsWith(editTime, editTimeFilter)) + + ){ + this.filteredBookList.add(book); + + } + + //this.filteredBookList.add(book); } } @@ -288,6 +310,7 @@ try { DBService.getInstance().updateComment(currentBookId, bookComment); + //DBService.getInstance().getBook(currentBookId).setComments(bookComment); } catch (Exception e) { addMsg("There is an internal error: " + e.getLocalizedMessage()); @@ -528,7 +551,18 @@ this.filteringMessage = filteringMessage; } + public String getLastEditorFilter() { + return lastEditorFilter; + } - + public void setLastEditorFilter(String lastEditorFilter) { + this.lastEditorFilter = lastEditorFilter; + } + public String getEditTimeFilter() { + return editTimeFilter; + } + public void setEditTimeFilter(String editTimeFilter) { + this.editTimeFilter = editTimeFilter; + } } diff -r dcc160f7db38 -r 07f7594ba56e src/main/java/de/mpiwg/web/jsp/JSPProxy.java --- a/src/main/java/de/mpiwg/web/jsp/JSPProxy.java Tue Jun 23 16:21:59 2015 +0200 +++ b/src/main/java/de/mpiwg/web/jsp/JSPProxy.java Thu Jun 25 10:53:52 2015 +0200 @@ -244,13 +244,16 @@ }catch(Exception e){ e.printStackTrace(); addMsg("There is an internal error: " + e.getLocalizedMessage()); - return HomePage.page; + + return BooksPage.page; + //return HomePage.page; } //Default Page - return "pages/search.jsp"; + return BooksPage.page; + //return "pages/search.jsp"; } diff -r dcc160f7db38 -r 07f7594ba56e src/main/resources/config.properties --- a/src/main/resources/config.properties Tue Jun 23 16:21:59 2015 +0200 +++ b/src/main/resources/config.properties Thu Jun 25 10:53:52 2015 +0200 @@ -4,19 +4,19 @@ files_root=/gazetteer-server/data #Local -#dvn_server=http://localhost/dvn +dvn_server=http://localhost/dvn #dvn_server=http://localhost:8082 -#root_server=http://localhost:8080/LGServices -#toc_interface=http://localhost:1080/localgazetteers-dev/LGToc -#extraction_interface=http://localhost:1080/localgazetteers-dev/extraction-interface +root_server=http://localhost:8080/LGServices +toc_interface=http://localhost:1080/localgazetteers-dev/LGToc +extraction_interface=http://localhost:1080/localgazetteers-dev/extraction-interface # Production one: #localgazetteers-dev -> localgazetteers -dvn_server=http://localgazetteers.mpiwg-berlin.mpg.de/dvn -root_server=http://localgazetteers.mpiwg-berlin.mpg.de/LGServices -toc_interface=http://localgazetteers.mpiwg-berlin.mpg.de/LGToc -extraction_interface=http://localgazetteers.mpiwg-berlin.mpg.de/extraction-interface +#dvn_server=http://localgazetteers.mpiwg-berlin.mpg.de/dvn +#root_server=http://localgazetteers.mpiwg-berlin.mpg.de/LGServices +#toc_interface=http://localgazetteers.mpiwg-berlin.mpg.de/LGToc +#extraction_interface=http://localgazetteers.mpiwg-berlin.mpg.de/extraction-interface # Development one: #localgazetteers -> localgazetteers-test diff -r dcc160f7db38 -r 07f7594ba56e src/main/webapp/WEB-INF/web.xml --- a/src/main/webapp/WEB-INF/web.xml Tue Jun 23 16:21:59 2015 +0200 +++ b/src/main/webapp/WEB-INF/web.xml Thu Jun 25 10:53:52 2015 +0200 @@ -7,7 +7,7 @@ LGServices - pages/home.jsp + pages/books.jsp diff -r dcc160f7db38 -r 07f7594ba56e src/main/webapp/pages/books.jsp --- a/src/main/webapp/pages/books.jsp Tue Jun 23 16:21:59 2015 +0200 +++ b/src/main/webapp/pages/books.jsp Thu Jun 25 10:53:52 2015 +0200 @@ -368,7 +368,16 @@ - + + + + + + + + @@ -390,6 +399,16 @@ + + + + + + + +