From 4390a92891b8c8152291104b728659307f70b407 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 9 Nov 2016 16:39:22 +0000 Subject: [PATCH] CCM NG/ccm-cms: ContentSectionPage git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4434 8810af33-2d31-482b-a856-94f89814c4df --- .../java/com/arsdigita/cms/PageLocations.java | 32 +++ .../cms/ui/ContentSectionContextBar.java | 160 ++++++++++++++ .../cms/ui/ContentSectionContextBar.java.off | 156 -------------- ...nPage.java.off => ContentSectionPage.java} | 202 ++++++++++-------- 4 files changed, 299 insertions(+), 251 deletions(-) create mode 100755 ccm-cms/src/main/java/com/arsdigita/cms/PageLocations.java create mode 100755 ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java delete mode 100755 ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off rename ccm-cms/src/main/java/com/arsdigita/cms/ui/{ContentSectionPage.java.off => ContentSectionPage.java} (75%) diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/PageLocations.java b/ccm-cms/src/main/java/com/arsdigita/cms/PageLocations.java new file mode 100755 index 000000000..656129039 --- /dev/null +++ b/ccm-cms/src/main/java/com/arsdigita/cms/PageLocations.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms; + +/** + * Specifies the standard locations of the pages that comprise the + * content section user interface. + * + * @author Karl Goldstein (karlg at arsdigita dot com) + * + * @version $Id: PageLocations.java 2090 2010-04-17 08:04:14Z pboy $ + **/ +public interface PageLocations { + public String SECTION_PAGE = "admin/index.jsp"; + public String ITEM_PAGE = "admin/item.jsp"; +} diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java new file mode 100755 index 000000000..005ad06cc --- /dev/null +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.ui; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.cms.CMS; +import com.arsdigita.cms.PageLocations; + +import org.librecms.contentsection.ContentItem; +import org.librecms.contentsection.ContentSection; +import org.librecms.contentsection.Folder; + +import com.arsdigita.web.ParameterMap; +import com.arsdigita.web.URL; + +import org.apache.logging.log4j.LogManager; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Stack; + +import org.apache.logging.log4j.Logger; +import org.libreccm.cdi.utils.CdiUtil; +import org.libreccm.core.CcmObject; +import org.librecms.contentsection.ContentSectionManager; + +import java.util.Optional; + +/** + * The context bar of the content section UI. + * + * @author Jens Pelzetter + * @author Justin Ross + */ +public class ContentSectionContextBar extends WorkspaceContextBar { + + private static final Logger LOGGER = LogManager.getLogger( + ContentSectionContextBar.class); + + @Override + protected List entries(final PageState state) { + + /* Include breadcrumb entries already set by content-center (i.e. the + * URL of the content center itself */ + final List entries = super.entries(state); + + final ContentSection section = CMS.getContext().getContentSection(); + final Stack folderEntryStack = new Stack(); + String currentFolderLabel = null; + ParameterMap params = new ParameterMap(); + boolean isTemplate = false; + BigDecimal templateID = null; + + if (CMS.getContext().hasContentItem()) { + final ContentItem item = CMS.getContext().getContentItem(); + if (item == null) { + LOGGER.warn("item is null"); + } else if (item.getContentType() == null) { + LOGGER.warn( + "item.getContentType() returns null. item.class.getName(): " + + item.getClass().getName()); + } + + //ToDo NG - Not sure what happens here... +// final Optional parent = item.getParent(); +// +// while (!isTemplate +// && parent.isPresent() +// && parent.get() instanceof ContentItem) { +// if (currentFolderLabel != null) { +// final URL folderURL = URL.there +// (state.getRequest(), +// section.getPath() + "/" + PageLocations.SECTION_PAGE, +// params); +// folderEntryStack.push(new Entry(currentFolderLabel, folderURL)); +// currentFolderLabel = null; +// params = new ParameterMap(); +// } +// final ContentItem pitem = (ContentItem) parent; +// +// if (pitem instanceof Folder) { +// final Folder folder = (Folder) pitem; +// parent = folder.getParent(); +// +// currentFolderLabel = folder.getLabel(); +// if (parent != null || folder.equals(section.getRootFolder())) { +// params.setParameter +// (ContentSectionPage.SET_FOLDER, folder.getID()); +// } +// } else if (pitem instanceof ContentBundle) { +// final ACSObject ppitem = pitem.getParent(); +// +// if (ppitem != null && ppitem instanceof Folder) { +// final Folder folder = (Folder) ppitem; +// +// parent = folder.getParent(); +// currentFolderLabel = folder.getLabel(); +// if (parent != null || folder.equals(section +// .getRootFolder())) { +// params.setParameter +// (ContentSectionPage.SET_FOLDER, folder.getID()); +// } +// } else { +// parent = null; +// } +// } else { +// parent = null; +// } +// } + } + + if (isTemplate) { + params.setParameter(ContentSectionPage.SET_TAB, + new BigDecimal( + ContentSectionPage.CONTENTTYPES_TAB)); + params.setParameter(ContentSectionPage.SET_TEMPLATE, templateID); + } + + // add section-level entry. if this is for an item page, the URL + // will be for the root folder. + final URL url = URL.there( + state.getRequest(), + String.format("%s/" + PageLocations.SECTION_PAGE, + section.getPrimaryUrl()), + params); + + final String sectionTitle = lz("cms.ui.content_section"); + final String title = sectionTitle + ": " + section.getLabel(); + + entries.add(new Entry(title, url)); + + // add any folders to the path now + while (!folderEntryStack.empty()) { + entries.add(folderEntryStack.pop()); + } + + return entries; + } + + private static String lz(final String key) { + return (String) ContentSectionPage.globalize(key).localize(); + } + +} diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off deleted file mode 100755 index 252c6df83..000000000 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentBundle; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.Folder; -import com.arsdigita.cms.PageLocations; -import com.arsdigita.cms.Template; -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.web.ParameterMap; -import com.arsdigita.web.URL; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Stack; - -import org.apache.log4j.Logger; - -/** - * The context bar of the content section UI. - * - * @author Justin Ross <jross@redhat.com> - * @version $Id: ContentSectionContextBar.java 287 2005-02-22 00:29:02Z sskracic $ - */ -// class ContentSectionContextBar extends WorkspaceContextBar { -public class ContentSectionContextBar extends WorkspaceContextBar { - - private static final Logger s_log = Logger.getLogger - (ContentSectionContextBar.class); - - @Override - protected List entries(final PageState state) { - - /* Include breadcrumb entries already set by content-center (i.e. the - * URL of the content center itself */ - final List entries = super.entries(state); - - final ContentSection section = CMS.getContext().getContentSection(); - final Stack folderEntryStack = new Stack(); - String currentFolderLabel = null; - ParameterMap params = new ParameterMap(); - boolean isTemplate = false; - BigDecimal templateID = null; - - if (CMS.getContext().hasContentItem()) { - final ContentItem item = CMS.getContext().getContentItem(); - if (item == null) { - s_log.warn("item is null"); - } else if(item.getContentType() == null) { - s_log.warn("item.getContentType() returns null. item.class.getName(): " - + item.getClass().getName()); - } - isTemplate = - item.getContentType().equals(ContentType - .findByAssociatedObjectType(Template.BASE_DATA_OBJECT_TYPE)); - if (isTemplate) { - templateID = item.getID(); - } - ACSObject parent = item.getParent(); - - while (!isTemplate && parent != null && parent instanceof ContentItem) { - if (currentFolderLabel != null) { - final URL folderURL = URL.there - (state.getRequest(), - section.getPath() + "/" + PageLocations.SECTION_PAGE, - params); - folderEntryStack.push(new Entry(currentFolderLabel, folderURL)); - currentFolderLabel = null; - params = new ParameterMap(); - } - final ContentItem pitem = (ContentItem) parent; - - if (pitem instanceof Folder) { - final Folder folder = (Folder) pitem; - parent = folder.getParent(); - - currentFolderLabel = folder.getLabel(); - if (parent != null || folder.equals(section.getRootFolder())) { - params.setParameter - (ContentSectionPage.SET_FOLDER, folder.getID()); - } - } else if (pitem instanceof ContentBundle) { - final ACSObject ppitem = pitem.getParent(); - - if (ppitem != null && ppitem instanceof Folder) { - final Folder folder = (Folder) ppitem; - - parent = folder.getParent(); - currentFolderLabel = folder.getLabel(); - if (parent != null || folder.equals(section - .getRootFolder())) { - params.setParameter - (ContentSectionPage.SET_FOLDER, folder.getID()); - } - } else { - parent = null; - } - } else { - parent = null; - } - } - - } - - if (isTemplate) { - params.setParameter - ( ContentSectionPage.SET_TAB, - new BigDecimal(ContentSectionPage.CONTENTTYPES_TAB) ); - params.setParameter(ContentSectionPage.SET_TEMPLATE, templateID); - } - // add section-level entry. if this is for an item page, the URL - // will be for the root folder. - final URL url = URL.there - (state.getRequest(), - section.getPath() + "/" + PageLocations.SECTION_PAGE, - params); - - - final String sectionTitle = lz("cms.ui.content_section"); - final String title = sectionTitle + ": " + section.getName(); - - entries.add(new Entry(title, url)); - - // add any folders to the path now - while (!folderEntryStack.empty()) { - entries.add(folderEntryStack.pop()); - } - - return entries; - } - - private static String lz(final String key) { - return (String) ContentSectionPage.globalize(key).localize(); - } -} diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java similarity index 75% rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java.off rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java index 6b708faf5..991b7755d 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java.off +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java @@ -29,13 +29,14 @@ import com.arsdigita.bebop.event.ActionListener; import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.cms.CMS; +import com.arsdigita.cms.PageLocations; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentSection; import com.arsdigita.cms.dispatcher.CMSPage; -import com.arsdigita.cms.ui.category.CategoryAdminPane; -import com.arsdigita.cms.ui.cse.ContentSoonExpiredPane; +//ToDo NG import com.arsdigita.cms.ui.category.CategoryAdminPane; +//ToDo NG import com.arsdigita.cms.ui.cse.ContentSoonExpiredPane; import com.arsdigita.cms.ui.folder.FolderAdminPane; import com.arsdigita.cms.ui.lifecycle.LifecycleAdminPane; import com.arsdigita.cms.ui.role.RoleAdminPane; @@ -46,15 +47,20 @@ import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.util.Assert; import com.arsdigita.web.Web; +import org.apache.logging.log4j.LogManager; + import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.Logger; import org.arsdigita.cms.CMSConfig; import org.libreccm.cdi.utils.CdiUtil; import org.libreccm.security.PermissionChecker; import org.librecms.CmsConstants; +import org.librecms.contentsection.ContentItemManager; +import org.librecms.contentsection.ContentItemRepository; import org.librecms.contentsection.ContentItemVersion; import org.librecms.contentsection.ContentSectionConfig; +import org.librecms.contentsection.privileges.AdminPrivileges; /** * Contains the entire admin UI for a content section. @@ -63,18 +69,18 @@ import org.librecms.contentsection.ContentSectionConfig; * replaced by the newer servlet based model. @see * c.ad.cms.ui.contentsection.MainPage (currently not active). * + * @author Jens Pelzetter * @author Jack Chung * @author Michael Pih - * @author Xixi D'Moon <xdmoon@redhat.com> - * @author Justin Ross <jross@redhat.com> - * @version $Id: ContentSectionPage.java 2224 2011-08-01 07:45:23Z pboy $ + * @author Xixi D'Moon + * @author Justin Ross + */ public class ContentSectionPage extends CMSPage implements ActionListener { - private static final Logger s_log = Logger.getLogger( + private static final Logger LOGGER = LogManager.getLogger( ContentSectionPage.class); - public static final String RESOURCE_BUNDLE - = "com.arsdigita.cms.CMSResources"; + /** * The URL parameter that can be passed in in order to set the current * folder. This is used in getting back to the correct level of folder @@ -123,17 +129,17 @@ public class ContentSectionPage extends CMSPage implements ActionListener { public static final int USER_ADMIN_TAB = 7; private TabbedPane m_tabbedPane; private FolderAdminPane m_folderPane; - private BrowsePane m_browsePane; - private ItemSearch m_searchPane; - private ImagesPane m_imagesPane; +//ToDo NG private BrowsePane m_browsePane; +//ToDo NG private ItemSearch m_searchPane; +//ToDo NG private ImagesPane m_imagesPane; private RoleAdminPane m_rolePane; private WorkflowAdminPane m_workflowPane; private LifecycleAdminPane m_lifecyclePane; - private CategoryAdminPane m_categoryPane; +//ToDo NG private CategoryAdminPane m_categoryPane; private ContentTypeAdminPane m_typePane; //private LayoutPanel m_userAdminPane; private LayoutPanel m_csePane; - private ReportPane m_reportPane; +//ToDo NG private ReportPane m_reportPane; /** * Creates the content section index page containing - a Navigaton bar for @@ -150,19 +156,19 @@ public class ContentSectionPage extends CMSPage implements ActionListener { // Initialize the individual panes m_folderPane = getFolderAdminPane(); - m_browsePane = getBrowsePane(); - m_searchPane = getSearchPane(); - m_imagesPane = getImagesPane(); +//ToDo NG m_browsePane = getBrowsePane(); +//ToDo NG m_searchPane = getSearchPane(); +//ToDo NG m_imagesPane = getImagesPane(); m_rolePane = getRoleAdminPane(); m_workflowPane = getWorkflowAdminPane(); m_lifecyclePane = getLifecycleAdminPane(); - m_categoryPane = getCategoryAdminPane(); +//ToDo NG m_categoryPane = getCategoryAdminPane(); m_typePane = getContentTypeAdminPane(); // userAdminPane removed, used to contain just one item (reset user // folder) which moved to the FolderAdminPane //m_userAdminPane = getUserAdminPane(); m_csePane = getCSEPane(); - m_reportPane = getReportPane(); +//ToDo NG m_reportPane = getReportPane(); // The panes m_tabbedPane = createTabbedPane(); @@ -186,32 +192,32 @@ public class ContentSectionPage extends CMSPage implements ActionListener { final PermissionChecker permissionChecker = CdiUtil .createCdiUtil().findBean(PermissionChecker.class); - //m_tabbedPane.setTabVisible(state, m_userAdminPane, sm.canAccess(user, SecurityConstants.STAFF_ADMIN)); if (CMSConfig.getConfig().isHideAdminTabs()) { m_tabbedPane.setTabVisible( state, m_workflowPane, permissionChecker.isPermitted( - CmsConstants.PRIVILEGE_ADMINISTER_WORKFLOW)); - m_tabbedPane.setTabVisible( - state, m_categoryPane, - permissionChecker.isPermitted( - CmsConstants.PRIVILEGE_ADMINISTER_CATEGORIES)); + AdminPrivileges.ADMINISTER_WORKFLOW)); +//ToDo NG +// m_tabbedPane.setTabVisible( +// state, m_categoryPane, +// permissionChecker.isPermitted( +// AdminPrivileges.ADMINISTER_CATEGORIES)); m_tabbedPane.setTabVisible( state, m_lifecyclePane, permissionChecker.isPermitted( - CmsConstants.PRIVILEGE_ADMINISTER_LIFECYLES)); + AdminPrivileges.ADMINISTER_LIFECYLES)); m_tabbedPane.setTabVisible( state, m_typePane, permissionChecker.isPermitted( - CmsConstants.PRIVILEGE_ADMINISTER_CONTENT_TYPES)); + AdminPrivileges.ADMINISTER_CONTENT_TYPES)); m_tabbedPane.setTabVisible( state, m_rolePane, permissionChecker.isPermitted( - CmsConstants.PRIVILEGE_ADMINISTER_ROLES)); + AdminPrivileges.ADMINISTER_ROLES)); // csePane: should check permission m_tabbedPane.setTabVisible(state, m_csePane, true); // TODO Check for reportPane as well @@ -239,34 +245,37 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * * @return */ - protected BrowsePane getBrowsePane() { - if (m_browsePane == null) { - m_browsePane = new BrowsePane(); - } - return m_browsePane; - } +// ToDo NG +// protected BrowsePane getBrowsePane() { +// if (m_browsePane == null) { +// m_browsePane = new BrowsePane(); +// } +// return m_browsePane; +// } /** * Creates, and then caches, the search pane. Overriding this method to * return null will prevent this tab from appearing. * @return */ - protected ItemSearch getSearchPane() { - if (m_searchPane == null) { - m_searchPane - = new ItemSearch( - ContentItemVersion.DRAFT.toString(), - CMSConfig.getConfig().isLimitItemSearchToContentSection()); - } - return m_searchPane; - } +// ToDo NG +// protected ItemSearch getSearchPane() { +// if (m_searchPane == null) { +// m_searchPane +// = new ItemSearch( +// ContentItemVersion.DRAFT.toString(), +// CMSConfig.getConfig().isLimitItemSearchToContentSection()); +// } +// return m_searchPane; +// } - protected ImagesPane getImagesPane() { - if (m_imagesPane == null) { - m_imagesPane = new ImagesPane(); - } - return m_imagesPane; - } +// ToDo NG +// protected ImagesPane getImagesPane() { +// if (m_imagesPane == null) { +// m_imagesPane = new ImagesPane(); +// } +// return m_imagesPane; +// } protected RoleAdminPane getRoleAdminPane() { if (m_rolePane == null) { @@ -301,17 +310,20 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * Creates, and then caches, the category administration pane. Overriding * this method to return null will prevent this tab from appearing. */ - protected CategoryAdminPane getCategoryAdminPane() { - if (m_categoryPane == null) { - m_categoryPane = new CategoryAdminPane(); - } - return m_categoryPane; - } +//ToDo NG +// protected CategoryAdminPane getCategoryAdminPane() { +// if (m_categoryPane == null) { +// m_categoryPane = new CategoryAdminPane(); +// } +// return m_categoryPane; +// } /** * Creates, and then caches, the content type administration pane. * Overriding this method to return null will prevent this tab from * appearing. + * + * @return */ protected ContentTypeAdminPane getContentTypeAdminPane() { if (m_typePane == null) { @@ -332,17 +344,18 @@ public class ContentSectionPage extends CMSPage implements ActionListener { if (m_csePane == null) { m_csePane = new LayoutPanel(); m_csePane.setLeft(new SimpleComponent()); - m_csePane.setBody(new ContentSoonExpiredPane()); +//ToDo NG m_csePane.setBody(new ContentSoonExpiredPane()); } return m_csePane; } - protected ReportPane getReportPane() { - if (m_reportPane == null) { - m_reportPane = new ReportPane(); - } - return m_reportPane; - } +// ToDo NG +// protected ReportPane getReportPane() { +// if (m_reportPane == null) { +// m_reportPane = new ReportPane(); +// } +// return m_reportPane; +// } /** * Adds the specified component, with the specified tab name, to the tabbed @@ -352,7 +365,9 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * @param tabName The name of the tab if it's added * @param comp The component to add to the pane */ - protected void addToPane(TabbedPane pane, String tabName, Component comp) { + protected void addToPane(final TabbedPane pane, + final String tabName, + final Component comp) { if (comp != null) { pane.addTab(new Label(tabName), comp); } @@ -384,21 +399,17 @@ public class ContentSectionPage extends CMSPage implements ActionListener { final TabbedPane pane = new TabbedPane(); //tab(pane, "cms.ui.folders", getFolderAdminPane()); - tab(pane, "cms.ui.browse", getBrowsePane()); - tab(pane, "cms.ui.search", getSearchPane()); - tab(pane, "cms.ui.images", getImagesPane()); +// ToDo NG tab(pane, "cms.ui.browse", getBrowsePane()); +// ToDo NG tab(pane, "cms.ui.search", getSearchPane()); +// ToDo NG tab(pane, "cms.ui.images", getImagesPane()); tab(pane, "cms.ui.roles", getRoleAdminPane()); tab(pane, "cms.ui.workflows", getWorkflowAdminPane()); tab(pane, "cms.ui.lifecycles", getLifecycleAdminPane()); - tab(pane, "cms.ui.categories", getCategoryAdminPane()); +// ToDo NG tab(pane, "cms.ui.categories", getCategoryAdminPane()); tab(pane, "cms.ui.content_types", getContentTypeAdminPane()); - // user admin tab removed from tab bar and the only one widget there - // (reset home folder) moved to folder browser - // tab(pane, "cms.ui.user_admin", getUserAdminPane()); tab(pane, "cms.ui.cse", getCSEPane()); - //if (DbHelper.getDatabase() == DbHelper.DB_ORACLE) { - tab(pane, "cms.ui.reports", getReportPane()); - //} +// ToDo NG tab(pane, "cms.ui.reports", getReportPane()); + return pane; } @@ -411,7 +422,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * @return The current content section */ @Override - public ContentSection getContentSection(HttpServletRequest request) { + public ContentSection getContentSection(final HttpServletRequest request) { // Resets all content sections associations. ContentSection section = super.getContentSection(request); Assert.exists(section); @@ -425,27 +436,28 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * @param event The event fired by selecting a tab */ @Override - public void actionPerformed(ActionEvent event) { + public void actionPerformed(final ActionEvent event) { final PageState state = event.getPageState(); final Component pane = m_tabbedPane.getCurrentPane(state); - if (pane == m_searchPane) { - m_searchPane.reset(state); - } else if (pane == m_imagesPane) { - m_imagesPane.reset(state); - } else if (pane == m_folderPane) { +//ToDo NG if (pane == m_searchPane) { +// m_searchPane.reset(state); +// } else if (pane == m_imagesPane) { +// m_imagesPane.reset(state); +// } else + if (pane == m_folderPane) { m_folderPane.reset(state); - } else if (pane == m_browsePane) { - m_browsePane.reset(state); +//ToDo NG } else if (pane == m_browsePane) { +// m_browsePane.reset(state); } else if (pane == m_rolePane) { m_rolePane.reset(state); } else if (pane == m_workflowPane) { m_workflowPane.reset(state); } else if (pane == m_lifecyclePane) { m_lifecyclePane.reset(state); - } else if (pane == m_categoryPane) { - m_categoryPane.reset(state); +//ToDo NG } else if (pane == m_categoryPane) { +// m_categoryPane.reset(state); } else if (pane == m_typePane) { m_typePane.reset(state); // } else if (pane == m_userAdminPane) { @@ -463,18 +475,18 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * * @return */ - public static String getSectionURL(ContentItem item, int tab) { + public static String getSectionURL(final ContentItem item, final int tab) { // Get the content section associated with the content item. - ContentSection section = ContentSection.getContentSection(item); - - String url = section.getURL() + PageLocations.SECTION_PAGE + final ContentSection section = item.getContentType().getContentSection(); + + final String url = section.getPrimaryUrl() + PageLocations.SECTION_PAGE + "?" + SET_TAB + "=" + tab; return url; } private static GlobalizedMessage gz(final String key) { - return new GlobalizedMessage(key, RESOURCE_BUNDLE); + return new GlobalizedMessage(key, CmsConstants.CMS_BUNDLE); } /** @@ -487,7 +499,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener { * @pre key != null */ public static GlobalizedMessage globalize(final String key) { - return new GlobalizedMessage(key, RESOURCE_BUNDLE); + return new GlobalizedMessage(key, CmsConstants.CMS_BUNDLE); } /** @@ -499,7 +511,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener { */ public static GlobalizedMessage globalize(final String key, final Object[] args) { - return new GlobalizedMessage(key, RESOURCE_BUNDLE, args); + return new GlobalizedMessage(key, CmsConstants.CMS_BUNDLE, args); } /** @@ -510,13 +522,13 @@ public class ContentSectionPage extends CMSPage implements ActionListener { /** * - * @param e + * @param event */ @Override - public void prepare(PrintEvent e) { - final Label l = (Label) e.getTarget(); + public void prepare(final PrintEvent event) { + final Label l = (Label) event.getTarget(); - l.setLabel(CMS.getContext().getContentSection().getName()); + l.setLabel(CMS.getContext().getContentSection().getLabel()); } }