diff --git a/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/image_select.jsp b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/image_select.jsp new file mode 100644 index 000000000..70da67db5 --- /dev/null +++ b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/image_select.jsp @@ -0,0 +1,29 @@ + + + + + + + + + + + private ImageSelectPage imageSelectPage = new ImageSelectPage(); + + + + // Restore the wrapped request + HttpServletRequest myRequest = DispatcherHelper.getRequest(); + DispatcherHelper.cacheDisable(response); + + ContentSection section = ContentSectionServlet.getContentSection(myRequest); + + if (! ContentSectionServlet.checkAdminAccess(myRequest, section)) { + throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); + } + + RequestContext context = DispatcherHelper.getRequestContext(myRequest); + imageSelectPage.init(); + imageSelectPage.dispatch(myRequest, response, context); + + diff --git a/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/index.jsp b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/index.jsp new file mode 100644 index 000000000..c12d4ba89 --- /dev/null +++ b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/index.jsp @@ -0,0 +1,37 @@ + + + + + + + + + + + + + private ContentSectionPage sectionPage = new ContentSectionPage(); + // private HttpServletRequest myRequest = DispatcherHelper.getRequest(); + + + + // Restore the wrapped request + HttpServletRequest myRequest = DispatcherHelper.getRequest(); + DispatcherHelper.cacheDisable(response); + + ContentSection section = ContentSectionServlet.getContentSection(myRequest); + + if (Web.getWebContext().getUser() == null) { + throw new LoginSignal(myRequest); + } else if (! ContentSectionServlet.checkAdminAccess(myRequest, section)) { + throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); + } + + + RequestContext context = DispatcherHelper.getRequestContext(myRequest); + sectionPage.init(); + sectionPage.dispatch(myRequest, response, context); + + + + diff --git a/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/item.jsp b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/item.jsp new file mode 100644 index 000000000..e2ad763ec --- /dev/null +++ b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/item.jsp @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + private static final Logger s_log = + Logger.getLogger("content-section.www.admin.item.jsp"); + private ContentItemPage itemPage = null; + private Date timestamp = new Date(0); + + + + s_log.debug("entered item.jsp's service method"); + // Restore the wrapped request + HttpServletRequest myRequest = DispatcherHelper.getRequest(); + DispatcherHelper.cacheDisable(response); + + // ?? just doubles the initial line + // request = DispatcherHelper.getRequest(); + + ContentSection section = ContentSectionServlet.getContentSection(myRequest); + + + if (Web.getWebContext().getUser() == null) { + throw new LoginSignal(myRequest); + } else if (! ContentSectionServlet.checkAdminAccess(myRequest, section)) { + throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); + } + + // page needs to be refreshed when content types or authoring kits + // in the section change + synchronized(this) { + if (Utilities.getLastSectionRefresh(section).after(timestamp)) { + s_log.debug("refreshing itemPage"); + s_log.debug("Creating new ContentItemPage instance..."); + itemPage = new ContentItemPage(); + s_log.debug("Calling init on new instance..."); + itemPage.init(); + s_log.debug("Creating time stamp..."); + timestamp = new Date(); + } + } + + s_log.debug("Starting dispatch process..."); + RequestContext context = DispatcherHelper.getRequestContext(myRequest); + if(itemPage == null) { + s_log.warn("WARNING: itemPage is NULL"); + } + else { + s_log.info("ALL OK: itemPage is not null"); + } + itemPage.dispatch(myRequest, response, context); + s_log.debug("exited item.jsp's service method"); + + + + + diff --git a/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/search.jsp b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/search.jsp new file mode 100644 index 000000000..c4c341b5d --- /dev/null +++ b/ccm-cms/src/main/resources/web/templates/ccm-cms/content-section/admin/search.jsp @@ -0,0 +1,32 @@ + + + + + + + + + + + private ItemSearchPage sectionPage = new ItemSearchPage(); + + + + // Restore the wrapped request + HttpServletRequest myRequest = DispatcherHelper.getRequest(); + DispatcherHelper.cacheDisable(response); + + ContentSection section = ContentSectionServlet.getContentSection(myRequest); + + if (! ContentSectionServlet.checkAdminAccess(myRequest, section)) { + throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); + } + + + RequestContext context = DispatcherHelper.getRequestContext(myRequest); + sectionPage.init(); + sectionPage.dispatch(myRequest, response, context); + + + +