Author: pboy Date: 2012-12-18 22:42:22 +0000 (Tue, 18 Dec 2012) New Revision: 2425 Added: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/CategoryPortalSelectionModel.java Removed: trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java Modified: trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal-welcome.jsp trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal.jsp trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java Log: Fixed various path entries. Modified: trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal-welcome.jsp =================================================================== --- trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal-welcome.jsp 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal-welcome.jsp 2012-12-18 22:42:22 UTC (rev 2425) @@ -4,12 +4,12 @@ xmlns:show="/WEB-INF/bebop-show.tld" version="1.2"> - <%-- JSP template to use a portal page as index page in navigation --%> + <!-- JSP template to use a portal page as index page in navigation --> <jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/> <jsp:directive.page import="com.arsdigita.navigation.Navigation"/> <jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/> - <jsp:directive.page import="com.arsdigita.aplaws.ui.CategoryPortalSelectionModel"/> + <jsp:directive.page import="com.arsdigita.portalworkspace.ui.CategoryPortalSelectionModel"/> <jsp:scriptlet> long age = Navigation.getConfig().getIndexPageCacheLifetime(); Modified: trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal.jsp =================================================================== --- trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal.jsp 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-bundle/web/templates/ccm-navigation/navigation/gen-portal.jsp 2012-12-18 22:42:22 UTC (rev 2425) @@ -9,7 +9,7 @@ <jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/> <jsp:directive.page import="com.arsdigita.navigation.Navigation"/> <jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/> - <jsp:directive.page import="com.arsdigita.aplaws.ui.CategoryPortalSelectionModel"/> + <jsp:directive.page import="com.arsdigita.portalworkspace.ui.CategoryPortalSelectionModel"/> <jsp:scriptlet> long age = Navigation.getConfig().getIndexPageCacheLifetime(); Modified: trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java =================================================================== --- trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-cms-types-article/src/com/arsdigita/cms/contenttypes/ui/ArticlePropertyForm.java 2012-12-18 22:42:22 UTC (rev 2425) @@ -66,6 +66,7 @@ */ public ArticlePropertyForm(ItemSelectionModel itemModel, ArticlePropertiesStep step) { super(itemModel, step); + m_step = step; addSubmissionListener(this); } @@ -131,7 +132,7 @@ article.setLead((String) data.get(LEAD)); article.save(); - } + } if (m_step != null) { m_step.maybeForwardToNextStep(fse.getPageState()); } Modified: trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp =================================================================== --- trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-ldn-aplaws/web/templates/ccm-navigation/navigation/aplaws-portal.jsp 2012-12-18 22:42:22 UTC (rev 2425) @@ -7,7 +7,7 @@ <jsp:directive.page import="com.arsdigita.dispatcher.DispatcherHelper"/> <jsp:directive.page import="com.arsdigita.london.navigation.Navigation"/> <jsp:directive.page import="com.arsdigita.bebop.parameters.BigDecimalParameter"/> - <jsp:directive.page import="com.arsdigita.aplaws.ui.CategoryPortalSelectionModel"/> + <jsp:directive.page import="com.arsdigita.portalworkspace.ui.CategoryPortalSelectionModel"/> <jsp:scriptlet> long age = Navigation.getConfig().getIndexPageCacheLifetime(); Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/Workspace.java 2012-12-18 22:42:22 UTC (rev 2425) @@ -575,7 +575,7 @@ // .retrieve("com.arsdigita.kernel.Party"); Filter f = dc.addNotInSubqueryFilter( "id", - "com.arsdigita.london.portal.WorkspaceParticipantIDs"); + "com.arsdigita.portalworkspace.WorkspaceParticipantIDs"); f.set("workspaceID", getID()); return new PartyCollection(dc); } @@ -594,7 +594,7 @@ **/ public Iterator getParticipantInitials() { DataQuery query = SessionManager.getSession().retrieveQuery( - "com.arsdigita.london.portal.WorkspaceParticipantInitials"); + "com.arsdigita.portalworkspace.WorkspaceParticipantInitials"); query.setParameter("workspaceID", getID()); LinkedList result = new LinkedList(); @@ -750,7 +750,7 @@ public WorkspaceCollection getChildWorkspaces() { DataQuery query = SessionManager.getSession().retrieveQuery( - "com.arsdigita.london.portal.childWorkspacesForApplicationID"); + "com.arsdigita.portalworkspace.childWorkspacesForApplicationID"); query.setParameter("applicationID", getID()); DataCollection collection = Added: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/CategoryPortalSelectionModel.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/CategoryPortalSelectionModel.java (rev 0) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/CategoryPortalSelectionModel.java 2012-12-18 22:42:22 UTC (rev 2425) @@ -0,0 +1,64 @@ +/* + * 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.portalworkspace.ui; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.categorization.Category; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.navigation.Navigation; +import com.arsdigita.navigation.NavigationModel; +import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.portalworkspace.Workspace; +import com.arsdigita.util.Assert; + +/** + * (Short description) + * + * Purpose: Service class to use in a Navigation jsp index page to enable + * the inclusion of a portal workspace as a leaf page into a navigation tree. + * + */ +public class CategoryPortalSelectionModel extends WorkspaceSelectionModel { + + /** + * + * @param state + * @return + */ + protected Workspace getDefaultWorkspace(PageState state) { + NavigationModel model = Navigation.getConfig().getDefaultModel(); + Category cat = model.getCategory(); + Assert.exists(cat); + + DataCollection workspaces + = SessionManager.getSession().retrieve( + Workspace.BASE_DATA_OBJECT_TYPE); + workspaces.addEqualsFilter("categories.id", cat.getID()); + + if (workspaces.next()) { + Workspace wk = (Workspace)DomainObjectFactory + .newInstance(workspaces.getDataObject()); + workspaces.close(); + return wk; + } + + return null; + } +} Modified: trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java =================================================================== --- trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/ui/admin/ApplicationPane.java 2012-12-18 22:42:22 UTC (rev 2425) @@ -15,7 +15,6 @@ * 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.portalworkspace.ui.admin; import java.util.HashMap; @@ -42,15 +41,10 @@ public class ApplicationPane extends SimpleContainer { private Map m_edit; // Map of application type -> edit config form - private Map m_create; - private NewApplicationForm m_newApp; - private ApplicationDetails m_appDetails; - private ActionLink m_editLink; - private ApplicationSelectionModel m_app; /** @@ -58,144 +52,156 @@ * @param app */ public ApplicationPane(ApplicationSelectionModel app) { - super("portal:applicationPane", PortalConstants.PORTAL_XML_NS); + super("portal:applicationPane", PortalConstants.PORTAL_XML_NS); - m_app = app; + m_app = app; - m_create = new HashMap(); - m_edit = new HashMap(); + m_create = new HashMap(); + m_edit = new HashMap(); - m_appDetails = new ApplicationDetails(app); - add(m_appDetails); + m_appDetails = new ApplicationDetails(app); + add(m_appDetails); - m_editLink = new ActionLink("edit"); - m_editLink.addActionListener(new ApplicationEditListener()); - add(m_editLink); + m_editLink = new ActionLink("edit"); + m_editLink.addActionListener(new ApplicationEditListener()); + add(m_editLink); - m_newApp = new NewApplicationForm(); - m_newApp.addCompletionListener(new ApplicationCreateListener()); - add(m_newApp); + m_newApp = new NewApplicationForm(); + m_newApp.addCompletionListener(new ApplicationCreateListener()); + add(m_newApp); - final RequestLocal appRL = new RequestLocal() { - public Object initialValue(PageState state) { - return m_app.getSelectedObject(state); - } - }; + final RequestLocal appRL = new RequestLocal() { + public Object initialValue(PageState state) { + return m_app.getSelectedObject(state); + } - ApplicationTypeCollection types = ApplicationType - .retrieveAllApplicationTypes(); - while (types.next()) { - ApplicationType type = types.getApplicationType(); + }; - ResourceConfigComponent create = type.getCreateComponent(appRL); - create.addCompletionListener(new ApplicationCompleteCreateListener( - create)); - m_create.put(type.getOID(), create); - add(create); + ApplicationTypeCollection types = ApplicationType + .retrieveAllApplicationTypes(); + while (types.next()) { + ApplicationType type = types.getApplicationType(); - ResourceConfigComponent modify = type.getModifyComponent(appRL); - modify.addCompletionListener(new ApplicationCompleteEditListener( - modify)); - m_edit.put(type.getOID(), modify); - add(modify); - } + ResourceConfigComponent create = type.getCreateComponent(appRL); + create.addCompletionListener(new ApplicationCompleteCreateListener( + create)); + m_create.put(type.getOID(), create); + add(create); - } + ResourceConfigComponent modify = type.getModifyComponent(appRL); + modify.addCompletionListener(new ApplicationCompleteEditListener( + modify)); + m_edit.put(type.getOID(), modify); + add(modify); + } - public void register(Page p) { - super.register(p); + } - Iterator c = m_create.keySet().iterator(); - while (c.hasNext()) { - OID type = (OID) c.next(); - p.setVisibleDefault((Component) m_create.get(type), false); - } + public void register(Page p) { + super.register(p); - Iterator e = m_edit.keySet().iterator(); - while (e.hasNext()) { - OID type = (OID) e.next(); - p.setVisibleDefault((Component) m_edit.get(type), false); - } - } + Iterator c = m_create.keySet().iterator(); + while (c.hasNext()) { + OID type = (OID) c.next(); + p.setVisibleDefault((Component) m_create.get(type), false); + } - private class ApplicationCreateListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); + Iterator e = m_edit.keySet().iterator(); + while (e.hasNext()) { + OID type = (OID) e.next(); + p.setVisibleDefault((Component) m_edit.get(type), false); + } + } - ApplicationType type = m_newApp.getApplicationType(state); + private class ApplicationCreateListener implements ActionListener { - Component editor = (Component) m_create.get(type.getOID()); - editor.setVisible(state, true); + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); - m_newApp.setVisible(state, false); - m_appDetails.setVisible(state, false); - m_editLink.setVisible(state, false); - } - } + ApplicationType type = m_newApp.getApplicationType(state); - private class ApplicationEditListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); + Component editor = (Component) m_create.get(type.getOID()); + editor.setVisible(state, true); - Application app = (Application) m_app.getSelectedObject(state); + m_newApp.setVisible(state, false); + m_appDetails.setVisible(state, false); + m_editLink.setVisible(state, false); + } - Component editor = (Component) m_edit.get(app.getResourceType() - .getOID()); - editor.setVisible(state, true); + } - m_newApp.setVisible(state, false); - m_appDetails.setVisible(state, false); - m_editLink.setVisible(state, false); - } - } + private class ApplicationEditListener implements ActionListener { - private class ApplicationCompleteCreateListener implements ActionListener { - private Component m_src; + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); - public ApplicationCompleteCreateListener(Component src) { - m_src = src; - } + Application app = (Application) m_app.getSelectedObject(state); - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); + Component editor = (Component) m_edit.get(app.getResourceType() + .getOID()); + editor.setVisible(state, true); - ResourceConfigComponent c = (ResourceConfigComponent) m_src; - Resource newResource = c.createResource(state); - c.setVisible(state, false); + m_newApp.setVisible(state, false); + m_appDetails.setVisible(state, false); + m_editLink.setVisible(state, false); + } - // Copy categorization from nav app instance - Resource parentResource = newResource.getParentResource(); - Category.setRootForObject(newResource, Category - .getRootForObject(parentResource)); + } - m_newApp.setVisible(state, true); - m_appDetails.setVisible(state, true); - m_editLink.setVisible(state, true); + private class ApplicationCompleteCreateListener implements ActionListener { - m_app.clearSelection(state); - } - } + private Component m_src; - private class ApplicationCompleteEditListener implements ActionListener { - private Component m_src; + public ApplicationCompleteCreateListener(Component src) { + m_src = src; + } - public ApplicationCompleteEditListener(Component src) { - m_src = src; - } + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); + ResourceConfigComponent c = (ResourceConfigComponent) m_src; + Resource newResource = c.createResource(state); + if (newResource != null) { - ResourceConfigComponent c = (ResourceConfigComponent) m_src; - c.modifyResource(state); - c.setVisible(state, false); - m_newApp.setVisible(state, true); - m_appDetails.setVisible(state, true); - m_editLink.setVisible(state, true); + c.setVisible(state, false); - m_app.clearSelection(state); - } - } + // Copy categorization from nav app instance + Resource parentResource = newResource.getParentResource(); + Category.setRootForObject(newResource, Category + .getRootForObject(parentResource)); + } + m_newApp.setVisible(state, true); + m_appDetails.setVisible(state, true); + m_editLink.setVisible(state, true); + + m_app.clearSelection(state); + } + + } + + private class ApplicationCompleteEditListener implements ActionListener { + + private Component m_src; + + public ApplicationCompleteEditListener(Component src) { + m_src = src; + } + + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + + ResourceConfigComponent c = (ResourceConfigComponent) m_src; + c.modifyResource(state); + c.setVisible(state, false); + + m_newApp.setVisible(state, true); + m_appDetails.setVisible(state, true); + m_editLink.setVisible(state, true); + + m_app.clearSelection(state); + } + + } } Deleted: trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java =================================================================== --- trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java 2012-12-18 22:40:23 UTC (rev 2424) +++ trunk/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java 2012-12-18 22:42:22 UTC (rev 2425) @@ -1,66 +0,0 @@ -/* - * 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.portalworkspace.ui.homepage; - -import com.arsdigita.navigation.Navigation; -import com.arsdigita.navigation.NavigationModel; - -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.DataCollection; - -import com.arsdigita.domain.DomainObjectFactory; - -import com.arsdigita.categorization.Category; -import com.arsdigita.util.Assert; -import com.arsdigita.bebop.PageState; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.ui.WorkspaceSelectionModel; - -/** - * - * - */ -public class CategoryPortalSelectionModel extends WorkspaceSelectionModel { - - /** - * - * @param state - * @return - */ - protected Workspace getDefaultWorkspace(PageState state) { - NavigationModel model = Navigation.getConfig().getDefaultModel(); - Category cat = model.getCategory(); - Assert.exists(cat); - - DataCollection workspaces - = SessionManager.getSession().retrieve( - Workspace.BASE_DATA_OBJECT_TYPE); - workspaces.addEqualsFilter("categories.id", cat.getID()); - - if (workspaces.next()) { - Workspace wk = (Workspace)DomainObjectFactory - .newInstance(workspaces.getDataObject()); - workspaces.close(); - return wk; - } - - return null; - } -} |