-
- |
-
-
- |
-
|
-
-
- |
-
-
- |
-
-
-
- |
-
-
-
-
-
- |
-
|
- |
-
|---|
| - |
File |
- Description |
- - |
|
- |
-
- |
- Remove | -
+
+ |
+
+
+ |
+
|
+
+
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
|
+ |
+
|---|
| + |
File |
+ Description |
+ + |
|
+ |
+
+ |
+ Remove | +
Security class used for checking and granting privileges in - * CMS.
+ *Security class used for checking and granting privileges in CMS.
* * @author Michael Pih * @version $Id: SecurityManager.java 2161 2011-02-02 00:16:13Z pboy $ diff --git a/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java b/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java new file mode 100644 index 000000000..34e720289 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2012 Peter Boy 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; + +import com.arsdigita.cms.dispatcher.SimpleCache; +import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.kernel.security.UserContext; +import com.arsdigita.kernel.security.Util; +import com.arsdigita.ui.login.LoginHelper; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; + +import com.arsdigita.web.LoginSignal; +import com.arsdigita.web.Web; +import java.io.IOException; + +import java.util.ArrayList; +import java.util.HashMap; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * CMS Workspace (content-center) application servlet serves all request made + * within the Content Center application. + * + * @author Peter BoyThis class provides many utility functions for the Content Management * System.
+ * Specifically used by various JSP templates. * * @author Michael Pih (pihman@arsdigita.com) * @version $Id: Utilities.java 2140 2011-01-16 12:04:20Z pboy $ @@ -64,6 +65,8 @@ public class Utilities { /** * Fetch the location of the CMS Workspace package. Caches the result. * @return The URL of the CMS Workspace package + * @deprecated without direct replacement yet, refactor code to use + * legacy free code in com.arsdigita.web */ public static String getWorkspaceURL() { String url = (String) m_cache.get(CMS.WORKSPACE_PACKAGE_KEY); @@ -166,6 +169,7 @@ public class Utilities { * Fetches the URL of a mounted instance of a package. * @param key The package key * @return The URL where the package is mounted + * @deprecated without direct replacement yet */ private static String getSingletonPackageURL(String key) { PackageType type = null; @@ -206,6 +210,13 @@ public class Utilities { return url.toString(); } + /** + * + * @param key + * @return + * @deprecated without replacement (singleton package is not a supported + * property for legacy free applications.) + */ private static String getSingletonPackageURLSansContext(String key) { PackageType type = null; type = PackageType.findByKey(key); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java b/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java index b18c768bf..e3962af9c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java @@ -86,11 +86,11 @@ public abstract class BaseAdminPane extends SelectionPanel super(title, builder); } - protected final static GlobalizedMessage gz(final String key) { + protected static GlobalizedMessage gz(final String key) { return GlobalizationUtil.globalize(key); } - protected final static String lz(final String key) { + protected static String lz(final String key) { return (String) gz(key).localize(); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java b/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java new file mode 100755 index 000000000..7d0c6d870 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java @@ -0,0 +1,346 @@ +/* + * 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.ui; + +import com.arsdigita.cms.dispatcher.*; +import com.arsdigita.bebop.Bebop; +import com.arsdigita.bebop.Container; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.page.PageTransformer; +import com.arsdigita.cms.CMSExcursion; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.SecurityManager; +import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelHelper; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.permissions.PermissionDescriptor; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.persistence.OID; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.util.Assert; +import com.arsdigita.web.Application; +import com.arsdigita.xml.Document; +import com.arsdigita.xml.Element; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashMap; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + *A CMSPage is a Bebop {@link com.arsdigita.bebop.Page} + * implementation of the {@link com.arsdigita.cms.dispatcher.ResourceHandler} + * interface.
+ * + *It stores the current {@link com.arsdigita.cms.ContentSection} and, if + * applicable, the {@link com.arsdigita.cms.ContentItem} in the page state as + * request local objects. Components that are part of the CMSPage + * may access these objects by calling:
+ *
+ * getContentSection(PageState state);
+ *
+ *
+ * @author Michael Pih (pihman@arsdigita.com)
+ * @author Uday Mathur (umathur@arsdigita.com)
+ * @version $Id: CMSPage.java 2140 2011-01-16 12:04:20Z pboy $
+ */
+public class CMSApplicationPage extends Page {
+
+ private static final Logger s_log = Logger.getLogger(CMSApplicationPage.class);
+
+ /** The global assets URL stub XML parameter name. */
+ public final static String ASSETS = "ASSETS";
+
+ /** The XML page class. */
+ public final static String PAGE_CLASS = "CMS";
+
+ /** Map of XML parameters */
+ private HashMap m_params;
+
+ /** */
+ private PageTransformer m_transformer;
+
+ public CMSApplicationPage() {
+ super();
+ buildPage();
+ }
+
+ public CMSApplicationPage(String title) {
+ super(title);
+ buildPage();
+ }
+
+ public CMSApplicationPage(String title, Container panel) {
+ super(title, panel);
+ buildPage();
+ }
+
+ public CMSApplicationPage(Label title) {
+ super(title);
+ buildPage();
+ }
+
+ public CMSApplicationPage(Label title, Container panel) {
+ super(title, panel);
+ buildPage();
+ }
+
+ /**
+ * Builds the page.
+ */
+ protected void buildPage() {
+ // Set the class attribute.
+ setClassAttr(PAGE_CLASS);
+
+ // Global XML params.
+ // MP: This only works with older versions of Xalan.
+ m_params = new HashMap();
+ setXMLParameter(ASSETS, Utilities.getGlobalAssetsURL());
+
+ // MP: This is a hack to so that the XML params work with the newer
+ // version of Xalan.
+ setAttribute(ASSETS, Utilities.getGlobalAssetsURL());
+
+ // Make sure the error display gets rendered.
+ getErrorDisplay().setIdAttr("page-body");
+
+ final PresentationManager pm = Bebop.getConfig().getPresentationManager();
+
+ if (pm instanceof PageTransformer) {
+ m_transformer = (PageTransformer) pm;
+ }
+ else {
+ m_transformer = new PageTransformer();
+ }
+ }
+
+ /**
+ * Finishes and locks the page. If the page is already locked, does nothing.
+ *
+ * This method is called by the {@link com.arsdigita.dispatcher.Dispatcher}
+ * that initializes this page.
+ */
+ public synchronized void init() {
+ s_log.debug("Initializing the page");
+
+ if (!isLocked()) {
+ s_log.debug("The page hasn't been locked; locking it now");
+
+ lock();
+ }
+ }
+
+ /**
+ * Fetches the value of the XML parameter.
+ *
+ * @param name The parameter name
+ * @return The parameter value
+ * @pre (name != null)
+ */
+ public String getXMLParameter(String name) {
+ return (String) m_params.get(name);
+ }
+
+ /**
+ * Set an XML parameter.
+ *
+ * @param name The parameter name
+ * @param value The parameter value
+ * @pre (name != null)
+ */
+ public void setXMLParameter(String name, String value) {
+ m_params.put(name, value);
+ }
+
+ /**
+ * Fetch the request-local content section.
+ *
+ * @param request The HTTP request
+ * @return The current content section
+ *
+ * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
+ * instead
+ * Despite of being deprecated it can not be removed because it
+ * is required by the interface Resourcehandler which is
+ * implemented by this class.
+ * On the other hand, if deprecated, implementing ResourceHandler
+ * may not be required
+ */
+ public ContentSection getContentSection(HttpServletRequest request) {
+ // Resets all content sections associations.
+ return ContentSectionDispatcher.getContentSection(request);
+ }
+
+ /**
+ * Fetch the request-local content section.
+ *
+ * @param state The page state
+ * @return The current content section
+ *
+ * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
+ * instead
+ * Despite of being deprecated it can not be removed because it
+ * is required by ContentItemPage which extends CMSPage and
+ * uses this method.
+ */
+ public ContentSection getContentSection(PageState state) {
+ return getContentSection(state.getRequest());
+ }
+
+ /**
+ * Fetch the request-local content item.
+ *
+ * @param request The HTTP request
+ * @return The current content item
+ *
+ * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
+ * instead
+ * Despite of being deprecated it can not be removed because it
+ * is required by the interface Resourcehandler which is
+ * implemented by this class.
+ * On the other hand, if deprecated, implementing ResourceHandler
+ * may not be required
+ */
+ public ContentItem getContentItem(HttpServletRequest request) {
+ // resets all content item associations
+ return ContentSectionDispatcher.getContentItem(request);
+ }
+
+ /**
+ * Fetch the request-local content item.
+ *
+ * @param state The page state
+ * @return The current content item
+ * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem()
+ * instead.
+ * Despite of being deprecated it can not be removed because it
+ * is required by ContentItemPage which extends CMSPage and
+ * uses this method.
+ */
+ public ContentItem getContentItem(PageState state) {
+ return getContentItem(state.getRequest());
+ }
+
+ /**
+ * Services the Bebop page.
+ *
+ * @param request The servlet request object
+ * @param response the servlet response object
+ *
+ * @pre m_transformer != null
+ */
+ public void dispatch(final HttpServletRequest request,
+ final HttpServletResponse response // ,
+ // RequestContext actx
+ )
+ throws IOException, ServletException {
+
+ DeveloperSupport.startStage("CMSPage.dispatch: serve page");
+
+ CMSExcursion excursion = new CMSExcursion() {
+ public void excurse() throws IOException, ServletException {
+ Application app = Application.getCurrentApplication(request);
+ ContentSection section = null;
+
+ if (app == null) {
+ // We're at the content center; do nothing.
+ } else if (app instanceof ContentSection) {
+ section = (ContentSection) app;
+ } else {
+ // hack to deal with category browser mounted
+ // under section app.
+ app = app.getParentApplication();
+ if (app instanceof ContentSection) {
+ section = (ContentSection) app;
+ }
+ }
+
+ if (section != null) {
+ setContentSection(section);
+ setSecurityManager(new SecurityManager(section));
+ }
+
+ final String itemID = request.getParameter("item_id");
+
+ if (itemID != null) {
+ try {
+ ContentItem item =
+ (ContentItem) DomainObjectFactory.newInstance
+ (new OID(ContentItem.BASE_DATA_OBJECT_TYPE,
+ new BigDecimal(itemID)));
+ setContentItem(item);
+ PermissionDescriptor perm = new PermissionDescriptor(
+ SecurityManager.CMS_PREVIEW_ITEM_DESCRIPTOR,
+ item,
+ Kernel.getContext().getParty() );
+ if (!PermissionService.checkPermission(perm)) {
+ s_log.warn("No perm to CMS_PREVIEW_ITEM " + itemID);
+ throw new AccessDeniedException(
+ "You do not have privileges to administer item "
+ + itemID);
+ }
+ } catch (DataObjectNotFoundException donfe) {
+ s_log.warn("Failed to load content item " + itemID);
+ }
+ }
+
+ final Document doc = buildDocument(request, response);
+
+ Assert.exists(m_transformer,
+ "Implementation of PresentationManager");
+ m_transformer.servePage(doc, request, response, m_params);
+ }
+ };
+ try {
+ excursion.run();
+ } finally {
+ DeveloperSupport.endStage("CMSPage.dispatch: serve page");
+ }
+ }
+
+ @Override
+ protected Element generateXMLHelper(PageState ps, Document parent) {
+ Element page = super.generateXMLHelper(ps,parent);
+ User user = getCurrentUser(ps);
+ if ( user != null ) {
+ page.addAttribute("name",user.getDisplayName());
+ }
+
+ return page;
+ }
+
+ /**
+ * @deprecated Use Kernel.getContext().getParty() if possible and
+ * Web.getContext().getUser() if necessary.
+ */
+ public static User getCurrentUser(PageState state) {
+ return KernelHelper.getCurrentUser(state.getRequest());
+ }
+}
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java b/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java
new file mode 100755
index 000000000..21513aef2
--- /dev/null
+++ b/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java
@@ -0,0 +1,204 @@
+/*
+ * 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.ui;
+
+import com.arsdigita.bebop.Component;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.Link;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.SimpleContainer;
+import com.arsdigita.bebop.TabbedPane;
+import com.arsdigita.bebop.event.ActionEvent;
+import com.arsdigita.bebop.event.ActionListener;
+import com.arsdigita.bebop.event.PrintEvent;
+import com.arsdigita.bebop.event.PrintListener;
+import com.arsdigita.bebop.parameters.BigDecimalParameter;
+import com.arsdigita.cms.ContentItem;
+import com.arsdigita.cms.ContentSection;
+import com.arsdigita.cms.ContentType;
+import com.arsdigita.cms.dispatcher.CMSPage;
+import com.arsdigita.cms.ui.workspace.TasksPanel;
+import com.arsdigita.cms.util.GlobalizationUtil;
+import com.arsdigita.kernel.KernelHelper;
+import com.arsdigita.kernel.User;
+import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
+import com.arsdigita.ui.DebugPanel;
+
+
+/**
+ * The Content Center page.
+ * + * @author Jack Chung (flattop@arsdigita.com) + * @author Michael Pih (pihman@arsdigita.com) + * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ + */ +public class CMSPageWorkspacePage extends CMSPage implements ActionListener { + + private final static String XSL_CLASS = "CMS Admin"; + + private TabbedPane m_tabbedPane; + + private TasksPanel m_tasks; + private ItemSearch m_search; + private ACSObjectSelectionModel m_typeSel; + private ACSObjectSelectionModel m_sectionSel; + + public static final String CONTENT_TYPE = "type_id"; + public static final String CONTENT_SECTION = "section_id"; + + /** + * Construct a new CMSPageWorkspacePage + */ + public CMSPageWorkspacePage() { // Constructor Page + super(new Label( GlobalizationUtil.globalize + ("cms.ui.content_center")), + new SimpleContainer()); + + setClassAttr("cms-admin"); + + BigDecimalParameter typeId = new BigDecimalParameter(CONTENT_TYPE); + addGlobalStateParam(typeId); + m_typeSel = new ACSObjectSelectionModel + (ContentType.class.getName(), ContentType.BASE_DATA_OBJECT_TYPE, typeId); + + BigDecimalParameter sectionId = new BigDecimalParameter + (CONTENT_SECTION); + addGlobalStateParam(sectionId); + m_sectionSel = new ACSObjectSelectionModel + (ContentSection.class.getName(), + ContentSection.BASE_DATA_OBJECT_TYPE, + sectionId); + + add( new WorkspaceContextBar() ); + add( new GlobalNavigation() ); + + m_tasks = getTasksPane(m_typeSel, m_sectionSel); + m_search = getSearchPane(); + + m_tabbedPane = createTabbedPane(); + m_tabbedPane.setIdAttr("page-body"); + add(m_tabbedPane); + + add(new DebugPanel()); + } + + /** + * Creates, and then caches, the Tasks pane. Overriding this + * method to return null will prevent this tab from appearing. + **/ + protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, + ACSObjectSelectionModel sectionModel) { + if (m_tasks == null) { + m_tasks = new TasksPanel(typeModel,sectionModel); + } + return m_tasks; + } + + /** + * Creates, and then caches, the Search pane. Overriding this + * method to return null will prevent this tab from appearing. + **/ + protected ItemSearch getSearchPane() { + if (m_search == null) { + m_search = new ItemSearch(ContentItem.DRAFT); + } + + return m_search; + } + + + private SimpleContainer makeHeader() { + PrintListener l = new PrintListener() { + public void prepare(PrintEvent event) { + PageState state = event.getPageState(); + Link link = (Link) event.getTarget(); + + User user = KernelHelper.getCurrentUser(state.getRequest()); + + link.setChild(new Label(user.getName())); + link.setTarget("/pvt/"); + } + }; + + SimpleContainer sc = new SimpleContainer(); + Label welcomeLabel = new Label(GlobalizationUtil.globalize("cms.ui.welcome")); + Link nameLink = new Link(l); + + sc.add(welcomeLabel); + sc.add(nameLink); + return sc; + + } + + + /** + * Created the TabbedPane to use for this page. Sets the class + * attribute for this tabbed pane. The default implementation uses a + * {@link com.arsdigita.bebop.TabbedPane} and sets the class + * attribute to "CMS Admin." This implementation also adds tasks, + * content sections, and search panes. + * + *+ * + * Developers can override this method to add only the tabs they + * want, or to add additional tabs after the default CMS tabs are + * added. + **/ + protected TabbedPane createTabbedPane() { + TabbedPane pane = new TabbedPane(); + pane.setClassAttr(XSL_CLASS); + addToPane(pane, "Tasks/Sections", getTasksPane(m_typeSel, m_sectionSel)); + addToPane(pane, "Search", getSearchPane()); + pane.addActionListener(this); + return pane; + } + + + /** + * Adds the specified component, with the specified tab name, to the + * tabbed pane only if it is not null. + * + * @param pane The pane to which to add the tab + * @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) { + if (comp != null) { + pane.addTab(tabName, comp); + } + } + + + /** + * When a new tab is selected, reset the state of the + * formerly-selected pane. + * + * @param event The event fired by selecting a tab + */ + public void actionPerformed(ActionEvent event) { + PageState state = event.getPageState(); + Component pane = m_tabbedPane.getCurrentPane(state); + + if ( pane == m_tasks ) { + m_tasks.reset(state); + } else if ( pane == m_search ) { + m_search.reset(state); + } + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java b/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java index 62d1b1f17..48e871dcd 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java @@ -33,6 +33,7 @@ import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.dispatcher.CMSPage; +import com.arsdigita.cms.ui.workspace.TasksPanel; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.kernel.KernelHelper; import com.arsdigita.kernel.User; @@ -45,7 +46,7 @@ import com.arsdigita.ui.DebugPanel; * * @author Jack Chung (flattop@arsdigita.com) * @author Michael Pih (pihman@arsdigita.com) - * @version $Id: WorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ + * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ */ public class WorkspacePage extends CMSPage implements ActionListener { @@ -62,9 +63,9 @@ public class WorkspacePage extends CMSPage implements ActionListener { public static final String CONTENT_SECTION = "section_id"; /** - * Construct a new WorkspacePage + * Construct a new CMSPageWorkspacePage */ - public WorkspacePage() { + public WorkspacePage() { // Constructor Page super(new Label( GlobalizationUtil.globalize ("cms.ui.content_center")), new SimpleContainer()); @@ -80,10 +81,12 @@ public class WorkspacePage extends CMSPage implements ActionListener { (CONTENT_SECTION); addGlobalStateParam(sectionId); m_sectionSel = new ACSObjectSelectionModel - (ContentSection.class.getName(), ContentSection.BASE_DATA_OBJECT_TYPE, sectionId); + (ContentSection.class.getName(), + ContentSection.BASE_DATA_OBJECT_TYPE, + sectionId); - add(new WorkspaceContextBar()); - add(new GlobalNavigation()); + add( new WorkspaceContextBar() ); + add( new GlobalNavigation() ); m_tasks = getTasksPane(m_typeSel, m_sectionSel); m_search = getSearchPane(); @@ -99,7 +102,8 @@ public class WorkspacePage extends CMSPage implements ActionListener { * Creates, and then caches, the Tasks pane. Overriding this * method to return null will prevent this tab from appearing. **/ - protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, ACSObjectSelectionModel sectionModel) { + protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, + ACSObjectSelectionModel sectionModel) { if (m_tasks == null) { m_tasks = new TasksPanel(typeModel,sectionModel); } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java b/ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java similarity index 82% rename from ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java rename to ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java index 8f99d4c9c..e303da20a 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.ui; +package com.arsdigita.cms.ui.workspace; import java.math.BigDecimal; @@ -44,12 +44,11 @@ import com.arsdigita.cms.ContentSectionCollection; import com.arsdigita.cms.Folder; import com.arsdigita.cms.PageLocations; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.Utilities; +import com.arsdigita.cms.ui.CMSContainer; import com.arsdigita.cms.ui.authoring.NewItemForm; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.User; import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; @@ -59,12 +58,11 @@ import com.arsdigita.web.Web; /** * Displays all the content sections in table, with links to the admin - * and public pages. Also displays a form for each content section to - * create an object of a given type. The list of available types is - * retrieved for each content section. + * (and in legacy mode to legacy public pages as well). Also displays a form for + * each content section to create an object of a given type. The list of + * available types retrieved for each content section. * *
- *
* This class is a container for two other components: a form and a
* table. The form represents the drop down list of the content types
* available in a particular content section. It is an extension of
@@ -110,11 +108,15 @@ public class ContentSectionContainer extends CMSContainer {
add(m_table);
}
+ @Override
public void register(Page p) {
super.register(p);
p.setVisibleDefault(m_formContainer, false);
}
+ /**
+ *
+ */
private class FormContainer extends CMSContainer {
private StaticNewItemForm m_form;
@@ -145,32 +147,36 @@ public class ContentSectionContainer extends CMSContainer {
folder = section.getRootFolder();
}
- if (! sm.canAccess(state.getRequest(), SecurityManager.NEW_ITEM, folder)) {
- throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.insufficient_privileges").localize());
+ if (! sm.canAccess(state.getRequest(),
+ SecurityManager.NEW_ITEM, folder)) {
+ throw new FormProcessException(
+ (String) GlobalizationUtil.globalize(
+ "cms.ui.insufficient_privileges").localize());
}
}
});
m_form.addProcessListener(new FormProcessListener() {
- /**
- * Process listener: redirects to the authoring kit to create a new item.
- */
- public void process(FormSectionEvent e) throws FormProcessException {
- StaticNewItemForm form = (StaticNewItemForm) e.getSource();
- PageState state = e.getPageState();
+ /**
+ * Process listener: redirects to the authoring kit to create a new item.
+ */
+ public void process(FormSectionEvent e) throws FormProcessException {
+ StaticNewItemForm form = (StaticNewItemForm) e.getSource();
+ PageState state = e.getPageState();
- BigDecimal typeId = form.getTypeID(state);
- if( typeId != null ) {
- BigDecimal sectionId = form.getContentSectionID(state);
- m_sectionSel.setSelectedKey(state, sectionId);
- m_typeSel.setSelectedKey(state, typeId);
- }
+ BigDecimal typeId = form.getTypeID(state);
+ if( typeId != null ) {
+ BigDecimal sectionId = form.getContentSectionID(state);
+ m_sectionSel.setSelectedKey(state, sectionId);
+ m_typeSel.setSelectedKey(state, typeId);
}
- });
+ }
+ });
add(m_form);
}
+ @Override
public void register(Page p) {
super.register(p);
p.addComponentStateParam(this, m_sectionIdParam);
@@ -272,6 +278,8 @@ public class ContentSectionContainer extends CMSContainer {
**/
private ContentSectionTable() {
super();
+
+ Integer colNo = 0;
Label emptyView = new Label
("There are currently no content sections installed.");
@@ -282,16 +290,20 @@ public class ContentSectionContainer extends CMSContainer {
// add columns to the table
TableColumnModel columnModel = getColumnModel();
- TableColumn contentSectionColumn = new TableColumn(0, COLUMN_SECTION);
- TableColumn locationColumn = new TableColumn(1, COLUMN_LOCATION);
- TableColumn actionColumn = new TableColumn(2, COLUMN_ACTION);
-
+
+ TableColumn contentSectionColumn = new TableColumn(colNo, COLUMN_SECTION);
contentSectionColumn.setCellRenderer(new AdminURLTableCellRenderer());
- locationColumn.setCellRenderer(new URLTableCellRenderer());
- actionColumn.setCellRenderer(new ActionTableCellRenderer());
-
columnModel.add(contentSectionColumn);
- columnModel.add(locationColumn);
+
+ if( !ContentSection.getConfig().getHideLegacyPublicSiteLink() ) {
+ TableColumn locationColumn = new TableColumn(colNo ++,
+ COLUMN_LOCATION);
+ locationColumn.setCellRenderer(new URLTableCellRenderer());
+ columnModel.add(locationColumn);
+ }
+
+ TableColumn actionColumn = new TableColumn(colNo ++, COLUMN_ACTION);
+ actionColumn.setCellRenderer(new ActionTableCellRenderer());
columnModel.add(actionColumn);
setModelBuilder(new ContentSectionTableModelBuilder());
@@ -346,7 +358,7 @@ public class ContentSectionContainer extends CMSContainer {
* table. This implementation orders the content sections by
* lower(label).
**/
- protected ContentSectionCollection getContentSectionCollection() {
+ private ContentSectionCollection getContentSectionCollection() {
ContentSectionCollection sections = ContentSection.getAllSections();
sections.addOrder("lower(label)");
return sections;
@@ -433,8 +445,14 @@ public class ContentSectionContainer extends CMSContainer {
SecurityManager sm = new SecurityManager(section);
if (! sm.canAccess(state.getRequest(), SecurityManager.NEW_ITEM, folder)
- || !ContentSection.getConfig().getAllowContentCreateInSectionListing()) {
- return new Label(" ", false);
+ || !ContentSection.getConfig().getAllowContentCreateInSectionListing()
+ ) {
+ return new Label(" - - "+
+ " "+
+ " "+
+ " "+
+ " ",
+ false);
} else {
// set the value of the sectionIdParameter in the form
// to this section
@@ -454,70 +472,43 @@ public class ContentSectionContainer extends CMSContainer {
**/
public static class URLTableCellRenderer implements TableCellRenderer {
- private static final String URL_STUB = "/";
-
/**
* The object passed in is the current content section. This
* returns a Link whose name and target are the url to the
* public pages.
- **/
- public Component getComponent(Table table, PageState state, Object value,
- boolean isSelected, Object key,
- int row, int column) {
+ *
+ * @return Link whose name and target are the url to the public pages
+ * of the current (passed in) content section
+ * or a Label if current use does not habe acces priviledge
+ * for the content section
+ */
+ public Component getComponent(Table table,
+ PageState state,
+ Object value,
+ boolean isSelected,
+ Object key,
+ int row,
+ int column) {
+
+ /* cast to ContentSection for further processing */
ContentSection section = (ContentSection) value;
- String baseUrl = getBaseURL();
String name = section.getName();
+ String path = section.getPath() ; // from Application
+
// If the user has no access, return a Label instead of a Link
SecurityManager sm = new SecurityManager(section);
- if (sm.canAccess(state.getRequest(), SecurityManager.PUBLIC_PAGES)) {
- return new Link(baseUrl + name + "/", baseUrl + generateURL(name));
+ if (sm.canAccess(state.getRequest(), SecurityManager.PUBLIC_PAGES)
+ && !ContentSection.getConfig().getHideLegacyPublicSiteLink()
+ ) {
+
+ return new Link("/"+name+"/", path+"/");
} else {
- return new Label(baseUrl + name + "/", false);
+ return new Label("/"+name+"/", false);
}
}
- /**
- * Trims leading slashes, if any, on the specified string.
- *
- * @param string The string for which we want to remove
- * leading slashes
- **/
- protected String trimSlashes(String string) {
- while (string != null && string.length() > 0 &&
- string.charAt(0) == '/') {
- string = string.substring(1);
- }
- return string;
- }
-
- /**
- * Generates the url for the specified prefix. Always returns
- * something that does not start with a forward slash.
- *
- * @param prefix The prefix of the URL
- **/
- protected String generateURL(String prefix) {
- return trimSlashes(prefix) + URL_STUB;
- }
-
- /**
- * Returns the current url stub from the webapp context and
- * the requested site node. Always returns something that ends
- * with a forward slash.
- **/
- protected String getBaseURL() {
- // Generate the base URL stub.
- StringBuffer buf = new StringBuffer(15);
- buf.append(Utilities.getWebappContext())
- .append(SiteNode.getRootSiteNode().getURL());
- String url = buf.toString();
- if (url.endsWith("/")) {
- return url;
- }
- return url + "/";
- }
}
@@ -532,6 +523,7 @@ public class ContentSectionContainer extends CMSContainer {
/**
* The object passed in is the current content section
**/
+ @Override
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
int row, int column) {
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java b/ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java
similarity index 90%
rename from ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java
rename to ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java
index 24f7965c9..bc14b3663 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.cms.ui;
+package com.arsdigita.cms.ui.workspace;
import java.math.BigDecimal;
@@ -52,6 +52,8 @@ import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.Folder;
+import com.arsdigita.cms.ui.CMSContainer;
+import com.arsdigita.cms.ui.ContentItemPage;
import com.arsdigita.cms.ui.authoring.CreationSelector;
import com.arsdigita.cms.ui.folder.FolderSelectionModel;
import com.arsdigita.cms.util.GlobalizationUtil;
@@ -121,8 +123,10 @@ public class TasksPanel extends CMSContainer {
private static final String SORT_WORKFLOW = "workflow";
// IMAGES
- public static final String UP_ARROW_IMAGE = "/themes/heirfloom/images/gray-triangle-up.gif";
- public static final String DOWN_ARROW_IMAGE = "/themes/heirfloom/images/gray-triangle-down.gif";
+ public static final String UP_ARROW_IMAGE =
+ "/themes/heirfloom/images/gray-triangle-up.gif";
+ public static final String DOWN_ARROW_IMAGE =
+ "/themes/heirfloom/images/gray-triangle-down.gif";
// CREATION PANE CONSTANTS
private Label m_selectorLabel;
@@ -168,7 +172,8 @@ public class TasksPanel extends CMSContainer {
/**
* Adds the components to this tasks panel
**/
- protected void addComponents() {
+// protected void addComponents() {
+ private void addComponents() {
m_creationPane = new BoxPanel(BoxPanel.VERTICAL);
// A label that says "Create $content_type in $section"
@@ -181,7 +186,9 @@ public class TasksPanel extends CMSContainer {
ContentSection sec =
(ContentSection) m_sectionSel.getSelectedObject(s);
- StringBuffer buf = new StringBuffer(GlobalizationUtil.globalize("cms.ui.create").localize() + " ");
+ StringBuffer buf = new StringBuffer(
+ GlobalizationUtil
+ .globalize("cms.ui.create").localize() + " ");
buf.append(type.getLabel());
buf.append(" in ");
buf.append(sec.getName());
@@ -217,7 +224,9 @@ public class TasksPanel extends CMSContainer {
}
});
- m_viewLockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_locked")));
+ m_viewLockLink = new ActionLink(new
+ Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_locked")));
m_viewLockLink.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PageState ps = e.getPageState();
@@ -225,7 +234,9 @@ public class TasksPanel extends CMSContainer {
}
});
- m_viewUnlockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_unlocked")));
+ m_viewUnlockLink = new ActionLink(new
+ Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_unlocked")));
m_viewUnlockLink.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PageState ps = e.getPageState();
@@ -233,7 +244,9 @@ public class TasksPanel extends CMSContainer {
}
});
- m_viewAllLockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_all")));
+ m_viewAllLockLink = new ActionLink(new
+ Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_all")));
m_viewAllLockLink.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PageState ps = e.getPageState();
@@ -241,11 +254,14 @@ public class TasksPanel extends CMSContainer {
}
});
- m_viewLockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_locked"));
+ m_viewLockLabel = new Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_locked"));
m_viewLockLabel.setFontWeight(Label.BOLD);
- m_viewUnlockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_unlocked"));
+ m_viewUnlockLabel = new Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_unlocked"));
m_viewUnlockLabel.setFontWeight(Label.BOLD);
- m_viewAllLockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_all"));
+ m_viewAllLockLabel = new Label(GlobalizationUtil
+ .globalize("cms.ui.workflow.task.view_all"));
m_viewAllLockLabel.setFontWeight(Label.BOLD);
add(new Label("
",false));
@@ -267,6 +283,11 @@ public class TasksPanel extends CMSContainer {
// m_actionLabel.setClassAttr("action");
}
+ /**
+ *
+ * @param p
+ */
+ @Override
public void register(Page p) {
super.register(p);
@@ -381,15 +402,18 @@ public class TasksPanel extends CMSContainer {
CompoundFilter authorFilter = ff.and();
//cg query changed to refer to task type id
authorFilter.addFilter(ff.equals("taskType",CMSTaskType.AUTHOR));
- authorFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.AUTHOR), party, ff));
+ authorFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.AUTHOR),
+ party, ff));
CompoundFilter approveFilter = ff.and();
approveFilter.addFilter(ff.equals("taskType",CMSTaskType.EDIT));
- approveFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.EDIT), party, ff));
+ approveFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.EDIT),
+ party, ff));
CompoundFilter deployFilter = ff.and();
deployFilter.addFilter(ff.equals("taskType",CMSTaskType.DEPLOY));
- deployFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.DEPLOY), party, ff));
+ deployFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.DEPLOY),
+ party, ff));
CompoundFilter permissionFilter = ff.or();
permissionFilter.addFilter(authorFilter);
@@ -416,6 +440,7 @@ public class TasksPanel extends CMSContainer {
m_sectionSel = sectionSel;
}
+ @Override
protected BigDecimal getRootFolderID(PageState s) {
ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s);
Assert.exists(sec);
@@ -468,12 +493,14 @@ public class TasksPanel extends CMSContainer {
}
private RequestLocal m_taskCount = new RequestLocal() {
+ @Override
public Object initialValue(PageState state) {
DataQuery query = makeQuery(state);
return new Long(query.size());
}
};
+ @Override
public void generateXML(PageState state,
Element parent) {
Element content = parent.newChildElement("cms:tasksPanel", CMS.CMS_XML_NS);
@@ -540,7 +567,8 @@ public class TasksPanel extends CMSContainer {
sections.put(sectionID, sectionPath);
}
- Element task = content.newChildElement("cms:tasksPanelTask", CMS.CMS_XML_NS);
+ Element task = content.newChildElement("cms:tasksPanelTask",
+ CMS.CMS_XML_NS);
BigDecimal itemID = (BigDecimal)query.get("itemID");
String taskType = (String)query.get("taskType");
@@ -590,9 +618,11 @@ public class TasksPanel extends CMSContainer {
}
if ("Deploy".equals(taskType)) {
- task.addAttribute("editTabNumber", String.valueOf(ContentItemPage.PUBLISHING_TAB));
+ task.addAttribute("editTabNumber",
+ String.valueOf(ContentItemPage.PUBLISHING_TAB));
} else {
- task.addAttribute("editTabNumber", String.valueOf(ContentItemPage.AUTHORING_TAB));
+ task.addAttribute("editTabNumber",
+ String.valueOf(ContentItemPage.AUTHORING_TAB));
}
}
@@ -635,6 +665,7 @@ public class TasksPanel extends CMSContainer {
}
+ @Override
public void respond(PageState state) throws ServletException {
String key = state.getControlEventName();
String value = state.getControlEventValue();
@@ -666,7 +697,9 @@ public class TasksPanel extends CMSContainer {
}
}
- String redirectURL = Web.getConfig().getDispatcherServletPath() + sectionPath + "/admin/item.jsp?item_id=" + itemID + "&set_tab=" + tabNumber;
+ String redirectURL = Web.getConfig().getDispatcherServletPath()
+ + sectionPath + "/admin/item.jsp?item_id="
+ + itemID + "&set_tab=" + tabNumber;
throw new RedirectSignal(redirectURL,true);
} catch (DataObjectNotFoundException ex) {
throw new ServletException("Unknown content ID" + itemID);
@@ -684,7 +717,8 @@ public class TasksPanel extends CMSContainer {
}
}
- private static Filter getTaskFilter(CMSTaskType taskType, Party party, FilterFactory factory) {
+ private static Filter getTaskFilter(CMSTaskType taskType
+ , Party party, FilterFactory factory) {
PrivilegeDescriptor privilege;
String queryName;
String queryType;
diff --git a/ccm-cms/web/packages/content-section/www/admin/index.jsp b/ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp
similarity index 83%
rename from ccm-cms/web/packages/content-section/www/admin/index.jsp
rename to ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp
index 39057f110..a6ab17905 100755
--- a/ccm-cms/web/packages/content-section/www/admin/index.jsp
+++ b/ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp
@@ -1,8 +1,8 @@
getMessage().
- * You may use the
- * com.arsdigita.templating.stylesheet_paths system
- * property to change the file from which the stylesheet patterns are
- * drawn.
+ * You may use the com.arsdigita.templating.stylesheet_paths system
+ * property to change the file from which the stylesheet patterns are drawn.
*
@@ -118,19 +116,19 @@ public class PatternStylesheetResolver implements StylesheetResolver {
/** Logger instance for debugging. */
private static final Logger s_log = Logger.getLogger
- (PatternStylesheetResolver.class);
+ (PatternStylesheetResolver.class);
/** List of registered pattern generators which are queried in turn. */
private static final HashMap s_generators = new HashMap();
+
/**
* Registers a new pattern generator for the given key.
*
* @param key the key as it appears in the pattern string
* @param gen a pattern generator for producing values to be
* substituted for key
- **/
-
+ */
public static void registerPatternGenerator(String key,
PatternGenerator gen) {
s_generators.put(key, gen);
@@ -159,6 +157,10 @@ public class PatternStylesheetResolver implements StylesheetResolver {
// This is a List of Lists.
private List m_paths = null;
+ /**
+ *
+ * @param path
+ */
private void loadPaths(String path) {
if (s_log.isInfoEnabled()) {
s_log.info("Loading paths from " + path);
@@ -200,6 +202,11 @@ public class PatternStylesheetResolver implements StylesheetResolver {
}
}
+ /**
+ *
+ * @param request
+ * @return
+ */
public URL resolve(HttpServletRequest request) {
synchronized(this) {
if (m_paths == null) {
@@ -271,6 +278,13 @@ public class PatternStylesheetResolver implements StylesheetResolver {
("no path to XSL stylesheet found; " + "try modifying " + m_path);
}
+ /**
+ *
+ * @param inBits
+ * @param paths
+ * @param values
+ * @param request
+ */
private void expandPlaceholders(String[] inBits,
ArrayList paths,
HashMap values,
@@ -324,6 +338,13 @@ public class PatternStylesheetResolver implements StylesheetResolver {
}
}
+ /**
+ *
+ * @param key
+ * @param values
+ * @param request
+ * @return
+ */
private String[] getValues(String key,
HashMap values,
HttpServletRequest request) {
diff --git a/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java b/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java
index 2da059e42..760ba932e 100755
--- a/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java
+++ b/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java
@@ -30,8 +30,8 @@ import javax.servlet.jsp.tagext.BodyTagSupport;
*
*
Usage:
* - *<acs:master path="path/to/master.jsp" />
- **/
+ * <acs:master path="path/to/master.jsp" />
+ */
public class QueryTag extends BodyTagSupport {
private String name = null;
@@ -46,6 +46,7 @@ public class QueryTag extends BodyTagSupport {
this.name = name;
}
+ @Override
public int doStartTag() throws JspTagException {
Session session = SessionManager.getSession();
diff --git a/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README
new file mode 100644
index 000000000..4efcaa027
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README
@@ -0,0 +1,4 @@
+Only used by components/master.jsp and related files which seem to be
+outdated.
+
+Might be deleted.
\ No newline at end of file
diff --git a/ccm-cms/web/packages/content-section/www/assets/blank.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/blank.gif
similarity index 100%
rename from ccm-cms/web/packages/content-section/www/assets/blank.gif
rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/blank.gif
diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-closed.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-closed.gif
similarity index 100%
rename from ccm-cms/web/packages/content-section/www/assets/folder-closed.gif
rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-closed.gif
diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-open.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-open.gif
similarity index 100%
rename from ccm-cms/web/packages/content-section/www/assets/folder-open.gif
rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-open.gif
diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-selected.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-selected.gif
similarity index 100%
rename from ccm-cms/web/packages/content-section/www/assets/folder-selected.gif
rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-selected.gif
diff --git a/ccm-cms/web/packages/content-section/www/components/folder-links.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp
similarity index 74%
rename from ccm-cms/web/packages/content-section/www/components/folder-links.jsp
rename to ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp
index 5c91010b5..21356cd02 100755
--- a/ccm-cms/web/packages/content-section/www/components/folder-links.jsp
+++ b/ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp
@@ -24,7 +24,7 @@
"open" : "closed";
%>
- %>/packages/content-section/www/assets/folder-<%=folderGraphic%>.gif)
<%=topFolders.get("folderLabel")%>
+ %>/templates/ccm-cms/content-section/assets/folder-<%=folderGraphic%>.gif)
<%=topFolders.get("folderLabel")%>
<% if (folderPath.startsWith((String) topFolders.get("folderName"))) { %>
@@ -42,7 +42,7 @@
"selected" : "closed";
%>
- %>/packages/content-section/www/assets/blank.gif)
 %>/packages/content-section/www/assets/folder-<%=subFolderGraphic%>.gif)
<%=subFolders.get("folderLabel")%>
+ %>/templates/ccm-cms/content-section/assets/blank.gif)
 %>/templates/ccm-cms/content-section/assets/folder-<%=subFolderGraphic%>.gif)
<%=subFolders.get("folderLabel")%>
<% } %>
diff --git a/ccm-cms/web/packages/content-section/www/components/master.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp
similarity index 99%
rename from ccm-cms/web/packages/content-section/www/components/master.jsp
rename to ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp
index 1bb7931a6..876a07292 100755
--- a/ccm-cms/web/packages/content-section/www/components/master.jsp
+++ b/ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp
@@ -1,5 +1,4 @@
<%@ taglib uri="/WEB-INF/jsp-template.tld" prefix="acs" %>
-
diff --git a/ccm-core/src/com/arsdigita/templating/jsp/example/package.html b/ccm-core/src/com/arsdigita/templating/jsp/example/package.html
new file mode 100755
index 000000000..d37c64119
--- /dev/null
+++ b/ccm-core/src/com/arsdigita/templating/jsp/example/package.html
@@ -0,0 +1,19 @@
+
+
+
+com.arsdigita.templating.jsp
+
+
+
+
+ Example for using JSP tags with the templating system.
+
+
+ File master.jsp is referenced as usabe example in
+ com.arsdigita.templating.jsp.QueryTag.java
+
+
+ Content of this directory is probably outdated!
+
+
+
diff --git a/ccm-cms/web/packages/content-section/www/components/section-tabs.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/section-tabs.jsp
similarity index 100%
rename from ccm-cms/web/packages/content-section/www/components/section-tabs.jsp
rename to ccm-core/src/com/arsdigita/templating/jsp/example/section-tabs.jsp
diff --git a/ccm-core/src/com/arsdigita/templating/jsp/package.html b/ccm-core/src/com/arsdigita/templating/jsp/package.html
index 219daf1b4..3f764f68f 100755
--- a/ccm-core/src/com/arsdigita/templating/jsp/package.html
+++ b/ccm-core/src/com/arsdigita/templating/jsp/package.html
@@ -1,15 +1,16 @@
-
+
com.arsdigita.templating.jsp
-
+
-
-JSP tags that integrate with the templating system.
-
+ JSP tags that integrate with the templating system.
-
+
+ Now no longer in use. All pages are either dynamically created (and rendered
+ using XSL transformation) or exported in html format.
+
diff --git a/ccm-core/src/com/arsdigita/web/Application.java b/ccm-core/src/com/arsdigita/web/Application.java
index 0430827bb..1a24cf88f 100755
--- a/ccm-core/src/com/arsdigita/web/Application.java
+++ b/ccm-core/src/com/arsdigita/web/Application.java
@@ -597,9 +597,14 @@ public class Application extends Resource {
}
/**
- * Returns the path to this application through the dispatcher.
+ * Returns the path to this application through the dispatcher. It does not
+ * contain the static prefix (if configured, "ccm" by default), so it can
+ * be used to construct url's for internal links.
+ *
* The path does not end in a slash. This method will not return
* null.
+ *
+ * @return Path string including w/o static prefix (if configured)
*/
public final String getPath() {
final String path = (String) get(PRIMARY_URL);
@@ -613,7 +618,7 @@ public class Application extends Resource {
}
}
- // XXX primary URL doesn't keep in sync with sitenode hierarchY
+ // XXX primary URL doesn't keep in sync with sitenode hierarchy
// We need to use a trigger-like mechanism to keep the primaryURL
// denormalization correct.
/**
diff --git a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
index 1ae45eaa6..148600bfc 100755
--- a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
+++ b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
@@ -30,7 +30,6 @@ import com.arsdigita.kernel.security.UserContext;
import com.arsdigita.sitenode.SiteNodeRequestContext;
import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
-import com.arsdigita.web.Application;
import java.io.IOException;
import javax.servlet.ServletException;
diff --git a/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java b/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java
index da61012d7..ebdbb06c3 100755
--- a/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java
+++ b/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java
@@ -24,6 +24,10 @@ import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Cookie;
+/**
+ *
+ * @author unknown
+ */
public class HttpServletRequestWrapper extends ServletRequestWrapper
implements HttpServletRequest {
private final HttpServletRequest m_req;
diff --git a/ccm-core/src/com/arsdigita/web/ResourceServlet.java b/ccm-core/src/com/arsdigita/web/ResourceServlet.java
index 780813686..d2b42e18e 100755
--- a/ccm-core/src/com/arsdigita/web/ResourceServlet.java
+++ b/ccm-core/src/com/arsdigita/web/ResourceServlet.java
@@ -51,6 +51,14 @@ public class ResourceServlet extends BaseServlet {
private static final Logger s_log =
Logger.getLogger(ResourceServlet.class);
+ /**
+ *
+ * @param sreq
+ * @param sresp
+ * @throws ServletException
+ * @throws IOException
+ */
+ @Override
protected void doService(HttpServletRequest sreq,
HttpServletResponse sresp)
throws ServletException, IOException {
diff --git a/ccm-core/src/com/arsdigita/web/URL.java b/ccm-core/src/com/arsdigita/web/URL.java
index 971a011fc..7d850100f 100755
--- a/ccm-core/src/com/arsdigita/web/URL.java
+++ b/ccm-core/src/com/arsdigita/web/URL.java
@@ -916,7 +916,11 @@ public class URL {
}
}
- public static final String getDispatcherPath() {
+ /**
+ *
+ * @return
+ */
+ public static String getDispatcherPath() {
final WebConfig config = Web.getConfig();
final HttpServletRequest req = Web.getRequest();
diff --git a/ccm-core/src/com/arsdigita/web/Web.java b/ccm-core/src/com/arsdigita/web/Web.java
index 7fcb02b96..782d843bc 100755
--- a/ccm-core/src/com/arsdigita/web/Web.java
+++ b/ccm-core/src/com/arsdigita/web/Web.java
@@ -51,11 +51,11 @@ public class Web {
private static final Logger s_log = Logger.getLogger(Web.class);
private static final ThreadLocal s_request =
- new InternalRequestLocal();
+ new InternalRequestLocal();
private static final ThreadLocal s_servletContext =
- new InternalRequestLocal();
+ new InternalRequestLocal();
private static final ThreadLocal s_userContext =
- new InternalRequestLocal();
+ new InternalRequestLocal();
private static final Map s_contexts = new HashMap();
diff --git a/ccm-core/web/templates/README.servlet b/ccm-core/web/templates/README.servlet
new file mode 100644
index 000000000..0523ce61b
--- /dev/null
+++ b/ccm-core/web/templates/README.servlet
@@ -0,0 +1,9 @@
+The address
+ /templates/servlet/*
+is used by some servlets to create a virtual temporary location to pass
+in dynamic information at runtime.
+
+Example:
+Servlet content-sectionr uses
+ /templates/servlet/content-item/*
+to pass in runtime information.
\ No newline at end of file
diff --git a/ccm-core/web/themes/README.servlet b/ccm-core/web/themes/README.servlet
new file mode 100644
index 000000000..aec959927
--- /dev/null
+++ b/ccm-core/web/themes/README.servlet
@@ -0,0 +1,11 @@
+The address
+ /themes/servlet/*
+is used by some servlets to create a virtual temporary location to pass
+in dynamic information for theme files (*.css / *.xsl) which need to be
+collected at runtime.
+
+Example:
+Servlet portlet-type-xsl used
+ /themes/servlet/portlet-type/*
+to pass in at runtime a list of actually installed portlet's default xsl
+templates to use as fallback.
\ No newline at end of file
diff --git a/ccm-ldn-aplaws/bundles/custom/cfg/project.xml b/ccm-ldn-aplaws/bundles/custom/cfg/project.xml
index a74f1df16..bbf7f9eaf 100755
--- a/ccm-ldn-aplaws/bundles/custom/cfg/project.xml
+++ b/ccm-ldn-aplaws/bundles/custom/cfg/project.xml
@@ -70,7 +70,10 @@
-
+
diff --git a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties
index 4093a6d40..cc70dc909 100755
--- a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties
+++ b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties
@@ -4,7 +4,8 @@ waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage
#
; dhtml editor to use (system wide)
; Xinha is default
-; waf.bebop.dhtml_editor=Xinha
+; default: Xinha editor & src=/assets/xinha/XinhaLoader.js
+; To use FCKeditor configure:
; waf.bebop.dhtml_editor=FCKeditor
waf.categorization.show_internal_name=true
@@ -13,9 +14,10 @@ waf.dispatcher.default_expiry=3600
;
waf.kernel.data_permission_check_enabled=false
waf.kernel.primary_user_identifier=email
-; if you activate screen_name, forum loader doesn't work.
+; if you activate screen_name, forum loader does not work.
; waf.kernel.primary_user_identifier=screen_name
waf.kernel.supported_languages=en,de
+waf.kernel.language_independent_items=true
; security.properties:
waf.auto_registration_on=false
@@ -98,7 +100,6 @@ com.arsdigita.cms.contenttypes.newsitem.start_year=2000
com.arsdigita.cms.contenttypes.newsitem.end_year_delta=5
-
# Forum application
com.arsdigita.forum.show_new_tabs=true
com.arsdigita.forum.use_wysiwyg_editor=true
@@ -116,18 +117,21 @@ com.arsdigita.london.atoz.root_category_picker=com.arsdigita.london.terms.ui.Roo
com.arsdigita.navigation.category_menu_show_grand_children=false
; com.arsdigita.navigation.category_menu_show_nephews=false
com.arsdigita.navigation.default_cat_root_path=/navigation/
-com.arsdigita.navigation.default_template=/packages/navigation/templates/default.jsp
+com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp
+; com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt
-# ccm-ldn-search application
+# ccm-search application
com.arsdigita.london.search.show_sponsored_links=true
-# ccm-ldn-subsite application
-com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
+# ccm-subsite application
+com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker
# ccm-themedirector application
+themedirector.default_theme_context=
+# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
themedirector.default_theme_path=themes/static/aplaws
com.arsdigita.london.cms.dublin.audience_domain=LGAL
diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml
index 58ae4512b..72c5f49c8 100755
--- a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml
+++ b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml
@@ -50,7 +50,10 @@
-
+
diff --git a/ccm-ldn-aplaws/bundles/extended/cfg/project.xml b/ccm-ldn-aplaws/bundles/extended/cfg/project.xml
index 62d5d5cd8..fd435356a 100755
--- a/ccm-ldn-aplaws/bundles/extended/cfg/project.xml
+++ b/ccm-ldn-aplaws/bundles/extended/cfg/project.xml
@@ -86,8 +86,12 @@
-
-
+
+
+
diff --git a/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl b/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl
similarity index 95%
rename from ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl
rename to ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl
index 7fa9efb68..70dc7223f 100644
--- a/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl
+++ b/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl
@@ -7,7 +7,7 @@
exclude-result-prefixes="bebop cms ui aplaws xsl"
version="1.0">
-
+
diff --git a/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java b/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java
index 8ef2df1f7..81d51ea01 100755
--- a/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java
+++ b/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java
@@ -60,6 +60,9 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver {
public static final String PATH_COOKIE_NAME = "ad_path";
public static final char PATH_COOKIE_SEPARATOR = '|';
+ /**
+ *
+ */
@Override
public RequestDispatcher resolve(String templatePath,
HttpServletRequest sreq,
diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java b/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java
index a72d11e50..5dc6fb757 100644
--- a/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java
+++ b/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java
@@ -49,16 +49,13 @@ import com.arsdigita.util.Assert;
*
* @author Tracy Adams
* @version $Revision: #6 $ $Date: 2004/08/17 $
- */
-
-/* XXX Have to control links with permissions and
- * add access control
+ * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/ApplicationPage.java#6 $
*/
public class ApplicationPage extends CWPage {
- public static final String versionId =
- "$Id: //portalserver/dev/src/com/arsdigita/portalserver/ApplicationPage.java#6 $" +
- "$Author: dennis $" +
- "$DateTime: 2004/08/17 23:19:25 $";
+
+ /* XXX Have to control links with permissions and
+ * add access control
+ */
private static org.apache.log4j.Logger log =
org.apache.log4j.Logger.getLogger(ApplicationPage.class.getName());
@@ -75,6 +72,7 @@ public class ApplicationPage extends CWPage {
}
}
+ @Override
public void lock() {
buildPage();
@@ -108,7 +106,9 @@ public class ApplicationPage extends CWPage {
}
protected void buildGlobal(Container global) {
- Link link = new Link( new Label(GlobalizationUtil.globalize("cw.workspace.sign_out")), "/register/logout");
+ Link link = new Link( new Label(
+ GlobalizationUtil.globalize("cw.workspace.sign_out")),
+ "/register/logout");
link.setClassAttr("signoutLink");
@@ -145,7 +145,8 @@ public class ApplicationPage extends CWPage {
// Assert.assertNotNull(party, "Party party");
Assert.exists(party, "Party party");
- link.setChild(new Label(GlobalizationUtil.globalize("cw.workspace.personal_workspace")));
+ link.setChild(new Label(GlobalizationUtil
+ .globalize("cw.workspace.personal_workspace")));
link.setTarget("/personal-portal/" + party.getID() + "/");
}
}
diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java b/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java
index 6090ff77e..a35d334d6 100644
--- a/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java
+++ b/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java
@@ -40,19 +40,16 @@ import org.apache.log4j.Logger;
*
* @author Eric Lorenzo
* @version $Revision: #5 $ $Date: 2004/08/17 $
- */
-
-/* XXX Have to control links with permissions and
- * add access control
+ * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/CWPage.java#5 $
*/
public class CWPage extends Page {
- public static final String versionId =
- "$Id: //portalserver/dev/src/com/arsdigita/portalserver/CWPage.java#5 $" +
- "$Author: dennis $" +
- "$DateTime: 2004/08/17 23:19:25 $";
private static final Logger s_log = Logger.getLogger(CWPage.class);
+ /* XXX Have to control links with permissions and
+ * add access control
+ */
+
private final Container m_global;
private final Container m_header;
private final Container m_body;
@@ -133,7 +130,11 @@ public class CWPage extends Page {
setSelected(ps, null);
}
+ /**
+ *
+ */
private class Panel extends SimpleContainer {
+ @Override
public void generateXML(PageState ps, Element p) {
Component selected = getSelected(ps);
if (selected == null) {
diff --git a/ccm-sci-bundle/application.xml b/ccm-sci-bundle/application.xml
index 3160a7062..c0d929103 100644
--- a/ccm-sci-bundle/application.xml
+++ b/ccm-sci-bundle/application.xml
@@ -16,8 +16,8 @@
-
+
diff --git a/ccm-sci-bundle/bundles/demo/cfg/integration.properties b/ccm-sci-bundle/bundles/demo/cfg/integration.properties
index 3a2006b84..dfcd3df85 100644
--- a/ccm-sci-bundle/bundles/demo/cfg/integration.properties
+++ b/ccm-sci-bundle/bundles/demo/cfg/integration.properties
@@ -17,6 +17,7 @@ waf.kernel.primary_user_identifier=email
; if you activate screen_name, forum loader does not work.
; waf.kernel.primary_user_identifier=screen_name
waf.kernel.supported_languages=de,en
+waf.kernel.language_independent_items=true
; security.properties:
waf.auto_registration_on=false
@@ -46,7 +47,7 @@ com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp
com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver
; Configure dhtml editor for use in cms content-center
-; Xinha is default and should work out of the box
+; Xinha is default and does work out of the box
; A CCM specific configuration file is used to prevent a mess with the standard
; configuration, default is:
; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js
@@ -94,7 +95,12 @@ com.arsdigita.forum.disable_page_caching=true
# ccm-navigation application
+; com.arsdigita.navigation.category_menu_show_grand_children_min=1
+; com.arsdigita.navigation.category_menu_show_grand_children=adaptive
+; com.arsdigita.navigation.category_menu_show_grand_children_limit=1
+; com.arsdigita.navigation.category_menu_show_grand_children_max=65536
com.arsdigita.navigation.category_menu_show_grand_children=false
+; com.arsdigita.navigation.category_menu_show_nephews=false
com.arsdigita.navigation.default_cat_root_path=/navigation/
com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp
com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt
@@ -112,7 +118,6 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
themedirector.default_theme_context=
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
themedirector.default_theme_path=themes/static/aplaws-generic
-themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl
# ccm-sci-bundle (Loader only)
diff --git a/ccm-sci-bundle/bundles/demo/cfg/project.xml b/ccm-sci-bundle/bundles/demo/cfg/project.xml
index 618955af2..747ea0d8b 100644
--- a/ccm-sci-bundle/bundles/demo/cfg/project.xml
+++ b/ccm-sci-bundle/bundles/demo/cfg/project.xml
@@ -84,8 +84,8 @@
-
@@ -104,7 +104,7 @@
-
+
-
+
-
+
+
- rss-files
+ rssfeed-files
com.arsdigita.web.ApplicationFileServlet
template-path
- /templates/ccm-ldn-rss
+ /templates/ccm-rssfeed
file-resolver
- com.arsdigita.london.rss.RSSFileResolver
+ com.arsdigita.rssfeed.RSSFileResolver
-
+
@@ -347,11 +347,12 @@
/ccm-navigation/files/*