# HG changeset patch # User Zoe Hong # Date 1468856132 -7200 # Node ID 824b808a7481e460b9cd0f91cd5d39eed05e304b # Parent 2486846e61d545e1f045f65b60696896d405c912 improvements and bug fixed diff -r 2486846e61d5 -r 824b808a7481 src/main/java/de/mpiwg/gazetteer/rest/GetFullTextSearchHtmlFile.java --- a/src/main/java/de/mpiwg/gazetteer/rest/GetFullTextSearchHtmlFile.java Wed May 25 11:20:27 2016 +0200 +++ b/src/main/java/de/mpiwg/gazetteer/rest/GetFullTextSearchHtmlFile.java Mon Jul 18 17:35:32 2016 +0200 @@ -2,6 +2,7 @@ import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -18,6 +19,7 @@ import de.mpiwg.gazetteer.bo.LGFile; import de.mpiwg.gazetteer.bo.LGFullTextSearchFile; import de.mpiwg.gazetteer.db.DBContents; +import de.mpiwg.gazetteer.utils.DBService; import de.mpiwg.gazetteer.utils.DataProvider; import de.mpiwg.gazetteer.utils.FileManager; import de.mpiwg.gazetteer.utils.HTTPUtils; @@ -42,12 +44,15 @@ LGFullTextSearchFile file = DataProvider.getInstance().getFullTextSearchFile(fileId); if(file != null){ + // we should only show the ones are not removed. removed them using javascript in LGService.js + String html = FileManager.getFullTextSearchHtmlFileText(file); - // parse text so that it doesn't show the field "isRemoved", which has two values, true or false + /* html = html.replaceAll("isRemoved", ""); html = html.replaceAll("true", ""); html = html.replaceAll("false", ""); + */ PrintWriter out = response.getWriter(); out.print(html); diff -r 2486846e61d5 -r 824b808a7481 src/main/java/de/mpiwg/gazetteer/utils/FileManager.java --- a/src/main/java/de/mpiwg/gazetteer/utils/FileManager.java Wed May 25 11:20:27 2016 +0200 +++ b/src/main/java/de/mpiwg/gazetteer/utils/FileManager.java Mon Jul 18 17:35:32 2016 +0200 @@ -60,7 +60,7 @@ PrintWriter out = new PrintWriter(absolutePath + fileName); String text = new String(); // make it from list - text += "Address,LEVEL1,LEVEL2,Name,DYNASTY,PERIOD,ADMIN_TYPE,TimeSpan:begin,TimeSpan:end,Longitude,Latitude,PAGE,SECTION,CONTENT,BOOK_ID,Description\n"; + text += "Address,LEVEL1,LEVEL2,Name,DYNASTY,PERIOD,ADMIN_TYPE,TimeSpan:begin,TimeSpan:end,Longitude,Latitude,PAGE,SECTION,CONTENT,BOOK_ID,Author,Edition,Volume,Description\n"; for (DBContents c : list) { @@ -85,6 +85,14 @@ c.getSection().getName() + "," + c.getContent() + "," + c.getBookId() + "," + + + + // add author, edition, volume + book.getAuthor() + "," + + book.getEdition() + "," + + book.getVolume() + "," + + + description + "\n"; } } @@ -153,11 +161,11 @@ + "section name" + "page" + "content" - + "content id" - + "isRemoved" + + "content id" + + "isRemoved" - // TODO add Author, edition, volume, place name, coordinates (x,y) - + "Author" + // add author, edition, volume, place name, coordinates (x,y) + + "author" + "edition" + "volume" + "place name" @@ -171,8 +179,14 @@ if ( c.getSection() != null){ DBBook book = c.getSection().getBook(); - - text += "" + + + if (c.isRemoved()) { + text += ""; + } else { + text += ""; + + } + text += "" + c.getInx() + "" + "" + c.getBookId() + "" + "" + book.getName() + "" + @@ -184,10 +198,9 @@ "" + c.getSection().getName() + "" + "" + c.getPage() + "" + "" + c.getContent() + "" + - "" + c.getId() + "" + - "" + c.isRemoved() + "" + + "" + c.getId() + "" + + "" + c.isRemoved() + "" + - // TODO "" + book.getAuthor() + "" + "" + book.getEdition() + "" + "" + book.getVolume() + "" + diff -r 2486846e61d5 -r 824b808a7481 src/main/java/de/mpiwg/web/jsp/BranchPage.java --- a/src/main/java/de/mpiwg/web/jsp/BranchPage.java Wed May 25 11:20:27 2016 +0200 +++ b/src/main/java/de/mpiwg/web/jsp/BranchPage.java Mon Jul 18 17:35:32 2016 +0200 @@ -20,7 +20,7 @@ public class BranchPage extends AbstractJSPPage{ - private static Logger logger = Logger.getLogger(CreateFilePage.class); + private static Logger logger = Logger.getLogger(BranchPage.class); public static String bean = "branchBean"; public static String page = "pages/branchPage.jsp"; @@ -145,6 +145,9 @@ public void loadBranch(String branchId0){ + + System.out.println("loading branch: " + branchId0); + try { this.branchId = Long.parseLong(branchId0); diff -r 2486846e61d5 -r 824b808a7481 src/main/java/de/mpiwg/web/jsp/HomePage.java --- a/src/main/java/de/mpiwg/web/jsp/HomePage.java Wed May 25 11:20:27 2016 +0200 +++ b/src/main/java/de/mpiwg/web/jsp/HomePage.java Mon Jul 18 17:35:32 2016 +0200 @@ -311,7 +311,7 @@ } if(completeBranchList.size() > 0){ - this.filteringMessage = this.filteredBranchList.size() + " branches listed after filtering"; + this.filteringMessage = this.filteredBranchList.size() + " tasks listed after filtering"; this.paginator.setCurrentPage(0); this.paginator.resetNumberOfPages(filteredBranchList.size()); this.updateCurrentBranches(); diff -r 2486846e61d5 -r 824b808a7481 src/main/java/de/mpiwg/web/jsp/TopicListPage.java --- a/src/main/java/de/mpiwg/web/jsp/TopicListPage.java Wed May 25 11:20:27 2016 +0200 +++ b/src/main/java/de/mpiwg/web/jsp/TopicListPage.java Mon Jul 18 17:35:32 2016 +0200 @@ -12,6 +12,7 @@ import de.mpiwg.gazetteer.bo.LGTopic; import de.mpiwg.gazetteer.utils.DataProvider; + import de.mpiwg.web.topicList.SortByDescription; import de.mpiwg.web.topicList.SortByLastModified; import de.mpiwg.web.topicList.SortByNameCh; diff -r 2486846e61d5 -r 824b808a7481 src/main/resources/config.properties --- a/src/main/resources/config.properties Wed May 25 11:20:27 2016 +0200 +++ b/src/main/resources/config.properties Mon Jul 18 17:35:32 2016 +0200 @@ -7,12 +7,12 @@ db_gazetter_username=root db_gazetter_password=root dvn_server=http://localhost:8082 -dvn_apitoken=9dd1f749-8c42-49ab-a2ba-fbb963c2ff90 +dvn_apitoken=ceaee8bb-483c-42c6-841a-f9ad9c39bdb4 dv_id=2 root_server=http://localhost:8080/LGServices toc_interface=http://localhost:1080/localgazetteers-dev/LGToc extraction_interface=http://localhost:1080/localgazetteers-dev/extraction-interface -localgazetteers_dvId=185 +localgazetteers_dvId=226 lgmap=http://localhost:1080/localgazetteers-dev/LGMap/map.php?mode=1 lgmap_datasets=/Applications/MAMP/htdocs/localgazetteers-dev/LGMap/datasets diff -r 2486846e61d5 -r 824b808a7481 src/main/webapp/componentes/template.jsp --- a/src/main/webapp/componentes/template.jsp Wed May 25 11:20:27 2016 +0200 +++ b/src/main/webapp/componentes/template.jsp Mon Jul 18 17:35:32 2016 +0200 @@ -77,8 +77,8 @@ Create File --> Sections + Full Text Search Books - Full Text Search diff -r 2486846e61d5 -r 824b808a7481 src/main/webapp/methods/addSectionToTopic.jsp --- a/src/main/webapp/methods/addSectionToTopic.jsp Wed May 25 11:20:27 2016 +0200 +++ b/src/main/webapp/methods/addSectionToTopic.jsp Mon Jul 18 17:35:32 2016 +0200 @@ -38,32 +38,43 @@ - <% for (LGTopic topic : sessionBean.getTopicListPage().getCompleteTopicList() ) {%> - - <%=topic.getId() %> - - <%=topic.getNameEn() %>(<%=topic.getNameCh() %>) - - <% if(request.getParameter("sectionId") != null) { - Long sectionId = Long.parseLong(request.getParameter("sectionId")); - %> - - " /> - - - - <% } else if (request.getParameter("addAllSections") != null) { %> - + + <% + Long userId = sessionBean.getUser().getId(); + + for (LGTopic topic : sessionBean.getTopicListPage().getCompleteTopicList() ) { + // should show only the topic that current user has access to (is the creator or in contributorList) + if (Long.compare(topic.getUserId(), userId) == 0 || topic.getContributorsList().contains(userId) ) { + + %> + + <%=topic.getId() %> + + <%=topic.getNameEn() %>(<%=topic.getNameCh() %>) - <% } %> - - - - <% } %> + <% if(request.getParameter("sectionId") != null) { + Long sectionId = Long.parseLong(request.getParameter("sectionId")); + %> + + " /> + + + + <% } else if (request.getParameter("addAllSections") != null) { %> + + + <% } %> + + + + <% + } + } + %> diff -r 2486846e61d5 -r 824b808a7481 src/main/webapp/pages/branchPage.jsp --- a/src/main/webapp/pages/branchPage.jsp Wed May 25 11:20:27 2016 +0200 +++ b/src/main/webapp/pages/branchPage.jsp Mon Jul 18 17:35:32 2016 +0200 @@ -128,18 +128,18 @@ - +
-
-
diff -r 2486846e61d5 -r 824b808a7481 src/main/webapp/pages/fullTextSearch.jsp --- a/src/main/webapp/pages/fullTextSearch.jsp Wed May 25 11:20:27 2016 +0200 +++ b/src/main/webapp/pages/fullTextSearch.jsp Mon Jul 18 17:35:32 2016 +0200 @@ -5,16 +5,17 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - + + - + - diff -r 2486846e61d5 -r 824b808a7481 src/main/webapp/resources/js/LGSearch.js --- a/src/main/webapp/resources/js/LGSearch.js Wed May 25 11:20:27 2016 +0200 +++ b/src/main/webapp/resources/js/LGSearch.js Mon Jul 18 17:35:32 2016 +0200 @@ -1,5 +1,8 @@ $(document).ready(function(){ + + $(".hiddenField").remove(); highlightKeywords(); + }) function highlightKeywords() // highlight keywords in content column, with class="content" @@ -24,4 +27,4 @@ }; }; -} \ No newline at end of file +}