Revision 60517
Added by Konstantina Galouni about 3 years ago
DivHelpContentService.java | ||
---|---|---|
90 | 90 |
return divHelpContentResponses; |
91 | 91 |
} |
92 | 92 |
|
93 |
|
|
94 |
public List<DivHelpContent> getDivHelpContentsBasic(String pid, String portalType, String pageId) { |
|
95 |
List<DivHelpContent> divHelpContents = null; |
|
96 |
|
|
97 |
Portal _portal = null; |
|
98 |
String portalId = null; |
|
99 |
if(pid != null) { |
|
100 |
_portal = portalService.getPortal(pid); |
|
101 |
portalService.checkPortalInfo(pid, portalType, _portal, pid, "pid"); |
|
102 |
if(_portal != null) { |
|
103 |
portalId = _portal.getId(); |
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
if(pid != null && pageId != null) { |
|
108 |
divHelpContents = divHelpContentDAO.findByPortalAndPage(portalId, pageId); |
|
109 |
} else if(pid != null) { |
|
110 |
divHelpContents = divHelpContentDAO.findByPortal(portalId); |
|
111 |
} else { |
|
112 |
divHelpContents = divHelpContentDAO.findAll(); |
|
113 |
} |
|
114 |
|
|
115 |
return divHelpContents; |
|
116 |
} |
|
117 |
|
|
93 | 118 |
public DivHelpContent getDivHelpContent(String id) { |
94 | 119 |
return divHelpContentDAO.findById(id); |
95 | 120 |
} |
Also available in: Unified diff
[Trunk | Admin Tools Library]:
1. PageHelpContentDAO.java & MongoDBPageHelpContentDAO.java: Added method "findByPortalAndPageOrderByPlacementAscOrderAsc()" to get page help contents for a specific portal and page.
2. PageHelpContentService.java: Added method "getPageHelpContentsBasic()".
3. DivHelpContentDAO.java & MongoDBDivHelpContentDAO.java: Added method "findByPortalAndPage()" to get div help contents for a specific portal and page.
4. DivHelpContentService.java: Added method "getDivHelpContentsBasic()".
5. AdminPortalRelationsController.java:
a. Added methods
"public List<PageHelpContent> getPageHelpContentsByPageId()" (/{portalType}/{pid}/{pageId}/pagehelpcontent),
"public Map<String, Integer> countPageHelpContentsForPages()" (/{portalType}/{pid}/pagehelpcontent/page/count),
"public List<DivHelpContent> getDivHelpContentsByPageId()" (/{portalType}/{pid}/{pageId}/divhelpcontent),
"public Map<String, Integer> countDivHelpContentsForPages()" (/{portalType}/{pid}/divhelpcontent/page/count)
b. Added @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)") in methods:
"public List<PageHelpContentResponse> getPageHelpContents()" and "public List<DivHelpContentResponse> getDivHelpContents()".
6. RolesUtils.java: [Bug fix] In method "getEmail()" call authorizationService.getEmail().