Mercurial > hg > LGServices
comparison 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 |
comparison
equal
deleted
inserted
replaced
36:eab47936591a | 37:ed215307f426 |
---|---|
40 Collections.sort(list); | 40 Collections.sort(list); |
41 Collections.reverse(list); | 41 Collections.reverse(list); |
42 return list; | 42 return list; |
43 } | 43 } |
44 | 44 |
45 public List<LGBranch> getBranches(Long userId){ | |
46 List<LGBranch> list = new ArrayList<LGBranch>(); | |
47 for(LGBranch branch : getBranchMap().values()){ | |
48 list.add(branch); | |
49 } | |
50 return list; | |
51 } | |
52 | |
53 /* | |
54 * old version: only showing the branches that the current user has contributor role. | |
55 * But we modify it to get all branches in the section, and leave the role checking to jsp at front-end. | |
56 * | |
45 public List<LGBranch> getBranches(Long userId){ | 57 public List<LGBranch> getBranches(Long userId){ |
46 List<LGBranch> list = new ArrayList<LGBranch>(); | 58 List<LGBranch> list = new ArrayList<LGBranch>(); |
47 for(LGBranch branch : getBranchMap().values()){ | 59 for(LGBranch branch : getBranchMap().values()){ |
48 if(branch.hasContributor(userId)){ | 60 if(branch.hasContributor(userId)){ |
49 list.add(branch); | 61 list.add(branch); |
50 } | 62 } |
51 } | 63 } |
52 return list; | 64 return list; |
53 } | 65 } |
66 */ | |
54 | 67 |
55 public LGBranch getBranch(Long branchId){ | 68 public LGBranch getBranch(Long branchId){ |
56 return getBranchMap().getValuesByOwnKey(branchId); | 69 return getBranchMap().getValuesByOwnKey(branchId); |
57 } | 70 } |
58 | 71 |