Mercurial > hg > LGServices
diff src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java @ 37:ed215307f426
new: show all existing branches in the searching result page of search for sections
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 20 Nov 2015 15:18:28 +0100 |
parents | 2e1662afc81c |
children | 8b7a204fa929 |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 11:53:29 2015 +0100 +++ b/src/main/java/de/mpiwg/gazetteer/utils/DataProvider.java Fri Nov 20 15:18:28 2015 +0100 @@ -44,6 +44,18 @@ public List<LGBranch> getBranches(Long userId){ List<LGBranch> list = new ArrayList<LGBranch>(); + for(LGBranch branch : getBranchMap().values()){ + list.add(branch); + } + 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<LGBranch> getBranches(Long userId){ + List<LGBranch> list = new ArrayList<LGBranch>(); for(LGBranch branch : getBranchMap().values()){ if(branch.hasContributor(userId)){ list.add(branch); @@ -51,6 +63,7 @@ } return list; } + */ public LGBranch getBranch(Long branchId){ return getBranchMap().getValuesByOwnKey(branchId);