# HG changeset patch # User Zoe Hong # Date 1448030224 -3600 # Node ID 8b7a204fa92939871b0d01679ed0cb079bf88fe6 # Parent ed215307f426f5982f0cb0f4baec2d652939c7a2 new: show all existing branches in the searching result page of search for sections diff -r ed215307f426 -r 8b7a204fa929 src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java --- a/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 15:18:28 2015 +0100 +++ b/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 15:37:04 2015 +0100 @@ -42,7 +42,7 @@ return list; } - public List getBranches(Long userId){ + public List getAllExistingBranches(){ List list = new ArrayList(); for(LGBranch branch : getBranchMap().values()){ list.add(branch); @@ -50,10 +50,6 @@ return list; } - /* - * old version: only showing the branches that the current user has contributor role. - * But we modify it to get all branches in the section, and leave the role checking to jsp at front-end. - * public List getBranches(Long userId){ List list = new ArrayList(); for(LGBranch branch : getBranchMap().values()){ @@ -63,7 +59,7 @@ } return list; } - */ + public LGBranch getBranch(Long branchId){ return getBranchMap().getValuesByOwnKey(branchId); diff -r ed215307f426 -r 8b7a204fa929 src/main/java/de/mpiwg/web/jsp/SearchPage.java --- a/src/main/java/de/mpiwg/web/jsp/SearchPage.java Fri Nov 20 15:18:28 2015 +0100 +++ b/src/main/java/de/mpiwg/web/jsp/SearchPage.java Fri Nov 20 15:37:04 2015 +0100 @@ -159,7 +159,9 @@ private void loadBranches(){ this.branchesMap = new HashMap>(); - List list = DataProvider.getInstance().getBranches(getSessionBean().getUser().getId()); + // List list = DataProvider.getInstance().getBranches(getSessionBean().getUser().getId()); + List list = DataProvider.getInstance().getAllExistingBranches(); + for(LGBranch branch : list){ branch.loadTransientData(); if(this.branchesMap.get(branch.getSectionId()) == null){