[Trunk | Admin Tools Library]: AdminPortalRelationsController.java:
a. Uncomment method "getDivHelpContent()" ({portalType}/{pid}/divhelpcontent/{id}) (used by portal). b. Update method "List<DivHelpContent> getDivHelpContentsByPageId()" to "List<DivHelpContentResponse> getDivHelpContentsByPageId()" to return full objects for DivHelpContents.
This commit is contained in:
parent
93efd1f7d3
commit
9c57010ca3
|
@ -78,25 +78,36 @@ public class AdminPortalRelationsController {
|
|||
return divHelpContentService.getDivHelpContents(pid, null, null, null);
|
||||
}
|
||||
|
||||
// @RequestMapping(value = "/{pid}/divhelpcontent/{id}", method = RequestMethod.GET)
|
||||
// public DivHelpContent getDivHelpContent(@PathVariable PortalType portalType,
|
||||
// @PathVariable(value = "pid") String pid,
|
||||
// @PathVariable(value = "id") String id) {
|
||||
// DivHelpContent divHelpContent = divHelpContentService.getDivHelpContent(id);
|
||||
// if(divHelpContent == null) {
|
||||
// throw new ContentNotFoundException("DivHelpContent with id: "+id+" not found");
|
||||
// }
|
||||
//
|
||||
// Portal portal = portalService.getPortalById(divHelpContent.getPortal());
|
||||
// portalService.checkPortalInfo(pid, portalType.name(), portal, divHelpContent.getPortal(), "id");
|
||||
// return divHelpContent;
|
||||
@RequestMapping(value = "/{pid}/divhelpcontent/{id}", method = RequestMethod.GET)
|
||||
public DivHelpContent getDivHelpContent(@PathVariable PortalType portalType,
|
||||
@PathVariable(value = "pid") String pid,
|
||||
@PathVariable(value = "id") String id) {
|
||||
DivHelpContent divHelpContent = divHelpContentService.getDivHelpContent(id);
|
||||
if(divHelpContent == null) {
|
||||
throw new ContentNotFoundException("DivHelpContent with id: "+id+" not found");
|
||||
}
|
||||
|
||||
Portal portal = portalService.getPortalById(divHelpContent.getPortal());
|
||||
portalService.checkPortalInfo(pid, portalType.name(), portal, divHelpContent.getPortal(), "id");
|
||||
return divHelpContent;
|
||||
}
|
||||
|
||||
// @RequestMapping(value = "/{pid}/{pageId}/divhelpcontent", method = RequestMethod.GET)
|
||||
// public List<DivHelpContent> getDivHelpContentsByPageId(@PathVariable PortalType portalType,
|
||||
// @PathVariable(value = "pid") String pid,
|
||||
// @PathVariable(value = "pageId") String pageId) {
|
||||
// return divHelpContentService.getDivHelpContentsBasic(pid, portalType.name(), pageId);
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "/{pid}/{pageId}/divhelpcontent", method = RequestMethod.GET)
|
||||
public List<DivHelpContent> getDivHelpContentsByPageId(@PathVariable PortalType portalType,
|
||||
@PathVariable(value = "pid") String pid,
|
||||
@PathVariable(value = "pageId") String pageId) {
|
||||
return divHelpContentService.getDivHelpContentsBasic(pid, portalType.name(), pageId);
|
||||
public List<DivHelpContentResponse> getDivHelpContentsByPageId(@PathVariable PortalType portalType,
|
||||
@PathVariable(value = "pid") String pid,
|
||||
@PathVariable(value = "pageId") String pageId) {
|
||||
Page page = pageService.getPage(pageId);
|
||||
if(page == null) {
|
||||
throw new ContentNotFoundException("Page with id: "+pageId+" not found");
|
||||
}
|
||||
return divHelpContentService.getDivHelpContents(pid, page.getRoute(), null, null);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{pid}/divhelpcontent/page/count", method = RequestMethod.GET)
|
||||
|
|
Loading…
Reference in New Issue