diff --git a/ccm-bundle/bundles/demo/cfg/integration.properties b/ccm-bundle/bundles/demo/cfg/integration.properties index bf42a9727..ee60cbf07 100644 --- a/ccm-bundle/bundles/demo/cfg/integration.properties +++ b/ccm-bundle/bundles/demo/cfg/integration.properties @@ -1,6 +1,6 @@ # Libre CMS demo bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default @@ -39,7 +39,7 @@ waf.xml.activate_full_date_formatter=true # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp @@ -105,7 +105,7 @@ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/g com.arsdigita.navigation.templates_file=bundle/navigation/gen-templates.txt -# ccm-ldn-search application +# ccm-search application com.arsdigita.london.search.show_sponsored_links=true diff --git a/ccm-bundle/bundles/demo/cfg/project.xml b/ccm-bundle/bundles/demo/cfg/project.xml index 0c60f93aa..f23df6d05 100644 --- a/ccm-bundle/bundles/demo/cfg/project.xml +++ b/ccm-bundle/bundles/demo/cfg/project.xml @@ -1,6 +1,7 @@ - + - + @@ -43,12 +44,14 @@ + + + - @@ -85,22 +88,13 @@ --> - - - - - - - - + - + + + + - @@ -109,20 +111,21 @@ --> - + + - - + shortcuts-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts - + subsite-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-subsite + /templates/ccm-subsite - + @@ -382,18 +382,18 @@ - + shortcuts-files - /ccm-ldn-shortcuts/files/* + /ccm-shortcuts/files/* - + subsite-files - /ccm-ldn-subsite/files/* + /ccm-subsite/files/* - + diff --git a/ccm-ldn-aplaws/bundles/demo/cfg/project.xml b/ccm-ldn-aplaws/bundles/demo/cfg/project.xml index 05109344c..2fa8c7e08 100755 --- a/ccm-ldn-aplaws/bundles/demo/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/demo/cfg/project.xml @@ -69,7 +69,6 @@ - @@ -81,6 +80,8 @@ + + diff --git a/ccm-ldn-aplaws/bundles/demo/cfg/web.xml b/ccm-ldn-aplaws/bundles/demo/cfg/web.xml index 0b177ca37..977c09f54 100755 --- a/ccm-ldn-aplaws/bundles/demo/cfg/web.xml +++ b/ccm-ldn-aplaws/bundles/demo/cfg/web.xml @@ -17,12 +17,12 @@ shortcuts - com.arsdigita.london.shortcuts.ShortcutFilter + com.arsdigita.shortcuts.ShortcutFilter subsite - com.arsdigita.london.subsite.SubsiteFilter + com.arsdigita.subsite.SubsiteFilter @@ -249,26 +249,26 @@ - + shortcuts-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts - + subsite-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-subsite + /templates/ccm-subsite - + @@ -360,18 +360,18 @@ - + shortcuts-files - /ccm-ldn-shortcuts/files/* + /ccm-shortcuts/files/* - + subsite-files - /ccm-ldn-subsite/files/* + /ccm-subsite/files/* - + diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml index 6331a2ef6..58ae4512b 100755 --- a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml @@ -80,13 +80,14 @@ - + + - + shortcuts-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-shortcuts + /templates/ccm-shortcuts - + subsite-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-subsite + /templates/ccm-subsite - + @@ -382,18 +382,18 @@ - + shortcuts-files - /ccm-ldn-shortcuts/files/* + /ccm-shortcuts/files/* - + subsite-files - /ccm-ldn-subsite/files/* + /ccm-subsite/files/* - + diff --git a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java b/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java deleted file mode 100755 index 93e06af4a..000000000 --- a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/CategoryPortalSelectionModel.java +++ /dev/null @@ -1,57 +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.aplaws.ui; - -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 { - - 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; - } -} diff --git a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/README.txt b/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/README.txt deleted file mode 100644 index b288a2697..000000000 --- a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/README.txt +++ /dev/null @@ -1,18 +0,0 @@ -jsp files replace files provided by ccm-ldn-portal. - -goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL - -Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins -to get the 'customize area' links. -see r1082 - -Actually: -In the default configuration BaseDispatcher searches in the following order: -1. /templates/ccm-ldn-portal/portal/index.jsp -2. /templates/ccm-ldn-portal/portal/index.html -3. /templates/ccm-ldn-portal/index.jsp -4. /templates/ccm-ldn-portal/index.html (probably, not tested) - -So, currently the first try is successfull and -aplaws/ui/HomepageWorkspaceSelectionModel is always used via index.jsp - diff --git a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/index.jsp b/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/index.jsp deleted file mode 100755 index be25d901d..000000000 --- a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/index.jsp +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - DispatcherHelper.cacheForWorld(response,900); - - - - - - - - - - HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel(); - - ((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0)); - ((HomepageWorkspace)left).setReadOnly(true); - ((HomepageWorkspace)left).setName("left"); - ((HomepageWorkspace)left).addWidgets(); - ((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1)); - ((HomepageWorkspace)middle).setReadOnly(true); - ((HomepageWorkspace)middle).setName("middle"); - ((HomepageWorkspace)middle).addWidgets(); - ((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2)); - ((HomepageWorkspace)right).setReadOnly(true); - ((HomepageWorkspace)right).setName("right"); - ((HomepageWorkspace)right).addWidgets(); - - - - - - diff --git a/ccm-portalworkspace-homepage/application.xml b/ccm-portalworkspace-homepage/application.xml new file mode 100644 index 000000000..2ac1cbb97 --- /dev/null +++ b/ccm-portalworkspace-homepage/application.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + Extension for ccm-portalworkspace to provide a custom frontpage for a site. + It uses a popular 3 column design (hardcoded unmutable) using 3 panes + which may further be divided into columns. + + diff --git a/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.config b/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.config new file mode 100644 index 000000000..3c932a6d0 --- /dev/null +++ b/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.load b/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.load new file mode 100644 index 000000000..da46e8044 --- /dev/null +++ b/ccm-portalworkspace-homepage/src/ccm-portalworkspace-homepage.load @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java similarity index 94% rename from ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java rename to ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java index c88e4f8a5..9be661c3b 100644 --- a/ccm-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java +++ b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/CategoryPortalSelectionModel.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.bundle.ui; +package com.arsdigita.portalworkspace.ui.homepage; import com.arsdigita.navigation.Navigation; import com.arsdigita.navigation.NavigationModel; @@ -33,8 +33,17 @@ 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(); diff --git a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepagePortalSelectionModel.java old mode 100755 new mode 100644 similarity index 94% rename from ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java rename to ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepagePortalSelectionModel.java index 65c0b2dab..d41a98c84 --- a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepagePortalSelectionModel.java +++ b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepagePortalSelectionModel.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.portalworkspace.ui.homepage; import com.arsdigita.bebop.AbstractSingleSelectionModel; import com.arsdigita.portalworkspace.ui.PortalSelectionModel; @@ -24,6 +24,10 @@ import com.arsdigita.domain.DomainObject; import org.apache.log4j.Logger; +/** + * Used via jsp! See ~/templates/ccm-portalworkspace/portal/index.jsp + * Service class for HomepageWorkspace + */ public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel implements PortalSelectionModel { diff --git a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspace.java old mode 100755 new mode 100644 similarity index 99% rename from ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java rename to ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspace.java index ca27b195e..953391c24 --- a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspace.java +++ b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspace.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.portalworkspace.ui.homepage; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.ActionLink; diff --git a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspaceSelectionModel.java old mode 100755 new mode 100644 similarity index 93% rename from ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java rename to ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspaceSelectionModel.java index 723550239..b8051e619 --- a/ccm-ldn-aplaws/src/com/arsdigita/aplaws/ui/HomepageWorkspaceSelectionModel.java +++ b/ccm-portalworkspace-homepage/src/com/arsdigita/portalworkspace/ui/homepage/HomepageWorkspaceSelectionModel.java @@ -13,7 +13,7 @@ * */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.portalworkspace.ui.homepage; import com.arsdigita.bebop.RequestLocal; @@ -41,7 +41,7 @@ import com.arsdigita.domain.DataObjectNotFoundException; import org.apache.log4j.Logger; -/** +/** * * */ @@ -75,10 +75,11 @@ public class HomepageWorkspaceSelectionModel { right, party); // Always ensure admin gets global portal - // don't use custom portals if asked not to - if (m_custom.get(state) == null || - PermissionService.checkPermission(admin) || - !Workspace.getConfig().getCreateUserWorkspaces()) { + // don't use custom portals if asked not to + if (m_custom.get(state) == null + || PermissionService.checkPermission(admin) + || !Workspace.getConfig() + .getCreateUserWorkspaces()) { s_log.debug("Returning global portal"); return (WorkspacePage)m_right.get(state); } else { @@ -102,9 +103,8 @@ public class HomepageWorkspaceSelectionModel { // When customizing right column, may need to clone // for a personal portal - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { + // don't use custom portals if asked not to + if (column == 2 && Workspace.getConfig().getCreateUserWorkspaces()) { Workspace global = getTopWorkspace(); WorkspacePage right = (WorkspacePage)m_right.get(state); @@ -167,9 +167,8 @@ public class HomepageWorkspaceSelectionModel { WorkspacePage clear = null; - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { + // don't use custom portals if asked not to + if (column == 2 && Workspace.getConfig().getCreateUserWorkspaces()) { // If we find a custom workspace, then delete it, // otherwise just clear the portlets. Workspace global = getTopWorkspace(); diff --git a/ccm-portalworkspace-homepage/src/empty.pdl.mf b/ccm-portalworkspace-homepage/src/empty.pdl.mf new file mode 100644 index 000000000..e69de29bb diff --git a/ccm-bundle/web/templates/ccm-portalworkspace/portal/README.txt b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/README.txt similarity index 54% rename from ccm-bundle/web/templates/ccm-portalworkspace/portal/README.txt rename to ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/README.txt index 8db7e6319..7fb68e644 100644 --- a/ccm-bundle/web/templates/ccm-portalworkspace/portal/README.txt +++ b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/README.txt @@ -1,6 +1,7 @@ -jsp files replace files provided by ccm-ldn-portal. +jsp files to provide a custom frontpage for a site based on ccm-portalworkspace. goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL -Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins to get the 'customize area' links. +Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins +to get the 'customize area' links. see r1082 diff --git a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/custom.jsp b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/custom.jsp old mode 100755 new mode 100644 similarity index 67% rename from ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/custom.jsp rename to ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/custom.jsp index fef11cc49..7d5a8f89a --- a/ccm-ldn-aplaws/web/templates/ccm-portalworkspace/portal/custom.jsp +++ b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/custom.jsp @@ -5,17 +5,20 @@ + com.arsdigita.portalworkspace.ui.homepage.*"/> DispatcherHelper.cacheDisable(response); - + - - - + + + HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel(); diff --git a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/index.jsp b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/index.jsp similarity index 69% rename from ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/index.jsp rename to ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/index.jsp index 2000fb99d..b0ff8f57e 100644 --- a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/index.jsp +++ b/ccm-portalworkspace-homepage/web/templates/ccm-portalworkspace/portal/index.jsp @@ -5,17 +5,20 @@ + com.arsdigita.portalworkspace.ui.homepage.*"/> DispatcherHelper.cacheForWorld(response,900); - + - - - + + + HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel(); diff --git a/ccm-sci-bundle/bundles/demo/cfg/integration.properties b/ccm-sci-bundle/bundles/demo/cfg/integration.properties index d76f5b0ba..3a2006b84 100644 --- a/ccm-sci-bundle/bundles/demo/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/demo/cfg/integration.properties @@ -1,6 +1,6 @@ # Scientific CMS demo bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default @@ -39,14 +39,14 @@ waf.xml.activate_full_date_formatter=true # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp 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 does work out of the box +; Xinha is default and should 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 @@ -117,7 +117,8 @@ themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl # ccm-sci-bundle (Loader only) #com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml - +#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/ # ============================================================================================= # runtime specific configurations diff --git a/ccm-sci-bundle/bundles/demo/cfg/project.xml b/ccm-sci-bundle/bundles/demo/cfg/project.xml index 1851e7cf2..d5e593447 100644 --- a/ccm-sci-bundle/bundles/demo/cfg/project.xml +++ b/ccm-sci-bundle/bundles/demo/cfg/project.xml @@ -1,6 +1,7 @@ - + + + + + + @@ -38,12 +44,14 @@ + + + - diff --git a/ccm-sci-bundle/bundles/devel/cfg/integration.properties b/ccm-sci-bundle/bundles/devel/cfg/integration.properties index aefa82e8e..e7642cf34 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/devel/cfg/integration.properties @@ -1,6 +1,6 @@ # Scientific CMS devel bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default @@ -39,7 +39,7 @@ waf.xml.activate_full_date_formatter=true # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp diff --git a/ccm-sci-bundle/bundles/devel/cfg/project.xml b/ccm-sci-bundle/bundles/devel/cfg/project.xml index fbcec2d81..50e32c079 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/project.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/project.xml @@ -44,13 +44,14 @@ + + - diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java deleted file mode 100644 index c88e4f8a5..000000000 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/CategoryPortalSelectionModel.java +++ /dev/null @@ -1,57 +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.bundle.ui; - -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 { - - 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; - } -} diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java deleted file mode 100644 index dabfdad5d..000000000 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepagePortalSelectionModel.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita Public - * License (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of - * the License at http://www.arsdigita.com/ADPL.txt - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - */ - -package com.arsdigita.bundle.ui; - -import com.arsdigita.bebop.AbstractSingleSelectionModel; -import com.arsdigita.portalworkspace.ui.PortalSelectionModel; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.domain.DomainObject; - -import org.apache.log4j.Logger; - -public class HomepagePortalSelectionModel extends AbstractSingleSelectionModel - implements PortalSelectionModel { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepagePortalSelectionModel.class); - - private HomepageWorkspaceSelectionModel m_workspace; - private int m_column; - - public HomepagePortalSelectionModel(HomepageWorkspaceSelectionModel workspace, - int column) { - m_workspace = workspace; - m_column = column; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspaceSelectionModel " + " [" + - "Workspace: " + m_workspace + "," + - "Columns: " + column + "]"); - } - - } - - public void onCustomize(PageState state) { - m_workspace.onCustomize(state, m_column); - } - - public void onReset(PageState state) { - m_workspace.onReset(state, m_column); - } - - public HomepageWorkspaceSelectionModel getWorkspaceModel() { - return m_workspace; - } - - public Object getSelectedKey(PageState state) { - return getSelectedPortal(state).getID(); - } - - public void setSelectedKey(PageState state, - Object key) { - throw new UnsupportedOperationException("cannot set key"); - } - - public void setSelectedObject(PageState state, - DomainObject key) { - throw new UnsupportedOperationException("cannot set object"); - } - - public ParameterModel getStateParameter() { - throw new UnsupportedOperationException("not state param"); - } - - - public DomainObject getSelectedObject(PageState state) { - return getSelectedPortal(state); - } - - public WorkspacePage getSelectedPortal(PageState state) { - return m_workspace.getPortal(state, m_column); - } -} diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java deleted file mode 100644 index d6d922b3b..000000000 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspace.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita Public - * License (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of - * the License at http://www.arsdigita.com/ADPL.txt - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - */ - -package com.arsdigita.bundle.ui; - -import com.arsdigita.bebop.SimpleContainer; -import com.arsdigita.bebop.ActionLink; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.event.ActionEvent; -import com.arsdigita.bebop.event.ActionListener; -import com.arsdigita.portalworkspace.ui.PersistentPortal; -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.bebop.PageState; -import com.arsdigita.xml.Element; -import com.arsdigita.portalworkspace.ui.PortalConstants; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.Kernel; - -import org.apache.log4j.Logger; - - -/** - * - * - */ -public class HomepageWorkspace extends SimpleContainer { - - /** Private logger instance for debugging */ - private static Logger s_log = Logger.getLogger( - HomepageWorkspace.class); - - private HomepagePortalSelectionModel m_model; - private ActionLink m_reset; - private ActionLink m_browse; - private ActionLink m_edit; - private PersistentPortal m_browser; - private PersistentPortal m_editor; - private boolean m_customizable; - private boolean m_readOnly; - private String m_name; - - public HomepageWorkspace() { - super("portal:homepageWorkspace", PortalConstants.PORTAL_XML_NS); - m_customizable = false; - - if (s_log.isDebugEnabled()) { - s_log.debug("Constructor HomepageWorkspace finished. " ); - } - - } - - public void setModel(HomepagePortalSelectionModel model) { - m_model = model; - - if (s_log.isDebugEnabled()) { - s_log.debug("setModel: " + m_model ); - } - } - - public void setCustomizable(boolean customizable) { - m_customizable = customizable; - } - - public void setReadOnly(boolean readOnly) { - m_readOnly = readOnly; - } - - public void setName(String name) { - m_name = name; - } - - public void addWidgets() { - m_edit = new ActionLink("customize"); - m_browse = new ActionLink("browse"); - m_reset = new ActionLink("reset"); - m_reset.setConfirmation("Are you sure you wish to reset this column? " + - "This will permanently remove all portlets."); - - m_browser = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_DISPLAY); - m_editor = new PersistentPortal(m_model, - m_name, - PortalConstants.MODE_EDITOR); - - m_edit.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, false); - - m_model.onCustomize(state); - } - }); - m_browse.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - } - }); - m_reset.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - setDisplayMode(state, true); - - m_model.onReset(state); - } - }); - - add(m_edit); - add(m_browse); - add(m_reset); - add(m_editor); - add(m_browser); - } - - public void setDisplayMode(PageState state, - boolean browse) { - if (m_readOnly) { - return; - } - m_browse.setVisible(state, !browse); - m_reset.setVisible(state, !browse); - m_edit.setVisible(state, browse); - m_browser.setVisible(state, browse); - m_editor.setVisible(state, !browse); - } - - public void register(Page page) { - super.register(page); - - page.setVisibleDefault(m_browse, false); - page.setVisibleDefault(m_reset, false); - page.setVisibleDefault(m_edit, !m_readOnly); - page.setVisibleDefault(m_browser, true); - page.setVisibleDefault(m_editor, false); - } - - public void generateXML(PageState state, - Element parent) { - Party party = Kernel.getContext().getParty(); - Workspace global = m_model.getWorkspaceModel().getGlobalWorkspace(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - global, - party); - boolean hasAdmin = PermissionService.checkPermission(admin); - boolean userWorkspaces = Workspace.getConfig().getCreateUserWorkspaces(); - - if (party == null || m_readOnly || - (!hasAdmin && !m_customizable) || (!hasAdmin && !userWorkspaces)) { - m_reset.setVisible(state, false); - m_browse.setVisible(state, false); - m_edit.setVisible(state, false); - } - - super.generateXML(state, parent); - } - -} diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java deleted file mode 100644 index daf73081f..000000000 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/HomepageWorkspaceSelectionModel.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. - * - * The contents of this file are subject to the ArsDigita Public - * License (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of - * the License at http://www.arsdigita.com/ADPL.txt - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - */ - -package com.arsdigita.bundle.ui; - - -import com.arsdigita.bebop.RequestLocal; -import com.arsdigita.bebop.PageState; - - -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; - -import com.arsdigita.portalworkspace.Workspace; -import com.arsdigita.portalworkspace.WorkspacePage; -import com.arsdigita.portalworkspace.WorkspacePageCollection; - -import com.arsdigita.subsite.Subsite; - -import com.arsdigita.util.Assert; -import com.arsdigita.util.UncheckedWrapperException; - -import com.arsdigita.domain.DataObjectNotFoundException; - -import org.apache.log4j.Logger; - - -public class HomepageWorkspaceSelectionModel { - private RequestLocal m_loaded = new RequestLocal(); - private RequestLocal m_global = new RequestLocal(); - private RequestLocal m_personal = new RequestLocal(); - private RequestLocal m_left = new RequestLocal(); - private RequestLocal m_middle = new RequestLocal(); - private RequestLocal m_right = new RequestLocal(); - private RequestLocal m_custom = new RequestLocal(); - - private static Logger s_log = Logger.getLogger - (HomepageWorkspaceSelectionModel.class.getName()); - - public WorkspacePage getPortal(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - if (column == 0) { // Always global portal - return (WorkspacePage)m_left.get(state); - } else if (column == 1) { // Always global portal - return (WorkspacePage)m_middle.get(state); - } else if (column == 2) { // Personal portal, fallback on global - Party party = (Party)Kernel.getContext().getParty(); - WorkspacePage right = (WorkspacePage)m_right.get(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - right, - party); - // Always ensure admin gets global portal - // don't use custom portals if asked not to - if (m_custom.get(state) == null || - PermissionService.checkPermission(admin) || - !Workspace.getConfig().getCreateUserWorkspaces()) { - s_log.debug("Returning global portal"); - return (WorkspacePage)m_right.get(state); - } else { - s_log.debug("Returning personal portal"); - return (WorkspacePage)m_custom.get(state); - } - } - - throw new UncheckedWrapperException("column out of range (0..2)"); - } - - public void onCustomize(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - Party party = (Party)Kernel.getContext().getParty(); - - Assert.exists(party, Party.class); - - // When customizing right column, may need to clone - // for a personal portal - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { - Workspace global = getTopWorkspace(); - - WorkspacePage right = (WorkspacePage)m_right.get(state); - PermissionDescriptor admin = - new PermissionDescriptor(PrivilegeDescriptor.ADMIN, - right, - party); - if (PermissionService.checkPermission(admin)) { - s_log.debug("Party has admin on global portal"); - return; - } - - if (m_custom.get(state) != null) { - s_log.debug("Party has custom portal already"); - return; - } - - s_log.debug("Looking for custom column 2"); - - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - s_log.debug("Found exsting personal workspce"); - } catch (DataObjectNotFoundException ex) { - s_log.debug("Created new personal workspace"); - custom = Workspace.createWorkspace( - "personal-" + party.getID(), - "Personal Workspace for " + party.getDisplayName(), - global, - (User)party - ); - } - s_log.debug("Looking for portal"); - m_personal.set(state, custom); - WorkspacePageCollection portals = custom.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - WorkspacePage portal; - if (portals.next()) { - s_log.debug("Found portal"); - portal = portals.getPage(); - portals.close(); - } else { - s_log.debug("Create portal"); - portal = custom.addPage("Custom", "Custom page"); - } - m_custom.set(state, portal); - } - } - - - public void onReset(PageState state, - int column) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - Party party = Kernel.getContext().getParty(); - - Assert.exists(party, Party.class); - - WorkspacePage clear = null; - - // don't use custom portals if asked not to - if (column == 2 && - Workspace.getConfig().getCreateUserWorkspaces()) { - // If we find a custom workspace, then delete it, - // otherwise just clear the portlets. - Workspace global = getTopWorkspace(); - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - Assert.isTrue(custom.getParty() != null && - custom.getParty().equals(party), - "party is not null and not admin"); - s_log.debug("Found exsting personal workspce"); - custom.delete(); - m_custom.set(state, null); - } catch (DataObjectNotFoundException ex) { - clear = (WorkspacePage)m_right.get(state); - } - } else if (column == 1) { - clear = (WorkspacePage)m_middle.get(state); - } else if (column == 0) { - clear = (WorkspacePage)m_left.get(state); - } - - if (clear != null) { - clear.clearPortlets(); - } - } - - - public Workspace getGlobalWorkspace(PageState state) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - return (Workspace)m_global.get(state); - } - - public Workspace getPersonalWorkspace(PageState state) { - if (!Boolean.TRUE.equals(m_loaded.get(state))) { - loadWorkspacePages(state); - } - - return (Workspace)m_personal.get(state); - } - - private void loadWorkspacePages(PageState state) { - Workspace global = getTopWorkspace(); - m_global.set(state, global); - - WorkspacePage left = null; - WorkspacePage middle = null; - WorkspacePage right = null; - - WorkspacePageCollection portals = global.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - while (portals.next()) { - WorkspacePage portal = portals.getPage(); - - if (portal.getSortKey() == 0) { - left = portal; - } else if (portal.getSortKey() == 1) { - middle = portal; - } else if (portal.getSortKey() == 2) { - right = portal; - } - } - - if (left == null) { - left = global.addPage("Left", "Left hand page"); - } - if (middle == null) { - middle = global.addPage("Middle", "Middle page"); - } - if (right == null) { - right = global.addPage("Right", "Right hand page"); - } - m_left.set(state, left); - m_middle.set(state, middle); - m_right.set(state, right); - - - Party party = (Party)Kernel.getContext().getParty(); - m_custom.set(state, null); - if (party != null) { - Workspace custom = null; - try { - custom = global.retrieveSubworkspaceForParty(party); - } catch (DataObjectNotFoundException ex) { - // nada - } - if (custom != null) { - portals = custom.getPages(); - portals.addOrder(WorkspacePage.SORT_KEY); - if (portals.next()) { - WorkspacePage portal = portals.getPage(); - m_custom.set(state, portal); - } - portals.close(); - } - s_log.debug("Is there a custom portal ?" + custom + - " - " + m_custom.get(state)); - m_personal.set(state, custom); - } - - m_loaded.set(state, Boolean.TRUE); - } - - protected Workspace getTopWorkspace() { - if (Subsite.getContext().hasSite()) { - if (s_log.isDebugEnabled()) { - s_log.debug("Return a subsite front page"); - } - return (Workspace)Subsite.getContext().getSite().getFrontPage(); - } else { - if (s_log.isDebugEnabled()) { - s_log.debug("Return the main front page"); - } - return (Workspace)Kernel.getContext().getResource(); - } - } -} diff --git a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/README.txt b/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/README.txt deleted file mode 100644 index 8db7e6319..000000000 --- a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -jsp files replace files provided by ccm-ldn-portal. - -goal: Make the portal homepage read-only and cached for 15min. EXPERIMENTAL - -Dynamic no-cache version is available at /ccm/portal/custom.jsp for admins to get the 'customize area' links. -see r1082 diff --git a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/custom.jsp b/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/custom.jsp deleted file mode 100644 index fef11cc49..000000000 --- a/ccm-sci-bundle/web/templates/ccm-portalworkspace/portal/custom.jsp +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - DispatcherHelper.cacheDisable(response); - - - - - - - - - -HomepageWorkspaceSelectionModel workspace = new HomepageWorkspaceSelectionModel(); -((HomepageWorkspace)left).setModel(new HomepagePortalSelectionModel(workspace, 0)); -((HomepageWorkspace)left).setName("left"); -((HomepageWorkspace)left).addWidgets(); -((HomepageWorkspace)middle).setModel(new HomepagePortalSelectionModel(workspace, 1)); -((HomepageWorkspace)middle).setName("middle"); -((HomepageWorkspace)middle).addWidgets(); -((HomepageWorkspace)right).setModel(new HomepagePortalSelectionModel(workspace, 2)); -((HomepageWorkspace)right).setCustomizable(true); -((HomepageWorkspace)right).setName("right"); -((HomepageWorkspace)right).addWidgets(); - - - - - -