You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(22) |
Feb
(68) |
Mar
(185) |
Apr
(11) |
May
(21) |
Jun
(23) |
Jul
(46) |
Aug
(69) |
Sep
(211) |
Oct
(26) |
Nov
(51) |
Dec
(52) |
2006 |
Jan
(13) |
Feb
(13) |
Mar
(8) |
Apr
(21) |
May
(17) |
Jun
(100) |
Jul
(34) |
Aug
(23) |
Sep
(26) |
Oct
(16) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(66) |
Oct
(10) |
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(31) |
Aug
(8) |
Sep
(11) |
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
(13) |
Feb
(2) |
Mar
(9) |
Apr
(6) |
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(120) |
2013 |
Jan
(6) |
Feb
(35) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Author: pboy Date: 2012-05-01 14:21:42 +0000 (Tue, 01 May 2012) New Revision: 2307 Added: trunk/ccm-bundle/bundles/demo/res/bundle/navigation/gen-templates.txt trunk/ccm-core/src/com/arsdigita/categorization/ui/ApplicationCategoryPicker.java trunk/ccm-core/src/com/arsdigita/util/cmd/Program.java trunk/ccm-core/src/com/arsdigita/util/cmd/ProgramErrorReport.java trunk/ccm-faq/web/WEB-INF/ trunk/ccm-faq/web/WEB-INF/web.ccm-faq.xml trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ApplyTemplates.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/Program.java.nolongerInUse trunk/ccm-ldn-util/src/com/arsdigita/london/util/ProgramErrorReport.java.nolongerInUse trunk/ccm-navigation/src/com/arsdigita/navigation/tools/NavigationCreator.java trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateTool.java trunk/ccm-webpage/src/com/arsdigita/cms/webpage/tools/ trunk/ccm-webpage/src/com/arsdigita/cms/webpage/tools/UrlUtil.java Removed: trunk/ccm-bundle/bundles/demo/res/bundle/navigation/sci-templates.txt trunk/ccm-core/src/com/arsdigita/packaging/Program.java trunk/ccm-core/src/com/arsdigita/packaging/ProgramErrorReport.java trunk/ccm-core/src/com/arsdigita/templating/ApplyTemplates.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/Program.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/ProgramErrorReport.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/UrlUtil.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/ui/ApplicationCategoryPicker.java trunk/ccm-navigation/src/com/arsdigita/navigation/AddNavigation.java trunk/ccm-navigation/src/com/arsdigita/navigation/TemplateTool.java Modified: trunk/ccm-bundle/bundles/devel/res/bundle/navigation/gen-templates.txt trunk/ccm-cms/src/com/arsdigita/cms/ContentPage.java trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitContactsTab.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitSubordinateTab.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java trunk/ccm-cms/src/com/arsdigita/cms/upgrade/CreateGenericContentTypes.java trunk/ccm-cms/src/com/arsdigita/cms/workflow/AddApprovePermission.java trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java trunk/ccm-core/src/com/arsdigita/packaging/Command.java trunk/ccm-core/src/com/arsdigita/packaging/MasterTool.java trunk/ccm-core/src/com/arsdigita/persistence/pdl/SQLRegressionGenerator.java trunk/ccm-core/src/com/arsdigita/web/CreateContainerGroup.java trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateContainerGroups.java trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateGroupsAndPortletType.java trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/src/com/arsdigita/aplaws/AutoCategorisation.java trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/CategoryExportTool.java trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/ItemExportTool.java trunk/ccm-ldn-importer/src/com/arsdigita/london/importer/cms/AssetImportTool.java trunk/ccm-ldn-importer/src/com/arsdigita/london/importer/cms/ItemImportTool.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/Reindexer.java trunk/ccm-ldn-terms/doc/esd/generate.pl trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/DefaultAncestorsFixer.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Importer.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/SetRoot.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/importer/skos/DomainImportTool.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/ACSObjectCategoryPicker.java trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/upgrade/Upgrade100to101.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/ConfigPrinter.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/Initializer.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/BulkDelete.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/BulkPublish.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/BulkUnpublish.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/MetadataPrinter.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/MoveFolder.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/ReloadAuthoringSteps.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/SiteMapList.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/db/ACSObjectInvariantCheck.java trunk/ccm-ldn-util/src/com/arsdigita/london/util/db/InvariantCheck.java trunk/ccm-navigation/src/com/arsdigita/navigation/tools/TemplateCreator.java trunk/ccm-navigation/src/com/arsdigita/navigation/ui/portlet/ObjectListPortletEditor.java trunk/ccm-navigation/src/com/arsdigita/navigation/upgrades/Upgrade141to142.java trunk/ccm-navigation/src/com/arsdigita/navigation/upgrades/Upgrade650to651.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/upgrade/CreateContainerGroups.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/upgrade/CreateFlashPortlet.java trunk/ccm-portalworkspace/src/com/arsdigita/portalworkspace/upgrade/CreateNavigationDirectoryPortlet.java trunk/ccm-subsite/src/ccm-subsite.load trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteConfig.java trunk/ccm-subsite/src/com/arsdigita/subsite/SubsiteConfig_parameter.properties trunk/ccm-webpage/application.xml trunk/ccm-webpage/src/com/arsdigita/cms/webpage/ui/WebpagePortlet.java Log: A rather large commit with various fixes, removing cross dependencies, various documentation enhancements. Added: trunk/ccm-bundle/bundles/demo/res/bundle/navigation/gen-templates.txt =================================================================== --- trunk/ccm-bundle/bundles/demo/res/bundle/navigation/gen-templates.txt (rev 0) +++ trunk/ccm-bundle/bundles/demo/res/bundle/navigation/gen-templates.txt 2012-05-01 14:21:42 UTC (rev 2307) @@ -0,0 +1,8 @@ +LibreCMS Default Items Page,Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/gen-default.jsp +LibreCMS Recent Items Page,List of items ordered with most recent first,/templates/ccm-navigation/navigation/gen-recent.jsp +LibreCMS A-Z Items,List of items paginated as A-Z,/templates/ccm-navigation/navigation/gen-atoz.jsp +LibreCMS Events Page,Events Page ordering events in decending order,/templates/ccm-navigation/navigation/gen-events.jsp +LibreCMS Portal Page,Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/gen-portal.jsp +LibreCMS Portal Welcome Page,Portal page meant as site welcome page,/templates/ccm-navigation/navigation/gen-portal-welcome.jsp +LibreCMS Navigation Welcome Page,Site welcome page created by navigation root term,/templates/ccm-navigation/navigation/gen-welcome.jsp +LibreCMS Specializing Items List,Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp \ No newline at end of file Property changes on: trunk/ccm-bundle/bundles/demo/res/bundle/navigation/gen-templates.txt ___________________________________________________________________ Added: svn:executable + Deleted: trunk/ccm-bundle/bundles/demo/res/bundle/navigation/sci-templates.txt =================================================================== --- trunk/ccm-bundle/bundles/demo/res/bundle/navigation/sci-templates.txt 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-bundle/bundles/demo/res/bundle/navigation/sci-templates.txt 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,9 +0,0 @@ -ScientificCMS Default Items Page,Sci Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/sci-default.jsp -ScientificCMS Recent Items Page,Sci List of items ordered with most recent first,/templates/ccm-navigation/navigation/sci-recent.jsp -ScientificCMS A-Z Items,Sci List of items paginated as A-Z,/templates/ccm-navigation/navigation/sci-atoz.jsp -ScientificCMS Events Page,Sci Events Page ordering events in ??? order,/templates/ccm-navigation/navigation/sci-events.jsp -ScientificCMS Portal Page,Sci Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/sci-portal.jsp -ScientificCMS Portal Welcome Page,Sci Portal page meant as site welcome page,/templates/ccm-navigation/navigation/sci-portal-welcome.jsp -ScientificCMS Navigation Welcome Page,Sci site welcome page created by navigation root term,/templates/ccm-navigation/navigation/sci-welcome.jsp -ScientificCMS Specializing Items List,Sci Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp -ScientificCMS Publications List,Sci publications listing page,/templates/ccm-navigation/navigation/SciPublicationList.jsp Modified: trunk/ccm-bundle/bundles/devel/res/bundle/navigation/gen-templates.txt =================================================================== --- trunk/ccm-bundle/bundles/devel/res/bundle/navigation/gen-templates.txt 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-bundle/bundles/devel/res/bundle/navigation/gen-templates.txt 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,8 +1,8 @@ -LibreCMS Default Items Page,Sci Default Navigation Index Page ordering items in ascending order,/templates/ccm-ldn-navigation/navigation/gen-default.jsp -LibreCMS Recent Items Page,Sci List of items ordered with most recent first,/templates/ccm-ldn-navigation/navigation/gen-recent.jsp -LibreCMS A-Z Items,Sci List of items paginated as A-Z,/templates/ccm-ldn-navigation/navigation/gen-atoz.jsp -LibreCMS Events Page,Sci Events Page ordering events in ??? order,/templates/ccm-ldn-navigation/navigation/gen-events.jsp -LibreCMS Portal Page,Sci Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-ldn-navigation/navigation/gen-portal.jsp -LibreCMS Portal Welcome Page,Sci Portal page meant as site welcome page,/templates/ccm-ldn-navigation/navigation/gen-portal-welcome.jsp -LibreCMS Navigation Welcome Page,Sci site welcome page created by navigation root term,/templates/ccm-ldn-navigation/navigation/gen-welcome.jsp -LibreCMS Specializing Items List,Sci Specialising List item page,/templates/ccm-ldn-navigation/navigation/SpecializingList.jsp +LibreCMS Default Items Page,Default Navigation Index Page ordering items in ascending order,/templates/ccm-navigation/navigation/gen-default.jsp +LibreCMS Recent Items Page,List of items ordered with most recent first,/templates/ccm-navigation/navigation/gen-recent.jsp +LibreCMS A-Z Items,List of items paginated as A-Z,/templates/ccm-navigation/navigation/gen-atoz.jsp +LibreCMS Events Page,Events Page ordering events in decending order,/templates/ccm-navigation/navigation/gen-events.jsp +LibreCMS Portal Page,Portal Page for embedding a portal page as navigation leaves page,/templates/ccm-navigation/navigation/gen-portal.jsp +LibreCMS Portal Welcome Page,Portal page meant as site welcome page,/templates/ccm-navigation/navigation/gen-portal-welcome.jsp +LibreCMS Navigation Welcome Page,Site welcome page created by navigation root term,/templates/ccm-navigation/navigation/gen-welcome.jsp +LibreCMS Specializing Items List,Specialising List item page,/templates/ccm-navigation/navigation/SpecializingList.jsp \ No newline at end of file Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentPage.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentPage.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentPage.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -49,7 +49,7 @@ private static final Logger s_log = Logger.getLogger(ContentPage.class); public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.ContentPage"; + "com.arsdigita.cms.ContentPage"; public static final String TITLE = "title"; public static final String SUMMARY = "summary"; @@ -58,9 +58,9 @@ protected static final String PAGES_IN_FOLDER = - "com.arsdigita.cms.pagesInFolder"; + "com.arsdigita.cms.pagesInFolder"; protected static final String PAGES_IN_CATEGORY = - "com.arsdigita.cms.pagesInFolderByCategory"; + "com.arsdigita.cms.pagesInFolderByCategory"; public static final String QUERY_PAGE = "page"; public static final String QUERY_TYPE = "type"; public static final String QUERY_ROOT_ID = "rootFolderID"; Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -112,50 +112,11 @@ ("ccm-cms.pdl.mf", new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); - // Step 1: - // Old type initializer "com.arsdigita.cms.installer.Initializer" - // Used to be the first initializer in old enterprise.init - // - // Replaced by new type initializer com.arsdigita.cms.installer.Initializer() - // Simple migration of the old code to the new initializer system with as - // less code change as possible. - // - // Invokes ContentCenterSetup (without any LegacyInitializer) - // performs mainly loader tasks and should be migrated to Loader. - // add(new com.arsdigita.cms.installer.Initializer()); - - // Step 2: - // Old type initializer "com.arsdigita.cms.installer.xml.ContentTypeInitializer" - // Completely moved into Loader - - // Step 4: - // Old type initializer "com.arsdigita.cms.installer.SectionInitializer" - // Invoking the Initializer rewritten to a separate enterprise.init in - // c.ad.cms.contentsection and modified in c.ad.cms.initializer - // Mainly loader tasks, to be moved into c.ad.cms.Loader - // 2010-08-16: Moved to Loader, works OK -// add(new LegacyInitializer("com/arsdigita/cms/contentsection/enterprise.init")); - - // Step 4a new - // Initializer for content section, needed when LegacyInitializer in step 4 - // has been moved to c.ad.Loader in order to register the application and - // optionally to install additional content sections. add(new com.arsdigita.cms.contentsection.Initializer()); - - // Used to be step 3 in old enterprise.init migrated to loader/new init. add(new com.arsdigita.cms.publishToFile.Initializer()); - // Used to be step 6 in old enterprise.init migrated to loader/new init. add(new com.arsdigita.cms.lifecycle.Initializer()); - // Used to be step 7 in old enterprise.init migrated to loader/new init. add(new com.arsdigita.cms.portlet.Initializer()); - - // Used to be step 5 in old enterprise.init - // Old type initializer "com.arsdigita.formbuilder.installer.Initializer" - // Used to initialize CMS forms using the forms in ccm-core - // Can be replaced in ccm after ccm-core is migrated to new initializer. - // add(new LegacyInitializer("com/arsdigita/cms/enterprise.init")); - s_log.debug("CMS.Initializer.(Constructor) completed"); } @@ -163,9 +124,6 @@ /** * Initializes domain-coupling machinery, usually consisting of * registering object instantiators and observers. - * - * This starts up the search threads according to the values in the - * properties file */ @Override public void init(DomainInitEvent e) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,6 +1,6 @@ package com.arsdigita.cms.contenttypes; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.util.jdbc.Connections; import java.math.BigDecimal; Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitContactsTab.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitContactsTab.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitContactsTab.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -11,7 +11,7 @@ /** * * @author Jens Pelzetter - * @version $Id: GenericOrgaUnitContactsTab.java 1186 2011-10-21 18:20:36Z jensp $ + * @version $Id: GenericOrgaUnitContactsTab.java 1614 2012-04-25 11:48:19Z jensp $ */ public class GenericOrgaUnitContactsTab implements GenericOrgaUnitTab { Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitSubordinateTab.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitSubordinateTab.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitSubordinateTab.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -11,7 +11,7 @@ /** * * @author Jens Pelzetter - * @version $Id: GenericOrgaUnitSubordinateTab.java 1188 2011-10-22 18:43:24Z jensp $ + * @version $Id: GenericOrgaUnitSubordinateTab.java 1614 2012-04-25 11:48:19Z jensp $ */ public abstract class GenericOrgaUnitSubordinateTab implements GenericOrgaUnitTab { Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitTab.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -8,7 +8,7 @@ * Interface for a tab rendered by {@link GenericOrgaUnitExtraXmlGenerator}. * * @author Jens Pelzetter - * @version $Id: GenericOrgaUnitTab.java 1363 2011-12-16 14:25:19Z jensp $ + * @version $Id: GenericOrgaUnitTab.java 1614 2012-04-25 11:48:19Z jensp $ */ public interface GenericOrgaUnitTab { Modified: trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/upgrade/AddNewStyleApplicationEntries.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -26,7 +26,7 @@ import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.Resource; import com.arsdigita.kernel.ResourceType; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; Modified: trunk/ccm-cms/src/com/arsdigita/cms/upgrade/CreateGenericContentTypes.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/upgrade/CreateGenericContentTypes.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/upgrade/CreateGenericContentTypes.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -30,7 +30,7 @@ import org.apache.commons.cli.CommandLine; import org.apache.log4j.Logger; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; Modified: trunk/ccm-cms/src/com/arsdigita/cms/workflow/AddApprovePermission.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/workflow/AddApprovePermission.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-cms/src/com/arsdigita/cms/workflow/AddApprovePermission.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -33,7 +33,7 @@ import com.arsdigita.kernel.permissions.PermissionDescriptor; import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.SessionManager; Added: trunk/ccm-core/src/com/arsdigita/categorization/ui/ApplicationCategoryPicker.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/ui/ApplicationCategoryPicker.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/categorization/ui/ApplicationCategoryPicker.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -0,0 +1,43 @@ +/* + * 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.categorization.ui; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.web.Web; + +/** + * Minimal implementation of abstract class ObjectCategoryPicker + * + */ +public class ApplicationCategoryPicker extends ObjectCategoryPicker { + + public ApplicationCategoryPicker(String name) { + super(name); + } + + protected ACSObject getObject(PageState state) { + return Web.getContext().getApplication(); + } + + protected String getContext(PageState state) { + return null; + } + +} Property changes on: trunk/ccm-core/src/com/arsdigita/categorization/ui/ApplicationCategoryPicker.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -22,7 +22,7 @@ import com.arsdigita.loader.CoreLoader; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; Modified: trunk/ccm-core/src/com/arsdigita/packaging/Command.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/Command.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/packaging/Command.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -20,6 +20,7 @@ import java.io.PrintStream; import java.io.PrintWriter; + import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; Modified: trunk/ccm-core/src/com/arsdigita/packaging/MasterTool.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/MasterTool.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/packaging/MasterTool.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -73,8 +73,8 @@ * * @param args the command line arguments */ + public static final void main(final String[] args) { - public static final void main(final String[] args) { final PrintStream out = System.out; final PrintStream err = System.err; @@ -125,6 +125,9 @@ } } + /** + * + */ private static final class Commands { private List m_commands = new ArrayList(); Deleted: trunk/ccm-core/src/com/arsdigita/packaging/Program.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/Program.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/packaging/Program.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. - * - * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html - * - * 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.packaging; - -import com.arsdigita.runtime.Startup; - -import org.apache.commons.cli.Options; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.OptionBuilder; -import org.apache.commons.cli.GnuParser; -import org.apache.commons.cli.ParseException; -import org.apache.commons.cli.CommandLine; - -import java.io.OutputStream; -import java.io.PrintWriter; - -/** - * <p> - * Provides base framework for writing command line - * programs that require the CCM context to be be - * initialized. It also integrates the Apache Commons - * CLI package for simple command line argument handling. - * </p> - * <p> - * As an example usage scenario for this class, - * consider a tool that prints out the current - * sitemap. This would be implemented as follows: - * </p> - * - * <pre> - *public class SiteMapList extends Program { - * - * public SiteMapList() { - * super("Site Map Listing" - * "1.0.0", - * ""); - * } - * - * protected void doRun(CommandLine cmdLine) { - * ApplicationCollection apps = - * Application.retrieveAllApplications(); - * apps.addOrder("primaryURL"); - * - * while (apps.next()) { - * Application app = apps.getApplication(); - * - * System.out.println(app.getPath() + " -> " + - * app.getApplicationType().getTitle()); - * - * if (isVerbose()) { - * System.out.println(" Description: " + - * app.getApplicationType().getDescription()); - * } - * if (isDebug()) { - * System.out.println(" Class: " + - * app.getClass()); - * } - * } - * } - * - * public static void main(String[] args) { - * new SiteMapList().run(args); - * } - *} - * </pre> - * - */ -public abstract class Program { - - private String m_name; - private String m_version; - private String m_usage; - private boolean m_verbose = false; - /** Whether to produce out marked by debug while running the CLI program.*/ - private boolean m_debug = false; - /** Whether to initialize the CCM system before running the CLI program. */ - private boolean m_startup = true; - /** True skips system.exit after processing finished so another program may - be invoked by a calling cammand script. Especially usefule for upgrade - script when a sql script has to be executed afer a jave class. */ - private boolean m_concatenate = false; - - private Options m_options; - - /** - * Creates a new program. The conventions for the - * usage parameter follow the GNU style guidelines. - * For example, if there are multiple source files - * and one destination, it would be "SOURCE... DEST". - * Standard WAF startup procedures will be performed - * before the doRun method is executed. - * @param name the program name - * @param version the version string - * @param usage for any non-option command line arguments - */ - public Program(String name, - String version, - String usage) { - this(name, version, usage, true, false); - } - - /** - * Creates a new program. The conventions for the - * usage parameter follow the GNU style guidelines. - * For example, if there are multiple source files - * and one destination, it would be "SOURCE... DEST" - * @param name the program name - * @param version the version string - * @param usage for any non-option command line arguments - * @param startup true to perform standard WAF startup - */ - public Program(String name, - String version, - String usage, - boolean startup) { - this(name, version, usage, startup, false); - } - - /** - * Creates a new program. The conventions for the - * usage parameter follow the GNU style guidelines. - * For example, if there are multiple source files - * and one destination, it would be "SOURCE... DEST" - * @param name the program name - * @param version the version string - * @param usage for any non-option command line arguments - * @param startup true to perform standard WAF startup - * @param concatenate false invokes System.exit when processing finished - */ - public Program(String name, - String version, - String usage, - boolean startup, - boolean concatenate) { - m_name = name; - m_version = version; - m_usage = usage; - m_startup = startup; - m_concatenate = concatenate; - m_options = new Options(); - - m_options.addOption - (OptionBuilder - .hasArg(false) - .withLongOpt("help") - .withDescription("Print this message") - .create('?')); - m_options.addOption - (OptionBuilder - .hasArg(false) - .withLongOpt("version") - .withDescription("Print version information") - .create('V')); - m_options.addOption - (OptionBuilder - .hasArg(false) - .withLongOpt("verbose") - .withDescription("Generate verbose output") - .create('v')); - m_options.addOption - (OptionBuilder - .hasArg(false) - .withLongOpt("debug") - .withDescription("Generate debugging output") - .create('D')); - } - - /** - * Retrieves the version for this program - * @return the version string - */ - public String getVersion() { - return m_version; - } - - /** - * Retrieves the program name - * @return the program name - */ - public String getName() { - return m_name; - } - - /** - * Retrieves the usage for non-option command - * line arguments - * @return the command usage - */ - public String getUsage() { - return m_usage; - } - - /** - * Retrieves the command line options configuration - * @return the command line options - */ - public Options getOptions() { - return m_options; - } - - /** - * Determines if the program should generate verbose - * output. Verbose output is information that is - * useful to end users of the program. - * @return true if verbose output is required - */ - public boolean isVerbose() { - return m_verbose; - } - - /** - * Determines if the program should generate debug - * output. Debug output is information that is useful - * to programmers or system administrators. - * @return true if debug output is required - */ - public boolean isDebug() { - return m_debug; - } - - /** - * Runs the program. First off all the command line - * arguments are first parsed. If the --help or - * --version arguments were specified then this - * information is output and execution stops. - * Otherwise, the CCM startup process is invoked - * and then finally the doRun method is run. - * @param args the command line arguments to parse - */ - public final void run(String[] args) { - CommandLine cmdLine = null; - try { - cmdLine = new GnuParser().parse(m_options, - args); - } catch (ParseException ex) { - help(System.err); - System.exit(1); - } - - if (cmdLine.hasOption("?")) { - help(System.out); - System.exit(0); - } else if (cmdLine.hasOption("V")) { - System.out.println(m_version); - System.exit(0); - } - - m_verbose = cmdLine.hasOption("v"); - m_debug = cmdLine.hasOption("D"); - - try { - if (m_startup) { - Startup startup = new Startup(); - startup.run(); - } - - doRun(cmdLine); - - if(!m_concatenate) { - System.exit(0); - } - } catch (Throwable t) { - System.err.println("Error: " + t.getClass() + - ":" + t.getMessage()); - if (isDebug()) { - ProgramErrorReport report = - new ProgramErrorReport(t, args); - report.logit(); - } else if (isVerbose()) { - t.printStackTrace(System.err); - } - System.exit(1); - } - } - - /** - * This method should be implemented by subclasses - * to do whatever processing they require. - * @param cmdLine the parsed command line - */ - protected abstract void doRun(CommandLine cmdLine); - - /** - * Sends a command line help usage message to the - * output stream - * @param os the destination stream - */ - public void help(OutputStream os) { - HelpFormatter fmt = new HelpFormatter(); - PrintWriter w = new PrintWriter(os); - fmt.printHelp(w, 80, - "ccm-run " + getClass().getName() + - " [OPTION]... " + getUsage(), - "\nOptions:", - getOptions(), - 2, 4, null, false); - w.flush(); - } -} Deleted: trunk/ccm-core/src/com/arsdigita/packaging/ProgramErrorReport.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/ProgramErrorReport.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/packaging/ProgramErrorReport.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. - * - * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html - * - * 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.packaging; - -import com.arsdigita.logging.ErrorReport; - -public class ProgramErrorReport extends ErrorReport { - - public ProgramErrorReport(Throwable throwable, - String[] args) { - super(throwable); - - try { - addArgs(args); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - private void addArgs(String[] args) { - addSection("Command line arguments", - args); - } -} Modified: trunk/ccm-core/src/com/arsdigita/persistence/pdl/SQLRegressionGenerator.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/persistence/pdl/SQLRegressionGenerator.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/persistence/pdl/SQLRegressionGenerator.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -108,7 +108,7 @@ * an exception is for the build process within ant to fail on * error. **/ - public static final void main(String[] args) throws PDLException { + public static void main(String[] args) throws PDLException { org.apache.log4j.BasicConfigurator.configure(); Deleted: trunk/ccm-core/src/com/arsdigita/templating/ApplyTemplates.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/templating/ApplyTemplates.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/templating/ApplyTemplates.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -1,166 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.templating; - -import com.arsdigita.util.cmd.CommandLine; -import com.arsdigita.util.cmd.StringSwitch; -import com.arsdigita.util.cmd.BooleanSwitch; -import com.arsdigita.util.UncheckedWrapperException; - -import javax.xml.transform.Templates; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; - -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; - -import java.util.Date; -import java.util.Map; -import java.util.HashMap; - -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.PatternLayout; - -public class ApplyTemplates { - - private static final String OPT_LOOP = "-loop"; - private static final String OPT_LOG = "-log"; - private static final String OPT_WARMUP = "-warmup"; - private static final String OPT_VERBOSE = "-verbose"; - - private static final Logger s_log = Logger.getLogger(ApplyTemplates.class); - - private static CommandLine s_cmd = new CommandLine( - "apply-templates", - "java com.arsdigita.templating.ApplyTemplates " + - "-loop [count] -log [loglevel] -verbose -warmup [count] Stylesheet Input Output " - ); - static { - s_log.debug("Static initalizer starting..."); - s_cmd.addSwitch(new StringSwitch(OPT_LOG, - "Log4j debug level", - "warn")); - s_cmd.addSwitch(new StringSwitch(OPT_LOOP, - "Number of iterations to apply xsl", - "1")); - s_cmd.addSwitch(new StringSwitch(OPT_WARMUP, - "Number of iterations to warm up on", - "0")); - s_cmd.addSwitch(new BooleanSwitch(OPT_VERBOSE, - "Display progress", - Boolean.FALSE)); - s_log.debug("Static initalizer finished."); - } - - public final static void main(String[] args) { - ConsoleAppender log = - new ConsoleAppender(new PatternLayout("%d{ISO8601} [%5.5t] %-5p %c{2} - %m%n")); - - log.setThreshold(Level.toLevel("warn")); - BasicConfigurator.configure(log); - - - Map options = new HashMap(); - args = s_cmd.parse(options, args); - - String stylesheet = args[0]; - String input = args[1]; - String output = args[2]; - - log.setThreshold(Level.toLevel((String)options.get(OPT_LOG))); - - s_log.debug("Build xml source " + new Date()); - StreamSource xml = new StreamSource(input); - - s_log.debug("Build xsl source " + new Date()); - StreamSource xsl = new StreamSource(stylesheet); - - s_log.debug("Build html dest " + new Date()); - StreamResult html = new StreamResult(output); - - s_log.debug("Build transformer factory " + new Date()); - TransformerFactory fact = TransformerFactory.newInstance(); - - s_log.debug("Build templates " + new Date()); - Templates templates = null; - try { - templates = fact.newTemplates(xsl); - } catch (TransformerConfigurationException tce) { - throw new UncheckedWrapperException(tce); - } - - - Transformer xf = null; - try { - xf = templates.newTransformer(); - } catch (TransformerConfigurationException tce) { - throw new UncheckedWrapperException(tce); - } - - boolean verbose = Boolean.TRUE.equals(options.get(OPT_VERBOSE)); - - try { - int warmup = (new Integer((String)options.get(OPT_WARMUP))).intValue(); - Date start = new Date(); - s_log.debug("Warming up " + start); - for (int i = 0 ; i < warmup ; i++) { - xf.setOutputProperty("encoding", "UTF-8"); - xf.transform(xml, - html); - if (verbose) { - System.out.print("."); - System.out.flush(); - } - } - if (warmup > 0 && verbose) { - System.out.println(); - } - - int loop = (new Integer((String)options.get(OPT_LOOP))).intValue(); - start = new Date(); - s_log.debug("Start " + start); - for (int i = 0 ; i < loop ; i++) { - xf.setOutputProperty("encoding", "UTF-8"); - xf.transform(xml, - html); - if (verbose) { - System.out.print("."); - System.out.flush(); - } - } - if (verbose) { - System.out.println(); - } - Date end = new Date(); - s_log.debug("End " + end); - - long duration = end.getTime() - start.getTime(); - s_log.info("Duration for " + loop + " iterations with " + - " is " + duration + " milliseconds"); - } catch (TransformerException ex) { - throw new UncheckedWrapperException("cannot transform document", ex); - } - - } -} Added: trunk/ccm-core/src/com/arsdigita/util/cmd/Program.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/util/cmd/Program.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/util/cmd/Program.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.util.cmd; + +import com.arsdigita.runtime.Startup; + +import org.apache.commons.cli.Options; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.OptionBuilder; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.CommandLine; + +import java.io.OutputStream; +import java.io.PrintWriter; + +/** + * <p> + * Provides base framework for writing command line + * programs that require the CCM context to be be + * initialized. It also integrates the Apache Commons + * CLI package for simple command line argument handling. + * </p> + * <p> + * As an example usage scenario for this class, + * consider a tool that prints out the current + * sitemap. This would be implemented as follows: + * </p> + * + * <pre> + *public class SiteMapList extends Program { + * + * public SiteMapList() { + * super("Site Map Listing" + * "1.0.0", + * ""); + * } + * + * protected void doRun(CommandLine cmdLine) { + * ApplicationCollection apps = + * Application.retrieveAllApplications(); + * apps.addOrder("primaryURL"); + * + * while (apps.next()) { + * Application app = apps.getApplication(); + * + * System.out.println(app.getPath() + " -> " + + * app.getApplicationType().getTitle()); + * + * if (isVerbose()) { + * System.out.println(" Description: " + + * app.getApplicationType().getDescription()); + * } + * if (isDebug()) { + * System.out.println(" Class: " + + * app.getClass()); + * } + * } + * } + * + * public static void main(String[] args) { + * new SiteMapList().run(args); + * } + *} + * </pre> + * + */ +public abstract class Program { + + private String m_name; + private String m_version; + private String m_usage; + private boolean m_verbose = false; + /** Whether to produce out marked by debug while running the CLI program.*/ + private boolean m_debug = false; + /** Whether to initialize the CCM system before running the CLI program. */ + private boolean m_startup = true; + /** True skips system.exit after processing finished so another program may + be invoked by a calling cammand script. Especially usefule for upgrade + script when a sql script has to be executed afer a jave class. */ + private boolean m_concatenate = false; + + private Options m_options; + + /** + * Creates a new program. The conventions for the + * usage parameter follow the GNU style guidelines. + * For example, if there are multiple source files + * and one destination, it would be "SOURCE... DEST". + * Standard WAF startup procedures will be performed + * before the doRun method is executed. + * @param name the program name + * @param version the version string + * @param usage for any non-option command line arguments + */ + public Program(String name, + String version, + String usage) { + this(name, version, usage, true, false); + } + + /** + * Creates a new program. The conventions for the + * usage parameter follow the GNU style guidelines. + * For example, if there are multiple source files + * and one destination, it would be "SOURCE... DEST" + * @param name the program name + * @param version the version string + * @param usage for any non-option command line arguments + * @param startup true to perform standard WAF startup + */ + public Program(String name, + String version, + String usage, + boolean startup) { + this(name, version, usage, startup, false); + } + + /** + * Creates a new program. The conventions for the + * usage parameter follow the GNU style guidelines. + * For example, if there are multiple source files + * and one destination, it would be "SOURCE... DEST" + * @param name the program name + * @param version the version string + * @param usage for any non-option command line arguments + * @param startup true to perform standard WAF startup + * @param concatenate false invokes System.exit when processing finished + */ + public Program(String name, + String version, + String usage, + boolean startup, + boolean concatenate) { + m_name = name; + m_version = version; + m_usage = usage; + m_startup = startup; + m_concatenate = concatenate; + m_options = new Options(); + + m_options.addOption + (OptionBuilder + .hasArg(false) + .withLongOpt("help") + .withDescription("Print this message") + .create('?')); + m_options.addOption + (OptionBuilder + .hasArg(false) + .withLongOpt("version") + .withDescription("Print version information") + .create('V')); + m_options.addOption + (OptionBuilder + .hasArg(false) + .withLongOpt("verbose") + .withDescription("Generate verbose output") + .create('v')); + m_options.addOption + (OptionBuilder + .hasArg(false) + .withLongOpt("debug") + .withDescription("Generate debugging output") + .create('D')); + } + + /** + * Retrieves the version for this program + * @return the version string + */ + public String getVersion() { + return m_version; + } + + /** + * Retrieves the program name + * @return the program name + */ + public String getName() { + return m_name; + } + + /** + * Retrieves the usage for non-option command + * line arguments + * @return the command usage + */ + public String getUsage() { + return m_usage; + } + + /** + * Retrieves the command line options configuration + * @return the command line options + */ + public Options getOptions() { + return m_options; + } + + /** + * Determines if the program should generate verbose + * output. Verbose output is information that is + * useful to end users of the program. + * @return true if verbose output is required + */ + public boolean isVerbose() { + return m_verbose; + } + + /** + * Determines if the program should generate debug + * output. Debug output is information that is useful + * to programmers or system administrators. + * @return true if debug output is required + */ + public boolean isDebug() { + return m_debug; + } + + /** + * Runs the program. First off all the command line + * arguments are first parsed. If the --help or + * --version arguments were specified then this + * information is output and execution stops. + * Otherwise, the CCM startup process is invoked + * and then finally the doRun method is run. + * @param args the command line arguments to parse + */ + public final void run(String[] args) { + CommandLine cmdLine = null; + try { + cmdLine = new GnuParser().parse(m_options, + args); + } catch (ParseException ex) { + help(System.err); + System.exit(1); + } + + if (cmdLine.hasOption("?")) { + help(System.out); + System.exit(0); + } else if (cmdLine.hasOption("V")) { + System.out.println(m_version); + System.exit(0); + } + + m_verbose = cmdLine.hasOption("v"); + m_debug = cmdLine.hasOption("D"); + + try { + if (m_startup) { + Startup startup = new Startup(); + startup.run(); + } + + doRun(cmdLine); + + if(!m_concatenate) { + System.exit(0); + } + } catch (Throwable t) { + System.err.println("Error: " + t.getClass() + + ":" + t.getMessage()); + if (isDebug()) { + ProgramErrorReport report = + new ProgramErrorReport(t, args); + report.logit(); + } else if (isVerbose()) { + t.printStackTrace(System.err); + } + System.exit(1); + } + } + + /** + * This method should be implemented by subclasses + * to do whatever processing they require. + * @param cmdLine the parsed command line + */ + protected abstract void doRun(CommandLine cmdLine); + + /** + * Sends a command line help usage message to the + * output stream + * @param os the destination stream + */ + public void help(OutputStream os) { + HelpFormatter fmt = new HelpFormatter(); + PrintWriter w = new PrintWriter(os); + fmt.printHelp(w, 80, + "ccm-run " + getClass().getName() + + " [OPTION]... " + getUsage(), + "\nOptions:", + getOptions(), + 2, 4, null, false); + w.flush(); + } +} Property changes on: trunk/ccm-core/src/com/arsdigita/util/cmd/Program.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-core/src/com/arsdigita/util/cmd/ProgramErrorReport.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/util/cmd/ProgramErrorReport.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/util/cmd/ProgramErrorReport.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2004 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.util.cmd; + +import com.arsdigita.logging.ErrorReport; + +public class ProgramErrorReport extends ErrorReport { + + public ProgramErrorReport(Throwable throwable, + String[] args) { + super(throwable); + + try { + addArgs(args); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + private void addArgs(String[] args) { + addSection("Command line arguments", + args); + } +} Property changes on: trunk/ccm-core/src/com/arsdigita/util/cmd/ProgramErrorReport.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-core/src/com/arsdigita/web/CreateContainerGroup.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/web/CreateContainerGroup.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-core/src/com/arsdigita/web/CreateContainerGroup.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -30,7 +30,7 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.kernel.Group; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.SessionManager; Added: trunk/ccm-faq/web/WEB-INF/web.ccm-faq.xml =================================================================== --- trunk/ccm-faq/web/WEB-INF/web.ccm-faq.xml (rev 0) +++ trunk/ccm-faq/web/WEB-INF/web.ccm-faq.xml 2012-05-01 14:21:42 UTC (rev 2307) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <!-- Servlets for the faq applications --> + + <servlet> + <servlet-name>faq-main</servlet-name> + <servlet-class>com.arsdigita.faq.FaqServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>faq-main</servlet-name> + <url-pattern>/faq/*</url-pattern> + </servlet-mapping> + +</web-app> \ No newline at end of file Modified: trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateContainerGroups.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateContainerGroups.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateContainerGroups.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -29,7 +29,7 @@ import com.arsdigita.kernel.Group; import com.arsdigita.kernel.GroupCollection; import com.arsdigita.messaging.MessageThread; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; Modified: trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateGroupsAndPortletType.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateGroupsAndPortletType.java 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-forum/src/com/arsdigita/forum/upgrade/CreateGroupsAndPortletType.java 2012-05-01 14:21:42 UTC (rev 2307) @@ -26,7 +26,7 @@ import com.arsdigita.kernel.Group; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.packaging.Program; +import com.arsdigita.util.cmd.Program; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-05-01 14:19:29 UTC (rev 2306) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 20... [truncated message content] |
Author: pboy Date: 2012-05-01 14:19:29 +0000 (Tue, 01 May 2012) New Revision: 2306 Added: trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/ trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/6.6.1-6.6.2/ trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/6.6.1-6.6.2/add_siteproxyprovider_inits.sql trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/oracle-se-6.6.1-6.6.2.sql trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/postgres-6.6.1-6.6.2.sql trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/ trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/drop_app_table.sql trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/ren_domainprovider_table.sql trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql trunk/ccm-atoz/sql/ccm-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql trunk/ccm-atoz/sql/ccm-atoz/upgrade/postgres-6.6.1-6.6.2.sql trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/DomainProvider.pdl trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/oracle-se-create.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/postgres-create.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/6.6.1-6.6.2/ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/6.6.1-6.6.2/add_domainprovider_inits.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.1-6.6.2.sql trunk/ccm-ldn-atoz/src/WEB-INF/ trunk/ccm-ldn-atoz/src/WEB-INF/resources/ trunk/ccm-ldn-atoz/src/WEB-INF/resources/atoz-ldn-domain-adapters.xml trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.config trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.load trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig_parameter.properties trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainGenerator.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainProvider.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/ui/ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/ui/DomainProviderAdmin.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/ui/DomainProviderForm.java Removed: trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/terms/ Modified: trunk/ccm-atoz-siteproxy/src/ccm-atoz-siteproxy.upgrade trunk/ccm-atoz-siteproxy/src/com/arsdigita/atoz/siteproxy/Initializer.java trunk/ccm-atoz/doc/atoz-standalone/README trunk/ccm-atoz/doc/atoz-standalone/web.xml trunk/ccm-atoz/doc/atoz.xsd trunk/ccm-atoz/pdl/com/arsdigita/atoz/AtoZ.pdl trunk/ccm-atoz/src/ccm-atoz.upgrade trunk/ccm-atoz/src/com/arsdigita/atoz/AtoZ.java trunk/ccm-atoz/src/com/arsdigita/atoz/Initializer.java trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java trunk/ccm-atoz/web/templates/ccm-atoz/admin/load-cat.jsp trunk/ccm-ldn-atoz/application.xml Log: AtoZ now finally split into a generic base package ccm-atoz, a LAW specific extension ccm-ldn-atoz and an extension for siteproxy content type. Modified: trunk/ccm-atoz/doc/atoz-standalone/README =================================================================== --- trunk/ccm-atoz/doc/atoz-standalone/README 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/doc/atoz-standalone/README 2012-05-01 14:19:29 UTC (rev 2306) @@ -1,6 +1,9 @@ Up to APLAWS version 1.0.4 atoz had been installed into its own application context: [webapps]/ccm-ldn-atoz. +Up to that version the package was named ccm-ldn-atoz and has then renamed to +ccm-atoz. + Now it is installed inside the main APLAWS application context along with all other applications. @@ -8,16 +11,16 @@ modifications are necessary: 1. remove webapp="xxx" from application.xml 2. move the files in this dir to WEB-INF/ -3. change src/com/ad/london/atoz/AtoZ.java +3. change src/com/ad/atoz/AtoZ.java method getServletContext() as back to "/files" 4. edit themes/.../xsl/index.xsl according the comment -5. edit in ccm-ldn-aplaws /web/themes/static/aplaws/atoz.xml +5. edit in ccm-aplaws /web/themes/static/aplaws/atoz.xml according to the comment Running it in its own webapplication context nevertheless is not suggestive. It needs several xsl files of the main application (esp. core) for basic -operations, which hac been directly mapped from the main applications directory +operations, which has been directly mapped from the main applications directory tree into its own directory tree. So no module separation is possible, no security context useable etc. Modified: trunk/ccm-atoz/doc/atoz-standalone/web.xml =================================================================== --- trunk/ccm-atoz/doc/atoz-standalone/web.xml 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/doc/atoz-standalone/web.xml 2012-05-01 14:19:29 UTC (rev 2306) @@ -9,7 +9,7 @@ <servlet-class>com.arsdigita.web.ContextRegistrationServlet</servlet-class> <init-param> <param-name>uri</param-name> - <param-value>/ccm-ldn-atoz/</param-value> + <param-value>/ccm-atoz/</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> @@ -19,7 +19,7 @@ <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-atoz</param-value> + <param-value>/templates/ccm-atoz</param-value> </init-param> </servlet> Modified: trunk/ccm-atoz/doc/atoz.xsd =================================================================== --- trunk/ccm-atoz/doc/atoz.xsd 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/doc/atoz.xsd 2012-05-01 14:19:29 UTC (rev 2306) @@ -14,7 +14,7 @@ </xs:documentation> <xs:appinfo> - <gen:class>com.arsdigita.london.atoz.ui.AtoZPane</gen:class> + <gen:class>com.arsdigita.atoz.ui.AtoZPane</gen:class> </xs:appinfo> </xs:annotation> Modified: trunk/ccm-atoz/pdl/com/arsdigita/atoz/AtoZ.pdl =================================================================== --- trunk/ccm-atoz/pdl/com/arsdigita/atoz/AtoZ.pdl 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/pdl/com/arsdigita/atoz/AtoZ.pdl 2012-05-01 14:19:29 UTC (rev 2306) @@ -20,5 +20,8 @@ import com.arsdigita.web.Application; object type AtoZ extends Application { - reference key (atoz_app.application_id); + // Nothing to persist yet + // there is only one instance of AtoZ and + // no instance specific settings about to be persisted. + // reference key (atoz_app.application_id); } Added: trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/drop_app_table.sql =================================================================== --- trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/drop_app_table.sql (rev 0) +++ trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/drop_app_table.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,23 @@ +-- +-- 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 +-- +-- $Id: drop_app_table.sql pboy $ + +-- drops table atoz_app which just contained application type id and is +-- never used for any action. + +drop table atoz_app ; Added: trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/ren_domainprovider_table.sql =================================================================== --- trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/ren_domainprovider_table.sql (rev 0) +++ trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/ren_domainprovider_table.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2011 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 +-- +-- $Id: ren_domainprovider_table.sql pboy $ + +-- rename table trm_atoz_providers to atoz_trm_providers following +-- ccm naming conventions to make maintenance tasks easier + + +alter table trm_atoz_providers drop constraint trm_ato_provi_provi_id_p_3qjph ; +alter table trm_atoz_providers drop constraint trm_ato_provi_provi_id_f_mibvl ; +alter table trm_atoz_providers drop constraint trm_ato_provide_domain_f_ee4ts ; + + +alter table trm_atoz_providers RENAME TO atoz_trm_providers ; + + +alter table atoz_trm_providers + add constraint atoz_trm_provi_prov_id_p_ifmav PRIMARY KEY (provider_id) ; +alter table atoz_trm_providers + add constraint atoz_trm_provi_prov_id_f_yjmjc FOREIGN KEY (provider_id) + REFERENCES atoz_provider (provider_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; +alter table atoz_trm_providers + add constraint atoz_trm_provid_domain_f_9drhn FOREIGN KEY ("domain") + REFERENCES trm_domains ("key") MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + Added: trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql =================================================================== --- trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql (rev 0) +++ trunk/ccm-atoz/sql/ccm-atoz/upgrade/default/6.6.1-6.6.2/upd_system_tables.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,102 @@ +-- +-- 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 +-- +-- $Id: upd_system_tables.sql pboy $ + +-- rename cm-ldn-atoz to ccm-atoz +-- adjust various system tables to the new name of application + +alter table init_requirements drop constraint init_requirements_init_f_cmmdn ; +alter table init_requirements drop constraint init_require_requ_init_f_i6rgg ; + +update inits + set class_name='com.arsdigita.atoz.Initializer' + where class_name='com.arsdigita.london.atoz.Initializer' ; + +update init_requirements + set init='com.arsdigita.atoz.Initializer' + where init='com.arsdigita.london.atoz.Initializer' ; + +update init_requirements + set required_init='com.arsdigita.atoz.Initializer' + where required_init='com.arsdigita.london.atoz.Initializer' ; + +ALTER TABLE init_requirements + ADD CONSTRAINT init_requirements_init_f_cmmdn FOREIGN KEY (init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; +ALTER TABLE init_requirements + ADD CONSTRAINT init_require_requ_init_f_i6rgg FOREIGN KEY (required_init) + REFERENCES inits (class_name) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION; + + +update application_types + set object_type=replace(object_type,'london.atoz.AtoZ','atoz.AtoZ') + where object_type like '%london.atoz.AtoZ%' ; + +-- table applications doesn't require an update +-- update applications +-- set title='CCM Themes Administration', +-- description='CCM themes administration' +-- where primary_url='/admin/themes/' ; + +-- table apm_package_types doesn't require an update +-- table apm_packages doesn't require an update either +-- table site_nodes doesn't require an update either + + +-- update application type in acs_objects +-- update acs_objects +-- set (object_type,display_name,default_domain_class) = +-- ('com.arsdigita.themedirector.ThemeDirector' , +-- 'CCM Themes Administration', +-- 'com.arsdigita.themedirector.ThemeDirector' ) +-- where default_domain_class like 'com.arsdigita.london.theme.ThemeApplication' ; + +-- update atoz in acs_objects +-- replace String london.atoz by atoz for all atoz.AtoZ* +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'london.atoz', 'atoz') , + replace(default_domain_class,'london.atoz', 'atoz') ) + where object_type like '%london.atoz.AtoZ%' ; +-- rename AtoZItemProvider to ItemProvider +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'AtoZItemProvider', 'ItemProvider') , + replace(default_domain_class,'AtoZItemProvider', 'ItemProvider') ) + where object_type like '%AtoZItemProvider%' ; +-- rename AtoZCategoryProvider to CategoryProvider +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'AtoZCategoryProvider', 'CategoryProvider') , + replace(default_domain_class,'AtoZCategoryProvider', 'CategoryProvider') ) + where object_type like '%AtoZCategoryProvider%' ; +-- rename AtoZSiteProxyProvider to siteproxy.SiteProxyProvider +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'AtoZSiteProxyProvider', 'siteproxy.SiteProxyProvider') , + replace(default_domain_class,'AtoZSiteProxyProvider', 'siteproxy.SiteProxyProvider') ) + where object_type like '%AtoZSiteProxyProvider%' ; +-- rename terms.DomainProvider to DomainProvider +update acs_objects + set (object_type,default_domain_class) = + (replace(object_type,'terms.DomainProvider', 'DomainProvider') , + replace(default_domain_class,'terms.DomainProvider', 'DomainProvider') ) + where object_type like '%atoz.terms.DomainProvider%' ; + Added: trunk/ccm-atoz/sql/ccm-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-atoz/sql/ccm-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-atoz/sql/ccm-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,28 @@ +-- +-- 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 +-- +-- $Id: oracle-se-6.6.1-6.6.2.sql $ + +-- AtoZ has been renamed from ccm-ldn-atoz to ccm-atoz and split up into +-- separate packages for generic purposes (items and categories), +-- siteproxy support, and LAW specific terms and ESD services. + +-- NOTE: Order is significant +@@ default/6.6.1-6.6.2/upd_system_tables.sql +@@ default/6.6.1-6.6.2/drop_app_table.sql +@@ default/6.6.1-6.6.2/ren_domainprovider_table.sql + Added: trunk/ccm-atoz/sql/ccm-atoz/upgrade/postgres-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-atoz/sql/ccm-atoz/upgrade/postgres-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-atoz/sql/ccm-atoz/upgrade/postgres-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,32 @@ +-- +-- 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 +-- +-- $Id: postgres-6.6.1-6.6.2.sql $ + +-- AtoZ has been renamed from ccm-ldn-atoz to ccm-atoz and split up into +-- separate packages for generic purposes (items and categories), +-- siteproxy support, and LAW specific terms and ESD services. + + +begin; + +-- NOTE: Order is significant +\i default/6.6.1-6.6.2/upd_system_tables.sql +\i default/6.6.1-6.6.2/drop_app_table.sql +\i default/6.6.1-6.6.2/ren_domainprovider_table.sql + +commit; Modified: trunk/ccm-atoz/src/ccm-atoz.upgrade =================================================================== --- trunk/ccm-atoz/src/ccm-atoz.upgrade 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/src/ccm-atoz.upgrade 2012-05-01 14:19:29 UTC (rev 2306) @@ -17,6 +17,6 @@ </version> <version from="6.6.1" to="6.6.2"> <!-- AtoZ renamed from ccm-ldn-atoz to ccm-atoz --> - <script sql="ccm-atoz/upgrade/::database::-6.6.0-6.6.1.sql"/> + <script sql="ccm-atoz/upgrade/::database::-6.6.1-6.6.2.sql"/> </version> </upgrade> Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/AtoZ.java =================================================================== --- trunk/ccm-atoz/src/com/arsdigita/atoz/AtoZ.java 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/src/com/arsdigita/atoz/AtoZ.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -147,7 +147,7 @@ // * web application context // */ // public String getContextPath() { -// return "/ccm-ldn-atoz"; +// return "/ccm-atoz"; // } /** Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/Initializer.java =================================================================== --- trunk/ccm-atoz/src/com/arsdigita/atoz/Initializer.java 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/src/com/arsdigita/atoz/Initializer.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -50,6 +50,9 @@ */ public class Initializer extends CompoundInitializer { + /** + * Constructor + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); Modified: trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java =================================================================== --- trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/src/com/arsdigita/atoz/tools/AtoZCreator.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -24,9 +24,9 @@ import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.london.util.Program; import com.arsdigita.london.util.Transaction; import com.arsdigita.persistence.DataObject; +import com.arsdigita.util.cmd.Program; import com.arsdigita.web.Application; import org.apache.commons.cli.CommandLine; Modified: trunk/ccm-atoz/web/templates/ccm-atoz/admin/load-cat.jsp =================================================================== --- trunk/ccm-atoz/web/templates/ccm-atoz/admin/load-cat.jsp 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz/web/templates/ccm-atoz/admin/load-cat.jsp 2012-05-01 14:19:29 UTC (rev 2306) @@ -3,7 +3,10 @@ xmlns:show="/WEB-INF/bebop-show.tld" version="1.2"> - <define:page name="childCategories" pageClass="com.arsdigita.cms.ui.authoring.EmptyPage" title="childCategories" cache="true"> + <define:page name="childCategories" + pageClass="com.arsdigita.cms.ui.authoring.EmptyPage" + title="childCategories" + cache="true"> <define:component name="catSubtree" classname="com.arsdigita.london.terms.ui.CategorySubtree"/> Added: trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/6.6.1-6.6.2/add_siteproxyprovider_inits.sql =================================================================== --- trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/6.6.1-6.6.2/add_siteproxyprovider_inits.sql (rev 0) +++ trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/6.6.1-6.6.2/add_siteproxyprovider_inits.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,36 @@ +-- +-- 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 +-- +-- $Id: add_siteproxyprovider_inits.sql pboy $ + +-- With this update the package ccm-atoz has been divided into a vore atoz +-- package and optional extensions, e.g. this siteproxy extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + + +INSERT INTO inits (class_name) + VALUES ('com.arsdigita.atoz.siteproxy.Initializer') ; + +INSERT INTO init_requirements (required_init, init) + VALUES ('com.arsdigita.atoz.Initializer', + 'com.arsdigita.atoz.siteproxy.Initializer') ; + +INSERT INTO init_requirements (required_init, init) + VALUES ('com.arsdigita.core.Initializer', + 'com.arsdigita.atoz.siteproxy.Initializer') ; + Added: trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/oracle-se-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/oracle-se-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/oracle-se-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,26 @@ +-- +-- 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 +-- +-- $Id: oracle-se-6.6.1-6.6.2.sql $ + +-- With this update the package ccm-atoz has been divided into a vore atoz +-- package and optional extensions, e.g. this siteproxy extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + +@@ default/6.6.1-6.6.2/add_siteproxyprovider_inits.sql + Added: trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/postgres-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/postgres-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-atoz-siteproxy/sql/ccm-atoz-siteproxy/upgrade/postgres-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,30 @@ +-- +-- 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 +-- +-- $Id: postgres-6.6.1-6.6.2.sql $ + +-- With this update the package ccm-atoz has been divided into a vore atoz +-- package and optional extensions, e.g. this siteproxy extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + + +begin; + +\i default/6.6.1-6.6.2/add_siteproxyprovider_inits.sql + +commit; Modified: trunk/ccm-atoz-siteproxy/src/ccm-atoz-siteproxy.upgrade =================================================================== --- trunk/ccm-atoz-siteproxy/src/ccm-atoz-siteproxy.upgrade 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz-siteproxy/src/ccm-atoz-siteproxy.upgrade 2012-05-01 14:19:29 UTC (rev 2306) @@ -1,8 +1,6 @@ <upgrade> -<!-- - <version from="x.y.z" to="x.y.a"> - <!-- AtoZ SiteProxy ........ --> - <script sql="ccm-atoz-siteproxy/upgrade/::database::-x.y.z-x.y.a.sql"/> + <version from="6.6.1" to="6.6.2"> + <!-- AtoZ SiteProxy add inits after split from generic atoz package --> + <script sql="ccm-atoz-siteproxy/upgrade/::database::-6.6.1-6.6.2.sql"/> </version> ---> </upgrade> Modified: trunk/ccm-atoz-siteproxy/src/com/arsdigita/atoz/siteproxy/Initializer.java =================================================================== --- trunk/ccm-atoz-siteproxy/src/com/arsdigita/atoz/siteproxy/Initializer.java 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-atoz-siteproxy/src/com/arsdigita/atoz/siteproxy/Initializer.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -22,18 +22,35 @@ import com.arsdigita.atoz.AtoZProviderType; import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderAdmin; import com.arsdigita.atoz.siteproxy.ui.admin.SiteProxyProviderForm; +import com.arsdigita.db.DbHelper; import com.arsdigita.domain.xml.TraversalHandler; +import com.arsdigita.persistence.pdl.ManifestSource; +import com.arsdigita.persistence.pdl.NameFilter; import com.arsdigita.runtime.CompoundInitializer; import com.arsdigita.runtime.DomainInitEvent; +import com.arsdigita.runtime.PDLInitializer; +import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.xml.XML; /** - * + * Initializes the A-Z system siteproxy extension * @author pb */ public class Initializer extends CompoundInitializer { /** + * Constructor + */ + public Initializer() { + + final String url = RuntimeConfig.getConfig().getJDBCURL(); + final int database = DbHelper.getDatabaseFromURL(url); + + add(new PDLInitializer(new ManifestSource("ccm-atoz-siteproxy.pdl.mf", + new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); + } + + /** * * @param evt */ Modified: trunk/ccm-ldn-atoz/application.xml =================================================================== --- trunk/ccm-ldn-atoz/application.xml 2012-05-01 12:26:33 UTC (rev 2305) +++ trunk/ccm-ldn-atoz/application.xml 2012-05-01 14:19:29 UTC (rev 2306) @@ -2,26 +2,34 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-atoz" prettyName="A-Z" - version="6.6.1" + version="6.6.2" release="1" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-atoz" version="6.6.0" relation="ge"/> + <!-- <ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-aplaws" version="6.6.0" relation="ge"/> + --> <ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-cms-types-siteproxy" version="6.6.0" relation="ge"/> </ccm:dependencies> + <ccm:contacts> <ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/> <ccm:contact uri="mailto:rh...@re..." type="support"/> </ccm:contacts> + <ccm:description> - The ccm-ldn-atoz package enables a site to present all it's content in + The ccm-ldn-atoz package is an extension for the ccm-atoz package in + combination with the ccm-ldn-terms package. It enables the ccm-atoz package + to deal with LAW specific terms. + + The ccm-atoz package enables a site to present all it's content in alphabetical order as an additional service to it's users. Usually the theme provides a link to the page as part of its static elements. Added: trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/DomainProvider.pdl =================================================================== --- trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/DomainProvider.pdl (rev 0) +++ trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/DomainProvider.pdl 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,28 @@ +// +// 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 + +model com.arsdigita.london.atoz; + +import com.arsdigita.atoz.AtoZProvider; +import com.arsdigita.london.terms.Domain; + +object type DomainProvider extends AtoZProvider { + Domain[1..1] domain = join atoz_trm_providers.domain to trm_domains.key; + + reference key (atoz_trm_providers.provider_id); +} + Property changes on: trunk/ccm-ldn-atoz/pdl/com/arsdigita/london/atoz/DomainProvider.pdl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/oracle-se-create.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/oracle-se-create.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/oracle-se-create.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,3 @@ +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql + Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/oracle-se-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/postgres-create.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/postgres-create.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/postgres-create.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,4 @@ +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/postgres-create.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/6.6.1-6.6.2/add_domainprovider_inits.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/6.6.1-6.6.2/add_domainprovider_inits.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/6.6.1-6.6.2/add_domainprovider_inits.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,36 @@ +-- +-- 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 +-- +-- $Id: add_domainprovider_inits.sql pboy $ + +-- With this update the package ccm-atoz has been divided into a generic atoz +-- package and optional extensions, e.g. this ldn (terms ESD domains) extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + + +INSERT INTO inits (class_name) + VALUES ('com.arsdigita.london.atoz.Initializer') ; + +INSERT INTO init_requirements (required_init, init) + VALUES ('com.arsdigita.atoz.Initializer', + 'com.arsdigita.london.atoz.Initializer') ; + +INSERT INTO init_requirements (required_init, init) + VALUES ('com.arsdigita.core.Initializer', + 'com.arsdigita.london.atoz.Initializer') ; + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,26 @@ +-- +-- 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 +-- +-- $Id: oracle-se-6.6.1-6.6.2.sql $ + +-- With this update the package ccm-atoz has been divided into a generic atoz +-- package and optional extensions, e.g. this ldn (terms ESD domains) extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + +@@ default/6.6.1-6.6.2/add_domainprovider_inits.sql + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.1-6.6.2.sql 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,30 @@ +-- +-- 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 +-- +-- $Id: postgres-6.6.1-6.6.2.sql $ + +-- With this update the package ccm-atoz has been divided into a generic atoz +-- package and optional extensions, e.g. this ldn (terms ESD domains) extension. +-- Therefore, in an update situation where atoz is already installed, all +-- tables exists and we must just added Initializer to the startup. + + +begin; + +\i default/6.6.1-6.6.2/add_domainprovider_inits.sql + +commit; Added: trunk/ccm-ldn-atoz/src/WEB-INF/resources/atoz-ldn-domain-adapters.xml =================================================================== --- trunk/ccm-ldn-atoz/src/WEB-INF/resources/atoz-ldn-domain-adapters.xml (rev 0) +++ trunk/ccm-ldn-atoz/src/WEB-INF/resources/atoz-ldn-domain-adapters.xml 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="utf-8"?> + +<xrd:adapters xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd"> +<!-- + <xrd:context name="com.arsdigita.atoz.ui.admin.ProviderList"> + <xrd:adapter objectType="com.arsdigita.atoz.AtoZProvider"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> + </xrd:context> +--> + + <xrd:context name="com.arsdigita.atoz.ui.admin.ProviderDetails"> +<!-- + <xrd:adapter objectType="com.arsdigita.atoz.CategoryProvider"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + <xrd:property name="/object/rootUseContext/id"/> + <xrd:property name="/object/rootUseContext/rootCategory/id"/> + <xrd:property name="/object/rootUseContext/rootCategory/objectType"/> + <xrd:property name="/object/rootUseContext/rootCategory/defaultDomainClass"/> + <xrd:property name="/object/rootUseContext/rootCategory/defaultAncestors"/> + </xrd:attributes> + + <xrd:associations rule="include"> + <xrd:property name="/object/rootUseContext"/> + <xrd:property name="/object/rootUseContext/rootCategory"/> + </xrd:associations> + </xrd:adapter> +--> +<!-- +--> + <xrd:adapter objectType="com.arsdigita.london.atoz.DomainProvider"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> +<!-- + <xrd:adapter objectType="com.arsdigita.atoz.ItemProvider"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + <xrd:property name="/object/category/id"/> + <xrd:property name="/object/category/objectType"/> + <xrd:property name="/object/category/defaultDomainClass"/> + <xrd:property name="/object/category/defaultAncestors"/> + </xrd:attributes> + <xrd:associations rule="include"> + <xrd:property name="/object/category"/> + </xrd:associations> + </xrd:adapter> +--> + +<!-- + <xrd:adapter objectType="com.arsdigita.atoz.siteproxy.SiteProxyProvider"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + <xrd:property name="/object/category/id"/> + <xrd:property name="/object/category/objectType"/> + <xrd:property name="/object/category/defaultDomainClass"/> + <xrd:property name="/object/category/defaultAncestors"/> + </xrd:attributes> + <xrd:associations rule="include"> + <xrd:property name="/object/category"/> + </xrd:associations> + </xrd:adapter> +--> + + </xrd:context> + +<!-- + <xrd:context name="com.arsdigita.atoz.ui.admin.CategoryProviderBlackList"> + <xrd:adapter objectType="com.arsdigita.categorization.Category"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> + </xrd:context> + + <xrd:context name="com.arsdigita.atoz.ui.admin.CategoryProviderContentTypeBlacklist"> + <xrd:adapter objectType="com.arsdigita.cms.ContentType"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> + </xrd:context> + + <xrd:context name="com.arsdigita.atoz.ui.admin.CategoryProviderAliasList"> + <xrd:adapter objectType="com.arsdigita.categorization.Category"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> + + <xrd:adapter objectType="com.arsdigita.atoz.CategoryAlias"> + <xrd:attributes rule="exclude"> + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + </xrd:attributes> + </xrd:adapter> + </xrd:context> +--> +<!-- + <xrd:context name="com.arsdigita.atoz.ui.admin.ItemProviderAliasList"> + <xrd:adapter objectType="com.arsdigita.cms.ContentItem"> + <xrd:attributes rule="exclude"> --> + <!-- + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + --> +<!-- </xrd:attributes> + </xrd:adapter> + + <xrd:adapter objectType="com.arsdigita.atoz.ItemAlias"> + <xrd:attributes rule="exclude"> --> + <!-- + <xrd:property name="/object/id"/> + <xrd:property name="/object/objectType"/> + <xrd:property name="/object/defaultDomainClass"/> + <xrd:property name="/object/displayName"/> + --> +<!-- </xrd:attributes> + </xrd:adapter> + </xrd:context> --> + +</xrd:adapters> Property changes on: trunk/ccm-ldn-atoz/src/WEB-INF/resources/atoz-ldn-domain-adapters.xml ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.config =================================================================== --- trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.config (rev 0) +++ trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.config 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<registry> + <config class="com.arsdigita.london.atoz.DomainConfig" + storage="ccm-atoz/termsdomain.properties"/> +</registry> Property changes on: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.config ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.load =================================================================== --- trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.load (rev 0) +++ trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.load 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,22 @@ +<load> + + <requires> + <table name="inits"/> + <table name="acs_objects"/> + <initializer class="com.arsdigita.core.Initializer"/> + <initializer class="com.arsdigita.atoz.Initializer"/> + </requires> + + <provides> + <table name="atoz_trm_providers"/> + <initializer class="com.arsdigita.london.atoz.Initializer"/> + </provides> + + <scripts> + <schema directory="ccm-ldn-atoz"/> +<!-- + <data class="com.arsdigita.london.atoz.Loader"/> +--> + </scripts> + +</load> Property changes on: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.load ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade =================================================================== --- trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade (rev 0) +++ trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,6 @@ +<upgrade> + <version from="6.6.1" to="6.6.2"> + <!-- AtoZ ldn-domain add inits after split from generic atoz package --> + <script sql="ccm-ldn-atoz/upgrade/::database::-6.6.1-6.6.2.sql"/> + </version> +</upgrade> Property changes on: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig.java (rev 0) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,87 @@ +/* + * 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.london.atoz; + +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.ResourceParameter; + + +import java.io.InputStream; + +import org.apache.log4j.Logger; + +/** + * This is the configuration file for the AtoZ application + */ +public class DomainConfig extends AbstractConfig { + + /** A logger instance to assist debugging. */ + private static final Logger s_log = Logger.getLogger(DomainConfig.class); + + /** Singelton config object. */ + private static DomainConfig s_conf; + + /** + * Gain a DomainConfig object. + * + * Singelton pattern, don't instantiate a config object using the + * constructor directly! + * @return + */ + public static synchronized DomainConfig getConfig() { + if (s_conf == null) { + s_conf = new DomainConfig(); + s_conf.load(); + } + + return s_conf; + } + + + // /////////////////////////////////////////////////////////////////////// + // + // set of configuration parameters + + /** Rules for configuring information in generated XML */ + private Parameter m_adapters = new ResourceParameter + ("com.arsdigita.london.atoz.traversal_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/atoz-ldn-domain-adapters.xml"); + + /** + * Constructor + */ + public DomainConfig() { + + register(m_adapters); + + loadInfo(); + } + + + /** + * Provides access to the traversal adapter as stream. + * @return + */ + InputStream getTraversalAdapters() { + return (InputStream)get(m_adapters); + } + +} Property changes on: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig.java ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig_parameter.properties =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig_parameter.properties (rev 0) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig_parameter.properties 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,4 @@ +com.arsdigita.london.atoz.traversal_adapters.title=XML renderer rules +com.arsdigita.london.atoz.traversal_adapters.purpose=Rules for configuring information in generated XML +com.arsdigita.london.atoz.traversal_adapters.format=[string] +com.arsdigita.london.atoz.traversal_adapters.example=/WEB-INF/resources/atoz-ldn-domain-adapters.xml Property changes on: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainConfig_parameter.properties ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainGenerator.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainGenerator.java (rev 0) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainGenerator.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,132 @@ +/* + * 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.london.atoz; + +import com.arsdigita.atoz.AtoZGeneratorAbstractImpl; +import com.arsdigita.atoz.AtoZAtomicEntry; +import com.arsdigita.atoz.AtoZEntry; +import com.arsdigita.categorization.Category; +import com.arsdigita.domain.DomainCollection; +import com.arsdigita.london.terms.Domain; +import com.arsdigita.london.terms.Term; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.Filter; +import com.arsdigita.persistence.OID; +import com.arsdigita.web.ParameterMap; +import com.arsdigita.web.URL; +import com.arsdigita.web.Web; +import com.arsdigita.xml.Element; + +import java.util.List; +import java.util.ArrayList; + +/** + * + * + */ +public class DomainGenerator extends AtoZGeneratorAbstractImpl { + + /** + * Constructor + * @param provider + */ + public DomainGenerator(DomainProvider provider) { + super(provider); + } + + /** + * + * @param letter + * @return + */ + public AtoZEntry[] getEntries(String letter) { + + DomainProvider provider = (DomainProvider) getProvider(); + + Domain domain = provider.getDomain(); + DomainCollection terms = domain.getTerms(); + terms.addPath(Term.MODEL + "." + Category.ID); + terms.addPath(Term.MODEL + "." + Category.OBJECT_TYPE); + terms.addPath(Term.MODEL + "." + Category.DESCRIPTION); + terms.addEqualsFilter(Term.IN_ATOZ, Boolean.TRUE); + Filter f = terms.addFilter("lower(" + Term.MODEL + "." + Category.NAME + + ") like :key"); + f.set("key", letter.toLowerCase() + "%"); + terms.addOrder(Term.MODEL + "." + Category.NAME); + + List l = new ArrayList(); + while (terms.next()) { + Term term = (Term) terms.getDomainObject(); + DataObject cat = (DataObject) terms.get(Term.MODEL); + + l + .add(new DomainAtomicEntry(cat.getOID(), (String) cat + .get(Category.NAME), (String) cat + .get(Category.DESCRIPTION))); + } + + return (AtoZEntry[]) l.toArray(new AtoZEntry[l.size()]); + + } + + /** + * + */ + private class DomainAtomicEntry implements AtoZAtomicEntry { + + private OID m_oid; + private String m_title; + private String m_description; + + /** + * + * @param oid + * @param title + * @param description + */ + public DomainAtomicEntry(OID oid, String title, String description) { + m_oid = oid; + m_title = title; + m_description = description; + } + + public String getTitle() { + return m_title; + } + + public String getDescription() { + return m_description; + } + + public String getLink() { + ParameterMap map = new ParameterMap(); + map.setParameter("oid", m_oid.toString()); + + URL here = Web.getContext().getRequestURL(); + + return (new URL(here.getScheme(), here.getServerName(), here + .getServerPort(), "", "", "/redirect/", map)).toString(); + } + + public Element getContent() { + // empty + return null; + } + } +} Property changes on: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainGenerator.java ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainProvider.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainProvider.java (rev 0) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainProvider.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,84 @@ +/* + * 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.london.atoz; + +import com.arsdigita.atoz.AtoZGenerator; +import com.arsdigita.atoz.AtoZProvider; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.london.terms.Domain; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; + +/** + * + * + */ +public class DomainProvider extends AtoZProvider { + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.london.atoz.DomainProvider"; + + public static final String DOMAIN = "domain"; + + public DomainProvider() { + this(BASE_DATA_OBJECT_TYPE); + } + + protected DomainProvider(String type) { + super(type); + } + + public DomainProvider(DataObject obj) { + super(obj); + } + + public DomainProvider(OID oid) { + super(oid); + } + + public static DomainProvider create(String title, + String description, + Domain domain) { + DomainProvider provider = new DomainProvider(); + provider.setup(title, + description, + domain); + return provider; + } + + protected void setup(String title, + String description, + Domain domain) { + super.setup(title, description); + setAssociation(DOMAIN, domain); + } + + public Domain getDomain() { + return (Domain)DomainObjectFactory.newInstance((DataObject)get(DOMAIN)); + } + + public void setDomain(Domain domain) { + setAssociation(DOMAIN, domain); + } + + public AtoZGenerator getGenerator() { + return new DomainGenerator(this); + } + +} Property changes on: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/DomainProvider.java ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java (rev 0) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java 2012-05-01 14:19:29 UTC (rev 2306) @@ -0,0 +1,75 @@ +/* + * 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 pub... [truncated message content] |
Author: pboy Date: 2012-05-01 12:15:41 +0000 (Tue, 01 May 2012) New Revision: 2304 Added: trunk/ccm-core/etc/libsNolongerInUse/ trunk/ccm-core/etc/libsNolongerInUse/icu4j-3.8.nolongerInUse.jar trunk/ccm-core/src/com/arsdigita/categorization/ui/AbstractCategoryPicker.java trunk/ccm-core/src/com/arsdigita/categorization/ui/CategorizationTree.java trunk/ccm-core/src/com/arsdigita/categorization/ui/CategoryPicker.java trunk/ccm-core/src/com/arsdigita/categorization/ui/ObjectCategoryPicker.java Removed: trunk/ccm-core/lib/icu4j-3.8.jar Modified: trunk/ccm-core/src/com/arsdigita/bebop/BaseLink.java trunk/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java trunk/ccm-core/src/com/arsdigita/categorization/Category.java trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java trunk/ccm-core/src/com/arsdigita/globalization/Globalization.java trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java trunk/ccm-core/src/com/arsdigita/search/lucene/LuceneSearch.java trunk/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java trunk/ccm-core/src/com/arsdigita/search/ui/ResultsPane.java trunk/ccm-core/src/com/arsdigita/util/ConcurrentDict.java trunk/ccm-core/src/com/arsdigita/workflow/package.html trunk/ccm-core/src/com/arsdigita/workflow/simple/package.html trunk/ccm-core/src/com/redhat/persistence/common/Path.java trunk/ccm-core/src/com/redhat/persistence/pdl/PDL.java Log: Enhanced multilanguage support in BaseLink, enhanced UI (e.g. added sitewide admin to sitewide admin group), fixed Search and advanced search. Added: trunk/ccm-core/etc/libsNolongerInUse/icu4j-3.8.nolongerInUse.jar =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/etc/libsNolongerInUse/icu4j-3.8.nolongerInUse.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/ccm-core/lib/icu4j-3.8.jar =================================================================== (Binary files differ) Modified: trunk/ccm-core/src/com/arsdigita/bebop/BaseLink.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/BaseLink.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/bebop/BaseLink.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -18,13 +18,13 @@ */ package com.arsdigita.bebop; -import com.arsdigita.xml.Element; -import java.util.TooManyListenersException; - +import com.arsdigita.bebop.event.PrintEvent; import com.arsdigita.bebop.event.PrintListener; -import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.util.Assert; import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.xml.Element; +import java.util.TooManyListenersException; /** * The parent of all Bebop Link classes, this class represents a URL on a page. @@ -77,8 +77,8 @@ implements Cloneable { /** - * The name of the attribute used in XML to indicate which type of link - * this link represents. + * The name of the attribute used in XML to indicate which type of link this + * link represents. */ private final String TYPE_ATTR = "type"; private final String HREF_NO_JAVASCRIPT = "href_no_javascript"; @@ -91,10 +91,11 @@ private PrintListener m_printListener; private String m_sConfirmMsg = ""; + private GlobalizedMessage m_confirmMsg; /** * Constructor - * + * * @param child label component, text, image, etc. * @param url */ @@ -106,7 +107,7 @@ /** * Constructor. - * + * * @param label as text * @param url */ @@ -116,7 +117,7 @@ /** * Constructor. - * + * * @param child * @param l */ @@ -132,7 +133,7 @@ /** * Constructor. - * + * * @param label * @param l */ @@ -141,14 +142,15 @@ } /** - * Constructor. - * + * Constructor. + * * @param l */ public BaseLink(PrintListener l) { this("", l); } + @Override public Object clone() throws CloneNotSupportedException { BaseLink result = (BaseLink) super.clone(); result.m_printListener = null; @@ -166,50 +168,46 @@ * added. * @pre listener != null */ public void addPrintListener(PrintListener listener) - throws IllegalStateException, TooManyListenersException - { - if ( listener == null ) { - throw new IllegalArgumentException - ("Argument listener can not be null"); + throws IllegalStateException, TooManyListenersException { + if (listener == null) { + throw new IllegalArgumentException("Argument listener can not be null"); } - if ( m_printListener != null ) { - throw new TooManyListenersException - ("Too many listeners. Can only have one"); + if (m_printListener != null) { + throw new TooManyListenersException("Too many listeners. Can only have one"); } m_printListener = listener; } /** * Removes a previously added print listener. If the passed in - * <code>listener</code> is - * not the listener that was added with {@link #addPrintListener + * <code>listener</code> is not the listener that was added with {@link #addPrintListener * addPrintListener}, an IllegalArgumentException will be thrown. + * * @param listener the listener that was previously added with - * <code>addPrintListener</code> - * @throws IllegalArgumentException if <code>listener</code> is not the - * currently registered print listener or is <code>null</code>. - * @pre listener != null + * <code>addPrintListener</code> + * @throws IllegalArgumentException if + * <code>listener</code> is not the currently registered print listener or + * is + * <code>null</code>. @pre listener != null */ public void removePrintListener(PrintListener listener) - throws IllegalArgumentException - { - if ( listener == null ) { + throws IllegalArgumentException { + if (listener == null) { throw new IllegalArgumentException("listener can not be null"); } - if ( listener != m_printListener ) { - throw new IllegalArgumentException - ("listener is not registered with this widget"); + if (listener != m_printListener) { + throw new IllegalArgumentException("listener is not registered with this widget"); } m_printListener = null; } protected BaseLink firePrintEvent(PageState state) { BaseLink l = this; - if ( m_printListener != null ) { + if (m_printListener != null) { try { l = (BaseLink) this.clone(); m_printListener.prepare(new PrintEvent(this, state, l)); - } catch ( CloneNotSupportedException e ) { + } catch (CloneNotSupportedException e) { l = this; throw new UncheckedWrapperException(e); } @@ -217,7 +215,6 @@ return l; } - public final Component getChild() { return m_child; } @@ -227,7 +224,7 @@ m_child = child; } - public final String getTarget(){ + public final String getTarget() { return m_url; } @@ -247,7 +244,6 @@ setAttribute(TYPE_ATTR, t); } - protected abstract void generateURL(PageState state, Element parent); /** @@ -266,12 +262,14 @@ * @see ControlLink#generateXML * @see ToggleLink#generateXML */ + @Override public void generateXML(PageState state, Element parent) { - if ( isVisible(state) ) { + if (isVisible(state)) { BaseLink target = firePrintEvent(state); - Element link = parent.newChildElement ("bebop:link", BEBOP_XML_NS); + Element link = parent.newChildElement("bebop:link", BEBOP_XML_NS); target.generateURL(state, link); - target.exportAttributes(link); + target.exportConfirmAttributes(state, link); + //setup the link without javascript target.setupNoJavascriptURL(state, link); target.exportAttributes(link); @@ -314,7 +312,9 @@ protected void setupNoJavascriptURL(PageState ps, Element link) { String sURL = null; - if (m_sConfirmMsg.length() > 0) { + if (m_sConfirmMsg.length() > 0 + || (m_confirmMsg != null && m_confirmMsg.localize().toString().length() > 0)) { + //if we want the confirm link, create the link String sOkUrl = getAbsoluteUrl(ps, link.getAttribute(HREF)); String sCancelUrl = null; @@ -324,7 +324,11 @@ Assert.fail("Could not get current page state as URL"); } - sURL = ConfirmPage.getConfirmUrl(m_sConfirmMsg, sOkUrl, sCancelUrl); + if (m_sConfirmMsg.length() > 0) { + sURL = ConfirmPage.getConfirmUrl(m_sConfirmMsg, sOkUrl, sCancelUrl); + } else if (m_confirmMsg != null) { + sURL = ConfirmPage.getConfirmUrl(m_confirmMsg.localize().toString(), sOkUrl, sCancelUrl); + } } else { //don't want confirm link--just no javascript link @@ -348,11 +352,13 @@ * @param state the current request * @param link the XML element representing this link */ - protected void generateExtraXMLAttributes(PageState state, Element link) {} + protected void generateExtraXMLAttributes(PageState state, Element link) { + } /** - * Sets onClick event and <em>disables the javascript-based double-click protection for this link</em>. - * Not for confirmation messages; Should call setConfirmation for that. + * Sets onClick event and <em>disables the javascript-based double-click + * protection for this link</em>. Not for confirmation messages; Should call + * setConfirmation for that. * * @param value * @pre value.toLowerCase().startsWith("return confirm(") == false @@ -364,8 +370,8 @@ //use setConfirmation() instead, or else the javascript will break if (value != null) { Assert.isTrue(!value.toLowerCase().startsWith("return confirm("), - "Do not use setOnClick() to set confirmation messages. " + - "Use setCofirmation() instead."); + "Do not use setOnClick() to set confirmation messages. " + + "Use setCofirmation() instead."); } setAttribute(ON_CLICK, value); @@ -382,11 +388,12 @@ * a JavaScript confirmation. * Subsequent calls to setOnClick will undo the effect of this method. * - * @param message the confirmation message presented to the user. This + * @param message the confirmation message presented to the user. This * message cannot have an apostrophe or back slash * * @pre message.indexOf("'") == -1 && message.indexOf("\\") == -1 - **/ + * + */ public void setConfirmation(String message) { //make sure that the message doesn't have any apostrophe's //or back slashes @@ -394,15 +401,48 @@ if (Assert.isEnabled()) { final boolean isGoodMessage = message.indexOf("'") == -1 && message.indexOf("\\") == -1; Assert.isTrue(isGoodMessage, - "confirmation message cannot contain apostrophe or back slash"); + "confirmation message cannot contain apostrophe or back slash"); } - setAttribute("confirm", "confirm"); + m_sConfirmMsg = message; + } - //set the onclick attribute for the link - setAttribute(ON_CLICK, "return confirm(\\'" + message + "\\');"); + /** + * Set a GlobalizedMessage as confirmation message + * @param msg + */ + public void setConfirmation(GlobalizedMessage msg) { + m_confirmMsg = msg; + } - m_sConfirmMsg = message; + /** + * Generate XML output for confirmation links + * + * @param state PageState + * @param link Parent element + */ + private void exportConfirmAttributes(PageState state, Element link) { + + // If a confirmation message is set + if (m_sConfirmMsg.length() > 0 || m_confirmMsg != null) { + + // then add the needed attributes to link + link.addAttribute("confirm", "confirm"); + + // If m_sConfirmMsg is not empty + if (m_sConfirmMsg.length() > 0) { + + // then set the onclick attribute for the link with the static message + link.addAttribute(ON_CLICK, "return confirm(\\'" + m_sConfirmMsg + "\\');"); + + // else if m_configMsg is set + } else if (m_confirmMsg != null) { + + //then set the onclick attribute for the link with a globalized message + link.addAttribute(ON_CLICK, "return confirm(\\'" + m_confirmMsg.localize() + "\\');"); + + } + } } public final void setNoJavascriptTarget(String sURL) { Modified: trunk/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/categorization/CategorizationConfig.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -34,11 +34,33 @@ private static Logger s_log = Logger.getLogger(CategorizationConfig.class); + /** A logger instance to assist debugging. */ private final Parameter m_showInternalName; + /** Singelton config object. */ + private static CategorizationConfig s_conf; + /** - * Public Constructor + * Gain a CategorizationConfig object. + * + * Singelton pattern, don't instantiate a config object using the + * constructor directly! + * @return */ + public static synchronized CategorizationConfig getConfig() { + if (s_conf == null) { + s_conf = new CategorizationConfig(); + s_conf.load(); + } + + return s_conf; + } + + /** + * Public Constructor, BUT: + * Singelton pattern, don't instantiate a config object using the + * constructor directly! + */ public CategorizationConfig() { /** Modified: trunk/ccm-core/src/com/arsdigita/categorization/Category.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/Category.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/categorization/Category.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -121,13 +121,8 @@ new PrivilegeDescriptor( "map_to_category"); // Quasimodo: Begin - private static CategorizationConfig s_config = new CategorizationConfig(); - - static { - s_log.debug("Static initalizer starting..."); - s_config.load(); - s_log.debug("Static initalizer finished."); - } + private static CategorizationConfig s_config = CategorizationConfig + .getConfig(); // Quasimodo: End public static final String ROOT_CATEGORY = "rootCategory"; public static final String USE_CONTEXT = "useContext"; Added: trunk/ccm-core/src/com/arsdigita/categorization/ui/AbstractCategoryPicker.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/ui/AbstractCategoryPicker.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/categorization/ui/AbstractCategoryPicker.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -0,0 +1,72 @@ +/* + * 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.categorization.ui; + + +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.PageState; +import com.arsdigita.categorization.Category; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.persistence.OID; +import com.arsdigita.toolbox.ui.OIDParameter; + +import java.util.TooManyListenersException; + + +public abstract class AbstractCategoryPicker extends SingleSelect + implements CategoryPicker { + + public AbstractCategoryPicker(String name) { + super(new OIDParameter(name)); + + try { + addPrintListener(new PrintListener() { + public void prepare(PrintEvent ev) { + addOptions(ev.getPageState(), + (SingleSelect)ev.getTarget()); + } + }); + } catch (TooManyListenersException ex) { + throw new RuntimeException("this cannot happen"); + } + } + + public Category getCategory(PageState state) { + OID oid = (OID)getValue(state); + + if (oid == null) { + return null; + } + return (Category)DomainObjectFactory.newInstance(oid); + } + + public void setCategory(PageState state, + Category category) { + if (category == null) { + setValue(state, null); + } else { + setValue(state, category.getOID()); + } + } + + protected abstract void addOptions(PageState state, + SingleSelect target); +} Property changes on: trunk/ccm-core/src/com/arsdigita/categorization/ui/AbstractCategoryPicker.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-core/src/com/arsdigita/categorization/ui/CategorizationTree.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/ui/CategorizationTree.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/categorization/ui/CategorizationTree.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -0,0 +1,91 @@ +/* + * 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.categorization.ui; + +import com.arsdigita.categorization.Category; + +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.domain.DomainServiceInterfaceExposer; +import com.arsdigita.domain.DomainCollection; + +import java.util.Map; +import java.util.HashMap; +import java.util.TreeMap; +import java.math.BigDecimal; + +import org.apache.log4j.Logger; + +/** + * Utility class provides categorisation trees to help building categorization + * ui widgets. + */ +public class CategorizationTree { + + private static final Logger s_log = Logger.getLogger(CategorizationTree.class); + + /** + * Retrieves the category subtree for the given root. + * The returned map has String objects for full path + * name as keys, and Category objects as values + */ + public static Map getSubtreePath(Category root) { + return getSubtreePath(root, " > "); + } + + /** + * Retrieves the category subtree for the given root. + * The returned map has String objects for full path + * name as keys, and Category objects as values + */ + public static Map getSubtreePath(Category root, String join) { + + DomainCollection cats = new DomainCollection( + SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE) + ); + cats.addFilter("defaultAncestors like :ancestors") + .set("ancestors", + ((String)DomainServiceInterfaceExposer + .get(root, "defaultAncestors")) + "%"); + cats.addEqualsFilter("parents.link.isDefault", Boolean.TRUE); + cats.addOrder("defaultAncestors"); + cats.addPath("parents.id"); + + Map path2cat = new TreeMap(); + Map cat2path = new HashMap(); + + path2cat.put(root.getName(), root); + cat2path.put(root.getID(), root.getName()); + + while (cats.next()) { + Category cat = (Category)cats.getDomainObject(); + BigDecimal parent = (BigDecimal)cats.get("parents.id"); + + if (parent == null) { + path2cat.put(cat.getName(), cat); + cat2path.put(cat.getID(), cat.getName()); + } else { + String parentPath = (String)cat2path.get(parent); + String path = parentPath + join + cat.getName(); + path2cat.put(path, cat); + cat2path.put(cat.getID(), path); + } + } + + return path2cat; + } +} Property changes on: trunk/ccm-core/src/com/arsdigita/categorization/ui/CategorizationTree.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-core/src/com/arsdigita/categorization/ui/CategoryPicker.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/ui/CategoryPicker.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/categorization/ui/CategoryPicker.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -0,0 +1,29 @@ +/* + * 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.categorization.ui; + +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.PageState; +import com.arsdigita.categorization.Category; + +public interface CategoryPicker extends Component { + + Category getCategory(PageState state); + void setCategory(PageState state, Category cat); +} Property changes on: trunk/ccm-core/src/com/arsdigita/categorization/ui/CategoryPicker.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-core/src/com/arsdigita/categorization/ui/ObjectCategoryPicker.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/ui/ObjectCategoryPicker.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/categorization/ui/ObjectCategoryPicker.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -0,0 +1,67 @@ +/* + * 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.categorization.ui; + +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.form.SingleSelect; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.categorization.Category; +import com.arsdigita.kernel.ACSObject; + +import java.util.Iterator; +import java.util.Map; + +import org.apache.log4j.Logger; + +public abstract class ObjectCategoryPicker extends AbstractCategoryPicker { + private static final Logger s_log = + Logger.getLogger(ObjectCategoryPicker.class); + + public ObjectCategoryPicker(String name) { + super(name); + } + + protected void addOptions(PageState state, + SingleSelect target) { + ACSObject object = getObject(state); + String context = getContext(state); + Category root = Category.getRootForObject(object, context); + + if (null == root) { + s_log.error("No category root for object " + object.getOID() + + " in context " + context); + return; + } + + Map cats = CategorizationTree.getSubtreePath(root, " > "); + Iterator i = cats.keySet().iterator(); + target.addOption(new Option(null, "-- pick one --")); + while (i.hasNext()) { + String path = (String)i.next(); + Category cat = (Category)cats.get(path); + + target.addOption(new Option(cat.getOID().toString(), + path)); + } + } + + protected abstract ACSObject getObject(PageState state); + protected abstract String getContext(PageState state); + +} Property changes on: trunk/ccm-core/src/com/arsdigita/categorization/ui/ObjectCategoryPicker.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -238,7 +238,7 @@ */ public synchronized static DomainObjectInstantiator registerInstantiator( ObjectType dataObjectType, - DomainObjectInstantiator instantiator) { + DomainObjectInstantiator instantiator) { if (null == dataObjectType) { throw new InstantiatorRegistryException("null", instantiator); } Modified: trunk/ccm-core/src/com/arsdigita/globalization/Globalization.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/globalization/Globalization.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/globalization/Globalization.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -18,13 +18,13 @@ */ package com.arsdigita.globalization; +import com.arsdigita.dispatcher.DispatcherHelper; +import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.kernel.Kernel; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.kernel.Kernel; import com.arsdigita.util.Assert; import java.io.UnsupportedEncodingException; import java.text.MessageFormat; Modified: trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -22,6 +22,8 @@ import com.arsdigita.globalization.Charset; import com.arsdigita.globalization.Locale; import com.arsdigita.kernel.EmailAddress; +import com.arsdigita.kernel.Group; +import com.arsdigita.kernel.GroupCollection; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.PackageInstance; @@ -50,8 +52,8 @@ import com.arsdigita.util.parameter.CSVParameterReader; import com.arsdigita.util.parameter.EmailParameter; import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.servlet.HttpHost; import com.arsdigita.web.Application; import com.arsdigita.web.ApplicationType; @@ -66,12 +68,11 @@ import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; +import java.util.ArrayList; import java.util.Arrays; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -// import java.util.Locale; import java.util.Map; import javax.mail.internet.InternetAddress; @@ -221,7 +222,7 @@ private String getResource() { return (String) get(m_resource); } - + /** * Retrieve systems recognized character sets. * @@ -315,7 +316,7 @@ // Used to invoke static class LoaderImpl - method load() in // com.arsdigita.search.lucene.IndexId. Same procedure is invoked by // the initializer each time the system starts. So it's redundant here. - // Using initializer code is favourable because it may be conditionally + // Using initializer code is favourable because it may be conditionally // performed, depending on configuration (Lucene or Intermedia). // But the currently given implementation requires the loader // instruction here to let the code initialization time (i.e. at each @@ -327,7 +328,7 @@ } /** - * + * * @param rootNode * @deprecated will be removed without replacement. Naot needed anymore */ @@ -387,7 +388,7 @@ /** - * Ensure that at least one User with universal "admin" permission exists + * Ensure that at least one User with universal "admin" permission exists * after installation. */ private void createSystemAdministrator() { @@ -445,6 +446,15 @@ (new UniversalPermissionDescriptor (PrivilegeDescriptor.ADMIN, sa)); + // Add system administrator to site-wide administrator group + GroupCollection groupColl = Group.retrieveAll(); + // FIXME: String for Site-wide Admininistrators is hardcoded because + // this group in inserted via sql-command during setup + groupColl.filter("Site-wide Administrators"); + if(groupColl.next()) { + groupColl.getGroup().addMember(sa); + } + s_log.debug("Adding administrator: \"" + givenName + " " + familyName + "\" <" + emailAddress + ">"); s_log.debug("CoreLoader: method createSystemAdministrator() completed."); @@ -455,17 +465,17 @@ * Setup Login application. Loads type into database and instances the * single default instance. * Has to be public access in order to enable script Upgrade664 to use it. - * @return + * @return */ public static void loadLoginApp() { - + ApplicationType loginType = new ApplicationType("login", Login.BASE_DATA_OBJECT_TYPE ); loginType.setDescription("CCM user login application"); loginType.save(); - - + + Application login = Application.createApplication(loginType, "register", "CCM Login", @@ -481,14 +491,14 @@ * Has to be public access in order to enable script Upgrade664 to use it. */ public static void loadAdminApp() { - + ApplicationType adminType = new ApplicationType("admin", Admin.BASE_DATA_OBJECT_TYPE ); adminType.setDescription("CCM user and group administration"); adminType.save(); - - + + Application admin = Application.createApplication(adminType, "admin", "CCM Admin", @@ -504,11 +514,11 @@ */ public static void loadPermissionsApp() { - /* NOTE: + /* NOTE: * The wording in the title parameter of ApplicationType determines * the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and - * replacing blanks between words and illegal characters with an hyphen + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an hyphen * and converted to lower case. * Example: "Permissions" will become "permissions". */ @@ -517,7 +527,7 @@ Permissions.BASE_DATA_OBJECT_TYPE ); type.setDescription("CCM permissions administration"); type.save(); - + Application app = Application.createApplication(type, "permissions", "CCM Permissions", @@ -533,7 +543,7 @@ * database and instantiate the (only) application instance. * * Public static access needed by upgrade script Upgrade664 - * @return webDevType ApplicationType + * @return webDevType ApplicationType */ public static void loadWebDev() { @@ -549,12 +559,12 @@ null); webDev.setDescription("The default WEB developer service instance."); webDev.save(); - + return; } /** - * Load core's basic portal infrastructure. + * Load core's basic portal infrastructure. */ private void loadPortal() { s_log.info("Adding resource type: portal"); @@ -568,7 +578,7 @@ /** * Reads supported mime types from a file and ???. - * + * * Run once during initial load. */ private void loadMimeTypes() { @@ -586,7 +596,7 @@ (new InputStreamReader(is), row.getParameters()); while (loader.next()) { - + row.load(loader); s_log.info("Adding mimetype: " + row.getType() + " (" + @@ -595,7 +605,7 @@ (row.getType(), row.getJavaClass(), row.getObjectType()); mime.setLabel(row.getLabel()); mime.setFileExtension(row.getDefaultExtension()); - + if (mime instanceof TextMimeType) { ((TextMimeType) mime).setAllowINSOConvert ("1".equals(row.getSizerOrINSO())); @@ -603,11 +613,11 @@ if (mime instanceof ImageMimeType) { ((ImageMimeType) mime).setImageSizer(row.getSizerOrINSO()); } - String[] extensions = + String[] extensions = StringUtils.split(row.getExtensions(), ','); for (int i = 0; i < extensions.length; i++) { - MimeTypeExtension ext = - MimeTypeExtension.create(extensions[i], + MimeTypeExtension ext = + MimeTypeExtension.create(extensions[i], mime.getMimeType()); ext.save(); } Modified: trunk/ccm-core/src/com/arsdigita/search/lucene/LuceneSearch.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/search/lucene/LuceneSearch.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/search/lucene/LuceneSearch.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -51,43 +51,37 @@ * @author Richard Su (ric...@al...) * @version $Id$ * - **/ - + * + */ public class LuceneSearch { private static final Logger LOG = Logger.getLogger(LuceneSearch.class); - private org.apache.lucene.document.Document m_doc; private float m_score; - private Query m_query; private Filter m_filter; - private long m_offset; private long m_howmany; - private List m_hits; private Iterator m_hitIterator; private int m_size; private long m_searchTime = 0; - private boolean m_rangeSet = false; - private static final LuceneLock LOCK = LuceneLock.getInstance(); - /** - * This is maximum number of search results that Lucene can return by default. - * If we need more than this, eg. for page 12 of search results we need entries - * 111-120, we have to use different (slower) search methods. + * This is maximum number of search results that Lucene can return by + * default. If we need more than this, eg. for page 12 of search results we + * need entries 111-120, we have to use different (slower) search methods. */ public static final int LUCENE_MAX_HITS = 100; /** - * Search over all objects in the system. Returns objects that matches - * the search string. + * Search over all objects in the system. Returns objects that matches the + * search string. * * @param searchString user specified search string - **/ + * + */ public LuceneSearch(String searchString) { this(searchString, (Filter) null); } @@ -97,7 +91,8 @@ * * @param searchString user specified search string * @param objectType ACS object type - **/ + * + */ public LuceneSearch(String searchString, String objectType) { this(searchString, new ObjectTypeFilter(objectType)); } @@ -107,33 +102,78 @@ * * @param searchString user specified search string * @param f a filter - **/ + * + */ public LuceneSearch(String searchString, Filter f) { m_filter = f; try { LuceneConfig conf = LuceneConfig.getConfig(); Analyzer analyzer = conf.getAnalyzer(); QueryParser parser = new QueryParser(Document.CONTENT, analyzer); - m_query = parser.parse(searchString); + m_query = parser.parse(escapeSearchString(searchString)); } catch (ParseException ex) { LOG.fatal("failed parsing the expression: " + searchString, ex); } } + + private String escapeSearchString(final String search) { + StringBuilder builder = new StringBuilder(); + char c; + for (int i = 0; i < search.length(); i++) { + c = search.charAt(i); + //Missing breaks are correct here! + switch (c) { + case '&': + case '|': + if (search.length() > (i+1)) { + if (search.charAt(i + 1) == c) { + builder.append("\\"); + builder.append(c); + builder.append(c); + break; + } + } + case '+': + case '-': + case '!': + case '(': + case ')': + case '{': + case '}': + case '[': + case ']': + case '^': + case '\"': + case '~': + case '*': + case '?': + case ':': + case '\\': + builder.append("\\"); + default: + builder.append(c); + } + } + + return builder.toString(); + } + /** * Search given a preformed query. * * @param q a performed query - **/ + * + */ public LuceneSearch(Query q) { m_query = q; m_filter = null; } /** - * @param offset indicates how many documents will be skipped, 0 means - * retrieve top-most hits - * @param howmany maximum size of the result set + * @param offset indicates how many documents will be skipped, 0 means + * retrieve top-most hits + * @param howmany maximum size of the result set */ public void setResultRange(long offset, long howmany) { m_rangeSet = true; @@ -141,10 +181,10 @@ m_howmany = howmany; } - private void performSearch() { if (LOG.isInfoEnabled()) { - LOG.info("About to perform search, query = " + m_query + ", filter = " + m_filter); + LOG.info("About to perform search, query = " + m_query + + ", filter = " + m_filter); } long st = System.currentTimeMillis(); m_hits = new ArrayList(); @@ -155,7 +195,8 @@ // search request, with explicitly stated requested document range. m_offset = 0; m_howmany = Search.CACHE_SIZE; - LOG.info("Result range not set. Retrieving first " + m_howmany + " hits from the result set"); + LOG.info("Result range not set. Retrieving first " + m_howmany + + " hits from the result set"); } if (m_offset + m_howmany <= LUCENE_MAX_HITS) { performClassicSearch(); @@ -166,15 +207,15 @@ m_searchTime = System.currentTimeMillis() - st; } - private void performClassicSearch() { if (LOG.isInfoEnabled()) { - LOG.info("Performing classic search, offset + howmany = " + (m_offset + m_howmany)); + LOG.info("Performing classic search, offset + howmany = " + + (m_offset + m_howmany)); } Hits hits = null; IndexSearcher index = null; try { - synchronized(LOCK) { + synchronized (LOCK) { index = new IndexSearcher(Index.getLocation()); hits = index.search(m_query, m_filter); m_size = hits.length(); @@ -186,43 +227,46 @@ int docID = 0; try { int ndx = (int) m_offset; - while (ndx < hits.length() && ndx < m_offset + m_howmany) { + while (ndx < hits.length() && ndx < m_offset + m_howmany) { docID = hits.id(ndx); float score = hits.score(ndx); - m_hits.add(new SearchResultWrapper(docID, score, hits.doc(ndx++))); + m_hits.add( + new SearchResultWrapper(docID, score, hits.doc(ndx++))); if (LOG.isDebugEnabled()) { - LOG.debug("Match #" + ndx + " doc: " + docID + " score: " + score); + LOG.debug("Match #" + ndx + " doc: " + docID + " score: " + + score); } } } catch (IOException ioe) { - LOG.error("Can't retrieve doc #" + docID + " from the result set", ioe); + LOG.error("Can't retrieve doc #" + docID + " from the result set", + ioe); return; } closeSearchIndex(index); } - - - private void performCustomSearch() { if (LOG.isInfoEnabled()) { - LOG.info("Performing CUSTOM search, offset + howmany = " + (m_offset + m_howmany)); + LOG.info("Performing CUSTOM search, offset + howmany = " + + (m_offset + m_howmany)); } IndexSearcher index = null; List unsortedHits = new ArrayList(); try { - synchronized(LOCK) { + synchronized (LOCK) { index = new IndexSearcher(Index.getLocation()); - index.search(m_query, m_filter, new CustomHitCollector(unsortedHits)); + index.search(m_query, m_filter, new CustomHitCollector( + unsortedHits)); } } catch (IOException ex) { - LOG.error("search failed" , ex); + LOG.error("search failed", ex); return; } m_size = unsortedHits.size(); // Results from a custom search are not sorted. We must explicitly sort them now, // with the documents having highest score on the top. Collections.sort(unsortedHits, new Comparator() { + public int compare(Object o1, Object o2) { CustomHitWrapper hit1 = (CustomHitWrapper) o1; CustomHitWrapper hit2 = (CustomHitWrapper) o2; @@ -237,10 +281,11 @@ // to avoid all surprises return hit1.getDocID() - hit2.getDocID(); } + public boolean equals(Object obj) { return equals(obj); } - }); + }); if (LOG.isDebugEnabled()) { LOG.debug("Dumping sorted result set"); @@ -248,29 +293,34 @@ Iterator i = unsortedHits.iterator(); while (i.hasNext()) { CustomHitWrapper hit = (CustomHitWrapper) i.next(); - LOG.debug("SORT #" + ++count + " doc: " + hit.getDocID() + " score: " + hit.getScore()); + LOG.debug("SORT #" + ++count + " doc: " + hit.getDocID() + + " score: " + hit.getScore()); } } // Finally populate the search results int ndx = (int) m_offset; - while (ndx < m_size && ndx < m_offset + m_howmany) { + while (ndx < m_size && ndx < m_offset + m_howmany) { CustomHitWrapper chw = (CustomHitWrapper) unsortedHits.get(ndx++); if (LOG.isDebugEnabled()) { - LOG.debug("Match #" + ndx + " is within the requested document range"); - LOG.debug("HIT doc: " + chw.getDocID() + " score: " + chw.getScore()); + LOG.debug("Match #" + ndx + + " is within the requested document range"); + LOG.debug("HIT doc: " + chw.getDocID() + " score: " + chw. + getScore()); } try { - m_hits.add(new SearchResultWrapper(chw.getDocID(), chw.getScore(), index.doc(chw.getDocID()))); + m_hits.add(new SearchResultWrapper(chw.getDocID(), + chw.getScore(), + index.doc(chw.getDocID()))); } catch (IOException ioe) { - LOG.error("Could not retrieve doc #" + chw.getDocID() + " from search index", ioe); + LOG.error("Could not retrieve doc #" + chw.getDocID() + + " from search index", ioe); } } closeSearchIndex(index); } - private class CustomHitCollector extends HitCollector { private List m_unsortedHits; @@ -282,14 +332,13 @@ public void collect(int doc, float score) { if (LOG.isDebugEnabled()) { - LOG.debug("Match #" + ++count + " doc: " + doc + " score: " + score); + LOG.debug("Match #" + ++count + " doc: " + doc + " score: " + + score); } m_unsortedHits.add(new CustomHitWrapper(doc, score)); } } - - private void closeSearchIndex(IndexSearcher index) { try { index.close(); @@ -300,8 +349,8 @@ /** * Returns the number of hits in this query. - **/ - + * + */ public int size() { if (m_hits == null) { performSearch(); @@ -320,7 +369,8 @@ * Returns true if the search has more results * * @return true if the search has more results - **/ + * + */ public boolean next() { if (m_hits == null) { performSearch(); @@ -335,15 +385,16 @@ } /** - * Closes this search. This is now no-op. - **/ + * Closes this search. This is now no-op. + * + */ public void close() { } /** * Returns the score of the current hit. - **/ - + * + */ public float getScore() { return m_score; } @@ -352,7 +403,8 @@ * Returns the ACS object ID of the current search hit. * * @return the object id - **/ + * + */ public BigDecimal getID() { return new BigDecimal(m_doc.get(Document.ID)); } @@ -361,14 +413,15 @@ * Returns the locale the current search hit is in. * * @return the locale the content is in - **/ + * + */ public Locale getLocale() { String language = m_doc.get(Document.LANGUAGE); String country = m_doc.get(Document.COUNTRY); if ("".equals(language) && "".equals(country)) { if (LOG.isDebugEnabled()) { - LOG.debug( "Document: " + getID() + ", Language: " + language + - ", Country: " + country ); + LOG.debug("Document: " + getID() + ", Language: " + language + + ", Country: " + country); } return null; } else { @@ -380,7 +433,8 @@ * Returns the object type of the current search hit. * * @return the object type - **/ + * + */ public String getType() { return m_doc.get(Document.TYPE); } @@ -389,7 +443,8 @@ * Returns type-specific info of the current search hit. * * @return the type-specific info - **/ + * + */ public String getTypeSpecificInfo() { return m_doc.get(Document.TYPE_SPECIFIC_INFO); } @@ -398,7 +453,8 @@ * Returns the title of the current search hit. * * @return the link text for the object - **/ + * + */ public String getTitle() { return m_doc.get(Document.TITLE); } @@ -407,26 +463,29 @@ * Returns a summary for the current search hit. * * @return a summary for the hit - **/ + * + */ public String getSummary() { return m_doc.get(Document.SUMMARY); } /** - * Returns the content of the current search hit, as it is stored in Lucene index. + * Returns the content of the current search hit, as it is stored in Lucene + * index. * * @return the content - **/ + * + */ public String getContent() { return m_doc.get(Document.CONTENT); } - /** * Returns the creation date of the current search hit. * * @return the creation date. - **/ + * + */ public Date getCreationDate() { return toDate(m_doc.get(Document.CREATION_DATE)); } @@ -435,7 +494,8 @@ * Returns the last modified date of the current search hit. * * @return the last modified date. - **/ + * + */ public Date getLastModifiedDate() { return toDate(m_doc.get(Document.LAST_MODIFIED_DATE)); } @@ -444,7 +504,8 @@ * Returns a Date. * * @return Date. - **/ + * + */ private Date toDate(String date) { if (date == null || date.equals("")) { return null; @@ -461,12 +522,12 @@ * Gets the title of the content section of the current search hit. * * @return content section title - **/ + * + */ public String getContentSection() { return m_doc.get(Document.CONTENT_SECTION); } - private class CustomHitWrapper { // Lucene search document id @@ -491,7 +552,8 @@ private org.apache.lucene.document.Document doc; - public SearchResultWrapper(int docID, float s, org.apache.lucene.document.Document d) { + public SearchResultWrapper(int docID, float s, + org.apache.lucene.document.Document d) { super(docID, s); doc = d; } @@ -499,7 +561,5 @@ public org.apache.lucene.document.Document getDoc() { return doc; } - } } - Modified: trunk/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/search/ui/BaseQueryComponent.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -27,6 +27,7 @@ import com.arsdigita.bebop.FormModel; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.parameters.ParameterData; +import com.arsdigita.globalization.Globalization; import com.arsdigita.xml.Element; import com.arsdigita.globalization.GlobalizedMessage; @@ -126,7 +127,9 @@ Element terms = Search.newElement("terms"); terms.addAttribute("param", m_terms.getName()); - terms.addAttribute("value", getTerms(state)); + terms.addAttribute("value", + Globalization.decodeParameter(state.getRequest(), + m_terms.getName())); generateErrorXML(state, terms); content.addContent(terms); Modified: trunk/ccm-core/src/com/arsdigita/search/ui/ResultsPane.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/search/ui/ResultsPane.java 2012-05-01 08:18:39 UTC (rev 2303) +++ trunk/ccm-core/src/com/arsdigita/search/ui/ResultsPane.java 2012-05-01 12:15:41 UTC (rev 2304) @@ -21,6 +21,7 @@ import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.parameters.IntegerParameter; +import com.arsdigita.globalization.Globalization; import com.arsdigita.kernel.Party; import com.arsdigita.xml.Element; @@ -34,6 +35,7 @@ import com.arsdigita.web.URL; import com.arsdigita.web.ParameterMap; import com.arsdigita.web.Web; +import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.Iterator; @@ -63,7 +65,7 @@ } public ResultsPane(QueryGenerator query, - String engine) { + String engine) { m_query = query; m_engine = engine; m_pageNumber = new IntegerParameter("page"); @@ -83,20 +85,23 @@ ResultSet resultSet = null; try { resultSet = m_engine == null - ? Search.process(spec) - : Search.process(spec, Search.DEFAULT_RESULT_CACHE, m_engine); + ? Search.process(spec) + : Search.process(spec, Search.DEFAULT_RESULT_CACHE, + m_engine); if (s_log.isDebugEnabled()) { s_log.debug("Got result set " + resultSet.getClass() - + " count: " + resultSet.getCount()); + + " count: " + resultSet.getCount()); } if (resultSet.getCount() > 0) { - Integer page = (Integer) m_pageNumber.transformValue(state.getRequest()); + Integer page = (Integer) m_pageNumber.transformValue(state. + getRequest()); int pageNumber = (page == null ? 1 : page.intValue()); long objectCount = resultSet.getCount(); - int pageCount = (int) Math.ceil((double) objectCount / (double) m_pageSize); + int pageCount = (int) Math.ceil((double) objectCount + / (double) m_pageSize); if (pageNumber < 1) { pageNumber = 1; @@ -117,16 +122,17 @@ if (s_log.isDebugEnabled()) { s_log.debug("Paginator stats\n page number:" + pageNumber - + "\n page count: " + pageCount + "\n page size: " - + m_pageSize + "\n start " + begin + "\n end: " - + end + "\n count: " + objectCount); + + "\n page count: " + pageCount + + "\n page size: " + + m_pageSize + "\n start " + begin + "\n end: " + + end + "\n count: " + objectCount); } content.addContent(generatePaginatorXML(state, - m_pageNumber.getName(), - pageNumber, pageCount, - m_pageSize, begin, end, - objectCount)); + m_pageNumber.getName(), + pageNumber, pageCount, + m_pageSize, begin, end, + objectCount)); content.addContent(generateDocumentsXML(state, results)); parent.addContent(content); @@ -158,13 +164,13 @@ } protected Element generatePaginatorXML(PageState state, - String pageParam, - int pageNumber, - int pageCount, - int pageSize, - long begin, - long end, - long objectCount) { + String pageParam, + int pageNumber, + int pageCount, + int pageSize, + long begin, + long end, + long objectCount) { Element paginator = Search.newElement("paginator"); URL url = Web.getContext().getRequestURL(); @@ -175,11 +181,15 @@ if (key.equals(pageParam)) { continue; } - map.setParameterValues(key, url.getParameterValues(key)); + //map.setParameterValues(key, url.getParameterValues(key)); + map.setParameterValues(key, + decodeParameters(url.getParamete... [truncated message content] |
Author: pboy Date: 2012-05-01 08:18:39 +0000 (Tue, 01 May 2012) New Revision: 2303 Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml trunk/ccm-forum/src/com/arsdigita/forum/Loader.java trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml trunk/ccm-ldn-atoz/application.xml Log: Adapted bundle files to modified packages. Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-05-01 08:18:39 UTC (rev 2303) @@ -87,27 +87,30 @@ <load-on-startup>1</load-on-startup> </servlet> +<!-- <servlet> <servlet-name>legacy-dispatcher</servlet-name> <servlet-class>com.arsdigita.sitenode.SiteNodeDispatcher</servlet-class> <load-on-startup>3</load-on-startup> </servlet> - +--> <servlet> <servlet-name>ccm-dispatcher</servlet-name> <servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class> +<!-- <init-param> <param-name>fallback-servlet</param-name> <param-value>legacy-dispatcher</param-value> - </init-param> + </init-param> +--> <load-on-startup>2</load-on-startup> </servlet> - +<!-- <servlet> <servlet-name>legacy-adapter</servlet-name> <servlet-class>com.arsdigita.web.LegacyAdapterServlet</servlet-class> </servlet> - +--> <servlet> <servlet-name>cache-manager</servlet-name> <servlet-class>com.arsdigita.caching.CacheServlet</servlet-class> @@ -134,11 +137,6 @@ </servlet> <servlet> - <servlet-name>webadmin-sitemap</servlet-name> - <servlet-class>com.arsdigita.ui.sitemap.SiteMapServlet</servlet-class> - </servlet> - - <servlet> <servlet-name>webadmin-permissions</servlet-name> <servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class> </servlet> @@ -448,12 +446,12 @@ <servlet-name>ccm-dispatcher</servlet-name> <url-pattern>/ccm/*</url-pattern> </servlet-mapping> - +<!-- <servlet-mapping> <servlet-name>legacy-adapter</servlet-name> <url-pattern>/templates/servlet/legacy-adapter/*</url-pattern> </servlet-mapping> - +--> <servlet-mapping> <servlet-name>cache-manager</servlet-name> <url-pattern>/expireCache/*</url-pattern> @@ -480,11 +478,6 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webadmin-sitemap</servlet-name> - <url-pattern>/admin-sitemap/*</url-pattern> - </servlet-mapping> - - <servlet-mapping> <servlet-name>webadmin-permissions</servlet-name> <url-pattern>/admin-permissions/*</url-pattern> </servlet-mapping> Modified: trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-05-01 08:18:39 UTC (rev 2303) @@ -87,27 +87,30 @@ <load-on-startup>1</load-on-startup> </servlet> +<!-- <servlet> <servlet-name>legacy-dispatcher</servlet-name> <servlet-class>com.arsdigita.sitenode.SiteNodeDispatcher</servlet-class> <load-on-startup>3</load-on-startup> </servlet> - +--> <servlet> <servlet-name>ccm-dispatcher</servlet-name> <servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class> +<!-- <init-param> <param-name>fallback-servlet</param-name> <param-value>legacy-dispatcher</param-value> - </init-param> + </init-param> +--> <load-on-startup>2</load-on-startup> </servlet> - +<!-- <servlet> <servlet-name>legacy-adapter</servlet-name> <servlet-class>com.arsdigita.web.LegacyAdapterServlet</servlet-class> </servlet> - +--> <servlet> <servlet-name>cache-manager</servlet-name> <servlet-class>com.arsdigita.caching.CacheServlet</servlet-class> @@ -134,11 +137,6 @@ </servlet> <servlet> - <servlet-name>webadmin-sitemap</servlet-name> - <servlet-class>com.arsdigita.ui.sitemap.SiteMapServlet</servlet-class> - </servlet> - - <servlet> <servlet-name>webadmin-permissions</servlet-name> <servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class> </servlet> @@ -448,12 +446,12 @@ <servlet-name>ccm-dispatcher</servlet-name> <url-pattern>/ccm/*</url-pattern> </servlet-mapping> - +<!-- <servlet-mapping> <servlet-name>legacy-adapter</servlet-name> <url-pattern>/templates/servlet/legacy-adapter/*</url-pattern> </servlet-mapping> - +--> <servlet-mapping> <servlet-name>cache-manager</servlet-name> <url-pattern>/expireCache/*</url-pattern> @@ -480,11 +478,6 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webadmin-sitemap</servlet-name> - <url-pattern>/admin-sitemap/*</url-pattern> - </servlet-mapping> - - <servlet-mapping> <servlet-name>webadmin-permissions</servlet-name> <url-pattern>/admin-permissions/*</url-pattern> </servlet-mapping> Modified: trunk/ccm-forum/src/com/arsdigita/forum/Loader.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/Loader.java 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-forum/src/com/arsdigita/forum/Loader.java 2012-05-01 08:18:39 UTC (rev 2303) @@ -109,13 +109,9 @@ setupDigestUser(); setupForumAppType( (String[]) get(m_forumInstances) ); - //setupInboxAppType(); //TODO: why it is commented out? setupRecentPostingsPortletType(); setupMyForumsPortletType(); - // moved upwards - // setupDigestUser(); - SessionManager.getSession().flushAll(); } }.run(); @@ -131,8 +127,7 @@ */ private static void setupForumAppType(String[] forumNames) { - /* Create legacy-free application type - * NOTE: The wording in the title parameter of ApplicationType + /* NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. * It gets "urlized", i.e. trimming leading and trailing blanks and * replacing blanks between words and illegal characters with an @@ -158,20 +153,6 @@ } /** - * TODO: What is it for? Execution is currently commented out. - * Referenced class com.arsdigita.forum.Inbox does not exist. - * @return - */ - private static ApplicationType setupInboxAppType() { - ApplicationType type = ApplicationType - .createApplicationType(Forum.PACKAGE_TYPE, - "Inbox", - "com.arsdigita.forum.Inbox"); - type.setDescription("Inbox"); - return type; - } - - /** * * @return */ Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-05-01 08:18:39 UTC (rev 2303) @@ -95,7 +95,7 @@ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Extended Bundle's Content Assets --> - <ccm:application name="ccm-cms-assets-imagestep"/> +<!-- <ccm:application name="ccm-cms-assets-imagestep"/> --> <!-- Extended Bundle's Content Types --> <ccm:application name="ccm-cms-types-agenda"/> @@ -142,7 +142,6 @@ <!-- --> <ccm:application name="ccm-cms-types-image"/> - <ccm:application name="ccm-webpage"/> <!-- ADD-ONs Bundle's Applications --> @@ -152,13 +151,26 @@ <ccm:application name="ccm-docrepo"/> <ccm:application name="ccm-faq"/> <ccm:application name="ccm-forum-categorised"/> + + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- APLAWS+ packages under evaluation --> +<!-- These packages will not be made available in any bundle. --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Content Types under evaluation --> + <ccm:application name="ccm-webpage"/> + +<!-- Applications under evaluation --> + <!-- Currently broken. --> + <ccm:application name="ccm-docmgr"/> + <!-- some minor program issues --> <ccm:application name="ccm-portalserver"/> + <!-- no documentation --> <ccm:application name="ccm-weblog"/> - <!-- Currently broken. --> - <ccm:application name="ccm-docmgr"/> - -<!-- ADD-ONs Bundle's Portlets --> +<!-- Portlets under evaluation --> <!-- Currently broken. Missing file: ccm-portlet/postgres-create.sql <ccm:application name="ccm-portlet"/> --> Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-05-01 08:18:39 UTC (rev 2303) @@ -87,27 +87,30 @@ <load-on-startup>1</load-on-startup> </servlet> +<!-- <servlet> <servlet-name>legacy-dispatcher</servlet-name> <servlet-class>com.arsdigita.sitenode.SiteNodeDispatcher</servlet-class> <load-on-startup>3</load-on-startup> </servlet> - +--> <servlet> <servlet-name>ccm-dispatcher</servlet-name> <servlet-class>com.arsdigita.web.DispatcherServlet</servlet-class> +<!-- <init-param> <param-name>fallback-servlet</param-name> <param-value>legacy-dispatcher</param-value> - </init-param> + </init-param> +--> <load-on-startup>2</load-on-startup> </servlet> - +<!-- <servlet> <servlet-name>legacy-adapter</servlet-name> <servlet-class>com.arsdigita.web.LegacyAdapterServlet</servlet-class> </servlet> - +--> <servlet> <servlet-name>cache-manager</servlet-name> <servlet-class>com.arsdigita.caching.CacheServlet</servlet-class> @@ -459,12 +462,12 @@ <servlet-name>ccm-dispatcher</servlet-name> <url-pattern>/ccm/*</url-pattern> </servlet-mapping> - +<!-- <servlet-mapping> <servlet-name>legacy-adapter</servlet-name> <url-pattern>/templates/servlet/legacy-adapter/*</url-pattern> </servlet-mapping> - +--> <servlet-mapping> <servlet-name>cache-manager</servlet-name> <url-pattern>/expireCache/*</url-pattern> Modified: trunk/ccm-ldn-atoz/application.xml =================================================================== --- trunk/ccm-ldn-atoz/application.xml 2012-05-01 08:16:46 UTC (rev 2302) +++ trunk/ccm-ldn-atoz/application.xml 2012-05-01 08:18:39 UTC (rev 2303) @@ -21,8 +21,15 @@ <ccm:contact uri="mailto:rh...@re..." type="support"/> </ccm:contacts> <ccm:description> - The Red Hat Web Application Framework is a platform for writing - database-backed web applications in Java. + The ccm-ldn-atoz package enables a site to present all it's content in + alphabetical order as an additional service to it's users. Usually the + theme provides a link to the page as part of its static elements. + + By default the application presents the A-Z list at ~/ccm/atoz/. + + An administration interface is provided at ~/ccm/atoz/admin/. Here you + can configure the content to be listed by selecting an appropriate + content provider. </ccm:description> </ccm:application> |
From: <pb...@fe...> - 2012-05-01 08:17:03
|
Author: pboy Date: 2012-05-01 08:16:46 +0000 (Tue, 01 May 2012) New Revision: 2302 Added: trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java.nolongerInUse Removed: trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java trunk/ccm-core/src/com/arsdigita/web/LegacyAdapterServlet.java Modified: trunk/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java trunk/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java trunk/ccm-core/src/com/arsdigita/ui/login/Login.java trunk/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java trunk/ccm-core/src/com/arsdigita/web/ApplicationType.java trunk/ccm-core/src/com/arsdigita/web/BaseDispatcher.java trunk/ccm-core/src/com/arsdigita/web/DispatcherServlet.java trunk/ccm-core/src/com/arsdigita/web/URL.java trunk/ccm-core/src/com/arsdigita/web/Web.java trunk/ccm-core/src/overview.html trunk/ccm-core/web/WEB-INF/web.ccm-core.xml Log: Removed legacy Servlets, various minor fixes. Modified: trunk/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -126,16 +126,6 @@ } }); - registerXSLParameterGenerator("static-prefix", - new XSLParameterGenerator() { - - @Override - public String generateValue(HttpServletRequest request) { - return Web.getContext().getRequestURL().getContextPath() - + com.arsdigita.web.URL.STATIC_DIR; - } - }); - registerXSLParameterGenerator("dispatcher-prefix", new XSLParameterGenerator() { Modified: trunk/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/sitenode/ServletErrorReport.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -18,23 +18,24 @@ */ package com.arsdigita.sitenode; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.PersonName; import com.arsdigita.logging.ErrorReport; import com.arsdigita.util.Exceptions; import com.arsdigita.util.ExceptionUnwrapper; -import java.util.ArrayList; -import java.util.TreeSet; -import java.text.Collator; -import java.util.Enumeration; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.PersonName; +import java.util.ArrayList; +import java.util.TreeSet; +import java.text.Collator; +import java.util.Enumeration; + import org.apache.log4j.Logger; /** Deleted: trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -1,453 +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.sitenode; - -import com.arsdigita.developersupport.DeveloperSupport; -import com.arsdigita.dispatcher.Dispatcher; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.kernel.DatabaseTransaction; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.KernelDispatcherServlet; -import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.kernel.PackageInstance; -import com.arsdigita.kernel.SiteNode; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.security.UserContext; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.util.Assert; -import com.arsdigita.util.UncheckedWrapperException; -import com.arsdigita.web.Application; -import com.arsdigita.web.BaseServlet; -import com.arsdigita.web.DispatcherServlet; -import com.arsdigita.web.ParameterMap; -import com.arsdigita.web.RedirectSignal; -import com.arsdigita.web.URL; -import com.arsdigita.web.Web; -import com.arsdigita.web.WebContextExposer; -import com.arsdigita.web.WebExposer; -import java.io.IOException; -import javax.security.auth.login.LoginException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; - -/** - * Main site-map dispatcher entry point for ACS. Selects a package to - * serve from a site map (URL-to-ACS package) in the RDBMS. This can - * be deployed as a servlet in web.xml, so that this becomes the main - * entry point for an ACS application. - * - * <p> - * - * When a request comes in: - * - * <ol> - * - * <li>The BaseDispatcherServlet superclass first looks for a concrete - * file in the webapp root that matches the requested URL. - * - * <li>If no file is found, we try to authenticate the user, and - * resolve the request for a URL to a <code>PackageInstance</code> - * using the <code>SiteNode</code> class, which represents a "site - * map" (URL to package mapping). - * - * <li>We pass control to the package-level dispatcher for that package, - * which will then resolve the URL to a particular file in the filesystem. - * - * </ol> - * - * <p> - * - * @author Bill Schneider - * @version $Id$ - * @since 4.5 - * @deprecated Use {@link com.arsdigita.web.DispatcherServlet} instead. - * Pboy (2009-08-06): - * a) SiteNodeDispatcher is still included in web.xml - * b) content-center needs SiteNodeDispatcher - * c) SiteNodeDispatcher is fallback in web.DispatcherServlet (cf web.xml) - * d) webDispatcherServlet requires a fallback as parameter - * therefore: SideNodeDispatcher is still required at the moment. - * ToDo: test if web.LegacyAdapterServlet, a 'servlet that does what - * SiteNodeDispatcher does' can do the job. - */ -public class SiteNodeDispatcher extends KernelDispatcherServlet - implements Dispatcher { - - private static final Logger s_log = - Logger.getLogger(SiteNodeDispatcher.class.getName()); - - private static SiteNodeDispatcher s_instance = null; - - // dispatcher for resolving abstract URLs in /www, /packages, etc., - // directories -// private SiteNode m_rootSiteNode; - - /** - * Returns the currently-loaded instance of the request - * processor servlet. - * @return The current JVM's RequestProcessor instance. - */ - public synchronized static SiteNodeDispatcher getInstance() { - return s_instance; - } - -// /** -// * Called when servlet is loaded, and sets static instance. -// */ -// public synchronized void init() throws ServletException { -// super.init(); -// -// try { -// DatabaseTransaction txn = new DatabaseTransaction(); -// txn.begin(); -// -// m_rootSiteNode = SiteNode.getRootSiteNode(); -// -// txn.end(); -// } catch (IllegalStateException e) { -// s_log.error("SiteNodeDispatcher.init", e); -// throw new UnavailableException( -// "SiteNodeDispatcher Initialization Failure" + -// "\n The most likely cause is that the initialization sequence did not" + -// "\n complete successfully. Check the error logs for other error messages" + -// "\n and make sure you have a valid enterprise.init" + -// "\n\n" + e.getMessage()); -// } catch (PersistenceException e) { -// s_log.error("SiteNodeDispatcher.init", e); -// throw new UnavailableException( -// "SiteNodeDispatcher Initialization Failure" + -// "\n The most likely cause is that the initialization sequence did not" + -// "\n complete successfully. Check the error logs for other error messages" + -// "\n and make sure you have a valid enterprise.init" + -// "\n\n" + e.getMessage()); -// } catch (Exception e) { -// s_log.error("SiteNodeDispatcher.init", e); -// throw new UnavailableException(e.getMessage()); -// } -// } - - /** - * Resolves the URL to a particular package instance, using the - * site_nodes table in the database, and passes control to the - * individual package. - * - * @param req The servlet request. - * @param resp The servlet response. - * @param rc the request context - * @pre rctx != null - */ - public void dispatch(final HttpServletRequest req, - final HttpServletResponse resp, - final RequestContext rc) - throws IOException, ServletException { - s_log.debug("SiteNodeDispatcher.dispatch called"); - - WebExposer.initializeRequestLocals(req); - - DispatcherHelper.setRequest(req); - - Assert.exists(rc, "rc"); - - SiteNode sn = getSiteNode(req, rc); - - if (sn == null) { - // This should be extremely rare, since you'll almost - // always have something mounted at the root site node. - resp.sendError(404, "getSiteNode returned null"); - throw new IllegalStateException("getSiteNode returned null"); - } - - final PackageInstance pkg = sn.getPackageInstance(); - - if (pkg == null) { - WebExposer.clearRequestLocals(); - - resp.sendError(404, "SiteNode " + sn.getURL() + - " has no package associated with it."); - - throw new IllegalStateException - ("SiteNode" + sn.getURL() + - " has no package associated with it."); - } - - final boolean fallingBack = - req.getAttribute(DispatcherServlet.FALLING_BACK_ATTRIBUTE) != null; - String prefix = null; - URL requestURL = null; - - if (fallingBack) { - // We got here through DispatcherServlet, which is mapped - // to a prefix. Change the value of prefix so SNRC's path - // accounting is correct. - - requestURL = (URL) req.getAttribute - (BaseServlet.REQUEST_URL_ATTRIBUTE); - - prefix = requestURL.getContextPath() + requestURL.getServletPath(); - } else { - // SND is mapped to / and *.jsp. As a result, its servletPath - // contains the whole remainder of the requestURI after the - // context path. Translate that servletPath to be the - // pathInfo, since our applications assume that the dispatcher - // is mounted at a prefix. - - String pathInfo; - - if (req.getPathInfo() == null) { - pathInfo = req.getServletPath(); - } else { - pathInfo = req.getServletPath() + req.getPathInfo(); - } - - // We initialize this temp URL first, so that we can - // pick up the virtual host correctly. - URL vhost = new URL(req); - requestURL = new URL - (req.getScheme(), - vhost.getServerName(), - vhost.getServerPort(), - req.getContextPath(), - "", - pathInfo, - new ParameterMap(req)); - - prefix = ""; - } - - final SiteNodeRequestContext snrc = new SiteNodeRequestContext - (req, rc, sn, prefix + sn.getURL()); - - DispatcherHelper.setRequestContext(req, snrc); - - final Application app = Application.retrieveApplicationForSiteNode(sn); - - final UserContext uc = snrc.getUserContext(); - - WebExposer.init(req, snrc.getServletContext(), uc); - - WebContextExposer wce = new WebContextExposer(Web.getContext()); - - wce.init(app, requestURL); - - final ServletException[] servletException = { null }; - final IOException[] ioException = { null }; - - new KernelExcursion() { - public void excurse() { - setResource(app); - setLocale(snrc.getLocale()); - setSessionID(req.getSession().getId()); - setTransaction(new DatabaseTransaction()); - - DeveloperSupport.startStage("SiteNodeDispatcher.dispatch"); - - try { - // Need to set the party where redirect signals - // are caught. - setParty(getCurrentUser(req, uc)); - - doDispatch(req, resp, snrc, pkg); - - // force listeners to run in correct context (bug 108499) - SessionManager.getSession().flushAll(); - - } catch (RedirectSignal rs) { - redirect(rs, resp); - - } catch (IOException ioe) { - ioException[0] = ioe; - } catch (ServletException se) { - // This handles the case where a RedirectSignal is thrown in the context - // of a JSP running under Resin. Resin wraps the JSP code with a try/catch(Throwable) block, - // which rethrows any unfiltered exceptions as ServletExceptions - // See SDM #225917 - - // This also now fixes SDM #226354. Tomcat wraps yet another ServletException - // around a ServletException. This way, we strip off all to find - // out what's really going on. - Throwable root = se.getRootCause(); - while(root instanceof ServletException) { - ServletException next = (ServletException) root; - root = next.getRootCause(); - } - if (root instanceof RedirectSignal) { - redirect((RedirectSignal) root, resp); - } else { - ServletErrorReport report = new ServletErrorReport - (se, req, resp); - report.logit(); - servletException[0] = se; - } - } catch (RuntimeException re) { - ServletErrorReport report = new ServletErrorReport - (re, req, resp); - report.logit(); - throw re; - } finally { - WebExposer.clearRequestLocals(); - DeveloperSupport.endStage("SiteNodeDispatcher.dispatch"); - } - - } - }.run(); - - if (servletException[0] != null) { - throw servletException[0]; - } - - if (ioException[0] != null) { - throw ioException[0]; - } - } - - /** - * Handles redirect signals. Aborts or commits transaction. - * - * @param rs The redirect signal - * @param resp HTTP response - */ - private void redirect(RedirectSignal rs, final HttpServletResponse resp) { - final String url = resp.encodeRedirectURL - (rs.getDestinationURL()); - - // The semantics of RedirectSignal require that we - // commit or abort the transaction before we send - // the redirect. - - TransactionContext context = - SessionManager.getSession().getTransactionContext(); - - if (context.inTxn()) { - if (rs.isCommitRequested()) { - context.commitTxn(); - } else { - context.abortTxn(); - } - } - - try { - resp.sendRedirect(url); - } catch (IOException ioe) { - throw new UncheckedWrapperException(ioe); - } - } - - private User getCurrentUser(HttpServletRequest sreq, - UserContext uc) { - User user = null; - - if (uc.isLoggedIn()) { - user = uc.getUser(); - - if (user == null) { - // Probably an old cookie lying around. Clear the - // login state. - - s_log.warn("The user cookie cannot be found; clearing " + - "login state and redirecting to login again"); - - try { - uc.logout(); - } catch (LoginException le) { - throw new UncheckedWrapperException(le); - } - - // Throws a redirect signal. - uc.redirectToLoginPage(sreq); - } - } - return user; - } - - private SiteNode getSiteNode(HttpServletRequest req, RequestContext rc) { - // The parent class already found no concrete file. - // So do site-node lookup. - - String url = null; - String pathInfo = req.getPathInfo(); - - if (pathInfo == null) { - url = rc.getRemainingURLPart(); - } else { - // We're using the new dispatcher, which is mounted at a - // prefix such as "/ccm". As a result, the path we care - // about is stored in pathInfo. - url = pathInfo; - } - // Totally empty URL at this point won't get found in the site - // map. Yes, there's no URL left to process, but we have to - // make getSiteNode() happy. - if (url.length() == 0) { - url = "/"; - } - - SiteNode sn = null; - - // look up the package that we're dispatching to in the - // site map - try { - // look up the package that we're dispatching to in the - sn = SiteNode.getSiteNode(url, true); - } catch (DataObjectNotFoundException nfe) { - // Do nothing. We look for a null return value in the - // calling code. - } - - return sn; - } - - private void doDispatch(HttpServletRequest req, - HttpServletResponse resp, - SiteNodeRequestContext rci, - PackageInstance pkg) - throws IOException, ServletException { - - try { - DeveloperSupport.endStage("SiteNodeDispatcher.dispatch getPackage"); - DeveloperSupport.startStage("SiteNodeDispatcher getDispatcher"); - - final Dispatcher dispatcher = pkg.getType().getDispatcher(); - - DeveloperSupport.endStage("SiteNodeDispatcher getDispatcher"); - DeveloperSupport.startStage("SiteNodeDispatcher subdispatch"); - - if (s_log.isDebugEnabled()) { - s_log.debug(Kernel.getContext().getDebugInfo()); - } - - dispatcher.dispatch(req, resp, rci); - - DeveloperSupport.endStage("SiteNodeDispatcher subdispatch"); - } catch (ClassNotFoundException e) { - s_log.error("Error loading dispatcher", e); - throw new ServletException("Error loading dispatcher", e); - } catch (InstantiationException e) { - throw new ServletException("Error loading dispatcher", e); - } catch (IllegalAccessException e) { - throw new ServletException("Error loading dispatcher", e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new ServletException("Error loading dispatcher", e); - } - } -} Added: trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse (rev 0) +++ trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse 2012-05-01 08:16:46 UTC (rev 2302) @@ -0,0 +1,453 @@ +/* + * 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.sitenode; + +import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.dispatcher.Dispatcher; +import com.arsdigita.dispatcher.DispatcherHelper; +import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.kernel.DatabaseTransaction; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelDispatcherServlet; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.kernel.PackageInstance; +import com.arsdigita.kernel.SiteNode; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.security.UserContext; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.TransactionContext; +import com.arsdigita.util.Assert; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseServlet; +import com.arsdigita.web.DispatcherServlet; +import com.arsdigita.web.ParameterMap; +import com.arsdigita.web.RedirectSignal; +import com.arsdigita.web.URL; +import com.arsdigita.web.Web; +import com.arsdigita.web.WebContextExposer; +import com.arsdigita.web.WebExposer; +import java.io.IOException; +import javax.security.auth.login.LoginException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; + +/** + * Main site-map dispatcher entry point for ACS. Selects a package to + * serve from a site map (URL-to-ACS package) in the RDBMS. This can + * be deployed as a servlet in web.xml, so that this becomes the main + * entry point for an ACS application. + * + * <p> + * + * When a request comes in: + * + * <ol> + * + * <li>The BaseDispatcherServlet superclass first looks for a concrete + * file in the webapp root that matches the requested URL. + * + * <li>If no file is found, we try to authenticate the user, and + * resolve the request for a URL to a <code>PackageInstance</code> + * using the <code>SiteNode</code> class, which represents a "site + * map" (URL to package mapping). + * + * <li>We pass control to the package-level dispatcher for that package, + * which will then resolve the URL to a particular file in the filesystem. + * + * </ol> + * + * <p> + * + * @author Bill Schneider + * @version $Id: SiteNodeDispatcher.java 287 2005-02-22 00:29:02Z sskracic $ + * @since 4.5 + * @deprecated Use {@link com.arsdigita.web.DispatcherServlet} instead. + * Pboy (2009-08-06): + * a) SiteNodeDispatcher is still included in web.xml + * b) content-center needs SiteNodeDispatcher + * c) SiteNodeDispatcher is fallback in web.DispatcherServlet (cf web.xml) + * d) webDispatcherServlet requires a fallback as parameter + * therefore: SideNodeDispatcher is still required at the moment. + * ToDo: test if web.LegacyAdapterServlet, a 'servlet that does what + * SiteNodeDispatcher does' can do the job. + */ +public class SiteNodeDispatcher extends KernelDispatcherServlet + implements Dispatcher { + + private static final Logger s_log = + Logger.getLogger(SiteNodeDispatcher.class.getName()); + + private static SiteNodeDispatcher s_instance = null; + + // dispatcher for resolving abstract URLs in /www, /packages, etc., + // directories +// private SiteNode m_rootSiteNode; + + /** + * Returns the currently-loaded instance of the request + * processor servlet. + * @return The current JVM's RequestProcessor instance. + */ + public synchronized static SiteNodeDispatcher getInstance() { + return s_instance; + } + +// /** +// * Called when servlet is loaded, and sets static instance. +// */ +// public synchronized void init() throws ServletException { +// super.init(); +// +// try { +// DatabaseTransaction txn = new DatabaseTransaction(); +// txn.begin(); +// +// m_rootSiteNode = SiteNode.getRootSiteNode(); +// +// txn.end(); +// } catch (IllegalStateException e) { +// s_log.error("SiteNodeDispatcher.init", e); +// throw new UnavailableException( +// "SiteNodeDispatcher Initialization Failure" + +// "\n The most likely cause is that the initialization sequence did not" + +// "\n complete successfully. Check the error logs for other error messages" + +// "\n and make sure you have a valid enterprise.init" + +// "\n\n" + e.getMessage()); +// } catch (PersistenceException e) { +// s_log.error("SiteNodeDispatcher.init", e); +// throw new UnavailableException( +// "SiteNodeDispatcher Initialization Failure" + +// "\n The most likely cause is that the initialization sequence did not" + +// "\n complete successfully. Check the error logs for other error messages" + +// "\n and make sure you have a valid enterprise.init" + +// "\n\n" + e.getMessage()); +// } catch (Exception e) { +// s_log.error("SiteNodeDispatcher.init", e); +// throw new UnavailableException(e.getMessage()); +// } +// } + + /** + * Resolves the URL to a particular package instance, using the + * site_nodes table in the database, and passes control to the + * individual package. + * + * @param req The servlet request. + * @param resp The servlet response. + * @param rc the request context + * @pre rctx != null + */ + public void dispatch(final HttpServletRequest req, + final HttpServletResponse resp, + final RequestContext rc) + throws IOException, ServletException { + s_log.debug("SiteNodeDispatcher.dispatch called"); + + WebExposer.initializeRequestLocals(req); + + DispatcherHelper.setRequest(req); + + Assert.exists(rc, "rc"); + + SiteNode sn = getSiteNode(req, rc); + + if (sn == null) { + // This should be extremely rare, since you'll almost + // always have something mounted at the root site node. + resp.sendError(404, "getSiteNode returned null"); + throw new IllegalStateException("getSiteNode returned null"); + } + + final PackageInstance pkg = sn.getPackageInstance(); + + if (pkg == null) { + WebExposer.clearRequestLocals(); + + resp.sendError(404, "SiteNode " + sn.getURL() + + " has no package associated with it."); + + throw new IllegalStateException + ("SiteNode" + sn.getURL() + + " has no package associated with it."); + } + + final boolean fallingBack = + req.getAttribute(DispatcherServlet.FALLING_BACK_ATTRIBUTE) != null; + String prefix = null; + URL requestURL = null; + + if (fallingBack) { + // We got here through DispatcherServlet, which is mapped + // to a prefix. Change the value of prefix so SNRC's path + // accounting is correct. + + requestURL = (URL) req.getAttribute + (BaseServlet.REQUEST_URL_ATTRIBUTE); + + prefix = requestURL.getContextPath() + requestURL.getServletPath(); + } else { + // SND is mapped to / and *.jsp. As a result, its servletPath + // contains the whole remainder of the requestURI after the + // context path. Translate that servletPath to be the + // pathInfo, since our applications assume that the dispatcher + // is mounted at a prefix. + + String pathInfo; + + if (req.getPathInfo() == null) { + pathInfo = req.getServletPath(); + } else { + pathInfo = req.getServletPath() + req.getPathInfo(); + } + + // We initialize this temp URL first, so that we can + // pick up the virtual host correctly. + URL vhost = new URL(req); + requestURL = new URL + (req.getScheme(), + vhost.getServerName(), + vhost.getServerPort(), + req.getContextPath(), + "", + pathInfo, + new ParameterMap(req)); + + prefix = ""; + } + + final SiteNodeRequestContext snrc = new SiteNodeRequestContext + (req, rc, sn, prefix + sn.getURL()); + + DispatcherHelper.setRequestContext(req, snrc); + + final Application app = Application.retrieveApplicationForSiteNode(sn); + + final UserContext uc = snrc.getUserContext(); + + WebExposer.init(req, snrc.getServletContext(), uc); + + WebContextExposer wce = new WebContextExposer(Web.getContext()); + + wce.init(app, requestURL); + + final ServletException[] servletException = { null }; + final IOException[] ioException = { null }; + + new KernelExcursion() { + public void excurse() { + setResource(app); + setLocale(snrc.getLocale()); + setSessionID(req.getSession().getId()); + setTransaction(new DatabaseTransaction()); + + DeveloperSupport.startStage("SiteNodeDispatcher.dispatch"); + + try { + // Need to set the party where redirect signals + // are caught. + setParty(getCurrentUser(req, uc)); + + doDispatch(req, resp, snrc, pkg); + + // force listeners to run in correct context (bug 108499) + SessionManager.getSession().flushAll(); + + } catch (RedirectSignal rs) { + redirect(rs, resp); + + } catch (IOException ioe) { + ioException[0] = ioe; + } catch (ServletException se) { + // This handles the case where a RedirectSignal is thrown in the context + // of a JSP running under Resin. Resin wraps the JSP code with a try/catch(Throwable) block, + // which rethrows any unfiltered exceptions as ServletExceptions + // See SDM #225917 + + // This also now fixes SDM #226354. Tomcat wraps yet another ServletException + // around a ServletException. This way, we strip off all to find + // out what's really going on. + Throwable root = se.getRootCause(); + while(root instanceof ServletException) { + ServletException next = (ServletException) root; + root = next.getRootCause(); + } + if (root instanceof RedirectSignal) { + redirect((RedirectSignal) root, resp); + } else { + ServletErrorReport report = new ServletErrorReport + (se, req, resp); + report.logit(); + servletException[0] = se; + } + } catch (RuntimeException re) { + ServletErrorReport report = new ServletErrorReport + (re, req, resp); + report.logit(); + throw re; + } finally { + WebExposer.clearRequestLocals(); + DeveloperSupport.endStage("SiteNodeDispatcher.dispatch"); + } + + } + }.run(); + + if (servletException[0] != null) { + throw servletException[0]; + } + + if (ioException[0] != null) { + throw ioException[0]; + } + } + + /** + * Handles redirect signals. Aborts or commits transaction. + * + * @param rs The redirect signal + * @param resp HTTP response + */ + private void redirect(RedirectSignal rs, final HttpServletResponse resp) { + final String url = resp.encodeRedirectURL + (rs.getDestinationURL()); + + // The semantics of RedirectSignal require that we + // commit or abort the transaction before we send + // the redirect. + + TransactionContext context = + SessionManager.getSession().getTransactionContext(); + + if (context.inTxn()) { + if (rs.isCommitRequested()) { + context.commitTxn(); + } else { + context.abortTxn(); + } + } + + try { + resp.sendRedirect(url); + } catch (IOException ioe) { + throw new UncheckedWrapperException(ioe); + } + } + + private User getCurrentUser(HttpServletRequest sreq, + UserContext uc) { + User user = null; + + if (uc.isLoggedIn()) { + user = uc.getUser(); + + if (user == null) { + // Probably an old cookie lying around. Clear the + // login state. + + s_log.warn("The user cookie cannot be found; clearing " + + "login state and redirecting to login again"); + + try { + uc.logout(); + } catch (LoginException le) { + throw new UncheckedWrapperException(le); + } + + // Throws a redirect signal. + uc.redirectToLoginPage(sreq); + } + } + return user; + } + + private SiteNode getSiteNode(HttpServletRequest req, RequestContext rc) { + // The parent class already found no concrete file. + // So do site-node lookup. + + String url = null; + String pathInfo = req.getPathInfo(); + + if (pathInfo == null) { + url = rc.getRemainingURLPart(); + } else { + // We're using the new dispatcher, which is mounted at a + // prefix such as "/ccm". As a result, the path we care + // about is stored in pathInfo. + url = pathInfo; + } + // Totally empty URL at this point won't get found in the site + // map. Yes, there's no URL left to process, but we have to + // make getSiteNode() happy. + if (url.length() == 0) { + url = "/"; + } + + SiteNode sn = null; + + // look up the package that we're dispatching to in the + // site map + try { + // look up the package that we're dispatching to in the + sn = SiteNode.getSiteNode(url, true); + } catch (DataObjectNotFoundException nfe) { + // Do nothing. We look for a null return value in the + // calling code. + } + + return sn; + } + + private void doDispatch(HttpServletRequest req, + HttpServletResponse resp, + SiteNodeRequestContext rci, + PackageInstance pkg) + throws IOException, ServletException { + + try { + DeveloperSupport.endStage("SiteNodeDispatcher.dispatch getPackage"); + DeveloperSupport.startStage("SiteNodeDispatcher getDispatcher"); + + final Dispatcher dispatcher = pkg.getType().getDispatcher(); + + DeveloperSupport.endStage("SiteNodeDispatcher getDispatcher"); + DeveloperSupport.startStage("SiteNodeDispatcher subdispatch"); + + if (s_log.isDebugEnabled()) { + s_log.debug(Kernel.getContext().getDebugInfo()); + } + + dispatcher.dispatch(req, resp, rci); + + DeveloperSupport.endStage("SiteNodeDispatcher subdispatch"); + } catch (ClassNotFoundException e) { + s_log.error("Error loading dispatcher", e); + throw new ServletException("Error loading dispatcher", e); + } catch (InstantiationException e) { + throw new ServletException("Error loading dispatcher", e); + } catch (IllegalAccessException e) { + throw new ServletException("Error loading dispatcher", e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new ServletException("Error loading dispatcher", e); + } + } +} Property changes on: trunk/ccm-core/src/com/arsdigita/sitenode/SiteNodeDispatcher.java.nolongerInUse ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-core/src/com/arsdigita/ui/login/Login.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/Login.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/ui/login/Login.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -23,13 +23,16 @@ import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; import com.arsdigita.web.Application; -import com.arsdigita.web.ApplicationCollection; -import com.arsdigita.web.ApplicationType; import org.apache.log4j.Logger; /** * Application domain class for the Login application. + * + * Serves as the main entry point into Login application. Because there are no + * instance specific functions (there is only a single instance to be installed) + * it provides mainly required configuration information and service methods + * for client classes. * * @author pb * @version $Id: Login.java $ @@ -82,26 +85,42 @@ } /** - * Provides an absolute URL (leading slash) into the system login page. - * It is relative to document root without any constant prefix if there is - * one configured. + * Service method provides an (absolute) URL into the system login page as + * servletPath() (leading slash) according servlet API. It is relative to + * document root without any constant prefix if there is one configured. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have to be checked. (2011-02) - * + * It is used by other classes to determine the login page. + * * @return URL for login page as String */ - // In old LegacyInitializer - // LOGIN_PAGE_KEY = page.kernel.login = register/ public static String getLoginPageURL() { return LOGIN_PAGE_URL; } /** + * Returns the path name of the location of the applications servlet/JSP. + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended) you may use a + * standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>login</servlet-name> + * <servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>login</servlet-name> + * <url-pattern>/login/*</url-pattern> + * </servlet-mapping> + * + * The appended "/*" ensures BaseServlet will find additional JSP's. * + * @return path name to the applications servlet/JSP */ @Override public String getServletPath() { Modified: trunk/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -33,25 +33,16 @@ import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.kernel.Kernel; import com.arsdigita.ui.UI; - import com.arsdigita.web.ReturnSignal; import com.arsdigita.web.URL; -import javax.servlet.http.HttpServletResponse; + import javax.servlet.http.HttpServletRequest; import javax.servlet.ServletException; import org.apache.log4j.Logger; -// WORK IN PROGRESS -// -// (a) Funktionen von SubsiteDispatcher übertragen -// Noch zu machen: preProcess für Handling caching -// (b) Konfiguration in web.xml etc. *DONE* -// (c) Einbau in core Load *DONE* -// (d) Testen - /** * Login Application Servlet class, central entry point to create and process * the Login application UI. @@ -59,6 +50,11 @@ * It manages user registration page, new user page, user workspace, logout, * and permissions admin pages. * + * It just defines a mapping URL <-> various pages and uses the super class + * to actually server the pages. Additionally is provides service methods + * to expose various properties, especially the URL's of public subpages + * (e.g. logout) and initializes the creation of the UI. + * * @author Peter Boy <pb...@ba...> * @version $Id: LoginServlet.java 2161 2012-03-15 00:16:13Z pboy $ */ @@ -67,8 +63,10 @@ /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(LoginServlet.class); - public static final String APPLICATION_NAME = "login"; + // //////////////////////////////////////////////////////////////////////// + // Define various URLs to subpages of Login to manage administrative tasks. + // //////////////////////////////////////////////////////////////////////// /** PathInfo into the Login application to access the (optional) newUser * page. Ends with "/" because it is a servlet/directory @@ -106,11 +104,16 @@ */ public static final String LOGOUT_PATH_INFO = "/logout/"; + + + /** Base URL of the Login application for internal use, fetched from + * Login domain class. */ + private final static String s_loginURL = Login.LOGIN_PAGE_URL; + // define namespace URI final static String SUBSITE_NS_URI = "http://www.arsdigita.com/subsite/1.0"; - // define - final static String s_loginURL = Login.LOGIN_PAGE_URL; + public static final String APPLICATION_NAME = "login"; /** * User extension point used to create the pages to server and setup a @@ -298,7 +301,7 @@ /** - * Provides an absolute URL (leading slash) to a user profile editig page. + * Provides an (absolute) URL to a user profile editig page. * It is relative to document root without any constant prefix if there is * one configured. * @@ -310,32 +313,23 @@ * * @return url to EditUserProfile page as String */ - // In old LegacyInitializer - // EDIT_PAGE_KEY = page.kernel.edit = register/edit-profile/ public static String getEditUserProfilePageURL() { return s_loginURL + EDIT_USER_PROFILE_PATH_INFO; } /** - * Provides an absolute URL (leading slash) to an optional new user - * registration page (accessible only if activated). It is relative to - * document root without any constant prefix if there is one configured. + * Provides an (absolute URL) to an optional new user registration page + * (accessible only if activated). It is relative to document root + * without any constant prefix if there is one configured. * * XXX This implementation starts with a leading slash and ends with a slash. * In previous configurations String urls began without a slash in order * to be able to provide a full URL which also contains the context part. * Since version 5.2 the context part is handled by (new) dispatcher. * The leading slash it API change! It's impacts have to be checked. (2011-02) - * - * XXX In violation of the Servlet API the string does NOT start with a "/" - * because currently the UI.getLoginPageURL() method provides a trailing - * slash because it still follows the old application convention. Should - * be reworked soon. * * @return url to new user registration page as String */ - // In old LegacyInitializer - // NEWUSER_PAGE_KEY = page.kernel.newuser = register/new-user/ public static String getNewUserPageURL() { return s_loginURL + NEW_USER_PATH_INFO; } Deleted: trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java 2012-05-01 08:13:26 UTC (rev 2301) +++ trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java 2012-05-01 08:16:46 UTC (rev 2302) @@ -1,342 +0,0 @@ -/* - * Copyright (C) 2002-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.web; - -import com.arsdigita.kernel.PackageType; -import com.arsdigita.domain.DomainObjectInstantiator; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.Assert; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; -import org.apache.log4j.Category; - -/** - * Automates the creation and setup of <code>ApplicationType</code>s. - * - * <pre><blockquote> - * ApplicationSetup setup = new ApplicationSetup(s_log); - * setup.setApplicationObjectType(SomeApp.BASE_DATA_OBJECT_TYPE); - * setup.setKey("some-app"); - * setup.setTitle("Some App"); - * setup.setInstantiator(new ACSObjectInstantiator() { - * protected DomainObject doNewInstance(DataObject dataObject) { - * return new SomeApp(dataObject); - * } - * }); - * setup.run(); - * </blockquote></pre> - * - * <strong>Important note.</strong> When <code>Application</code>s are used - * in the context of old-style apps that use <code>SiteNode</code>s and - * <code>PackageType</code>s, it is important to use the - * <code>setKey("some-string-key")</code> so that your new applications can - * interoperate fluidly with the legacy applications. - * Use of the <code>setKey</code> method ensures that your application will, - * behind the scenes, use site nodes and package instances, in addition to the - * <code>Application</code> object, to represent each new mountable application. - * As a result, legacy code for managing and dispatching applications will work - * with both your old and your new applications. - * - * @see com.arsdigita.web.ApplicationType - * @author Justin Ross <<a href="mailto:jr...@re...">jr...@re...</a>> - * @version $Id$ - * @deprecated without direct replacement. - * Class requires ApplicationSetup.setInstantiator( ...) domain initialization - * code which is only useful in old legacy initialization code. Initialization - * now differentiates bitween one time loading step and recurring initialization - * step. - * Use ApplicationType apptype = new ApplicationType(...) and - * Application app Application.createApplication(...) instead to create - * new style legacy free applications. - */ -public class ApplicationSetup { - - /** Appender to enable writing to the löog file. */ - protected Category m_category; - protected String m_title = null; - protected String m_description = null; - protected String m_typeName = null; - protected DomainObjectInstantiator m_instantiator = null; - - // Legacy fields. - - protected String m_key = null; - protected PackageType m_packageType = null; - protected boolean m_isWorkspaceApplication = true; - protected boolean m_isSingleton = false; - protected String m_dispatcherClass = null; - - /** - * Constructor. - * - * @param category as appender to the log file. - */ - public ApplicationSetup(Category category) { - m_category = category; - } - - /** - * Sets a key for use in creating a package type and, later, site - * node objects, as used by older applications, to match the new - * application type. - * - * @param key the <code>String</code> key to use to generate a - * package type corresponding to the new application type - */ - public void setKey(String key) { - m_key = key; - } - - /** - * Sets the package type to use to represent your application - * under the older package instance and site node approach. - * - * @param packageType a <code>PackageType</code> to use behind the - * new application type - */ - public void setPackageType(PackageType packageType) { - m_packageType = packageType; - } - - /** - * Sets the title of the installed application type. - */ - public void setTitle(String title) { - m_title = title; - } - - /** - * Sets the description of the installed application type. - */ - public void setDescription(String description) { - m_description = description; - } - - /** - * Sets the object type of the application instances this - * application type represents. - */ - public void setApplicationObjectType(String typeName) { - m_typeName = typeName; - } - - /** - * Sets the instantiator used by {@link - * com.arsdigita.domain.DomainObjectFactory} to resurrect specific - * domain classes from data objects. - */ - public void setInstantiator(DomainObjectInstantiator instantiator) { - m_instantiator = instantiator; - } - - /** - * This method is an alternative to {@link - * #setPortalApplication(boolean)}. It does the same thing. - */ - public void setWorkspaceApplication(boolean isWorkspaceApplication) { - m_isWorkspaceApplication = isWorkspaceApplication; - } - - /** - * Marks this applications of this type as ones that do or do not belong to - * a "portal", a special application type that collects child applications - * together for presentation and navigation purposes. - * - * By default, this value is true. - */ - public void setPortalApplication(boolean isWorkspaceApplication) { - m_isWorkspaceApplication = isWorkspaceApplication; - } - - /** - * Sets whether there can be more than one application of this - * type in the system. - * - * The default is false. - */ - public void setSingleton(boolean isSingleton) { - m_isSingleton = isSingleton; - } - - /** - * Sets the dispatcher to use for appliactions of this type. - */ - public void setDispatcherClass(String dispatcherClass) { - m_dispatcherClass = dispatcherClass; - } - - protected void notice(String message) { - m_category.info("ApplicationType '" + m_title + "' - " + message); - } - - /** - * After all the properties are set, validates and installs the - * specified application type. - */ - public ApplicationType run() { - notice("Validating setup..."); - - List messages = validate(); - - if (messages.size() > 0) { - Iterator iter = messages.iterator(); - String errors = "Validation of ApplicationSetup data failed:\n"; - - while (iter.hasNext()) { - String msg = (String)iter.next(); - m_category.error(msg); - errors += msg + "\n"; - } - - throw new RuntimeException(errors); - } - - notice("Done validating."); - - ApplicationType applicationType = process(); - Assert.exists(applicationType, "applicationType is not null"); - applicationType.save(); - - return applicationType; - } - - protected List validate() { - final ArrayList messages = new ArrayList(); - - if (m_title == null) { - messages.add("Title is not set."); - } - - if (m_typeName == null) { - messages.add("ApplicationObjectType is not set."); - } - - if (m_instantiator == null) { - messages.add("Instantiator is not set."); - } - - return messages; - } - - protected ApplicationType process() { - notice("Starting setup..."); - - ApplicationType applicationType = null; - - if (ApplicationType.isInstalled(m_typeName)) { - // When migrating new code, sometimes an ApplicationType - // exists but its corresponding PackageType does not. - // This happens, for instance, when someone changes the - // package key but not the object type in their app setup - // script. To treat this case, we need to create the - // PackageType if it isn't there, even if the - // ApplicationType exists. - - if (m_key != null && !packageTypeIsInstalled(m_key)) { - Assert.isTrue(m_packageType == null); - - m_category.warn - ("ApplicationType " + m_typeName + " did not have " + - "its corresponding PackageType " + m_key + ". Adding " + - "one now."); - - PackageType packageType = new PackageType(); - - packageType.setKey(m_key); - packageType.setDisplayName(m_title); - packageType.setURI("http://arsdigita.com/" + m_key); - - applicationType = - ApplicationType.retrieveApplicationTypeForApplication - (m_typeName); - - applicationType.setPackageType(packageType); - applicationType.setDispatcherClass(m_dispatcherClass); - - packageType.save(); - applicationType.save(); - } else { - applicationType = - ApplicationType.retrieveApplicationTypeForApplication - (m_typeName); - } - } else { - // And, likewise, sometimes a package type is present, but - // the application type does not yet exist. - // ApplicationType's constructor knows how to handle this. - - notice("Not installed. Installing now..."); - - notice("Using the following properties to perform install."); - notice(" ApplicationObjectType: " + m_typeName); - notice(" Title: " + m_title); - notice(" Description: " + m_description); - notice(" Instantiator: " + m_instantiator); - notice(" IsWorkspaceApplication: " + m_isWorkspaceApplication); - notice(" IsSingleton: " + m_isSingleton); - notice(" Key: " + m_key); - notice(" PackageType: " + m_packageType); - notice(" DispatcherClass: " + m_dispatcherClass); - - if (m_key == null && m_packageType == null) { - // This is a new style / legacy free application - applicationType = new ApplicationType(m_title, m_typeName); - } else { - // This is a legacy application type. - - if (m_key == null) { - applicationType = ApplicationType.createApplicationType - (m_packageType, m_title, m_typeName); - } else if (m_packageType == null) { - applicationType = ApplicationType.createApplicationType - (m_key, m_title, m_typeName); - - if (m_dispatcherClass != null) { - applicationType.setDispatcherClass(m_dispatcherClass); - } - } - - applicationType.setWorkspaceApplication - (m_isWorkspaceApplication); - applicationType.setSingleton(m_isSingleton); - } - - applicationType.setDescription(m_description); - - notice("Done installing."); - } - - DomainObjectFactory.registerInstantiator(m_typeName, m_instantiator); - - notice("Done setting up."); - - return applicationType; - } - - private boolean packageTypeIsInstalled(String key) { - try { - PackageType.findByKey(key); - return true; - } catch (DataObjectNotFoundException nfe) { - return false; - } - } -} Added: trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse =================================================================== --- trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse (rev 0) +++ trunk/ccm-core/src/com/arsdigita/web/ApplicationSetup.java.nolongerInUse 2012-05-01 08:16:46 UTC (rev 2302) @@ -0,0 +1,342 @@ +/* + * Copyright (C) 2002-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... [truncated message content] |
From: <pb...@fe...> - 2012-05-01 08:13:37
|
Author: pboy Date: 2012-05-01 08:13:26 +0000 (Tue, 01 May 2012) New Revision: 2301 Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties Removed: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties Modified: trunk/ccm-bookmarks/application.xml trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java Log: Bookmarks refactored, now legacy free type of application. NO ugrade script provided because is was not officially distributed. Modified: trunk/ccm-bookmarks/application.xml =================================================================== --- trunk/ccm-bookmarks/application.xml 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/application.xml 2012-05-01 08:13:26 UTC (rev 2301) @@ -13,11 +13,21 @@ <ccm:contact uri="mailto:in...@ru..." type="support"/> </ccm:contacts> <ccm:description> - Bookmarks application for CCM. Displays bookmarks for a portal. - - - CCM is a collaboration and content management system which is based upon - the Red Hat Web Application Framework (WAF), which is a platform for writing - database-backed web applications in Java. + Bookmarks application provides an admin interface to maintain one or more + lists of bookmarks and a portlet to embed on one or more portal pages. + Each portlet instance can be configured to display one of several bookmark + list. + + By default an administration instance to maintain a list of bookmarks is + installed at ~/ccm/admin/bookmarks. The UI provides the capability to add, + modify and delete bookmarks and to modify their order. + + To display this list the Bookmark portlet must be installed on a portal + page. It's installation UI provides (besides the standard properties title + and description) a drop-down list to select the list provider, + “/admin/bookmarks” in case of the default installation. + + For each additional, separate bookmarks list it is necessary to install an + additional administration instance for each list. </ccm:description> </ccm:application> Deleted: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse 2012-05-01 08:13:26 UTC (rev 2301) @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. - * - * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html - * - * 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.bookmarks; - -import com.arsdigita.bookmarks.ui.BookmarkEditPane; -import com.arsdigita.bookmarks.ui.BookmarkBasePage; - -import com.arsdigita.bebop.page.BebopMapDispatcher; -import com.arsdigita.bebop.Page; - -import java.util.HashMap; -import java.util.Map; -import org.apache.log4j.Logger; - -/** - * Bookmark dispatcher for both Bebop-backed and other URLs. - * - * @author Jim Parsons - */ - -public class BookmarksDispatcher extends BebopMapDispatcher { - - - private static final Logger s_log = - Logger.getLogger(BookmarksDispatcher.class); - - public BookmarksDispatcher() { - super(); - - Map m = new HashMap(); - - Page index = buildIndexPage(); - - m.put("", index); - - setMap(m); - } - - private Page buildIndexPage() { - BookmarkBasePage p = new BookmarkBasePage(); - - p.addRequestListener(new ApplicationAuthenticationListener("admin")); - p.getBody().add(new BookmarkEditPane()); - - p.lock(); - return p; - } - - -} Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties 2012-05-01 08:13:26 UTC (rev 2301) @@ -0,0 +1,17 @@ +bookmarks.ui.select_a_bookmark_for_editing=Select a Bookmark for editing +bookmarks.ui.name_of_new_bookmark=Name of New Bookmark: +bookmarks.ui.new_bookmark_url=New Bookmark URL: +bookmarks.ui.bookmark_description=Bookmark Description: +bookmarks.ui.delete_this_bookmark=Delete this Bookmark +bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. +bookmarks.ui.bookmark_name=Bookmark Name: +bookmarks.ui.none=No Bookmarks +bookmarks.ui.bookmark_url=Bookmark URL: +bookmarks.ui.creation_date=Creation Date: +bookmarks.ui.last_modified_date=Last Modified Date: +bookmarks.ui.created_by=Created by: +bookmarks.ui.number_of_visits=Number of visits: +bookmarks.ui.modification_date=Modification Date +bookmarks.ui.creator=Creator +bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Are you sure you want to delete this Bookmark? +bookmarks.ui.bookmark_in_new_window=Open in a new window Property changes on: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources.properties ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties 2012-05-01 08:13:26 UTC (rev 2301) @@ -0,0 +1,17 @@ +bookmarks.ui.select_a_bookmark_for_editing=Ein Lesezeichen zur Bearbeitung ausw\u00e4hlen +bookmarks.ui.name_of_new_bookmark=Name f\u00fcr das Lesezeichens: +bookmarks.ui.new_bookmark_url=URL f\u00fcr das Lesezeichen: +bookmarks.ui.bookmark_description=Lesezeichen Beschreibung: +bookmarks.ui.delete_this_bookmark=Dieses LEsezeichen l\u00f6schen +bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. +bookmarks.ui.bookmark_name=Lesezeichen Name: +bookmarks.ui.none=Keine Lesezeichen +bookmarks.ui.bookmark_url=URL Lesezeichen: +bookmarks.ui.creation_date=Erstellungsdatum: +bookmarks.ui.last_modified_date=Zuletzt ver\u00e4ndert: +bookmarks.ui.created_by=Erstellt von: +bookmarks.ui.number_of_visits=Anzahl Besuche: +bookmarks.ui.modification_date=\u00c4nderungsdatum +bookmarks.ui.creator=Ersteller +bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Soll dieses Lesezeichen tats\u00e4chlich gel\u00f6scht werden? +bookmarks.ui.bookmark_in_new_window=In einen neuen Fenster \u00f6ffnen Property changes on: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_de.properties ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties 2012-05-01 08:13:26 UTC (rev 2301) @@ -0,0 +1,17 @@ +bookmarks.ui.select_a_bookmark_for_editing=Select a Bookmark for editing +bookmarks.ui.name_of_new_bookmark=Name of New Bookmark: +bookmarks.ui.new_bookmark_url=New Bookmark URL: +bookmarks.ui.bookmark_description=Bookmark Description: +bookmarks.ui.delete_this_bookmark=Delete this Bookmark +bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. +bookmarks.ui.bookmark_name=Bookmark Name: +bookmarks.ui.none=No Bookmarks +bookmarks.ui.bookmark_url=Bookmark URL: +bookmarks.ui.creation_date=Creation Date: +bookmarks.ui.last_modified_date=Last Modified Date: +bookmarks.ui.created_by=Created by: +bookmarks.ui.number_of_visits=Number of visits: +bookmarks.ui.modification_date=Modification Date +bookmarks.ui.creator=Creator +bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Are you sure you want to delete this Bookmark? +bookmarks.ui.bookmark_in_new_window=Open in a new window Property changes on: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksResources_en.properties ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java 2012-05-01 08:13:26 UTC (rev 2301) @@ -53,7 +53,7 @@ /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(BookmarksServlet.class); - private Page adminPage; + private Page indexPage; /** * User extension point, overwrite this method to setup a URL - page mapping @@ -63,7 +63,7 @@ @Override public void doInit() throws ServletException { - adminPage = buildAdminPage(); + indexPage = buildIndexPage(); } @@ -77,9 +77,9 @@ Application app) throws ServletException, IOException { - if (adminPage != null) { + if (indexPage != null) { - final Document doc = adminPage.buildDocument(sreq, sresp); + final Document doc = indexPage.buildDocument(sreq, sresp); PresentationManager pm = Templating.getPresentationManager(); pm.servePage(doc, sreq, sresp); @@ -96,7 +96,7 @@ * * @return */ - private Page buildAdminPage() { + private Page buildIndexPage() { BookmarkBasePage p = new BookmarkBasePage(); Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-05-01 08:13:26 UTC (rev 2301) @@ -80,6 +80,7 @@ e.getFactory().registerInstantiator( BookmarkPortlet.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override public DomainObject doNewInstance(DataObject dataObject) { return new BookmarkPortlet(dataObject); } Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java 2012-05-01 08:13:26 UTC (rev 2301) @@ -49,6 +49,7 @@ private static final Logger s_log = Logger.getLogger(Loader.class); /** + * Run script invoked by com.arsdigita.packing loader script. * * @param ctx */ @@ -72,8 +73,7 @@ */ private ApplicationType loadBookmarksApp() { - /* Create new type legacy free application type - * NOTE: The wording in the title parameter of ApplicationType + /* NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. * It gets "urlized", i.e. trimming leading and trailing blanks and * replacing blanks between words and illegal characters with an @@ -105,20 +105,15 @@ * */ public static void setupDefaultBookmarkApplicationInstance() { + s_log.debug("Creating BookmarkApplication instance ..."); /* Determine a parent application. Bookmarks admin page will be * installed beyond the admin's applications URL. */ - Application admin = Application.retrieveApplicationForPath("/admin/"); + Application parent = Application.retrieveApplicationForPath("/admin/"); // create application instance - // Whether a legacy compatible or a legacy free application is - // created depends on the type of ApplicationType above. No need to - // modify anything here in the migration process - // old-style package key used as url fragment where to install the instance - s_log.debug("Creating BookmarkApplication instance ..."); + Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", parent); - Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", admin); - s_log.debug("Bookmarks instance " + " created."); s_log.debug("Done loading bookmarks."); } Deleted: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkResources.properties 2012-05-01 08:13:26 UTC (rev 2301) @@ -1,17 +0,0 @@ -bookmarks.ui.select_a_bookmark_for_editing=Select a Bookmark for editing -bookmarks.ui.name_of_new_bookmark=Name of New Bookmark: -bookmarks.ui.new_bookmark_url=New Bookmark URL: -bookmarks.ui.bookmark_description=Bookmark Description: -bookmarks.ui.delete_this_bookmark=Delete this Bookmark -bookmarks.ui.edit_fields_and_click_save_button=Edit fields and click save button. -bookmarks.ui.bookmark_name=Bookmark Name: -bookmarks.ui.none=No Bookmarks -bookmarks.ui.bookmark_url=Bookmark URL: -bookmarks.ui.creation_date=Creation Date: -bookmarks.ui.last_modified_date=Last Modified Date: -bookmarks.ui.created_by=Created by: -bookmarks.ui.number_of_visits=Number of visits: -bookmarks.ui.modification_date=Modification Date -bookmarks.ui.creator=Creator -bookmarks.ui.are_you_sure_you_want_to_delete_this_bookmark=Are you sure you want to delete this Bookmark? -bookmarks.ui.bookmark_in_new_window=Open in a new window Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java 2012-05-01 08:11:40 UTC (rev 2300) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/util/GlobalizationUtil.java 2012-05-01 08:13:26 UTC (rev 2301) @@ -31,7 +31,8 @@ public class GlobalizationUtil implements Globalized { - private static final String BUNDLE_NAME = "com.arsdigita.bookmarks.ui.BookmarkResources"; + private static final String BUNDLE_NAME = + "com.arsdigita.bookmarks.BookmarksResources"; public static GlobalizedMessage globalize(String key) { return new GlobalizedMessage(key, BUNDLE_NAME); |
From: <pb...@fe...> - 2012-05-01 08:12:07
|
Author: pboy Date: 2012-05-01 08:11:40 +0000 (Tue, 01 May 2012) New Revision: 2300 Added: trunk/ccm-cms/web/assets/jquery.js Removed: trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java Modified: trunk/ccm-cms/application.xml trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSubordinateCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitSuperiorCollection.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPersonBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitCreate.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonCreate.java trunk/ccm-cms/src/com/arsdigita/cms/ui/folder/FolderBrowser.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java trunk/ccm-cms/web/themes/heirloom/packages/cms/xsl/admin/cms-admin.xsl trunk/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl Log: Enhanced publishing process (esp. associations), added jquery, enhanced UI (delete Link fixed). Modified: trunk/ccm-cms/application.xml =================================================================== --- trunk/ccm-cms/application.xml 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/application.xml 2012-05-01 08:11:40 UTC (rev 2300) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-cms" prettyName="Red Hat CCM Content Management System" - version="6.6.6" + version="6.6.7" release="1" webapp="ROOT"> <ccm:dependencies> Modified: trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl =================================================================== --- trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl 2012-05-01 08:11:40 UTC (rev 2300) @@ -75,15 +75,15 @@ //Used build hierarchies of organizational units association { - GenericOrganizationalUnit[0..n] superiorOrgaunits = join cms_organizationalunits.organizationalunit_id + GenericOrganizationalUnitBundle[0..n] superiorOrgaunits = join cms_orgaunit_bundles.bundle_id to cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id, join cms_organizationalunits_hierarchy_map.superior_orgaunit_id - to cms_organizationalunits.organizationalunit_id; + to cms_orgaunit_bundles.bundle_id; - GenericOrganizationalUnit[0..n] subordinateOrgaunits = join cms_organizationalunits.organizationalunit_id + GenericOrganizationalUnitBundle[0..n] subordinateOrgaunits = join cms_orgaunit_bundles.bundle_id to cms_organizationalunits_hierarchy_map.superior_orgaunit_id, join cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id - to cms_organizationalunits.organizationalunit_id; + to cms_orgaunit_bundles.bundle_id; //Additonal attributes for the assoication //Optional string for *internal* data Deleted: trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -1,20 +0,0 @@ -package com.arsdigita.cms; - -import com.arsdigita.domain.DomainObject; -import com.arsdigita.persistence.metadata.Property; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public interface AssociationCopier { - - boolean copyReverseProperty(CustomCopy source, - DomainObject target, - Property property, - DomainObject value, - ItemCopier copier); - - -} Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -18,15 +18,14 @@ */ package com.arsdigita.cms; -/* May 2009: - * This file serves as an information for developers how to replace +/* + * May 2009: This file serves as an information for developers how to replace * the URL resource: protocol extension (which is a application specific, - * non-standard extension of the Java URL protocol) by supported, - * standard compliant API. + * non-standard extension of the Java URL protocol) by supported, standard + * compliant API. * - * Look for: - * // URL resource: protocol handler removal: START - * Will be removed as soon as a stable release 6.6 is created. + * Look for: // URL resource: protocol handler removal: START Will be removed as + * soon as a stable release 6.6 is created. */ import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.bebop.form.DHTMLEditor; @@ -40,36 +39,16 @@ import com.arsdigita.cms.ui.authoring.ItemCategoryExtension; import com.arsdigita.cms.ui.authoring.ItemCategoryForm; import com.arsdigita.runtime.AbstractConfig; -// URL resource: protocol handler removal: START -// remove -// import com.arsdigita.util.UncheckedWrapperException; -// URL resource: protocol handler removal: END +import com.arsdigita.util.StringUtils; import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.EnumerationParameter; import com.arsdigita.util.parameter.ErrorList; import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; -// import com.arsdigita.util.parameter.ParameterError; -// URL resource: protocol handler removal: START -// new: import: import com.arsdigita.util.parameter.ResourceParameter; -// URL resource: protocol handler removal: END import com.arsdigita.util.parameter.SpecificClassParameter; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -// URL resource: protocol handler removal: START -// remove: -// import com.arsdigita.util.parameter.URLParameter; -// new: import: -import com.arsdigita.util.StringUtils; -// URL resource: protocol handler removal: END - -// URL resource: protocol handler removal: START -// remove: -// import java.io.IOException; -// import java.net.MalformedURLException; -// import java.net.URL; -// URL resource: protocol handler removal: END import java.io.InputStream; import java.util.Collection; import java.util.HashMap; @@ -78,14 +57,13 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.apache.log4j.Logger; /** * A record containing server-session scoped configuration properties. * - * Accessors of this class may return null. Developers should take care - * to trap null return values in their code. + * Accessors of this class may return null. Developers should take care to trap + * null return values in their code. * * @see ContentSection#getConfig() * @@ -94,16 +72,21 @@ */ public final class CMSConfig extends AbstractConfig { - /** Private Logger instance for debugging purpose. */ + /** + * Private Logger instance for debugging purpose. + */ private static final Logger s_log = Logger.getLogger(CMSConfig.class); - /** Private Object to hold one's own instance to return to users. */ + /** + * Private Object to hold one's own instance to return to users. + */ private static CMSConfig s_config; /** * Returns the singleton configuration record for the content section * environment. * - * @return The <code>ContentSectionConfig</code> record; it cannot be null + * @return The + * <code>ContentSectionConfig</code> record; it cannot be null */ public static synchronized CMSConfig getInstance() { if (s_config == null) { @@ -115,13 +98,13 @@ } /** * Storage (map) for method getAssetStepsToSkip(ContentType type) to store - * mapping of steps that are deemed irrelevant for the passid in type. + * mapping of steps that are deemed irrelevant for the passid in type. */ private static Map s_skipAssetSteps = null; /** - * Item category add form speciofies Subclass of ItemCategoryForm - * to use for the assign categories step. - * Used in c.ad.cms.ui.authoring.ItemCategoryStep + * Item category add form speciofies Subclass of ItemCategoryForm to use for + * the assign categories step. Used in + * c.ad.cms.ui.authoring.ItemCategoryStep */ private final Parameter m_categoryAuthoringAddForm = new SpecificClassParameter( @@ -130,8 +113,8 @@ ItemCategoryForm.class, SimpleComponent.class); /** - * Path for the default item template. Path is relative to the - * Template Root path. + * Path for the default item template. Path is relative to the Template Root + * path. */ private final Parameter m_defaultItemTemplatePath = new StringParameter( @@ -139,8 +122,8 @@ Parameter.REQUIRED, "/default/item.jsp"); /** - * Path for the default folder template. Path is relative to the - * Template Root path. + * Path for the default folder template. Path is relative to the Template + * Root path. */ private final Parameter m_defaultFolderTemplatePath = new StringParameter( @@ -148,17 +131,17 @@ Parameter.REQUIRED, "/default/folder.jsp"); /** - * Path or the root folter for template folders. - * Path is relative to webapp root. + * Path or the root folter for template folders. Path is relative to webapp + * root. */ private final Parameter m_templateRootPath = - new StringParameter("com.arsdigita.cms.template_root_path", - Parameter.REQUIRED, - "/templates/ccm-cms/content-section"); + new StringParameter( + "com.arsdigita.cms.template_root_path", + Parameter.REQUIRED, + "/templates/ccm-cms/content-section"); // up to version 6.6.4 // "/packages/content-section/templates"); - - // URL resource: protocol handler removal: START + // URL resource: protocol handler removal: START // remove: // try { // m_itemAdapters = new URLParameter @@ -174,22 +157,22 @@ * specifications. Path is relative to webapp root. */ private final Parameter m_itemAdapters = - new ResourceParameter("com.arsdigita.cms.item_adapters", - Parameter.REQUIRED, - "/WEB-INF/resources/cms-item-adapters.xml"); + new ResourceParameter( + "com.arsdigita.cms.item_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/cms-item-adapters.xml"); // URL resource: protocol handler removal: END /** - * Use streamlined content creation: upon item creation, - * automatically open authoring steps and forward to the next step + * Use streamlined content creation: upon item creation, automatically open + * authoring steps and forward to the next step */ private final Parameter m_useStreamlinedCreation = new BooleanParameter( "com.arsdigita.cms.use_streamlined_creation", Parameter.REQUIRED, - new Boolean( - true)); + Boolean.TRUE); /** - * DHTML Editor Configuration for use in CMS module, lists the - * config object name and Javascript source location for its definition. + * DHTML Editor Configuration for use in CMS module, lists the config object + * name and Javascript source location for its definition. */ private final Parameter m_dhtmlEditorConfig = new DHTMLEditorConfigParameter( @@ -208,16 +191,16 @@ // be accessable by other modules which use DHTMLeditor. // Would be bad style to configure a cms specific parameter in core. /** - * Defines which plugins to use, e.g.TableOperations,CSS - * Format: [string,string,string] + * Defines which plugins to use, e.g.TableOperations,CSS Format: + * [string,string,string] */ private final Parameter m_dhtmlEditorPlugins = new StringArrayParameter( "com.arsdigita.cms.dhtml_editor_plugins", Parameter.OPTIONAL, null); /** - * Prevent undesirable functions from being made available, - * eg images should only be added through the cms methods. + * Prevent undesirable functions from being made available, eg images should + * only be added through the cms methods. */ private final Parameter m_dhtmlEditorHiddenButtons = new StringArrayParameter( @@ -230,65 +213,57 @@ private final Parameter m_hideAdminTabs = new BooleanParameter( "com.arsdigita.cms.hide_admin_tabs", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Hide Folder Index Checkbox from folder view */ private final Parameter m_hideFolderIndexCheckbox = new BooleanParameter( "com.arsdigita.cms.hide_folder_index_checkbox", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Hide launch date parameter on all forms and displays where it's used. */ private final Parameter m_hideLaunchDate = new BooleanParameter( "com.arsdigita.cms.hide_launch_date", Parameter.REQUIRED, - new Boolean( - true)); + Boolean.TRUE); /** * Require the launch date parameter to be set by the content author. */ private final Parameter m_requireLaunchDate = new BooleanParameter( "com.arsdigita.cms.require_launch_date", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Hide the templates tab on the item admin page. */ private final Parameter m_hideTemplatesTab = new BooleanParameter( "com.arsdigita.cms.hide_templates_tab", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Hide the upload file link in the editing of a text asset. */ private final Parameter m_hideTextAssetUploadFile = new BooleanParameter( "com.arsdigita.cms.hide_text_asset_upload_file", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** - * Hide timezone labels (if, for example, all users will be in the - * same timezone and such information would be unnecessary) + * Hide timezone labels (if, for example, all users will be in the same + * timezone and such information would be unnecessary) */ private final Parameter m_hideTimezone = new BooleanParameter( "com.arsdigita.cms.hide_timezone", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Hide User Defined Content Types UI */ private final Parameter m_hideUDCTUI = new BooleanParameter( "com.arsdigita.cms.hide_udct_ui", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Specifies the name of the class to use as a PublishLifecycleListener */ @@ -298,14 +273,13 @@ Parameter.OPTIONAL, PublishLifecycleListener.class.getName()); /** - * Wether the Wysiwyg editor should clear the text of MSWord tags, - * everytime the user clicks on 'Save' + * Wether the Wysiwyg editor should clear the text of MSWord tags, everytime + * the user clicks on 'Save' */ private final Parameter m_saveTextCleansWordTags = new BooleanParameter( "com.arsdigita.cms.save_text_cleans_word_tags", Parameter.OPTIONAL, - new Boolean( - false)); + Boolean.FALSE); /** * Hide Additional Resource Fields on RelatedLinkPropertyForm */ @@ -314,60 +288,55 @@ "com.arsdigita.cms.contentassets.ui." + "RelatedLinkPropertyForm.hideAdditionalResourceFields", Parameter.REQUIRED, - new Boolean(false)); + Boolean.FALSE); /** - * Get the search indexing not to process FileAssets, - * eg to avoid PDF slowdowns + * Get the search indexing not to process FileAssets, eg to avoid PDF + * slowdowns */ private final Parameter m_disableFileAssetExtraction = new BooleanParameter( "com.arsdigita.cms.search.disableFileAssetExtraction", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** - * Whether an item's workflow should be deleted, once the item - * has been (re)published + * Whether an item's workflow should be deleted, once the item has been + * (re)published */ private final Parameter m_deleteWorkflowAfterPublication = new BooleanParameter( "com.arsdigita.cms.delete_workflow_after_publication", Parameter.REQUIRED, - new Boolean(true)); + Boolean.TRUE); /** - * Defines the number of days ahead that are covered in the - * 'Soon Expired' tab + * Defines the number of days ahead that are covered in the 'Soon Expired' + * tab */ private final Parameter m_soonExpiredTimespanDays = new IntegerParameter( "com.arsdigita.cms.soon_expired_timespan_days", Parameter.REQUIRED, - new Integer( - 14)); + new Integer(14)); /** - * Defines the number of months ahead that are covered in the - * 'Soon Expired' tab + * Defines the number of months ahead that are covered in the 'Soon Expired' + * tab */ private final Parameter m_soonExpiredTimespanMonths = new IntegerParameter( "com.arsdigita.cms.soon_expired_timespan_months", Parameter.REQUIRED, - new Integer( - 1)); + new Integer(1)); /** * Does a redirect to the unpublished item generate not found error? */ private final Parameter m_unpublishedNotFound = new BooleanParameter( "com.arsdigita.cms.unpublished_not_found", Parameter.REQUIRED, - new Boolean( - true)); + Boolean.TRUE); /** - * Links created through browse interfaces should only be within the - * same subsite + * Links created through browse interfaces should only be within the same + * subsite */ private final Parameter m_linksOnlyInSameSubsite = new BooleanParameter( "com.arsdigita.cms.browse_links_in_same_subsite_only", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** * Item category step extension hook: Subclass of ItemCategoryExtension * which adds extension actions for the category authoring step @@ -385,10 +354,10 @@ private final Parameter m_hideResetLifecycleLink = new BooleanParameter( "com.arsdigita.cms.hide_reset_lifecycle_link", Parameter.OPTIONAL, - new Boolean( - true)); + Boolean.TRUE); /** - * Whether to include INPATH operators to contains clause in intermedia search + * Whether to include INPATH operators to contains clause in intermedia + * search */ private final Parameter m_scoreTitleAndKeywords = new BooleanParameter( @@ -396,8 +365,8 @@ Parameter.OPTIONAL, Boolean.FALSE); /** - * Title Weight, the relative weight given to title element within - * cms:item when ranking search results (only used by interMedia) + * Title Weight, the relative weight given to title element within cms:item + * when ranking search results (only used by interMedia) */ private final Parameter m_titleWeight = new IntegerParameter( "com.arsdigita.cms.search.intermedia.title_weight", @@ -405,8 +374,8 @@ new Integer(1)); /** * Keyword Weight, the relative weight given to the dcKeywords element - * within dublinCore element within cms:item element when ranking - * search results (only used by interMedia) + * within dublinCore element within cms:item element when ranking search + * results (only used by interMedia) */ private final Parameter m_keywordWeight = new IntegerParameter( @@ -423,26 +392,24 @@ Boolean.TRUE); /** * Asset steps to skip, specify asset steps that are not relevant for - * specific content types. - * Each entry in the list is a : separated pair. The first string - * is the className for the type (refer to classname column in contenttypes - * table eg com.arsdigita.cms.contenttypes.MultiPartArticle - * Second string is the name of the bebop step component - * eg com.arsdigita.cms.contenttypes.ui.ImageStep + * specific content types. Each entry in the list is a : separated pair. The + * first string is the className for the type (refer to classname column in + * contenttypes table eg com.arsdigita.cms.contenttypes.MultiPartArticle + * Second string is the name of the bebop step component eg + * com.arsdigita.cms.contenttypes.ui.ImageStep */ private final Parameter m_skipAssetSteps = new StringArrayParameter( "com.arsdigita.cms.skip_asset_steps", Parameter.OPTIONAL, null); /** - * Mandatory Descriptions Content types may refer to this to decide - * whether to validate against empty descriptions + * Mandatory Descriptions Content types may refer to this to decide whether + * to validate against empty descriptions */ private final Parameter m_mandatoryDescriptions = new BooleanParameter( "com.arsdigita.cms.mandatory_descriptions", Parameter.OPTIONAL, - new Boolean( - false)); + Boolean.FALSE); /** * Delete Finished Lifecycles. Decide whether lifecycles and their phases * should be deleted from the system when finished. @@ -451,56 +418,50 @@ new BooleanParameter( "com.arsdigita.cms.delete_lifecycle_when_complete", Parameter.OPTIONAL, - new Boolean(false)); + Boolean.FALSE); /** - * Contacts for content items. Allows you to add a Contact authoring step - * to all items + * Contacts for content items. Allows you to add a Contact authoring step to + * all items */ private final Parameter m_hasContactsAuthoringStep = new BooleanParameter( "com.arsdigita.cms.has_contacts_authoring_step", Parameter.REQUIRED, - new Boolean( - false)); + Boolean.FALSE); /** - * Ordering for nodes in assign category tree. Decide whether entries - * should be ordered alphabetically or according to sort key - * (maintained in category admin tab in content centre) - * SortKey|Alphabetical is initialized in constructor! See below. + * Ordering for nodes in assign category tree. Decide whether entries should + * be ordered alphabetically or according to sort key (maintained in + * category admin tab in content centre) SortKey|Alphabetical is initialized + * in constructor! See below. */ private final Parameter m_categoryTreeOrdering = - new EnumerationParameter( - "com.arsdigita.cms.category_tree_order", - Parameter.OPTIONAL, - Category.SORT_KEY); - + new EnumerationParameter( + "com.arsdigita.cms.category_tree_order", + Parameter.OPTIONAL, + Category.SORT_KEY); /** - * Allow content creation in Workspace (content center) section listing. - * Allows you to turn off the ability to create content in the section listing + * Allow content creation in Workspace (content center) section listing. + * Allows you to turn off the ability to create content in the section + * listing */ private final Parameter m_allowContentCreateInSectionListing = - new BooleanParameter( - "com.arsdigita.cms.allow_content_create_in_section_listing", - Parameter.REQUIRED, - new Boolean(true)); - + new BooleanParameter( + "com.arsdigita.cms.allow_content_create_in_section_listing", + Parameter.REQUIRED, + Boolean.TRUE); /** * Hide the legacy public site link in Workspace (content center) section * listing. Legacy public site display is replaced by navigation based - * presentation (or by portlets) and should be hidden in the admin ui - * be default now. + * presentation (or by portlets) and should be hidden in the admin ui be + * default now. */ private final Parameter m_hideLegacyPublicSiteLink = - new BooleanParameter( - "com.arsdigita.cms.hide_legacy_public_site_link", - Parameter.REQUIRED, - new Boolean(true)); - - + new BooleanParameter( + "com.arsdigita.cms.hide_legacy_public_site_link", + Parameter.REQUIRED, + Boolean.TRUE); // /////////////////////////////////////////// // Notification related parameters // /////////////////////////////////////////// - - /** * Delete Sent Workflow Notifications. Decide whether successfully sent * notifications and messages should be deleted from the system @@ -509,34 +470,32 @@ new BooleanParameter( "com.arsdigita.cms.delete_workflow_notification_when_sent", Parameter.OPTIONAL, - new Boolean(false)); + Boolean.FALSE); /** - * Decide whether successfully sent notifications and messages - * should be deleted from the system + * Decide whether successfully sent notifications and messages should be + * deleted from the system */ private final Parameter m_deleteExpiryNotificationsWhenSent = new BooleanParameter( "com.arsdigita.cms.delete_expiry_notification_when_sent", Parameter.OPTIONAL, - new Boolean(false)); + Boolean.FALSE); /** - * Amount of time (in hours) before the expiration of a content item - * that users in the Alert Recipient role are alerted via email + * Amount of time (in hours) before the expiration of a content item that + * users in the Alert Recipient role are alerted via email */ private final Parameter m_defaultNotificationTime = new IntegerParameter( "com.arsdigita.cms.default_notification_time", Parameter.REQUIRED, - new Integer( - 0)); + new Integer(0)); /** - * Wether a content item's author should be notified - * by the item's LifecycleListener; defaults to true + * Wether a content item's author should be notified by the item's + * LifecycleListener; defaults to true */ private final Parameter m_notifyAuthorOnLifecycle = new BooleanParameter( "com.arsdigita.cms.notify_author_on_lifecycle", Parameter.OPTIONAL, - new Boolean( - true)); + Boolean.TRUE); // //////////////////////////////////////////////////// // Content Center (Workspace) config related parameters // //////////////////////////////////////////////////// @@ -607,7 +566,6 @@ "com.arsdigita.cms.lifecycle.use_old_style_item_lifecycle_item_pane", Parameter.REQUIRED, false); - //////////////////////////////////////////////// //Actives threaded publishing. If active, the publish process for //content items will run in a separate thread. May useful if you have @@ -620,6 +578,14 @@ "com.arsdigita.cms.lifecycle.threaded_publishing", Parameter.REQUIRED, true); + private final Parameter m_publishingFailureSender = new StringParameter( + "cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from", + Parameter.REQUIRED, + ""); + private final Parameter m_publishingFailureReceiver = new StringParameter( + "cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to", + Parameter.REQUIRED, + ""); // /////////////////////////////////////////// // publishToFile package related parameter @@ -631,7 +597,8 @@ * Constructor, but do NOT instantiate this class directly. * * @see ContentSection#getConfig() - **/ + * + */ public CMSConfig() { // Initialize m_categoryTreeOrdering parameter here! @@ -704,7 +671,10 @@ register(m_useOldStyleItemLifecycleItemPane); register(m_threadPublishing); + register(m_publishingFailureSender); + register(m_publishingFailureReceiver); + // publishToFile package related parameter // Moved to publishToFile.PublishToFileConfig as of version 6.0.2 // register(m_disableItemPfs); @@ -714,8 +684,8 @@ } /** - * Retrieve path of the root folter for template folders. - * Path is relative to webapp root. + * Retrieve path of the root folter for template folders. Path is relative + * to webapp root. */ public final String getTemplateRoot() { return (String) get(m_templateRootPath); @@ -754,9 +724,9 @@ } /** - * - * @deprecated - * use com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead + * + * @deprecated use + * com.arsdigita.cms.ContentSection.getDefaultSection().getName() instead */ public final String getDefaultContentSection() { // return (String) get(m_defaultSection); @@ -871,8 +841,9 @@ } /** - * Fetch the file name contaning XML Mapping of the content center tabs - * to URLs + * Fetch the file name contaning XML Mapping of the content center tabs to + * URLs + * * @return String containig file name including path component. */ public String getContentCenterMap() { @@ -880,17 +851,16 @@ } /** - * Internal class representing a DHTMLEditor configuration parameter. It + * Internal class representing a DHTMLEditor configuration parameter. It * creates a new DHMTLEditor Config object (internal class in DHTMLEditor). - * + * * XXX Method unmarshal is broken and currently does not work correctly. It - * does not process default values provided by using + * does not process default values provided by using * DHTMLEditor.Config.Standard (see parameter m_dhtmlEditorConfig above). * May be a similiar problem as with ResourceParameter and default value, - * see patch provided by pbrucha. - * Best solution may be to remove this special parameter class and use a - * string parameter instead to directly create a DHTMLEditor.Config object. - * (pboy, 2010-09-02) + * see patch provided by pbrucha. Best solution may be to remove this + * special parameter class and use a string parameter instead to directly + * create a DHTMLEditor.Config object. (pboy, 2010-09-02) */ private class DHTMLEditorConfigParameter extends StringParameter { @@ -902,6 +872,7 @@ /** * WARNING: Does not correctly process default values, see above! + * * @param value * @param errors * @return @@ -913,7 +884,9 @@ } protected static HashMap extraXMLGenerators = new HashMap(); - /** Add one ExtraXMLGenerator to the list. */ + /** + * Add one ExtraXMLGenerator to the list. + */ public static void registerExtraXMLGenerator(String type, ExtraXMLGenerator gen) { List gens = (List) extraXMLGenerators.get(type); @@ -927,7 +900,9 @@ gens.add(gen.getClass()); // XXX assumes default ctor } - /** Get the iterator of ExtraXMLGenerators. */ + /** + * Get the iterator of ExtraXMLGenerators. + */ public static Iterator getExtraXMLGeneratorsIterator() { return extraXMLGenerators.entrySet().iterator(); } @@ -937,11 +912,11 @@ } /** - * The relative weight given to the dcKeywords element - * within dublinCore element within cms:item element - * when ranking search results - * Only used by the interMedia query engine. - **/ + * The relative weight given to the dcKeywords element within dublinCore + * element within cms:item element when ranking search results Only used by + * the interMedia query engine. + * + */ public Integer getKeywordSearchWeight() { return (Integer) get(m_keywordWeight); } @@ -951,18 +926,20 @@ } /** - * The relative weight given to title element - * within cms:item element when ranking search results - * Only used by the interMedia query engine. - **/ + * The relative weight given to title element within cms:item element when + * ranking search results Only used by the interMedia query engine. + * + */ public Integer getTitleSearchWeight() { return (Integer) get(m_titleWeight); } /** - * Whether to include INPATH operators to contains clause in intermedia search + * Whether to include INPATH operators to contains clause in intermedia + * search * - * NB - if true, INDEX MUST BE CREATED WITH PATH_SECTION_GROUP - upgrade 6.5.0 - 6.5.1 + * NB - if true, INDEX MUST BE CREATED WITH PATH_SECTION_GROUP - upgrade + * 6.5.0 - 6.5.1 * * @return */ @@ -971,14 +948,14 @@ } /** - * for the given content type, returns a collection of - * steps that are deemed irrelevant for the type. - * + * for the given content type, returns a collection of steps that are deemed + * irrelevant for the type. + * * If no irrelevant steps, an empty set is returned. - * - * Steps are the names of the bebop step components that - * are used by the authoring kit wizard - * + * + * Steps are the names of the bebop step components that are used by the + * authoring kit wizard + * * @param type * @return */ @@ -1022,8 +999,8 @@ } /** - * May be used by any content type creation form to decide whether to validate - * description field + * May be used by any content type creation form to decide whether to + * validate description field * */ public boolean mandatoryDescriptions() { @@ -1031,9 +1008,9 @@ } /** - * Used to decide whether lifecycles (and all asociated phases) - * should be deleted from the system when complete - * + * Used to decide whether lifecycles (and all asociated phases) should be + * deleted from the system when complete + * * (Deleting lifecycle means that you lose a bit of historical information * eg when was this item unpublished) */ @@ -1042,26 +1019,24 @@ } /** - * Used to decide whether to delete old notification records - * for expiry notifications. - * - * If true, notifications and messages are deleted if the - * notification is successfully sent. Any send failures are - * retained - * + * Used to decide whether to delete old notification records for expiry + * notifications. + * + * If true, notifications and messages are deleted if the notification is + * successfully sent. Any send failures are retained + * */ public boolean deleteExpiryNotifications() { return ((Boolean) get(m_deleteExpiryNotificationsWhenSent)).booleanValue(); } /** - * Used to decide whether to delete old notification records - * for workflow notifications. - * - * If true, notifications and messages are deleted if the - * notification is successfully sent. Any send failures are - * retained - * + * Used to decide whether to delete old notification records for workflow + * notifications. + * + * If true, notifications and messages are deleted if the notification is + * successfully sent. Any send failures are retained + * */ public boolean deleteWorkflowNotifications() { return ((Boolean) get(m_deleteWorkflowNotificationsWhenSent)). @@ -1074,11 +1049,11 @@ /** * I'am not sure for what this method is. I found it here when I tried - * figure out how add multiple parts to an ContentType, like ccm-cms-types-contact - * and the Multipart article do. I think this method should not be here because - * it is only needed by one specific contenttype. Because of this, I think that - * this method and the contact are violating many rules of modern software design. - * Jens Pelzetter, 2009-06-02. + * figure out how add multiple parts to an ContentType, like + * ccm-cms-types-contact and the Multipart article do. I think this method + * should not be here because it is only needed by one specific contenttype. + * Because of this, I think that this method and the contact are violating + * many rules of modern software design. Jens Pelzetter, 2009-06-02. * * @return */ @@ -1096,8 +1071,8 @@ } /** - * Hide the (no longer used) legacy public site link in Workspace - * (content center) section listing, true by default. + * Hide the (no longer used) legacy public site link in Workspace (content + * center) section listing, true by default. */ public final boolean getHideLegacyPublicSiteLink() { return ((Boolean) get(m_hideLegacyPublicSiteLink)).booleanValue(); @@ -1122,4 +1097,12 @@ public Boolean getThreadedPublishing() { return (Boolean) get(m_threadPublishing); } + + public String getPublicationFailureSender() { + return (String) get(m_publishingFailureSender); + } + + public String getPublicationFailureReceiver() { + return (String) get(m_publishingFailureReceiver); + } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig_parameter.properties 2012-05-01 08:11:40 UTC (rev 2300) @@ -259,6 +259,17 @@ com.arsdigita.cms.lifecycle.threaded_publishing.example = false com.arsdigita.cms.lifecycle.threaded_com.arsdigita.cms.lifecycle.threaded_publishingpublishing.format = [Boolean] +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.title = Publishing failed notification sender +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.purpose = Sender e-mail address for notificiation on error while publishing +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.example = web...@ex... +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.from.format = [String] + +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.title = Publishing failed notification receiver +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.purpose = email address to send failure notifications to +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.example = web...@ex... +cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to.format = [String] + + com.arsdigita.cms.xx.title= com.arsdigita.cms.xx.purpose= com.arsdigita.cms.xx.example= Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -1061,9 +1061,9 @@ } /** - * Returns true if this item has a publicly viewable version. This item is - * not necessarily the live version nor is this method to be confused with - * isPublished. + * Returns true if this language version of this item has a publicly viewable + * version. This item is not necessarily the live version nor is this + * method to be confused with isPublished. * * @return < code>true<code> if this content item has a live * version, or if it <em>is</em> the live version @@ -1072,7 +1072,20 @@ return getLiveVersion() != null; } + // Added by: Quasimodo /** + * Returns true if this item has a publicly viewable version in any language. + * This item is not necessarily the live version nor is this method + * to be confused with isPublished. + * + * @return < code>true<code> if this content bundle item has a live + * version + */ + public boolean hasLiveInstance() { + return getBundle().getLiveVersion() != null; + } + + /** * Makes an item live or not live. * * @param version the version which should become live, null to make the @@ -1139,7 +1152,7 @@ s_log.debug("Deleting old live version"); oldVersion.delete(); - PublishedLink.refreshOnUnpublish(this); + PublishedLink.refreshOnUnpublish(this); } if (parent instanceof ContentBundle || parent instanceof Folder) { @@ -1167,7 +1180,7 @@ save(); - PublishedLink.updateLiveLinks(version); + PublishedLink.updateLiveLinks(version); save(); // publish item (as template or html pages) to the file @@ -1947,8 +1960,41 @@ } } + /*final AssociationCopierLoader assocCopierLoader = + AssociationCopierLoader.getInstance(); + final AssociationCopier assocCopier = assocCopierLoader. + getAssociationCopierFor(property, source); + if (assocCopier != null) { + return assocCopier.copyProperty(source, property, copier); + }*/ + + if (source instanceof ContentItem) { + final ContentItem sourceItem = (ContentItem) source; + final Object value = sourceItem.get(property.getName()); + if (value instanceof DataCollection) { + final DataCollection collection = (DataCollection) value; + while(collection.next()) { + DomainObject obj = DomainObjectFactory.newInstance(collection.getDataObject()); + if (obj instanceof ContentItem) { + final ContentItem item = (ContentItem) obj; + return item.copyReverseProperty(source, + this, + property, + copier); + } + } + } + } + return false; } + + public boolean copyReverseProperty(final CustomCopy source, + final ContentItem liveItem, + final Property property, + final ItemCopier copier) { + return false; + } /** * Copy services from the source item. This method is the analogue of the {@link #copyProperty} Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -34,27 +34,27 @@ setContentType(primary.getContentType()); addInstance(primary); - super.setName(primary.getName()); + super.setName(primary.getName()); } public GenericContactBundle(final OID oid) throws DataObjectNotFoundException { - super(oid); + super(oid); } public GenericContactBundle(final BigDecimal id) throws DataObjectNotFoundException { - super(new OID(BASE_DATA_OBJECT_TYPE, id)); + super(new OID(BASE_DATA_OBJECT_TYPE, id)); } public GenericContactBundle(final DataObject dobj) { - super(dobj); + super(dobj); } public GenericContactBundle(final String type) { super(type); } - + /** * <p> Copy association properties. These are for example the associations * between GenericPerson and GenericContact, or between @@ -76,7 +76,6 @@ (GenericContactBundle) source; if (PERSON.equals(attribute)) { - final DataCollection persons = (DataCollection) contactBundle. get(PERSON); @@ -85,7 +84,16 @@ } return true; - } else { + } else if ("organizationalunit".equals(attribute)) { + final DataCollection orgaunits = (DataCollection) contactBundle. + get("organizationalunit"); + + while (orgaunits.next()) { + createOrgaUnitAssoc(orgaunits); + } + + return true; + } else { return super.copyProperty(source, property, copier); } } else { @@ -114,6 +122,28 @@ } } + private void createOrgaUnitAssoc(final DataCollection orgaunits) { + final GenericOrganizationalUnitBundle draftOrga = + (GenericOrganizationalUnitBundle) DomainObjectFactory. + newInstance(orgaunits.getDataObject()); + final GenericOrganizationalUnitBundle liveOrga = + (GenericOrganizationalUnitBundle) draftOrga. + getLiveVersion(); + + if (liveOrga != null) { + final DataObject link = add("organizationalunit", liveOrga); + + link.set(GenericOrganizationalUnitContactCollection.CONTACT_TYPE, + orgaunits.get( + GenericOrganizationalUnitContactCollection.LINK_CONTACT_TYPE)); + link.set(GenericOrganizationalUnitContactCollection.CONTACT_ORDER, + orgaunits.get( + GenericOrganizationalUnitContactCollection.LINK_CONTACT_ORDER)); + + link.save(); + } + } + public GenericPerson getPerson() { DataCollection collection; Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -20,14 +20,10 @@ package com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitSubordinateOrgaUnitAddForm; -import com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitSubordinateOrgaUnitsTable; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; -import com.arsdigita.util.Assert; import java.math.BigDecimal; import org.apache.log4j.Logger; @@ -172,14 +168,15 @@ } public GenericOrganizationalUnitSuperiorCollection getSuperiorOrgaUnits() { - final DataCollection dataCollection = (DataCollection) get( - SUPERIOR_ORGAUNITS); - return new GenericOrganizationalUnitSuperiorCollection(dataCollection); + //final DataCollection dataCollection = (DataCollection) get( + // SUPERIOR_ORGAUNITS); + //return new GenericOrganizationalUnitSuperiorCollection(dataCollection); + return getGenericOrganizationalUnitBundle().getSuperiorOrgaUnits(); } public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit, final String assocType) { - Assert.exists(orgaunit, GenericOrganizationalUnit.class); + /*Assert.exists(orgaunit, GenericOrganizationalUnit.class); final DataObject link = add(SUPERIOR_ORGAUNITS, orgaunit); link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE, @@ -190,7 +187,9 @@ link.set( GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER, ((int) getSubordinateOrgaUnits().size()) + 1); - link.save(); + link.save();*/ + getGenericOrganizationalUnitBundle().addSuperiorOrgaUnit(orgaunit, + assocType); } public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit) { @@ -199,41 +198,26 @@ public void removeSuperiorOrgaUnit( final GenericOrganizationalUnit orgaunit) { - Assert.exists(orgaunit, GenericOrganizationalUnit.class); - remove(SUPERIOR_ORGAUNITS, orgaunit); + //Assert.exists(orgaunit, GenericOrganizationalUnit.class); + //remove(SUPERIOR_ORGAUNITS, orgaunit); + getGenericOrganizationalUnitBundle().removeSuperiorOrgaUnit(orgaunit); } public boolean hasSuperiorOrgaUnits() { - return !getSuperiorOrgaUnits().isEmpty(); + //return !getSuperiorOrgaUnits().isEmpty(); + return getGenericOrganizationalUnitBundle().hasSuperiorOrgaUnits(); } - - /** - * Gets a collection of subordinate organizational units. Note that their - * is no authoring step registered for this property. The {@code ccm-cms} - * module provides only a form for adding subordinate organizational units - * and a table for showing them. Subtypes of - * {@code GenericOrganizationalUnit} may add these components to their - * authoring steps via a new authoring step which contains the form - * and the table. These authoring steps should be registered by using - * {@link AuthoringKitWizard#registerAssetStep(java.lang.String, java.lang.Class, com.arsdigita.globalization.GlobalizedMessage, com.arsdigita.globalization.GlobalizedMessage, int) } - * in the initalizer of the content type. Some aspects of the form and - * table, for example the labels, can be configured using implementations - * of two interfaces. Please refer to the documentation of - * {@link GenericOrganizationalUnitSubordinateOrgaUnitsTable} and - * {@link GenericOrganizationalUnitSubordinateOrgaUnitAddForm} - * for more information about customizing the table and the form. - * - * @return A collection of subordinate organizational units. - */ + public GenericOrganizationalUnitSubordinateCollection getSubordinateOrgaUnits() { - final DataCollection dataCollection = (DataCollection) get( - SUBORDINATE_ORGAUNITS); - return new GenericOrganizationalUnitSubordinateCollection(dataCollection); + //final DataCollection dataCollection = (DataCollection) get( + // SUBORDINATE_ORGAUNITS); + //return new GenericOrganizationalUnitSubordinateCollection(dataCollection); + return getGenericOrganizationalUnitBundle().getSubordinateOrgaUnits(); } public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit, final String assocType) { - Assert.exists(orgaunit, GenericOrganizationalUnit.class); + /*Assert.exists(orgaunit, GenericOrganizationalUnit.class); final DataObject link = add(SUBORDINATE_ORGAUNITS, orgaunit); link.set(GenericOrganizationalUnitSubordinateCollection.ASSOCTYPE, @@ -244,7 +228,9 @@ link.set( GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER, ((int) getSuperiorOrgaUnits().size()) + 1); - link.save(); + link.save();*/ + getGenericOrganizationalUnitBundle().addSubordinateOrgaUnit(orgaunit, + assocType); } public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit) { @@ -253,12 +239,14 @@ public void removeSubordinateOrgaUnit( final GenericOrganizationalUnit orgaunit) { - Assert.exists(orgaunit, GenericOrganizationalUnit.class); - remove(SUBORDINATE_ORGAUNITS, orgaunit); + //Assert.exists(orgaunit, GenericOrganizationalUnit.class); + //remove(SUBORDINATE_ORGAUNITS, orgaunit); + getGenericOrganizationalUnitBundle().removeSubordinateOrgaUnit(orgaunit); } public boolean hasSubordinateOrgaUnits() { - return !getSubordinateOrgaUnits().isEmpty(); + //return !getSubordinateOrgaUnits().isEmpty(); + return getGenericOrganizationalUnitBundle().hasSubordinateOrgaUnits(); } @Override Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java 2012-05-01 08:00:40 UTC (rev 2299) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitBundle.java 2012-05-01 08:11:40 UTC (rev 2300) @@ -2,10 +2,14 @@ import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.CustomCopy; +import com.arsdigita.cms.ItemCopier; import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.metadata.Property; import com.arsdigita.util.Assert; import java.math.BigDecimal; @@ -22,6 +26,8 @@ public static final String PERSONS = "persons"; public static final String ORGAUNITS = "organizationalunits"; public final static String CONTACTS = "contacts"; + public final static String SUPERIOR_ORGAUNITS = "superiorOrgaunits"; + public final static String SUBORDINATE_ORGAUNITS = "subordinateOrgaunits"; public GenericOrganizationalUnitBundle(final ContentItem primary) { super(BASE_DATA_OBJECT_TYPE); @@ -106,4 +112,252 @@ public boolean hasContacts() { return !this.getContacts().isEmpty(); } + + public GenericOrganizationalUnitSuperiorCollection getSuperiorOrgaUnits() { + return new GenericOrganizationalUnitSuperiorCollection((DataCollection) get( + SUPERIOR_ORGAUNITS)); + } + + public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit, + final String assocType) { + Assert.exists(orgaunit, GenericOrganizationalUnit.class); + + final DataObject link = + add(SUPERIOR_ORGAUNITS, + orgaunit.getGenericOrganizationalUnitBundle()); + link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE, + assocType); + link.set( + GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER, + (int) getSuperiorOrgaUnits().size()); + link.set( + GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER, + (int) getSubordinateOrgaUnits().size() + 1); + + link.save(); + } + + public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit) { + addSuperiorOrgaUnit(orgaunit, ""); + } + + public void removeSuperiorOrgaUnit( + final GenericOrganizationalUnit orgaunit) { + Assert.exists(orgaunit, GenericOrganizationalUnit.class); + remove(SUPERIOR_ORGAUNITS, orgaunit.getGenericOrganizationalUnitBundle()); + } + + public boolean hasSuperiorOrgaUnits() { + return !getSuperiorOrgaUnits().isEmpty(); + } + + /** + * Gets a collection of subordinate organizational units. Note that their + * is no authoring step registered for this property. The {@code ccm-cms} + * module provides only a form for adding subordinate organizational units + * and a table for showing them. Subtypes of + * {@code GenericOrganizationalUnit} may add these components to their + * authoring steps via a new authoring step which contains the form + * and the table. These authoring steps should be registered by using + * {@link AuthoringKitWizard#registerAssetStep(java.lang.String, java.lang.Class, com.arsdigita.globalization.GlobalizedMessage, com.arsdigita.globalization.GlobalizedMessage, int) } + * in the initalizer of the content type. Some aspects of the form and + * table, for example the labels, can be configured using implementations + * of two interfaces. Please refer to the documentation of + * {@link GenericOrganizationalUnitSubordinateOrgaUnitsTable} and + * {@link GenericOrganizationalUnitSubordinateOrgaUnitAddForm} + * for more information about customizing the table and the form. + * + * @return A collection of subordinate organizational units. + */ + public GenericOrganizationalUnitSubordinateCollection getSubordinateOrgaUnits() { + final DataCollection dataCollection = (DataCollection) get( + SUBORDINATE_ORGAUNITS); + return new GenericOrganizationalUnitSubordinateCollection(dataCollection); + } + + public void addSubordinateOrgaUnit(final GenericOrgani... [truncated message content] |
From: <pb...@fe...> - 2012-05-01 08:00:59
|
Author: pboy Date: 2012-05-01 08:00:40 +0000 (Tue, 01 May 2012) New Revision: 2299 Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolderInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocLinkInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Initializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/MimeIconInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/RepositoryLoader.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CategoryBrowserServlet.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/DCNDispatcher.java.nolongerInUse trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/DMDispatcher.java.nolongerInUse trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/RepositoryServlet.java trunk/ccm-docmgr/web/WEB-INF/ trunk/ccm-docmgr/web/WEB-INF/web.ccm-docmgr.xml Removed: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/DCNDispatcher.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/DMDispatcher.java Modified: trunk/ccm-docmgr/src/ccm-docmgr.load trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentCategoryBrowserApplication.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/LegacyCategoryBrowserApplication.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CreateDocLinkPane.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FileEditForm.java trunk/ccm-docmgr/web/packages/docmgr/xsl/docs.xsl Log: DocMgr refactored, now legacy free type of application. NO ugrade script provided because is was not officially distributed. Modified: trunk/ccm-docmgr/src/ccm-docmgr.load =================================================================== --- trunk/ccm-docmgr/src/ccm-docmgr.load 2012-05-01 07:59:14 UTC (rev 2298) +++ trunk/ccm-docmgr/src/ccm-docmgr.load 2012-05-01 08:00:40 UTC (rev 2299) @@ -6,15 +6,15 @@ <initializer class="com.arsdigita.core.Initializer"/> </requires> <provides> - <initializer class="com.arsdigita.cms.docmgr.installer.Initializer"/> - <initializer class="com.arsdigita.cms.docmgr.installer.DocumentInitializer"/> - <initializer class="com.arsdigita.cms.docmgr.installer.DocLinkInitializer"/> + <initializer class="com.arsdigita.cms.docmgr.Initializer"/> + <initializer class="com.arsdigita.cms.docmgr.DocumentInitializer"/> + <initializer class="com.arsdigita.cms.docmgr.DocLinkInitializer"/> </provides> <scripts> <schema directory="ccm-docmgr"/> <data class="com.arsdigita.cms.docmgr.DocumentLoader"/> <data class="com.arsdigita.cms.docmgr.DocLinkLoader"/> <data class="com.arsdigita.cms.docmgr.DocFolderLoader"/> - <data class="com.arsdigita.cms.docmgr.Loader"/> + <data class="com.arsdigita.cms.docmgr.RepositoryLoader"/> </scripts> </load> Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolderInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolderInitializer.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolderInitializer.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,32 @@ +package com.arsdigita.cms.docmgr; + +import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.docmgr.DocFolder; + +/** + * Loader class for the DocFolder content type. Registers the content + * type, and creates an authoring kit for it. + * + * @author Crag Wolfe + */ +public class DocFolderInitializer { + + private final static org.apache.log4j.Logger s_log = + org.apache.log4j.Logger.getLogger(DocFolderInitializer.class); + + public static final String LABEL = "DocFolder"; + public static final String DESCRIPTION = "A document type."; + + public void load() { + ContentType type; + + type = new ContentType(); + type.setLabel( LABEL ); + type.setDescription( DESCRIPTION ); + type.setClassName( DocFolder.class.getName() ); + type.setAssociatedObjectType( DocFolder.TYPE ); + type.save(); + + s_log.debug("loaded DocFolder content type"); + } +} Property changes on: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolderInitializer.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocLinkInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocLinkInitializer.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocLinkInitializer.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,51 @@ +package com.arsdigita.cms.docmgr; + +import org.apache.log4j.Category; + +import com.arsdigita.cms.contenttypes.ContentTypeInitializer; +import com.arsdigita.cms.docmgr.DocLink; + +/* + * Instantiates the DocLink content type + * Initializes the DocLink content type. + * + * Defines the content type specific properties and just uses the super class + * methods to register the content type with the (transient) content type store + * (map). This is done by runtimeRuntime startup method which runs the init() + * methods of all initializers (this one just using the parent implementation). + * + * @version $Id: DocLinkInitializer.java,v 1.3 2003/06/30 21:47:31 cwolfe Exp $ + */ +public class DocLinkInitializer extends ContentTypeInitializer { + + private static Category s_log = + Category.getInstance(DocLinkInitializer.class); + + // + /** + * Constructor, sets the PDL manifest file and object type string. + * Using empty mf here, everything is loaded by DocumentInitializer + */ + public DocLinkInitializer() { + super("empty.pdl.mf", DocLink.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/DocLink.xml"; + } + + /** + * Retrieve location of this content types stylesheet. Overwrites parent + * method with FormItem specific value for use by the parent class worker + * methods. + * + * @return fully qualified path info string relative to document root + */ + @Override + public String[] getStylesheets() { + return new String[] { + "/themes/heirloom/contenttypes/DMDocLink.xsl" }; + // "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" }; + } +} Property changes on: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocLinkInitializer.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentCategoryBrowserApplication.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentCategoryBrowserApplication.java 2012-05-01 07:59:14 UTC (rev 2298) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentCategoryBrowserApplication.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -33,16 +33,18 @@ */ public class DocumentCategoryBrowserApplication extends Application { + + private static Logger s_log = + Logger.getLogger(DocumentCategoryBrowserApplication.class); + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.docmgr.DocumentCategoryBrowserApplication"; + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } - private static Logger s_log = - Logger.getLogger(DocumentCategoryBrowserApplication.class); - // pdl constants private static final String OWNER = "ownerID"; private static final String ROOT = "rootID"; @@ -101,5 +103,34 @@ // set("name", name); //} + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended for versions newer + * than 1.0.4) you may use a standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>docmgr-categorybrowser</servlet-name> + * <servlet-class>com.arsdigita.cms.docmgr.ui.CategoryBrowserServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>docmgr-categorybrowser</servlet-name> + * <url-pattern>/docmgr-cat/*</url-pattern> + * </servlet-mapping> + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/docmgr-cat"; + } + } Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentInitializer.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentInitializer.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,44 @@ +package com.arsdigita.cms.docmgr; + +import org.apache.log4j.Category; + +import com.arsdigita.cms.contenttypes.ContentTypeInitializer; +import com.arsdigita.cms.docmgr.Document; + +/* + * Instantiates the Document content type + * + * @version $Id: DocumentInitializer.java $ + */ +public class DocumentInitializer extends ContentTypeInitializer { + + private static Category s_log = + Category.getInstance(DocumentInitializer.class); + + /** + * Constructor, sets the PDL manifest file and object type string. + * Using the whole module's mf here + */ + public DocumentInitializer() { + super("ccm-docmgr.pdl.mf", Document.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/Document.xml"; + } + + /** + * Retrieve location of this content types stylesheet. Overwrites parent + * method with FormItem specific value for use by the parent class worker + * methods. + * + * @return fully qualified path info string reltive to document (context) root + */ + @Override + public String[] getStylesheets() { + return new String[] { + "/themes/heirloom/contenttypes/DMDocument.xsl" }; + // "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" }; + } +} Property changes on: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocumentInitializer.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Initializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Initializer.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Initializer.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,295 @@ +/* + * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.cms.docmgr; + +import org.apache.log4j.Logger; + +import com.arsdigita.cms.docmgr.DocFolder; +import com.arsdigita.cms.docmgr.Document; +import com.arsdigita.cms.docmgr.DocumentCategoryBrowserApplication; +import com.arsdigita.cms.docmgr.LegacyCategoryBrowserApplication; +import com.arsdigita.cms.docmgr.Repository; +// unused: import com.arsdigita.cms.docmgr.search.SearchUtils; +import com.arsdigita.cms.docmgr.ui.CategoryDocsNavigatorPortlet; +import com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet; +import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +// import com.arsdigita.initializer.Configuration; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.TransactionContext; +import com.arsdigita.portal.PortletType; +import com.arsdigita.portal.apportlet.AppPortletSetup; +import com.arsdigita.runtime.CompoundInitializer; +import com.arsdigita.runtime.DomainInitEvent; +import com.arsdigita.web.ApplicationSetup; +import com.arsdigita.web.ApplicationType; + + +/** + * Initializes the document manager package, sets up the + * DomainFactory, registers knowledge types and portlets. + * + * @author Stefan Deusch + * @author David Dao + * + * @version $Revision: #11 $ $Date: 2004/01/14 $ + */ +public class Initializer extends CompoundInitializer { + + /** Private Logger instance for debugging purpose. */ + private static Logger s_log = Logger.getLogger(Initializer.class); + + // private Configuration m_conf = new Configuration(); + + private static final String SEPARATOR = java.io.File.separator; + + private static String PACKAGE_TYPE_NAME = "cmsdocs"; + private static String CATEGORY_PACKAGE_TYPE_NAME = "cmsdocs-categories"; + private static String LEGACY_PACKAGE_TYPE_NAME = "cmsdocs-categories-legacy"; + + public static final String CONTENT_SECTION = "contentSection"; + public static final String INTERNAL_GROUP_ID = "internalGroupID"; + public static final String LEGACY_FOLDER_NAME = "legacyFolderName"; + + /** + * + */ + public Initializer() { + } + + /** + * Returns the configuration object used by this initializer. + */ +// public Configuration getConfiguration() { +// return m_conf; +// } + + /** + * + * @param e + */ + @Override + public void init(DomainInitEvent e) { + s_log.debug("Document (CCM) Manager is Domain initializing ... "); + + /* Register REPOSITORY application type.*/ + e.getFactory().registerInstantiator( + Repository.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Repository(dataObject); + } + }); + + /* Register Portlet DocumentBrowser. */ + e.getFactory().registerInstantiator( + RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new RecentUpdatedDocsPortlet(dataObject); + } + }); + + /* Set up domain object factories for basic document manager + * object types. */ + + DomainObjectFactory.registerInstantiator( + Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Document(dataObject); + } + } + ); + DomainObjectFactory.registerInstantiator( + DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new DocFolder(dataObject); + } + } + ); + + + startup(); + } + + /** + * Called on startup. + */ + public void startup() { + s_log.info("Document Manager is initializing."); + + // setupDomainFactory(); + + TransactionContext txn = SessionManager.getSession() + .getTransactionContext(); + txn.beginTxn(); + + // ApplicationType docsAppType = setupDocs(); + // setupDocManagerPortlet(docsAppType); + + // ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing(); + // setupCategoryDocsPortlet(categoryBrowseDocsAppType); + + // ApplicationType legacyCategoryBrowseDocsAppType = + // setupLegacyCategoryBrowsing(); + // setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType); + + // de-activate search for now + //SearchUtils.setSearcher + // (new com.arsdigita.cms.docmgr.search.IntermediaSearcher()); + + txn.commitTxn(); + s_log.info("Document Manager Initializer completed."); + } + + /** + * Set up the document manager. Checks to see if the necessary + * package exists, and if not it creates it for the first time. + */ + + private ApplicationType setupDocs() { + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE); + setup.setKey(PACKAGE_TYPE_NAME); + setup.setTitle("Document Manager (CMS) Application"); + setup.setSingleton(false); + setup.setDescription + ("The document manager empowers users to share documents."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Repository(dataObject); + } + }); + + return setup.run(); + } + + private void setupDocManagerPortlet(ApplicationType provider) { + // Create the document manager portlet + AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); + setup.setTitle("Recent Documents"); + setup.setDescription("Displays the most recent documents in the document manager."); + setup.setProfile(PortletType.WIDE_PROFILE); + setup.setProviderApplicationType(provider); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new RecentUpdatedDocsPortlet(dataObject); + } + }); + + setup.run(); + } + + private ApplicationType setupCategoryBrowsing() { + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + setup.setKey(CATEGORY_PACKAGE_TYPE_NAME); + setup.setTitle("Browse Documents Application"); + setup.setSingleton(true); + setup.setDescription + ("Browse documents by category."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + // Class Stylesheet and database backed stylesheet locations are + // deprecated and removed. New StylesheetResolver is pattern based. + //setup.setStylesheet("/packages/cms-docmgr/xsl/docs.xsl"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new DocumentCategoryBrowserApplication(dataObject); + } + }); + return setup.run(); + + } + private ApplicationType setupLegacyCategoryBrowsing() { + ApplicationSetup setup = new ApplicationSetup(s_log); + setup.setApplicationObjectType(LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + setup.setKey(LEGACY_PACKAGE_TYPE_NAME); + setup.setTitle("Taxonomy Browser"); + setup.setSingleton(true); + setup.setDescription + ("Browse documents by category."); + setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + // Class Stylesheet and database backed stylesheet locations are + // deprecated and removed. New StylesheetResolver is pattern based. + //setup.setStylesheet("/packages/cms-docmgr/xsl/docs.xsl"); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new LegacyCategoryBrowserApplication(dataObject); + } + }); + return setup.run(); + + } + + private void setupCategoryDocsPortlet(ApplicationType provider) { + // Create the document manager portlet + AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(CategoryDocsNavigatorPortlet.BASE_DATA_OBJECT_TYPE); + setup.setTitle("Document Category Navigator"); + setup.setDescription("Browse documents by category."); + setup.setProfile(PortletType.WIDE_PROFILE); + setup.setProviderApplicationType(provider); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new CategoryDocsNavigatorPortlet(dataObject); + } + }); + + setup.run(); + } + + private void setupLegacyCategoryDocsPortlet(ApplicationType provider) { + // Create the document manager portlet + AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(LegacyCategoryDocsNavigatorPortlet.BASE_DATA_OBJECT_TYPE); + setup.setTitle("Taxonomy Browser"); + setup.setDescription("Browse documents by category."); + setup.setProfile(PortletType.WIDE_PROFILE); + setup.setProviderApplicationType(provider); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new LegacyCategoryDocsNavigatorPortlet(dataObject); + } + }); + + setup.run(); + } + + + /** + * Shutdown the document manager. + */ + public void shutdown() { } + +} Property changes on: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Initializer.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/LegacyCategoryBrowserApplication.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/LegacyCategoryBrowserApplication.java 2012-05-01 07:59:14 UTC (rev 2298) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/LegacyCategoryBrowserApplication.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -31,6 +31,10 @@ */ public class LegacyCategoryBrowserApplication extends Application { + + private static Logger s_log = + Logger.getLogger(LegacyCategoryBrowserApplication.class); + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.docmgr.LegacyCategoryBrowserApplication"; @@ -38,9 +42,6 @@ return BASE_DATA_OBJECT_TYPE; } - private static Logger s_log = - Logger.getLogger(LegacyCategoryBrowserApplication.class); - // pdl constants private static final String OWNER = "ownerID"; private static final String ROOT = "rootID"; @@ -99,5 +100,33 @@ // set("name", name); //} + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended for versions newer + * than 1.0.4) you may use a standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>docmgr-categorybrowser</servlet-name> + * <servlet-class>com.arsdigita.cms.docmgr.ui.CategoryBrowserServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>docmgr-categorybrowser</servlet-name> + * <url-pattern>/docmgr-cat/*</url-pattern> + * </servlet-mapping> + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/docmgr-cat"; + } } Deleted: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java 2012-05-01 07:59:14 UTC (rev 2298) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -1,354 +0,0 @@ -/* - * Copyright (C) 2012 Peter Boy <pb...@ze...> 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.docmgr; - -import com.arsdigita.cms.docmgr.ui.CategoryDocsNavigatorPortlet; -import com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet; -import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.kernel.ACSObjectInstantiator; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.loader.PackageLoader; -// import com.arsdigita.mimetypes.*; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.portal.PortletType; -import com.arsdigita.portal.apportlet.AppPortletSetup; -import com.arsdigita.portal.apportlet.AppPortletType; -import com.arsdigita.runtime.ScriptContext; -import com.arsdigita.web.ApplicationSetup; -import com.arsdigita.web.ApplicationType; - -import org.apache.log4j.Logger; - - -// /////////////////////////////////////////////////////////////////////////// -// Project: Migrate to new style legacy free type of application. -// -// Step 1: Copy from Initializer all data base / applicationtype -// related code to LOADER and use Loader for data loading. -// -// Step 2: Remove usage of ApplicationSetup and switch to legacy -// compativle AppType xxx = new AppType.create(......) -// Move setInstantiator back to Initializer as required. -// -// Step 3: Move to legacy free app type -// (a) modify new App.Tpye..... -// (b) create AppServlet from Dispatcher -// -// -// TESTS: -// (a) Try to instantiate an instance of each type and check the UI -// produced by the dispatcher / servlet -// (b) Instantiate the porlets and try to reproduce the behaviour -// (probably reproduce the error showing up originally) -// -// -// /////////////////////////////////////////////////////////////////////////// - - - -/** - * CMS Document Manager (DocMgr) Loader - * - * @author pboy <pb...@ba...> - * @version $Id: Loader.java $ - **/ - -public class Loader extends PackageLoader { - - - /** Logger instance for debugging */ - private static final Logger s_log = Logger.getLogger(Loader.class); - - /** - * Run script invoked by com.arsdigita.packing loader script. - * - * @param ctx - */ - public void run(final ScriptContext ctx) { - - new KernelExcursion() { - public void excurse() { - setEffectiveParty(Kernel.getSystemParty()); - - loadDocRepositoryApplicationType(); //former setupDocs - setupDocRepositoryPortlet(null); //former setupDocManagerPortlet - - ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing(); - setupCategoryDocsPortlet(categoryBrowseDocsAppType); - - ApplicationType legacyCategoryBrowseDocsAppType = - setupLegacyCategoryBrowsing(); - setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType); - - // de-activate search for now - //SearchUtils.setSearcher - // (new com.arsdigita.cms.docmgr.search.IntermediaSearcher()); - - setupDefaultDocRepository(); //new here! - - } - }.run(); - - s_log.info("Done"); - } - - // //////////////////////////////////////////////////////////////////////// - // - // S e t u p o f a p p l i c a t i o n t y p e s - // - // //////////////////////////////////////////////////////////////////////// - - /** - * COPY & PASTE, has to be adopted !! - * Creates a document repository application type, the domain class of the - * document repository (docrepo) package, as a legacy-compatible type of - * application. - * - * Creates an entry in table application_types and a corresponding entry in - * apm_package_types - * - * TODO: migrate to a new style, legacy free application type. - */ - // formerly setupDocs() - private ApplicationType loadDocRepositoryApplicationType() { - -/* ApplicationSetup setup = new ApplicationSetup(s_log); - setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE); - setup.setKey("cmsdocs"); - setup.setTitle("Document Manager (CMS) Application"); - setup.setSingleton(false); - setup.setDescription - ("The document manager empowers users to share documents."); - setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new Repository(dataObject); - } - }); - - return setup.run(); -*/ - /* Create new type legacy compatible application type */ - ApplicationType type = ApplicationType - .createApplicationType("cmsdocs", - "DocRepo", - Repository.BASE_DATA_OBJECT_TYPE); - type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); - type.setDescription("The document manager empowers users to share documents."); - - - /* Legacy free initialization - * NOTE: The wording in the title parameter of ApplicationType determines - * the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and replacing - * blanks between words and illegal characters with an hyphen and converted - * to lower case. - * Example: "DocRepo" will become "docrepo". - */ - // ApplicationType type = new - // ApplicationType("DocRepo", - // Repository.BASE_DATA_OBJECT_TYPE ); - - // type.setDescription - // ("The document repository empowers users to share documents."); - - return type; - } - - private ApplicationType setupCategoryBrowsing() { -/* ApplicationSetup setup = new ApplicationSetup(s_log); - setup.setApplicationObjectType(DocumentCategoryBrowserApplication - .BASE_DATA_OBJECT_TYPE); - setup.setKey("cmsdocs-categories"); - setup.setTitle("Browse Documents Application"); - setup.setSingleton(true); - setup.setDescription - ("Browse documents by category."); - setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new DocumentCategoryBrowserApplication(dataObject); - } - }); - return setup.run(); -*/ - /* Create new type legacy compatible application type */ - ApplicationType type = ApplicationType - .createApplicationType("cmsdocs-categories", - "Browse Documents Application", - DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); - type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); - type.setDescription("Browse documents by category."); - - return type; - - } - private ApplicationType setupLegacyCategoryBrowsing() { -/* ApplicationSetup setup = new ApplicationSetup(s_log); - setup.setApplicationObjectType(LegacyCategoryBrowserApplication - .BASE_DATA_OBJECT_TYPE); - setup.setKey("cmsdocs-categories-legacy"); - setup.setTitle("Taxonomy Browser"); - setup.setSingleton(true); - setup.setDescription - ("Browse documents by category."); - setup.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new LegacyCategoryBrowserApplication(dataObject); - } - }); - return setup.run(); -*/ - /* Create new type legacy compatible application type */ - ApplicationType type = ApplicationType - .createApplicationType("cmsdocs-categories-legacy", - "Taxonomy Browser", - LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); - type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); - type.setDescription("Browse documents by category."); - - return type; - - } - - - - // //////////////////////////////////////////////////////////////////////// - // - // S e t u p a D O C M G R a p p l i c a t i o n - // - // //////////////////////////////////////////////////////////////////////// - private void setupDefaultDocRepository() { - - // try { - // SiteNode sn = SiteNode.getSiteNode("/administration", false); - // if (!"administration".equals(sn.getName())) { - Repository repo = Repository - .create( "docrepo", - "Default DocumentMgr Repository", - null); - repo.save(); - // } - // } catch (DataObjectNotFoundException e) { - // Assert.fail(e.getMessage()); - // } - - } - - - // //////////////////////////////////////////////////////////////////////// - // - // S e t u p o f i n t e r n a l p o r t l e t s - // - // //////////////////////////////////////////////////////////////////////// - - - /** - * Creates a PortletType (persistent object) for the RecentUpdatedDocs - * Portlet. - * - * Instances (Portlets) are created by user interface or programmatically - * by configuration. - */ - //former setupDocManagerPortlet - private void setupDocRepositoryPortlet(ApplicationType provider) { - - // Create the document repository portlet -/* AppPortletSetup setup = new AppPortletSetup(s_log); - - setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); - setup.setTitle("Recently Updated Documents"); - setup.setDescription( - "Displays the most recent documents in the document repository."); - setup.setProfile(PortletType.WIDE_PROFILE); - // setup.setProviderApplicationType(provider); - setup.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new RecentUpdatedDocsPortlet(dataObject); - } - }); - - setup.run(); -*/ - AppPortletType type = AppPortletType.createAppPortletType( - "Portal Bookmarks", - PortletType.NARROW_PROFILE, - RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); - // type.setProviderApplicationType(provider); - type.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE); - type.setDescription( - "Displays the most recent documents in the document repository."); - - - } - - private void setupCategoryDocsPortlet(ApplicationType provider) { - - // Create the document manager portlet - AppPortletSetup setup = new AppPortletSetup(s_log); - - setup.setPortletObjectType(CategoryDocsNavigatorPortlet - .BASE_DATA_OBJECT_TYPE); - setup.setTitle("Document Category Navigator"); - setup.setDescription("Browse documents by category."); - setup.setProfile(PortletType.WIDE_PROFILE); - setup.setProviderApplicationType(provider); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new CategoryDocsNavigatorPortlet(dataObject); - } - }); - - setup.run(); - - } - - private void setupLegacyCategoryDocsPortlet(ApplicationType provider) { - - // Create the document manager portlet - AppPortletSetup setup = new AppPortletSetup(s_log); - - setup.setPortletObjectType(LegacyCategoryDocsNavigatorPortlet - .BASE_DATA_OBJECT_TYPE); - setup.setTitle("Taxonomy Browser"); - setup.setDescription("Browse documents by category."); - setup.setProfile(PortletType.WIDE_PROFILE); - setup.setProviderApplicationType(provider); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new LegacyCategoryDocsNavigatorPortlet(dataObject); - } - }); - - setup.run(); - - } - - -} Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/MimeIconInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/MimeIconInitializer.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/MimeIconInitializer.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.cms.docmgr; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import org.apache.log4j.Logger; + +//Bimport com.arsdigita.initializer.Configuration; +// import com.arsdigita.initializer.InitializationException; +import com.arsdigita.mimetypes.MimeType; + + +/** + * Initializes mime-type to icon map. + * + * @author Crag Wolfe + * + */ + +public class MimeIconInitializer { // implements com.arsdigita.initializer.Initializer { + + // private Configuration m_conf = new Configuration(); + + private static final String SEPARATOR = java.io.File.separator; + + public static String ICON_URL_ROOT = "iconURLRoot"; + public static final String MIME_ICON_MAP = "mimeIconMap"; + public static final String DEFAULT_ICON = "defaultIcon"; + + private static Logger s_log = + Logger.getLogger(MimeIconInitializer.class); + + private static HashMap m_iconMap = new HashMap(); + private static String m_iconUrlRoot = null; + private static String m_defaultIcon = null; + + public MimeIconInitializer() { + // m_conf.initParameter(ICON_URL_ROOT, + // "location of mime-type icons", + // String.class); + // m_conf.initParameter(DEFAULT_ICON, + // "icon to use if no match found", + // String.class); + // m_conf.initParameter(MIME_ICON_MAP, + // "mime-type to icon map", + // List.class); + } + + /** + * Returns the configuration object used by this initializer. + */ +// public Configuration getConfiguration() { +// return m_conf; +// } + + /** + * Called on startup. + */ + public void startup() { + s_log.warn("Mime Icon Initializer beginning"); + + // m_iconUrlRoot = (String) m_conf.getParameter + // (ICON_URL_ROOT); + // m_defaultIcon = (String) m_conf.getParameter + // (DEFAULT_ICON); + + // List mimeTypes = (List) m_conf.getParameter + // (MIME_ICON_MAP); + +/* Iterator i = mimeTypes.iterator(); + while(i.hasNext()) { + List values = (List) i.next(); + if(values.size() != 2) { + s_log.fatal("expected two elements in row, but "+ + "found "+ + (new Integer(values.size())).toString()); + throw new InitializationException + (MIME_ICON_MAP+" parameter not formatted correctly"); + } + String mimeTypeName = (String) values.get(0); + String iconName = (String) values.get(1); + MimeType mt = MimeType.loadMimeType(mimeTypeName); + if (mimeTypeName == null) { + s_log.error + ("mime type "+mimeTypeName+" does not exist in "+ + "com.arsdigita.mimetypes.MimeTypeInitializer,"+ + "so this icon will not be used"); + continue; + } + m_iconMap.put(mimeTypeName, m_iconUrlRoot + iconName); + } +*/ + s_log.info("Mime Icon Initializer completed."); + } + +/* public static String getMimeIconURL(String mimeTypeName) { + if (m_iconMap.get(mimeTypeName) != null) { + return (String) m_iconMap.get(mimeTypeName); + } + return m_iconUrlRoot + m_defaultIcon; + } +*/ + /** + * Shutdown the document manager. + */ +// public void shutdown() { } + +} Property changes on: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/MimeIconInitializer.java ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java 2012-05-01 07:59:14 UTC (rev 2298) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -346,4 +346,34 @@ } return null; } + + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended for versions newer + * than 1.0.4) you may use a standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>docmgr-repository</servlet-name> + * <servlet-class>com.arsdigita.cms.docmgr.ui.RepositoryServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>docmgr-repository</servlet-name> + * <url-pattern>/docmgr-repo/*</url-pattern> + * </servlet-mapping> + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/docmgr-repo"; + } + } Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/RepositoryLoader.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/RepositoryLoader.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/RepositoryLoader.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,292 @@ +/* + * Copyright (C) 2012 Peter Boy <pb...@ze...> 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.docmgr; + +import com.arsdigita.cms.docmgr.ui.CategoryDocsNavigatorPortlet; +import com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet; +import com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortlet; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.portal.PortletType; +import com.arsdigita.portal.apportlet.AppPortletSetup; +import com.arsdigita.portal.apportlet.AppPortletType; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.ApplicationType; + +import org.apache.log4j.Logger; + + +// /////////////////////////////////////////////////////////////////////////// +// Project: Migrate to new style legacy free type of application. +// +// Step 1: Copy from Initializer all data base / applicationtype *DONE* +// related code to LOADER and use RepositoryLoader for +// data loading. +// +// Step 2: Remove usage of ApplicationSetup and switch to legacy *DONE* +// compativle AppType xxx = new AppType.create(......) +// Move setInstantiator back to Initializer as required. +// +// Step 3: Move to legacy free app type +// (a) modify new App.Tpye..... *DONE* +// (b) create AppServlet from Dispatcher *DONE* +// +// +// TESTS: +// (a) Try to instantiate an instance of each type and check *MOSTLY +// the UI produced by the dispatcher / servlet DONE +// (b) Instantiate the portlets and try to reproduce the behaviour +// (probably reproduce the error showing up originally) +// +// +// /////////////////////////////////////////////////////////////////////////// + + + +/** + * CMS Document Manager (DocMgr) RepositoryLoader + * + * @author pboy <pb...@ba...> + * @version $Id: RepositoryLoader.java $ + **/ + +public class RepositoryLoader extends PackageLoader { + + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(RepositoryLoader.class); + + /** + * Run script invoked by com.arsdigita.packing loader script. + * + * @param ctx + */ + public void run(final ScriptContext ctx) { + + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + + loadRepositoryApplicationType(); //former setupDocs + loadRepositoryPortletType(null); //former setupDocManagerPortlet + + ApplicationType categoryBrowseDocsAppType = loadCategoryBrowserType(); + setupCategoryDocsPortlet(categoryBrowseDocsAppType); + + ApplicationType legacyCategoryBrowseDocsAppType = + loadLegacyCategoryBrowserType(); + setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType); + + // de-activate search for now + //SearchUtils.setSearcher + // (new com.arsdigita.cms.docmgr.search.IntermediaSearcher()); + + setupDefaultDocRepository(); //new here! + + } + }.run(); + + s_log.info("Done"); + } + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p o f a p p l i c a t i o n t y p e s + // + // //////////////////////////////////////////////////////////////////////// + + /** + * COPY & PASTE, has to be adopted !! + * Creates a document repository application type, the domain class of the + * document repository (docrepo) package, as a legacy-compatible type of + * application. + * + * Creates an entry in table application_types and a corresponding entry in + * apm_package_types + * + * TODO: migrate to a new style, legacy free application type. + */ + private ApplicationType loadRepositoryApplicationType() { + + /* Legacy free initialization + * NOTE: The wording in the title parameter of ApplicationType determines + * the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an hyphen + * and converted to lower case. + * Example: "DocRepo" will become "docrepo". + */ + ApplicationType type = new ApplicationType( + "CMSDocs", + Repository.BASE_DATA_OBJECT_TYPE ); + type.setDescription + ("The document repository empowers users to share documents."); + + return type; + } + + private ApplicationType loadCategoryBrowserType() { + + ApplicationType type = new ApplicationType( + "cmsdocs-categories", + DocumentCategoryBrowserApplication + .BASE_DATA_OBJECT_TYPE ); + type.setDescription("Browse documents by category."); + + return type; + + } + + /** + * + * @return + */ + private ApplicationType loadLegacyCategoryBrowserType() { + + ApplicationType type = new ApplicationType("cmsdocs-categories-legacy", + LegacyCategoryBrowserApplication + .BASE_DATA_OBJECT_TYPE ); + type.setDescription("Browse documents by legacy category (Taxonomie Browser)."); + + return type; + + } + + + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p a D O C M G R a p p l i c a t i o n + // + // //////////////////////////////////////////////////////////////////////// + private void setupDefaultDocRepository() { + + // try { + // SiteNode sn = SiteNode.getSiteNode("/administration", false); + // if (!"administration".equals(sn.getName())) { + Repository repo = Repository + .create( "cmsdocs-repo", + "Default DocumentMgr Repository", + null); + repo.save(); + // } + // } catch (DataObjectNotFoundException e) { + // Assert.fail(e.getMessage()); + // } + + } + + + // //////////////////////////////////////////////////////////////////////// + // + // S e t u p o f i n t e r n a l p o r t l e t s + // + // //////////////////////////////////////////////////////////////////////// + + + /** + * Creates a PortletType (persistent object) for the RecentUpdatedDocs + * Portlet. + * + * Instances (Portlets) are created by user interface or programmatically + * by configuration. + */ + //former setupDocManagerPortlet + private void loadRepositoryPortletType(ApplicationType provider) { + + // Create the document repository portlet +/* AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); + setup.setTitle("Recently Updated Documents"); + setup.setDescription( + "Displays the most recent documents in the document repository."); + setup.setProfile(PortletType.WIDE_PROFILE); + // setup.setProviderApplicationType(provider); + setup.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new RecentUpdatedDocsPortlet(dataObject); + } + }); + + setup.run(); +*/ + AppPortletType type = AppPortletType.createAppPortletType( + "Portal Bookmarks", + PortletType.NARROW_PROFILE, + RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); + // type.setProviderApplicationType(provider); + type.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE); + type.setDescription( + "Displays the most recent documents in the document repository."); + + + } + + private void setupCategoryDocsPortlet(ApplicationType provider) { + + // Create the document manager portlet + AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(CategoryDocsNavigatorPortlet + .BASE_DATA_OBJECT_TYPE); + setup.setTitle("Document Category Navigator"); + setup.setDescription("Browse documents by category."); + setup.setProfile(PortletType.WIDE_PROFILE); + setup.setProviderApplicationType(provider); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new CategoryDocsNavigatorPortlet(dataObject); + } + }); + + setup.run(); + + } + + private void setupLegacyCategoryDocsPortlet(ApplicationType provider) { + + // Create the document manager portlet + AppPortletSetup setup = new AppPortletSetup(s_log); + + setup.setPortletObjectType(LegacyCategoryDocsNavigatorPortlet + .BASE_DATA_OBJECT_TYPE); + setup.setTitle("Taxonomy Browser"); + setup.setDescription("Browse documents by category."); + setup.setProfile(PortletType.WIDE_PROFILE); + setup.setProviderApplicationType(provider); + setup.setInstantiator(new ACSObjectInstantiator() { + @Override + protected DomainObject doNewInstance(DataObject dataObject) { + return new LegacyCategoryDocsNavigatorPortlet(dataObject); + } + }); + + setup.run(); + + } + +} Added: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CategoryBrowserServlet.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CategoryBrowserServlet.java (rev 0) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/CategoryBrowserServlet.java 2012-05-01 08:00:40 UTC (rev 2299) @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2012 Peter boy (pb...@ba... + * + * 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.docmgr.ui; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.TabbedPane; + +import org.apache.log4j.Logger; + +/** + * Application servlet for ccm-docmgr's DocumentCategoryBrowser and + * LegacyCategoryBrowser application which serves all request made for + * the application's UI. + * + * CagtegoryBrowserServlet is called by BaseApplicationServlet which has + * determined that it is associated with a request URL. + * + * The servlet has to be included in servlet container's deployment descriptor, + * see teh domain classes' getServletPath() method for details + * about web.xml record. It is NOT directly referenced by any other class. + * + * It determines whether a <tt>Page</tt> has been registered to the URL and + * if so passes the request to that page. Otherwise it hands the request + * to the TemplateResolver to find an appropriate JSP file. + * + * @author <mailto href="Ste...@co...">Stefan Deusch</a> + * @author Peter Boy <pb...@ba...> + * @version $Id: RepositoryServlet.java 2161 2012-02-26 00:16:13Z pboy $ + */ +public class CategoryBrowserServlet extends RepositoryServlet + implements DMConstants { + + ... [truncated message content] |
From: <pb...@fe...> - 2012-05-01 07:59:27
|
Author: pboy Date: 2012-05-01 07:59:14 +0000 (Tue, 01 May 2012) New Revision: 2298 Added: trunk/ccm-weblog/src/org/undp/weblog/Loader.java trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java.nolongerInUse trunk/ccm-weblog/src/org/undp/weblog/WebLogServlet.java trunk/ccm-weblog/src/overview.html trunk/ccm-weblog/web/WEB-INF/ trunk/ccm-weblog/web/WEB-INF/web.ccm-weblog.xml trunk/ccm-weblog/web/themes/ trunk/ccm-weblog/web/themes/heirloom/ trunk/ccm-weblog/web/themes/heirloom/apps/ trunk/ccm-weblog/web/themes/heirloom/apps/weblog/ trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/ trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/index.xsl trunk/ccm-weblog/web/themes/heirloom/packages/ trunk/ccm-weblog/web/themes/heirloom/packages/weblog/ trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/ trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog-portlet.xsl trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog.xsl Removed: trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java trunk/ccm-weblog/web/__ccm__/ trunk/ccm-weblog/web/packages/ Modified: trunk/ccm-weblog/src/ccm-weblog.load trunk/ccm-weblog/src/org/undp/weblog/Initializer.java trunk/ccm-weblog/src/org/undp/weblog/WebLogApplication.java Log: WebLog refactored, now legacy free type of application. NO ugrade script provided because is was not officially distributed. Modified: trunk/ccm-weblog/src/ccm-weblog.load =================================================================== --- trunk/ccm-weblog/src/ccm-weblog.load 2012-05-01 07:57:05 UTC (rev 2297) +++ trunk/ccm-weblog/src/ccm-weblog.load 2012-05-01 07:59:14 UTC (rev 2298) @@ -9,5 +9,6 @@ </provides> <scripts> <schema directory="ccm-weblog"/> + <data class="org.undp.weblog.Loader"/> </scripts> </load> Modified: trunk/ccm-weblog/src/org/undp/weblog/Initializer.java =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/Initializer.java 2012-05-01 07:57:05 UTC (rev 2297) +++ trunk/ccm-weblog/src/org/undp/weblog/Initializer.java 2012-05-01 07:59:14 UTC (rev 2298) @@ -1,122 +1,90 @@ package org.undp.weblog; -import org.apache.log4j.Logger; -import org.undp.weblog.ui.WebLogPortlet; - import com.arsdigita.db.DbHelper; -import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObject; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.domain.DomainObjectInstantiator; -// import com.arsdigita.initializer.InitializationException; import com.arsdigita.kernel.ACSObjectInstantiator; -import com.arsdigita.kernel.PackageType; -// import com.arsdigita.kernel.Stylesheet; import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; -import com.arsdigita.portal.apportlet.AppPortletType; import com.arsdigita.runtime.CompoundInitializer; import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; -import com.arsdigita.web.ApplicationType; +import org.apache.log4j.Logger; +import org.undp.weblog.ui.WebLogPortlet; + + /** * @author Peter Kopunec */ public class Initializer extends CompoundInitializer { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger(Initializer.class); -//ublic Initializer() throws InitializationException { + /** + * + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); - add(new PDLInitializer(new ManifestSource("ccm-weblog.pdl.mf", - new NameFilter(DbHelper. - getDatabaseSuffix(database), "pdl")))); + add(new PDLInitializer( + new ManifestSource("ccm-weblog.pdl.mf", + new NameFilter(DbHelper. + getDatabaseSuffix(database), "pdl")))); } + /** + * + * @param e + */ @Override public void init(DomainInitEvent e) { s_log.info("WebLog Initializer starting."); + super.init(e); - boolean isMyTransaction = false; - TransactionContext txn = SessionManager.getSession(). - getTransactionContext(); - if (!txn.inTxn()) { - txn.beginTxn(); - isMyTransaction = true; - } - // register application - DomainObjectInstantiator instantiator = new ACSObjectInstantiator() { - +/* DomainObjectInstantiator instantiator = new ACSObjectInstantiator() { @Override protected DomainObject doNewInstance(DataObject dataObject) { return new WebLogApplication(dataObject); } }; DomainObjectFactory.registerInstantiator( - WebLogApplication.BASE_DATA_OBJECT_TYPE, instantiator); - checkSetup(); + WebLogApplication.BASE_DATA_OBJECT_TYPE, instantiator); */ + /* Register object instantiator for Bookmarks Application */ + e.getFactory().registerInstantiator( + WebLogApplication.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new WebLogApplication(dataObject); + } + }); + // Register the portlets - instantiator = new ACSObjectInstantiator() { - +/* instantiator = new ACSObjectInstantiator() { @Override protected DomainObject doNewInstance(DataObject dataObject) { return new WebLogPortlet(dataObject); } }; DomainObjectFactory.registerInstantiator( - WebLogPortlet.BASE_DATA_OBJECT_TYPE, instantiator); + WebLogPortlet.BASE_DATA_OBJECT_TYPE, instantiator); */ - if (isMyTransaction) { - txn.commitTxn(); - } + /* Register object instantiator for Bookmarks Portlet */ + e.getFactory().registerInstantiator( + WebLogPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new WebLogPortlet(dataObject); + } + }); s_log.debug("WebLog Initializer done."); } - private void checkSetup() { - try { - s_log.debug("WebLog Initializer - verifying setup."); - PackageType entityType = PackageType.findByKey("weblog"); - } catch (DataObjectNotFoundException e) { - setup(); - } - } - - private void setup() { - s_log.info("WebLog Initializer - setting up new package"); - - PackageType entityType = PackageType.create("weblog", "WebLog", - "WebLogs", - "http://www.undp.org/weblog"); - s_log.debug("Just added package type WebLog "); - - - entityType.setDispatcherClass(WebLogDispatcher.class.getName()); - - entityType.save(); - - final ApplicationType entityAppType = ApplicationType. - createApplicationType(entityType, "WebLog Application", - WebLogApplication.BASE_DATA_OBJECT_TYPE); - entityAppType.save(); - - // portlet - AppPortletType portletType = AppPortletType.createAppPortletType( - "WebLog Portlet", AppPortletType.WIDE_PROFILE, - WebLogPortlet.BASE_DATA_OBJECT_TYPE); - portletType.setProviderApplicationType(entityAppType); - portletType.setPortalApplication(true); - portletType.save(); - - } } Added: trunk/ccm-weblog/src/org/undp/weblog/Loader.java =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/Loader.java (rev 0) +++ trunk/ccm-weblog/src/org/undp/weblog/Loader.java 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,142 @@ +/* + * 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 org.undp.weblog; + +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; + +import com.arsdigita.portal.apportlet.AppPortletType; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationType; +import org.apache.log4j.Logger; +import org.undp.weblog.ui.WebLogPortlet; + +/** + * Executes nonrecurring at install time and loads (installs and initializes) + * the WebLog application and type persistently into database.</p> + * + * @author pboy <pb...@ba...> + * @version $Id: Loader.java $ + */ +public class Loader extends PackageLoader { + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(Loader.class); + + + /** + * Run script invoked by com.arsdigita.packing loader script. + * + * @param ctx + */ + public void run(final ScriptContext ctx) { + + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + + ApplicationType weblogType = loadWebLogApplicationType(); + loadWebLogPortletType(weblogType); + + // NOTE: Perhaps it is not usefull to create a default instance, + // because a site might have more than one blog and a more + // appropriate location has to be determined. + setupDefaultWebLogApplicationInstance(); + + } + }.run(); + + s_log.info("Done"); + + } + /** + * Creates a WebLog application type, the domain class of the weblog + * package, as a legacy-free type of application. + * + * Creates an entry in table application_types + * + */ + private ApplicationType loadWebLogApplicationType() { + s_log.info("WebLog Loader - setting up application type"); + + /* NOTE: The wording in the title parameter of ApplicationType determines + * the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and replacing + * blanks between words and illegal characters with an hyphen and converted + * to lower case. + * Example: "WebLog" will become "weblog". + */ + ApplicationType type = new ApplicationType("WebLog", + WebLogApplication.BASE_DATA_OBJECT_TYPE ); + type.setDescription("The WebLog application enables user ....."); + type.save(); + + return type; + } + + + /** + * + * @param webLogAppType + */ + private void loadWebLogPortletType(ApplicationType webLogAppType ) { + + AppPortletType type = AppPortletType.createAppPortletType( + "WebLog Portlet", + AppPortletType.WIDE_PROFILE, + WebLogPortlet.BASE_DATA_OBJECT_TYPE); + type.setDescription("Displays WebLogs for this portal."); + type.setProviderApplicationType(webLogAppType); + type.setPortalApplication(true); + + type.save(); + + } + + + /** + * Instantiates the WebLog application admin instance. + * + */ + public static void setupDefaultWebLogApplicationInstance() { + + /* Determine a parent application. WebLog default page will be + * installed beyond the admin's applications URL. It enshures + * the user has to be logged in. */ + /* NOTE: The location /admin/ might not be a good selection and a + * more appropriate one should be found. */ + Application parent = Application.retrieveApplicationForPath("/admin/"); + + // create application instance + // Whether a legacy compatible or a legacy free application is + // created depends on the type of ApplicationType above. No need to + // modify anything here in the migration process + // old-style package key used as url fragment where to install the instance + s_log.debug("Creating WebLogApplication instance ..."); + + WebLogApplication app = WebLogApplication.create("blog", + "Weblog", + parent); + app.setDescription("Default WebLog application instance."); + app.save(); + + s_log.debug("WebLog instance " + " created."); + } + +} Modified: trunk/ccm-weblog/src/org/undp/weblog/WebLogApplication.java =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/WebLogApplication.java 2012-05-01 07:57:05 UTC (rev 2297) +++ trunk/ccm-weblog/src/org/undp/weblog/WebLogApplication.java 2012-05-01 07:59:14 UTC (rev 2298) @@ -16,20 +16,36 @@ import com.arsdigita.web.Application; /** + * Application domain class for the WebLog application. + * * @author Peter Kopunec + * @version $Id: WebLogApplication.java $ */ public class WebLogApplication extends Application { + /** Logger instance for debugging */ + private static final Logger s_log = Logger + .getLogger(WebLogApplication.class); + + // pdl stuff (constants) public static final String BASE_DATA_OBJECT_TYPE = WebLogApplication.class .getName(); - private static final Logger s_log = Logger - .getLogger(WebLogApplication.class); - - public WebLogApplication(DataObject data) { - super(data); + /** + * Constructs a service domain object from the underlying data object. + * + * @param obj the DataObject + */ + public WebLogApplication(DataObject obj) { + super(obj); } + /** + * Constructor retrieving WebLogApplication from the database usings its OID. + * + * @param obj + * @throws DataObjectNotFoundException + */ public WebLogApplication(OID oid) throws DataObjectNotFoundException { super(oid); } @@ -38,6 +54,12 @@ this(new OID(BASE_DATA_OBJECT_TYPE, id)); } + /** + * Getter to retrieve the base database object type name + * + * @return base data aoject type as String + */ + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } @@ -60,6 +82,7 @@ /** * Overrides the superclass adding some permissions. */ + @Override protected void afterSave() { super.afterSave(); Party currentParty = Kernel.getContext().getParty(); @@ -73,4 +96,12 @@ } }.run(); } + + /** + * + */ + @Override + public String getServletPath() { + return "/weblog"; + } } Deleted: trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java 2012-05-01 07:57:05 UTC (rev 2297) +++ trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java 2012-05-01 07:59:14 UTC (rev 2298) @@ -1,26 +0,0 @@ -package org.undp.weblog; - -import java.util.HashMap; - -import org.undp.weblog.ui.WebLogPage; - -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.page.BebopMapDispatcher; - -/** - * @author Peter Kopunec - */ -public class WebLogDispatcher extends BebopMapDispatcher { - - public WebLogDispatcher() { - super(); - - HashMap m = new HashMap(); - - Page index = new WebLogPage(); - m.put("", index); - m.put("index.jsp", index); - - setMap(m); - } -} Added: trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java.nolongerInUse (rev 0) +++ trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java.nolongerInUse 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,26 @@ +package org.undp.weblog; + +import java.util.HashMap; + +import org.undp.weblog.ui.WebLogPage; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.page.BebopMapDispatcher; + +/** + * @author Peter Kopunec + */ +public class WebLogDispatcher extends BebopMapDispatcher { + + public WebLogDispatcher() { + super(); + + HashMap m = new HashMap(); + + Page index = new WebLogPage(); + m.put("", index); + m.put("index.jsp", index); + + setMap(m); + } +} Property changes on: trunk/ccm-weblog/src/org/undp/weblog/WebLogDispatcher.java.nolongerInUse ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-weblog/src/org/undp/weblog/WebLogServlet.java =================================================================== --- trunk/ccm-weblog/src/org/undp/weblog/WebLogServlet.java (rev 0) +++ trunk/ccm-weblog/src/org/undp/weblog/WebLogServlet.java 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2012 Peter Boy <pb...@ze...> 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 org.undp.weblog; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.page.BebopApplicationServlet; + +import javax.servlet.ServletException; + +import org.apache.log4j.Logger; +import org.undp.weblog.ui.WebLogPage; + + +/** + * WebLog Application Servlet class, central entry point to create and process + * the applications UI. + * + * We should have subclassed BebopApplicationServlet but couldn't overwrite + * doService() method to add permission checking. So we use our own page + * mapping. The general logic is the same as for BebopApplicationServlet. + * {@see com.arsdigita.bebop.page.BebopApplicationServlet} + * + * @author pb + */ +public class WebLogServlet extends BebopApplicationServlet { + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(WebLogServlet.class); + + /** + * User extension point used to create the pages to server and setup a + * URL - page mapping. + * + * @throws ServletException + */ + @Override + public void doInit() throws ServletException { + s_log.debug(" Initialize WebLogServlet ..."); + + Page indexPage = new WebLogPage(); + put("/",indexPage); + put("/index.jsp",indexPage); + + } + +} Added: trunk/ccm-weblog/src/overview.html =================================================================== --- trunk/ccm-weblog/src/overview.html (rev 0) +++ trunk/ccm-weblog/src/overview.html 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,90 @@ +<html> +<!-- + +README: This HTML page is the overview documentation comment for the +entire Core; javadoc copies everything inside the <body> into +the front page of the HTML documentation it produces. + +--> +<body> + <h1>Package WebLog</h1> + + <h2>1. Purpose</h2> + <p> + Weblog provides a Blogging facility. The package provides a portlet + (“WebLog Portlet”) to display and edit a blog. Each blogging entry + has the structure of an CCM article: Title, lead, and body. A reader + can create comments to each blogging entry. + </p> + + + <h2>2. Status</h2> + <p> + Under evaluation. + </p> + + <p> + Application is supported by the default internal theme, not by the + APLAWS standard theme. Currently only English is available for public + site and admin UI. + </p> + + + <h2>Recommendations </h2>¶ + <p> + The application requires a portal to display the blog. So the site must + at least use one portal page (e.g. the front page at root). + </p> + <p> + As an alternative the blog can be displayed on its own page, but can not + be integrated into the navigation menue (Navigation application). + </p> + + + <h2>Additional Application Details</h2> + <p> + By default the blogging page shows a list of all blog entries by title + and lead (abstract) and provides a “more” link the a details page which + contains the complete text and all comments. This page enables the reader + to add a comment. + </p> + <p> + Currently no information about permission management! + </p> + + + <h2>Usage</h2> + <p> + Before a blog can be used, an instance of WebLog must be created using + one of the administration facilities. By default one instance is created + at admin/blog, e.g. http://my.domain/ccm/admin/blog. + </p> + <p> + To display the blog on a portal page, an instance of WebLog portlet must + be installed on a portal page. It's installation UI provides (besides the + standard properties title and description) a drop-down list to select the + list provider, “/admin/blog” in case of the default installation in the + above example. + </p> + <p> + For each additional, separate blog it is necessary to install an additional + WebLog instance. This may be done using the UI at ~/portal/admin/sitemap.jsp + or the administration UI of portalserver's ~/ccm/administration portal page. + It is good practice to install the WebLog UI beyond admin of eventually + the default content section. + </p> + <p> + <b>Guess:</b> An instance may not installed as root application. + </p> + <p> + Additional instances of WebLog portlet have to be installed with (one of) + the additionally installed WebLog application instance(s) selected as + provider. + </p> + + <p> + Last modified: $Date: 2012/03/28 $ + </p> + +</body> +</html> Property changes on: trunk/ccm-weblog/src/overview.html ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-weblog/web/WEB-INF/web.ccm-weblog.xml =================================================================== --- trunk/ccm-weblog/web/WEB-INF/web.ccm-weblog.xml (rev 0) +++ trunk/ccm-weblog/web/WEB-INF/web.ccm-weblog.xml 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <!-- Servlets for the weblog application --> + <servlet> + <servlet-name>weblog</servlet-name> + <servlet-class>org.undp.weblog.WebLogServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>weblog</servlet-name> + <url-pattern>/weblog/*</url-pattern> + </servlet-mapping> + +</web-app> \ No newline at end of file Added: trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/index.xsl =================================================================== --- trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/index.xsl (rev 0) +++ trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/index.xsl 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../../../packages/weblog/xsl/weblog.xsl"/> + +</xsl:stylesheet> Property changes on: trunk/ccm-weblog/web/themes/heirloom/apps/weblog/xsl/index.xsl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog-portlet.xsl =================================================================== --- trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog-portlet.xsl (rev 0) +++ trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog-portlet.xsl 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:forum="http://www.arsdigita.com/forum/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:portlet="http://www.uk.arsdigita.com/portlet/1.0" + xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" + xmlns:ui="http://www.arsdigita.com/ui/1.0" + version="1.0"> + + <xsl:output method="html"/> + + <xsl:template match="bebop:portlet[@bebop:classname='org.undp.weblog.ui.WebLogPortlet' and //bebop:page/@id='viewWorkspace']"> + <table width="100%" border="0" cellspacing="2" cellpadding="0"> + <tr> + <td bgcolor="#cccccc"> + <table width="100%" cellspacing="2" cellpadding="4" border="0"> + <tr> + <th class="split_pane_header" width="100%"> + <xsl:value-of select="@title"/> + </th> + </tr> + <tr> + <td class="table_cell" bgcolor="#ffffff" colspan="20"> + <xsl:apply-templates select="*"/> + </td> + </tr> + <tr> + <td class="table_cell" bgcolor="#eeeeee" colspan="20"> + <xsl:for-each select="@applicationlink"> + <a> + <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute> + view all weblogs + </a> + <br /> + </xsl:for-each> + </td> + </tr> + </table> + </td> + </tr> + </table> + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog-portlet.xsl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog.xsl =================================================================== --- trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog.xsl (rev 0) +++ trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog.xsl 2012-05-01 07:59:14 UTC (rev 2298) @@ -0,0 +1,114 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:weblog="http://www.undp.org/weblog/1.0" + xmlns:unport="http://www.undp.org/unport/1.0" + version="1.0" +> + +<xsl:import href="../../bebop/xsl/bebop.xsl"/> + + +<!-- IMPORT MAIN UNPORT STYLING TEMPLATE --> +<!-- +<xsl:import href="../../unport/xsl/unport.xsl"/> +--> +<!-- IMPORT UNDP WEBLOG APP --> +<!-- +<xsl:import href="../../unport/xsl/apps/weblog/weblog.xsl"/> +--> + + +<xsl:output method="html" indent="yes"/> + +<!--<xsl:variable name="css-dir">/packages/portalserver/www/css</xsl:variable>--> + + + + + + + + + + +<!--<xsl:template match="bebop:page[@class='weblog']"> + <html> + <head> + <title><xsl:value-of select="bebop:title"/></title> + <link href="{$css-dir}/portalserver.css" rel="stylesheet" type="text/css"/> + + <xsl:for-each select="bebop:stylesheet"> + <link href="{@href}" rel="stylesheet" type="{@type}"/> + </xsl:for-each> + + </head> + <body> + <xsl:apply-templates select="weblog:header"/> + + <xsl:apply-templates select="weblog:body"/> + + <xsl:apply-templates select="weblog:footer"/> + + <xsl:apply-templates select="*[position()>3]"/> + </body> + </html> +</xsl:template>--> + + + + + + + + +<xsl:template match="weblog:header"> + <!-- + <xsl:call-template name="unport:topHeaderApp"/> --> + + <table class="setInside"><tr><td class="setInside"> + + <table class="localHeader"> + <tr> + <td class="localTitle"> + <xsl:value-of select="../bebop:title"/> + </td> + </tr> + </table> + + </td></tr></table> +</xsl:template> + + + + + + + + + + +<xsl:template match="weblog:body"> + <table class="setInside"><tr><td class="setInside"> + <xsl:apply-templates/> + </td></tr></table> +</xsl:template> + + + + + + + +<xsl:template match="weblog:footer"> +</xsl:template> + + + + + + + + + +</xsl:stylesheet> Property changes on: trunk/ccm-weblog/web/themes/heirloom/packages/weblog/xsl/weblog.xsl ___________________________________________________________________ Added: svn:executable + |
Author: pboy Date: 2012-05-01 07:57:05 +0000 (Tue, 01 May 2012) New Revision: 2297 Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-simplesurvey/src/ccm-simplesurvey.upgrade trunk/ccm-simplesurvey/web/themes/ trunk/ccm-simplesurvey/web/themes/heirloom/ trunk/ccm-simplesurvey/web/themes/heirloom/apps/ trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/ trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/ trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/index.xsl trunk/ccm-simplesurvey/web/themes/heirloom/packages/ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/simplesurvey.css trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/simplesurvey.xsl trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/survey-response-data.xsl trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/view.xsl Removed: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql trunk/ccm-simplesurvey/web/__ccm__/ trunk/ccm-simplesurvey/web/packages/ Modified: trunk/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Initializer.java trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Loader.java Log: SimpleSurvey refactored, now segacy free type of application. UPGRADE script provided. Modified: trunk/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl =================================================================== --- trunk/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl 2012-04-22 16:23:50 UTC (rev 2296) +++ trunk/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl 2012-05-01 07:57:05 UTC (rev 2297) @@ -22,5 +22,6 @@ import com.arsdigita.web.Application; object type SimpleSurvey extends Application { - reference key (ss_simplesurvey.application_id); + // nothing to persist + // reference key (ss_simplesurvey.application_id); } Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql (rev 0) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,23 @@ +-- +-- 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 +-- +-- $Id: drop_app_table.sql pboy $ + +-- drops table ss_simplesurvey which just contained application type id and is +-- never used for any action. + +drop table ss_simplesurvey ; Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql (rev 0) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,131 @@ +-- +-- 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 +-- +-- $Id: remove_simplesurvey_legacy_entries.sql $ + +-- ccm-simplesurvey is now initialized as a legacy free type +-- of application so entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') + ) + ); + +-- delete all entries in site_nodes referring to a simplesurvey instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') + ); + +-- delete all entries for simplesurvey instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') ; + + +-- set package_id to null for all entries referring to a simplesurvey instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like '%simplesurvey.SimpleSurvey%') ; + +-- set package_id to null for all entries referring to a simplesurvey instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like '%simplesurvey.SimpleSurvey%' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql (rev 0) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,35 @@ +-- +-- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: oracle-se-upgrade-5.2.0-5.2.1.sql 287 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:26:27 $ + +alter table ss_surveys add (responses_public_p integer default(1) not null, + quiz_type varchar(50) default 'knowledge_test' not null check (quiz_type in ('knowledge_test','personal_assessment'))); + +-- Create a new table to hold the answers to questions + +create table ss_correct_answers ( + label_id integer not null references bebop_components, + widget_id integer not null references bebop_components, + value varchar(4000) +); + + +-- Add the column score to the responses +alter table ss_responses add (score integer default '0' not null); + Property changes on: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql (rev 0) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,27 @@ +-- +-- 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 +-- +-- $DateTime: 2012/03/27 23:15:09 $ +-- $Id: oracle-se-6.6.0-6.6.1 pboy $ + +PROMPT Red Hat Enterprise SimpleSurvey 6.6.0 -> 6.6.1 Upgrade Script (Oracle) + +-- drop table ss_simplesurvey - not needed anyway +@@ default/6.6.0-6.6.1/drop_app_table.sql + +-- remove legacy compatible bits +@@ default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql Deleted: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql 2012-04-22 16:23:50 UTC (rev 2296) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -1,35 +0,0 @@ --- --- Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public License --- as published by the Free Software Foundation; either version 2.1 of --- the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public --- License along with this library; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --- --- $Id$ --- $DateTime: 2004/08/17 23:26:27 $ - -alter table ss_surveys add (responses_public_p integer default(1) not null, - quiz_type varchar(50) default 'knowledge_test' not null check (quiz_type in ('knowledge_test','personal_assessment'))); - --- Create a new table to hold the answers to questions - -create table ss_correct_answers ( - label_id integer not null references bebop_components, - widget_id integer not null references bebop_components, - value varchar(4000) -); - - --- Add the column score to the responses -alter table ss_responses add (score integer default '0' not null); - Added: trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql (rev 0) +++ trunk/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,30 @@ +-- +-- 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 +-- +-- $DateTime: 2010/11/10 23:15:09 $ + +\echo Red Hat Enterprise SimpleSurvey 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL) + +begin; + +-- drop table subsite_app - not needed anyway +\i default/6.6.0-6.6.1/drop_app_table.sql + +-- remove legacy compatible bits +\i default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql + +commit; Added: trunk/ccm-simplesurvey/src/ccm-simplesurvey.upgrade =================================================================== --- trunk/ccm-simplesurvey/src/ccm-simplesurvey.upgrade (rev 0) +++ trunk/ccm-simplesurvey/src/ccm-simplesurvey.upgrade 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,5 @@ +<upgrade> + <version from="6.6.0" to="6.6.1"> + <script sql="ccm-simplesurvey/upgrade/::database::-6.6.0-6.6.1.sql"/> + </version> +</upgrade> Property changes on: trunk/ccm-simplesurvey/src/ccm-simplesurvey.upgrade ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Initializer.java =================================================================== --- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Initializer.java 2012-04-22 16:23:50 UTC (rev 2296) +++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Initializer.java 2012-05-01 07:57:05 UTC (rev 2297) @@ -19,13 +19,18 @@ package com.arsdigita.simplesurvey; import com.arsdigita.db.DbHelper; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.kernel.ACSObjectInstantiator; +import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; import com.arsdigita.runtime.CompoundInitializer; -// import com.arsdigita.runtime.LegacyInitializer; +import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; +import org.apache.log4j.Logger; + /** * Initializes ccm-simplesurvey at each system startup. * @@ -34,6 +39,9 @@ */ public class Initializer extends CompoundInitializer { + /** Creates a s_logging category with name = to the full name of class */ + private static Logger s_log = Logger.getLogger(Initializer.class); + /** * Constructor. Delegates to the old initializer system. */ @@ -46,6 +54,26 @@ ("ccm-simplesurvey.pdl.mf", new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); -// add(new LegacyInitializer("com/arsdigita/simplesurvey/enterprise.init")); } + + /** + * Initializes domain-coupling machinery, usually consisting of + * registering object instantiators and observers. + */ + @Override + public void init(DomainInitEvent e) { + s_log.debug("SimpleSurvey Initializer.init(DomainInitEvent) invoked"); + super.init(e); + + /* Register object instantiator for Workspace (Content Center) */ + e.getFactory().registerInstantiator + (SimpleSurvey.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dobj) { + return new SimpleSurvey(dobj); + } + } ); + + } } Modified: trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Loader.java =================================================================== --- trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Loader.java 2012-04-22 16:23:50 UTC (rev 2296) +++ trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Loader.java 2012-05-01 07:57:05 UTC (rev 2297) @@ -54,7 +54,9 @@ new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); + setupSimpleSurveyPackage(); + } }.run(); } @@ -97,35 +99,31 @@ "com.arsdigita.simplesurvey.ui.widgets.RadioEditor" ) ); - - ApplicationSetup setup = new ApplicationSetup(s_log); - - setup.setApplicationObjectType(SimpleSurvey.BASE_DATA_OBJECT_TYPE); - setup.setKey("simplesurvey"); - setup.setTitle("Simple Survey"); - // setup.setDescription("Simple Survey"); - setup.setDescription("A simple survey application."); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new SimpleSurvey(dataObject); - } - }); - ApplicationType type = setup.run(); + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Content Center" will become "content-center". */ + ApplicationType type = new + ApplicationType("Simple Survey", + SimpleSurvey.BASE_DATA_OBJECT_TYPE ); + type.setDescription("An application to conduct a simple survey."); type.save(); if (!Application.isInstalled(SimpleSurvey.BASE_DATA_OBJECT_TYPE, "/simplesurvey/")) { - Application app = - Application.createApplication(type, - "simplesurvey", - "Simplesurvey", - null); + Application app = Application.createApplication(type, + "simplesurvey", + "Simplesurvey", + null); + app.setDescription("The default Survey application instance."); app.save(); } // Load the widgets types (i.e. description and class names to be - // instantiated ad runtime) used in survey forms into database. + // instantiated at runtime) used in survey forms into database. FormbuilderSetup fbs = new FormbuilderSetup(); fbs.setup(widgetTypes, null, null); Added: trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/index.xsl =================================================================== --- trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/index.xsl (rev 0) +++ trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/index.xsl 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../../packages/simple-survey/xsl/simplesurvey.xsl"/> + +</xsl:stylesheet> Property changes on: trunk/ccm-simplesurvey/web/themes/heirloom/apps/simple-survey/xsl/index.xsl ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/simplesurvey.css =================================================================== --- trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/simplesurvey.css (rev 0) +++ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/simplesurvey.css 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,4 @@ +.strong { + color: red; + font-weight: bold; +} Property changes on: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/css/simplesurvey.css ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/simplesurvey.xsl =================================================================== --- trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/simplesurvey.xsl (rev 0) +++ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/simplesurvey.xsl 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:simplesurvey="http://www.arsdigita.com/simplesurvey/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + version="1.0"> + + <!-- IMPORT DEFINITIONS ccm-simplesurvey installed as separate web application + <xsl:import href="../../../../ROOT/packages/content-section/xsl/cms.xsl"/> + --> + + <!-- IMPORT DEFINITIONS ccm-simplesurvey installed into the main CCM webapp + --> + <xsl:import href="../../packages/cms/xsl/cms.xsl"/> + + <xsl:import href="view.xsl"/> <!-- Stylesheet for the page for submitting a survey --> + <xsl:import href="survey-response-data.xsl"/> <!-- Stylesheet for the CSV file page --> + + <xsl:template match="bebop:label[@class='strong']"> + <span class="strong"><xsl:value-of select="text()"/></span> + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/simplesurvey.xsl ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/survey-response-data.xsl =================================================================== --- trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/survey-response-data.xsl (rev 0) +++ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/survey-response-data.xsl 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,18 @@ +<?xml version="1.0"?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:simplesurvey="http://www.arsdigita.com/simplesurvey/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + + <xsl:template match="bebop:page[@id='csvPage']"> + <xsl:apply-templates select="//*[@id='csvFile']"/> + </xsl:template> + + <xsl:template match="bebop:label[@id='csvFile']"> + <xsl:value-of select="text()"/> + </xsl:template> + +</xsl:stylesheet> + + + Property changes on: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/survey-response-data.xsl ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/view.xsl =================================================================== --- trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/view.xsl (rev 0) +++ trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/view.xsl 2012-05-01 07:57:05 UTC (rev 2297) @@ -0,0 +1,14 @@ +<?xml version="1.0"?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:simplesurvey="http://www.arsdigita.com/simplesurvey/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + + <xsl:template match="bebop:label[@id='surveyNotLive']"> + This survey is currently not active. + </xsl:template> + + <xsl:template match="bebop:label[@id='surveyAlreadySubmitted']"> + You have already submitted a response to this survey and only one response is permitted. + </xsl:template> +</xsl:stylesheet> Property changes on: trunk/ccm-simplesurvey/web/themes/heirloom/packages/simple-survey/xsl/view.xsl ___________________________________________________________________ Added: svn:executable + * |
Author: pboy Date: 2012-04-22 16:23:50 +0000 (Sun, 22 Apr 2012) New Revision: 2296 Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.6-6.6.7.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.6-6.6.7.sql trunk/ccm-ldn-aplaws/bundles/devel/res/ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/placeholder.info trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-domain-1.00.xml trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-hierarchy-1.00.xml trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-domain.xml trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-hierarchy.xml trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-mapping-lgcl-anav.xml trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-mapping-lgcl-anav.xsl trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/navigation/ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/navigation/sci-templates.txt trunk/ccm-ldn-aplaws/bundles/devel/res/placeholder.info trunk/ccm-ldn-aplaws/bundles/devel/templates/ trunk/ccm-ldn-aplaws/bundles/devel/templates/ccm-navigation/ trunk/ccm-ldn-aplaws/bundles/devel/templates/ccm-navigation/navigation/ trunk/ccm-ldn-aplaws/bundles/devel/templates/placeholder.info trunk/ccm-ldn-aplaws/bundles/devel/themes/ trunk/ccm-ldn-aplaws/bundles/devel/themes/master/ trunk/ccm-ldn-aplaws/bundles/devel/themes/master/dummy trunk/ccm-ldn-aplaws/bundles/devel/themes/placeholder.info trunk/ccm-ldn-aplaws/web/templates/ccm-cms/ trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/ trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/admin/ trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/admin/auto-cat.jsp trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/admin/load-cat.jsp trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/crash-me.jsp trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/ trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-folder.jsp trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/default/aplaws-item.jsp trunk/ccm-ldn-aplaws/web/templates/ccm-cms/content-section/textonly.jsp trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/contenttypes/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/contenttypes/ESDService.pdl trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/london/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/london/contenttypes/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/london/contenttypes/ESDService.xml trunk/ccm-ldn-types-esdservice/src/ccm-ldn-types-esdservice.config trunk/ccm-ldn-types-esdservice/src/ccm-ldn-types-esdservice.load trunk/ccm-ldn-userpreferences/sql/ccm-ldn-userpreferences/ trunk/ccm-ldn-userpreferences/sql/ccm-ldn-userpreferences/oracle-se-create.sql trunk/ccm-ldn-userpreferences/sql/ccm-ldn-userpreferences/postgres-create.sql trunk/ccm-ldn-userpreferences/src/ccm-ldn-userpreferences.config trunk/ccm-ldn-userpreferences/src/ccm-ldn-userpreferences.load Removed: trunk/ccm-ldn-aplaws/web/packages/ trunk/ccm-ldn-types-esdservice/pdl/com/arsdigita/london/content-types/ trunk/ccm-ldn-types-esdservice/src/WEB-INF/traversal-adapters/com/arsdigita/cms/ trunk/ccm-ldn-types-esdservice/src/ccm-cms-types-esdservice.config trunk/ccm-ldn-types-esdservice/src/ccm-cms-types-esdservice.load trunk/ccm-ldn-userpreferences/sql/ccm-user-preferences/ trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.config trunk/ccm-ldn-userpreferences/src/ccm-user-preferences.load Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java trunk/ccm-cms/src/ccm-cms.upgrade trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java trunk/ccm-ldn-aplaws/application.xml trunk/ccm-ldn-aplaws/bundles/devel/ChangeLog trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml trunk/ccm-ldn-aplaws/src/ccm-ldn-aplaws.load trunk/ccm-ldn-aplaws/web/WEB-INF/web.xml-aplaws trunk/ccm-ldn-dublin/application.xml trunk/ccm-ldn-types-esdservice/application.xml trunk/ccm-ldn-types-esdservice/src/WEB-INF/content-types/com/arsdigita/london/contenttypes/ESDService.xml trunk/ccm-ldn-types-esdservice/src/com/arsdigita/london/contenttypes/ESDServiceInitializer.java trunk/ccm-ldn-userpreferences/application.xml trunk/ccm-ldn-userpreferences/src/com/arsdigita/london/userprefs/Initializer.java trunk/ccm-navigation/sql/ccm-navigation/upgrade/postgres-6.6.1-6.6.2.sql trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java Log: Adapted ccm-ldn-aplaws, various minor fixes. Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java =================================================================== --- trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2012-04-22 16:23:50 UTC (rev 2296) @@ -118,7 +118,7 @@ */ private void setupAdministrator() { - s_log.warn("Administrator eMail is retrieved as: " + getAdminEmail()); + s_log.info("Administrator eMail is retrieved as: " + getAdminEmail()); DataCollection coll = SessionManager.getSession() .retrieve(User.BASE_DATA_OBJECT_TYPE); @@ -133,7 +133,7 @@ User admin = User.retrieve( coll.getDataObject() ); coll.close(); - s_log.warn("Administrator is retrieved as: " + admin); + s_log.info("Administrator is retrieved as: " + admin); UserLogin login = UserLogin.findByUser(admin); if (login == null) { Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,131 @@ +-- +-- 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 +-- +-- $Id: remove_service_legacy_entries.sql $ + +-- ccm-cms Service is now initialized as a legacy free type +-- of application so entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Service%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Service%') + ) + ); + +-- delete all entries in site_nodes referring to a Service instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Service%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Service%') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Service%') + ); + +-- delete all entries for Service instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Service%') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Service%') ; + + +-- set package_id to null for all entries referring to a Service instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Service%') ; + +-- set package_id to null for all entries referring to a Service instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like '%cms.Service%' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,131 @@ +-- +-- 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 +-- +-- $Id: remove_workspace_legacy_entries.sql $ + +-- ccm-cms Workspace (content-center) is now initialized as a legacy free type +-- of application so entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Workspace%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Workspace%') + ) + ); + +-- delete all entries in site_nodes referring to a Workspace instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Workspace%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Workspace%') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Workspace%') + ); + +-- delete all entries for Workspace instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Workspace%') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like '%cms.Workspace%') ; + + +-- set package_id to null for all entries referring to a Workspace instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like '%cms.Workspace%') ; + +-- set package_id to null for all entries referring to a Workspace instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like '%cms.Workspace%' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.6-6.6.7.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.6-6.6.7.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.6-6.6.7.sql 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,25 @@ +-- +-- 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 +-- +-- $Id: oracle-se-6.6.6-6.6.7.sql 2012-03-26 15:10:39Z pboy $ + +-- Update: content-center (Workspace) & CMS Service now loaded as +-- legacy free application +PROMPT Red Hat Enterprise CMS 6.6.6 -> 6.6.7 Upgrade Script (Oracle) + +@@ ../default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql +@@ ../default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql Added: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.6-6.6.7.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.6-6.6.7.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.6-6.6.7.sql 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,30 @@ +-- +-- 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 +-- +-- $DateTime: 2011/09/06 23:15:09 $ +-- $Id: postgres-6.6.6-6.6.7.sql 2012-03-26 15:10:39Z pboy $ + +-- Update: content-center (Workspace) & CMS Service now loaded as +-- legacy free application +\echo Red Hat Enterprise CMS 6.6.6 -> 6.6.7 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql +\i ../default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql + +commit; Modified: trunk/ccm-cms/src/ccm-cms.upgrade =================================================================== --- trunk/ccm-cms/src/ccm-cms.upgrade 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-cms/src/ccm-cms.upgrade 2012-04-22 16:23:50 UTC (rev 2296) @@ -40,6 +40,7 @@ <script class="com.arsdigita.cms.upgrade.CreateGenericContentTypes"/> </version> <version from="6.6.1" to="6.6.2"> + <!-- CMS Workspace & Service now new style legacy compatible apps --> <script class="com.arsdigita.cms.upgrade.AddNewStyleApplicationEntries"/> <script sql="ccm-cms/upgrade/::database::-6.6.1-6.6.2.sql"/> </version> @@ -58,4 +59,8 @@ <!-- ContentSection now loaded as legacy free application --> <script sql="ccm-cms/upgrade/::database::-6.6.5-6.6.6.sql"/> </version> + <version from="6.6.6" to="6.6.7"> + <!-- CMS Workspace&Service now loaded as legacy free application --> + <script sql="ccm-cms/upgrade/::database::-6.6.6-6.6.7.sql"/> + </version> </upgrade> Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-04-22 16:23:50 UTC (rev 2296) @@ -46,18 +46,6 @@ import org.apache.log4j.Logger; -// Migration status -// -// The module in its complete version (i.e. all method invocations in run() -// method commented IN(!) does load all packages into database and -// ccm/admin/sitemap lists them appropriately. -// -// Next Try -// Refactor using legacy compatible web/Application and ApplicationSetup *DONE* -// Refactor content-section als legacy free application *DONE* -// Refactor workspace (content-center) as a legacy free application *DONE* -// Refactor cms-service as a legacy free application *DONE* - /** * <p>Executes nonrecurring at install time and loads (installs and initializes) * the Content Management System module,including the Content Center, CMS Service @@ -184,13 +172,6 @@ public static ApplicationType loadWorkspaceApplicationType() { s_log.debug("Creating CMS Workspace..."); - /* Create new type legacy compatible application type */ - // ApplicationType type = ApplicationType - // .createApplicationType(Workspace.PACKAGE_KEY, - // Workspace.INSTANCE_NAME, - // Workspace.BASE_DATA_OBJECT_TYPE); - // type.setDispatcherClass(Workspace.DISPATCHER_CLASS); - /* Create new type legacy free application type * NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. @@ -249,40 +230,6 @@ public static ApplicationType loadServiceApplicationType() { s_log.debug("Loading CMS Servce Package..."); - -// Creating Service package using new style c.ad.web.Application -// in legacy compatible mode. Needs refactoring of the Service package. -// In a first step these instructions replace c.ad.installer.ServiceInstaller - - // create application type -// ApplicationSetup appsetup = new ApplicationSetup(s_log); -// // new style properties -// appsetup.setApplicationObjectType(Service.BASE_DATA_OBJECT_TYPE); -// appsetup.setTitle(Service.INSTANCE_NAME); // same as for instance - // there is only one -// appsetup.setDescription("Services to store global resources and assets."); - // old style / legacy compatible properties -// appsetup.setKey(Service.PRIMARY_URL_STUB); -// appsetup.setDispatcherClass(Service.DISPATCHER_CLASS); -// appsetup.setSingleton(true); -// appsetup.setPortalApplication(false); -// appsetup.setInstantiator(new ACSObjectInstantiator() { -// @Override -// protected DomainObject doNewInstance(DataObject dataObject) { -// return new Service(dataObject); -// } -// }); - -// ApplicationType serviceType = appsetup.run(); -// serviceType.save(); -// ////////////// Current style to create app type /////////////// - /* Create new type legacy compatible application type */ - // ApplicationType type = ApplicationType - // .createApplicationType(Service.PRIMARY_URL_STUB, - // Service.INSTANCE_NAME, - // Service.BASE_DATA_OBJECT_TYPE); - // type.setDispatcherClass(Service.DISPATCHER_CLASS); - /* Create new type legacy free application type * NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. @@ -292,7 +239,6 @@ * "CMS Service" will become "cms-service". */ ApplicationType type = new ApplicationType("CMS Service", Service.BASE_DATA_OBJECT_TYPE ); - type.setDescription("Services to store global resources and assets."); type.save(); @@ -340,13 +286,6 @@ // Step 1: Create content section application type // prerequisite for concrete content-section instance creation. - - /* Create new type legacy compatible application type */ -// ApplicationType type = ApplicationType -// .createApplicationType(ContentSection.PACKAGE_TYPE, -// "CMS Content Section", -// ContentSection.BASE_DATA_OBJECT_TYPE); - /* Create legacy-free application type * NOTE: The wording in the title parameter of ApplicationType * determines the name of the subdirectory for the XSL stylesheets. Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java 2012-04-22 16:23:50 UTC (rev 2296) @@ -136,7 +136,7 @@ * Called on startup. */ public void startup() { - s_log.warn("Document Manager is initializing."); + s_log.info("Document Manager is initializing."); // setupDomainFactory(); Modified: trunk/ccm-ldn-aplaws/application.xml =================================================================== --- trunk/ccm-ldn-aplaws/application.xml 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-ldn-aplaws/application.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -3,18 +3,19 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-aplaws" prettyName="APLAWS" - version="6.6.0" + version="6.6.1" release="1" webapp="ROOT"> + <ccm:dependencies> <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-portalworkspace" version="6.6.1" relation="ge"/> + <ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-rssfeed" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-dublin" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-navigation" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-search" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-subsite" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-rss" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/> </ccm:dependencies> Modified: trunk/ccm-ldn-aplaws/bundles/devel/ChangeLog =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/ChangeLog 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-ldn-aplaws/bundles/devel/ChangeLog 2012-04-22 16:23:50 UTC (rev 2296) @@ -1,3 +1,6 @@ +* Mo March 26 29012 Peter Boy <pb...@ba...> +- Modified to new deployment structure ov version 2.0.0 + * Thu Sep 22 2005 Alan Pevec <ap...@re...> - Build all APLAWS+ bundles from the common set of templates. Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties 2012-04-22 16:23:50 UTC (rev 2296) @@ -4,11 +4,11 @@ # ; 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 -waf.categorization.supported_languages=de,en waf.dispatcher.default_expiry=3600 ; @@ -17,22 +17,18 @@ ; if you activate screen_name, forum loader doesn't 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 -# MOVED to ui.Config -#waf.pagemap.root=portal/ -#waf.pagemap.workspace=portal/ -#waf.pagemap.login_redirect=content/content-center-redirect.jsp - ; Searches for localized style sheet (among others) waf.templating.stylesheet_resolver=com.arsdigita.templating.PatternStylesheetResolver waf.templating.stylesheet_paths=/WEB-INF/resources/aplaws-stylesheet-paths.txt core.ui.pagemap.root_page_url=portal/ core.ui.pagemap.workspace_url=portal/ -core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp +core.ui.pagemap.user_redirect_url=content-center/redirect.jsp ; workflow configuration waf.workflow.simple.alerts_enabled=true @@ -51,24 +47,17 @@ 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 -;com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js -; as a temporary measure a different configuration file which includes a link selection box for CCM items -; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js +; 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 ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= -; com.arsdigita.cms.dhtml_editor_plugins= - -; to use deprecated HTMLarea (NOT recommended!): -; currently configuration is hardcoded, so the fest alternative works -; com.arsdigita.cms.dhtml_editor_config=HTMLArea -; com.arsdigita.cms.dhtml_editor_config=HTMLArea,/assets/htmlarea/config/Styled.js ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS +com.arsdigita.cms.allow_content_create_in_section_listing=false com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.hide_admin_tabs=true @@ -99,17 +88,6 @@ com.arsdigita.cms.contenttypes.newsitem.end_year_delta=5 -# ?? Where are these used? -com.arsdigita.cms.contenttypes.mparticle.template=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-mparticle-item.jsp - -com.arsdigita.cms.contenttypes.siteproxy.defaulttemplate=/WEB-INF/content-types/com/arsdigita/cms/contenttypes/aplaws-siteproxy-item.jsp - - -# auth-http application -auth.http.admin_email=web...@ap... -auth.http.admin_identifier=webmaster - - # Forum application com.arsdigita.forum.show_new_tabs=true com.arsdigita.forum.use_wysiwyg_editor=true @@ -127,7 +105,7 @@ 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/nav-default.jsp # ccm-ldn-search application @@ -136,17 +114,27 @@ com.arsdigita.london.search.num_threads=0 -# 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 +# ccm-auth-http application +auth.http.admin_email=web...@ap... +auth.http.admin_identifier=webmaster + com.arsdigita.london.cms.dublin.audience_domain=LGAL -; ============================================================================================= -; runtime specific configurations +# 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 waf.admin.email=web...@ap... waf.admin.name.given=Aplaws @@ -155,7 +143,7 @@ waf.admin.password.question=12345 waf.admin.password.answer=6 -waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm?user\=ccm&password\=ccm +waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm?user\=ccm&password\=ccm42web waf.runtime.jdbc_pool_size=60 waf.web.server=localhost\:8080 @@ -163,6 +151,7 @@ # ============================================================================================= # devel specific configurations -#com.arsdigita.aplaws.lite_load=true -#waf.debug=true -#waf.bebop.fancy_xsl_errors=true +com.arsdigita.aplaws.lite_load=true +waf.debug=true +waf.bebop.fancy_xsl_errors=true + Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/project.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -10,9 +10,9 @@ ccmVersion="6.1" name="aplaws" prettyName="APLAWS plus (devel)" - version="1-1-5" + version="2-0-0" release="devel" - webxml="web.xml-aplaws" + webxml="web.xml" webapp="ROOT" xsi:schemaLocation="http://ccm.redhat.com/ccm-project file:tools-ng/common/xsd/project.xsd"> @@ -24,89 +24,147 @@ <ccm:build> - <ccm:application name="ccm-auth-http"/> - <ccm:application name="ccm-bookmarks"/> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- APLAWS+ set of CORE packages --> +<!-- NONE can be omitted for technical reasons / internal dependencies --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Main apps --> + <ccm:application name="ccm-core"/> <ccm:application name="ccm-cms"/> + +<!-- Content Assets --> + +<!-- Content Types --> + <ccm:application name="ccm-cms-types-article"/> + <!-- Currently siteproxy is a prerequisite for ccm-ldn-atoz --> + <ccm:application name="ccm-cms-types-siteproxy"/> + +<!-- Applications --> + <ccm:application name="ccm-navigation"/> + <!-- ccm-portalworkspace depends on ccm-subsite --> + <ccm:application name="ccm-portalworkspace"/> + <ccm:application name="ccm-portalworkspace-homepage"/> + <ccm:application name="ccm-rssfeed"/> + <ccm:application name="ccm-shortcuts"/> + <ccm:application name="ccm-subsite"/> + <ccm:application name="ccm-themedirector"/> + +<!-- LDN core extensions --> + <ccm:application name="ccm-ldn-aplaws"/> + <ccm:application name="ccm-ldn-atoz"/> + <ccm:application name="ccm-ldn-dublin"/> + <ccm:application name="ccm-ldn-search"/> + <ccm:application name="ccm-ldn-terms"/> + <ccm:application name="ccm-ldn-util"/> + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- APLAWS+ OPTIONAL packages --> +<!-- Various combinations of these packages make up specific bundles --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Standard Bundle --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Standard Bundle's Content Assets --> + <ccm:application name="ccm-cms-assets-relatedlink"/> <ccm:application name="ccm-cms-assets-fileattachment"/> + +<!-- Standard Bundle's Content Types --> + <ccm:application name="ccm-cms-types-filestorageitem"/> + <ccm:application name="ccm-cms-types-formitem"/> + <ccm:application name="ccm-cms-types-formsectionitem"/> + <ccm:application name="ccm-cms-types-inlinesite"/> + <ccm:application name="ccm-cms-types-mparticle"/> + <ccm:application name="ccm-cms-types-newsitem"/> + <ccm:application name="ccm-cms-types-pressrelease"/> + <ccm:application name="ccm-cms-types-xmlfeed"/> + +<!-- Standard Bundle's Applications --> + <ccm:application name="ccm-forum"/> + +<!-- Standard Bundle's LDN extensions --> + <ccm:application name="ccm-ldn-importer"/> + <ccm:application name="ccm-ldn-types-contact"/> + <ccm:application name="ccm-ldn-types-esdservice"/> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- Extended Bundle --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- Extended Bundle's Content Assets --> <ccm:application name="ccm-cms-assets-imagestep"/> - <ccm:application name="ccm-cms-assets-notes"/> - <ccm:application name="ccm-cms-assets-relatedlink"/> +<!-- Extended Bundle's Content Types --> <ccm:application name="ccm-cms-types-agenda"/> - <ccm:application name="ccm-cms-types-article"/> <ccm:application name="ccm-cms-types-bookmark"/> - <ccm:application name="ccm-cms-types-contact"/> - <ccm:application name="ccm-cms-types-esdservice"/> <ccm:application name="ccm-cms-types-event"/> <ccm:application name="ccm-cms-types-faqitem"/> - <ccm:application name="ccm-cms-types-filestorageitem"/> - <ccm:application name="ccm-cms-types-formitem"/> - <ccm:application name="ccm-cms-types-formsectionitem"/> <ccm:application name="ccm-cms-types-glossaryitem"/> <ccm:application name="ccm-cms-types-htmlform"/> - <ccm:application name="ccm-cms-types-image"/> - <ccm:application name="ccm-cms-types-inlinesite"/> <ccm:application name="ccm-cms-types-job"/> <ccm:application name="ccm-cms-types-legalnotice"/> <ccm:application name="ccm-cms-types-minutes"/> -<!-- <ccm:application name="ccm-cms-types-motditem"/> - Current code does not include any xsl templates, conent type does not - appear in the list of types in content center. - For the moment no longer supported (2012-02-06) --> - <ccm:application name="ccm-cms-types-motditem"/> - <ccm:application name="ccm-cms-types-mparticle"/> - <ccm:application name="ccm-cms-types-newsitem"/> <ccm:application name="ccm-cms-types-organization"/> - <ccm:application name="ccm-cms-types-pressrelease"/> <ccm:application name="ccm-cms-types-service"/> <ccm:application name="ccm-cms-types-simpleaddress"/> - <!-- Currently siteproxy is a prerequisite for ccm-ldn-atoz --> - <ccm:application name="ccm-cms-types-siteproxy"/> - <ccm:application name="ccm-cms-types-xmlfeed"/> + <!-- Current code does not include any xsl templates, + neither it does not appear in content center --> + <ccm:application name="ccm-cms-types-motditem"/> - <ccm:application name="ccm-core"/> +<!-- Extended Bundle's Applications --> + <ccm:application name="ccm-auth-http"/> + <!-- currently doesn't work for unknown reason --> + <ccm:application name="ccm-simplesurvey"/> + <!-- Without known funcionality --> + <ccm:application name="ccm-formbuilder-pdf"/> + <ccm:application name="ccm-ldn-userpreferences"/> - <!-- Currently broken. c.ad.cms....DocLinkInitializer doesn't load - <ccm:application name="ccm-docmgr"/> --> +<!-- Extended Bundle's LDN extensions --> + <ccm:application name="ccm-ldn-exporter"/> + <ccm:application name="ccm-ldn-freeform"/> + + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<!-- APLAWS+ potential ADD-ONS packages --> +<!-- These packages are not included in any distribution bundle. --> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + +<!-- ADD-ONs Content Assets --> + <!-- + --> + <ccm:application name="ccm-cms-assets-notes"/> + +<!-- ADD-ONs Bundle's Content Types --> + <!-- + --> + <ccm:application name="ccm-cms-types-image"/> + <ccm:application name="ccm-webpage"/> + + +<!-- ADD-ONs Bundle's Applications --> + <!-- + --> + <ccm:application name="ccm-bookmarks"/> <ccm:application name="ccm-docrepo"/> <ccm:application name="ccm-faq"/> - <ccm:application name="ccm-formbuilder-pdf"/> - <ccm:application name="ccm-forum"/> <ccm:application name="ccm-forum-categorised"/> + <ccm:application name="ccm-portalserver"/> + <ccm:application name="ccm-weblog"/> + <!-- Currently broken. --> + <ccm:application name="ccm-docmgr"/> - <ccm:application name="ccm-ldn-aplaws"/> - <ccm:application name="ccm-ldn-atoz"/> - <ccm:application name="ccm-ldn-dublin"/> - <ccm:application name="ccm-ldn-exporter"/> - <ccm:application name="ccm-ldn-freeform"/> - <ccm:application name="ccm-ldn-importer"/> - <ccm:application name="ccm-ldn-rss"/> - <ccm:application name="ccm-ldn-search"/> - <ccm:application name="ccm-ldn-terms"/> - <ccm:application name="ccm-ldn-util"/> - <ccm:application name="ccm-navigation"/> - <ccm:application name="ccm-portalserver"/> - <ccm:application name="ccm-portalworkspace"/> - <ccm:application name="ccm-portalworkspace-homepage"/> - <ccm:application name="ccm-shortcuts"/> - <ccm:application name="ccm-subsite"/> - <!-- Currently broken. +<!-- ADD-ONs Bundle's Portlets --> + <!-- Currently broken. Missing file: ccm-portlet/postgres-create.sql <ccm:application name="ccm-portlet"/> --> - <!-- Currently ant configure error , depends on ccm-portlet + <!-- Currently ant configure error , depends on ccm-portlet <ccm:application name="ccm-portlet-helloworld"/> --> - <ccm:application name="ccm-simplesurvey"/> - <ccm:application name="ccm-themedirector"/> - <ccm:application name="ccm-user-preferences"/> - <ccm:application name="ccm-weblog"/> - <ccm:application name="ccm-webpage"/> -<!-- tools will be downloaded from trunk, but does not - contain java code to be compiled! - <ccm:application name="tools"/> --> - </ccm:build> </ccm:project> Modified: trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-04-22 16:22:59 UTC (rev 2295) +++ trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -124,8 +124,8 @@ </servlet> <servlet> - <servlet-name>webdevsupport</servlet-name> - <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> + <servlet-name>login</servlet-name> + <servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class> </servlet> <servlet> @@ -134,13 +134,13 @@ </servlet> <servlet> - <servlet-name>webadmin-sitemap</servlet-name> - <servlet-class>com.arsdigita.ui.sitemap.SiteMapServlet</servlet-class> + <servlet-name>webadmin-permissions</servlet-name> + <servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class> </servlet> <servlet> - <servlet-name>webadmin-permissions</servlet-name> - <servlet-class>com.arsdigita.ui.permissions.PermissionsServlet</servlet-class> + <servlet-name>webdevsupport</servlet-name> + <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> </servlet> <servlet> @@ -481,8 +481,8 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webdevsupport</servlet-name> - <url-pattern>/webdevsupport/*</url-pattern> + <servlet-name>login</servlet-name> + <url-pattern>/login/*</url-pattern> </servlet-mapping> <servlet-mapping> @@ -491,13 +491,13 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webadmin-sitemap</servlet-name> - <url-pattern>/admin-sitemap/*</url-pattern> + <servlet-name>webadmin-permissions</servlet-name> + <url-pattern>/admin-permissions/*</url-pattern> </servlet-mapping> <servlet-mapping> - <servlet-name>webadmin-permissions</servlet-name> - <url-pattern>/admin-permissions/*</url-pattern> + <servlet-name>webdevsupport</servlet-name> + <url-pattern>/webdevsupport/*</url-pattern> </servlet-mapping> <servlet-mapping> Added: trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/placeholder.info =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/placeholder.info (rev 0) +++ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/placeholder.info 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,3 @@ +Subdirectory <cat> may optionally contain one or more local site specific +import xml files for Terms domain categories. + Added: trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-domain-1.00.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-domain-1.00.xml (rev 0) +++ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-domain-1.00.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Document : domain-nav-sci-1.00.xml + Created on : 8. Aug. 2007, 10:00 + Author : pb + Description: + Definition of the terms (categories) in the SHP Navigation Menue. + In hierarchy-nav-shp the structure of the tree will be defined. +--> + +<terms:domain xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + about="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml" + key="STD-NAV" + title="Sci Navigation List" + version="1.00" released="2007-08-10"> + + <terms:term id="1000" name="Institut" inAtoZ="false"/> + <terms:term id="1200" name="Abteilungen" inAtoZ="false"/> + <terms:term id="1220" name="Abteilung 1" inAtoZ="false"/> + <terms:term id="1240" name="Abteilung 2" inAtoZ="false"/> + <terms:term id="1260" name="Abteilung 3" inAtoZ="false"/> + <terms:term id="1280" name="Abteilung 4" inAtoZ="false"/> + <terms:term id="1300" name="Abteilung 5" inAtoZ="false"/> + <terms:term id="1400" name="Mitglieder" inAtoZ="false"/> + <terms:term id="1600" name="Bibliothek" inAtoZ="false"/> + <terms:term id="1800" name="Ankündigungen" inAtoZ="false"/> + + <terms:term id="3000" name="Forschung" inAtoZ="false"/> + <terms:term id="3200" name="Projekte" inAtoZ="false"/> + <terms:term id="3400" name="Veröffentlichungen" inAtoZ="false"/> + <terms:term id="3420" name="Publikationen" inAtoZ="false"/> + <terms:term id="3440" name="Arbeitspapiere" inAtoZ="false"/> + <terms:term id="3460" name="Schriftenreihe" inAtoZ="false"/> + <terms:term id="3480" name="Sci Report" inAtoZ="false"/> + <terms:term id="3500" name="Jahresberichte" inAtoZ="false"/> + <terms:term id="3600" name="Kolloquium" inAtoZ="false"/> + <terms:term id="3800" name="Jour Fix" inAtoZ="false"/> + <terms:term id="4000" name="Tagungen" inAtoZ="false"/> + + <terms:term id="5000" name="Lehre und Studium" inAtoZ="false"/> + <terms:term id="5200" name="Masterstudiengang Sci" inAtoZ="false"/> + <terms:term id="5400" name="Weitere Lehre" inAtoZ="false"/> + + <terms:term id="9002" name="Archiv" inAtoZ="false"/> + <terms:term id="9200" name="Informative Links" inAtoZ="false"/> + +</terms:domain> + Added: trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-hierarchy-1.00.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-hierarchy-1.00.xml (rev 0) +++ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/sci-nav-hierarchy-1.00.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Document : hierarchy-nav-sci-1.00.xml + Created on : 8. Aug. 2007, 10:30 + Author : pb + Description: + Purpose of the document follows. +--> + +<terms:hierarchy xmlns:terms="http://xmlns.redhat.com/london/terms/1.0"> + <terms:domain resource="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml"/> + <!-- set root terms --> + <terms:term id="1000"/> + <terms:term id="3000"/> + <terms:term id="5000"/> + + <terms:orderedPair> + <!-- narrower terms, first level --> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1200"/> + </terms:destination> + </terms:orderedPair> + + <!-- narrower terms, second level --> + <terms:orderedPair> + <terms:source> + <terms:term id="1200"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1220"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1200"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1240"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1200"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1260"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1200"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1280"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1200"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1300"/> + </terms:destination> + </terms:orderedPair> +<!-- narrower terms, second level END --> + + <terms:orderedPair> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1400"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1600"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="1800"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="9002"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="1000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="9200"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3200"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3400"/> + </terms:destination> + </terms:orderedPair> + + <!-- narrower terms, second level --> + <terms:orderedPair> + <terms:source> + <terms:term id="3400"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3420"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3400"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3440"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3400"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3460"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3400"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3480"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3400"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3500"/> + </terms:destination> + </terms:orderedPair> +<!-- narrower terms, second level END --> + + <terms:orderedPair> + <terms:source> + <terms:term id="3000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3600"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="3800"/> + </terms:destination> + </terms:orderedPair> + + <terms:orderedPair> + <terms:source> + <terms:term id="3000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="4000"/> + </terms:destination> + </terms:orderedPair> + + + <terms:orderedPair> + <terms:source> + <terms:term id="5000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="5200"/> + </terms:destination> + </terms:orderedPair> + <terms:orderedPair> + <terms:source> + <terms:term id="5000"/> + </terms:source> + <terms:destination isDefault="true" isPreferred="true"> + <terms:term id="5200"/> + </terms:destination> + </terms:orderedPair> + + </terms:hierarchy> Added: trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-domain.xml =================================================================== --- trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-domain.xml (rev 0) +++ trunk/ccm-ldn-aplaws/bundles/devel/res/bundle/categories/xample-nav-domain.xml 2012-04-22 16:23:50 UTC (rev 2296) @@ -0,0 +1,151 @@ +<?xml version="1.0"?> +<terms:domain xmlns:terms="http://xmlns.redhat.com/london/terms/1.0" + about="http://www.aplaws.org.uk/standards/nav/1.03/termslist.xml" + key="APLAWS-NAV" + title="APLAWS Navigation List" + version="1.03" released="2004-03-24"> + + <terms:term id="1" name="Business" inAtoZ="false"/> + <terms:term id="1007" name="Jobs and careers" inAtoZ="false"/> + <terms:term id="1021" name="Legal services" inAtoZ="false"/> + <terms:term id="1039" name="Leisure and culture" inAtoZ="false"/> + <terms:term id="1286" name="Policing and public safety" inAtoZ="false"/> + <terms:term id="1325" name="Social issues" inAtoZ="false"/> + <terms:term id="1337" name="Transport and streets" inAtoZ="false"/> + <terms:term id="204" name="Education and learning" inAtoZ="false"/> + <terms:term id="281" name="Environment"... [truncated message content] |
From: <pb...@fe...> - 2012-04-22 17:20:54
|
Author: pboy Date: 2012-04-22 16:22:59 +0000 (Sun, 22 Apr 2012) New Revision: 2295 Removed: trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMap.java trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapDispatcher.java.nolongerInUse trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapServlet.java Modified: trunk/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/recreate_users_index.sql trunk/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_bebop_legacy_entries.sql trunk/ccm-core/src/ccm-core.upgrade trunk/ccm-core/src/com/arsdigita/core/Initializer.java trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java trunk/ccm-core/src/com/arsdigita/packaging/Loader.java trunk/ccm-core/src/com/arsdigita/packaging/Unload.java Log: Core admin/sitemap removed because it only displays old type package nodes which no longer exists. Update script adapted. Modified: trunk/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/recreate_users_index.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/recreate_users_index.sql 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/sql/ccm-core/default/upgrade/6.6.0-6.6.1/recreate_users_index.sql 2012-04-22 16:22:59 UTC (rev 2295) @@ -18,7 +18,7 @@ -- for some unkown reason for some ccm installations an index for -- users tables has been lost. Just in case it is recreated here. --- First: Drop index to avoid an error it it already exists +-- First: Drop index to avoid an error if it already exists drop index if exists users_lower_screen_name_idx ; create unique index users_lower_screen_name_idx on users Modified: trunk/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_bebop_legacy_entries.sql =================================================================== --- trunk/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_bebop_legacy_entries.sql 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/sql/ccm-core/upgrade/default/6.6.3-6.6.4/remove_bebop_legacy_entries.sql 2012-04-22 16:22:59 UTC (rev 2295) @@ -18,7 +18,7 @@ -- $Id: remove_bebop_legacy_entries.sql $ -- CoreLoader used to load a bebop package_type into database, but without --- mounting any instance or to associate a dispatcher class. Si it never had +-- mounting any instance or to associate a dispatcher class. So it never had -- had a function as application. -- entries in tables apm_package_types and apm_packages are no longer needed. Modified: trunk/ccm-core/src/ccm-core.upgrade =================================================================== --- trunk/ccm-core/src/ccm-core.upgrade 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/ccm-core.upgrade 2012-04-22 16:22:59 UTC (rev 2295) @@ -35,12 +35,15 @@ <script sql="ccm-core/upgrade/::database::-6.5.5-6.5.6.sql"/> </version> <version from="6.6.0" to="6.6.1"> + <!-- Drop deprecated and unused stylesheet tables --> <script sql="ccm-core/upgrade/::database::-6.6.0-6.6.1.sql"/> </version> <version from="6.6.1" to="6.6.2"> + <!-- unused table web_apps removed --> <script sql="ccm-core/upgrade/::database::-6.6.1-6.6.2.sql"/> </version> <version from="6.6.2" to="6.6.3"> + <!-- core portal legacy free --> <script sql="ccm-core/upgrade/::database::-6.6.2-6.6.3.sql"/> </version> <version from="6.6.3" to="6.6.4"> Modified: trunk/ccm-core/src/com/arsdigita/core/Initializer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -37,7 +37,6 @@ import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.toolbox.CharsetEncodingProvider; import com.arsdigita.ui.admin.Admin; -import com.arsdigita.ui.sitemap.SiteMap; import com.arsdigita.util.URLRewriter; import com.arsdigita.xml.FactoriesSetup; import com.arsdigita.web.Host; @@ -171,15 +170,6 @@ }); e.getFactory().registerInstantiator - (SiteMap.BASE_DATA_OBJECT_TYPE, - new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(final DataObject data) { - return new SiteMap(data); - } - }); - - e.getFactory().registerInstantiator (Permissions.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { @Override @@ -196,26 +186,6 @@ } }); -/* MimeType used to have its own initializer in the old initialize system - * based on enterprise.ini. This initializer performed a DomainObjectFactgory - * instantiation and some handling of INSO filter, an Oracle db related - * filter for intermedia textsearch. INSO filter handling is moved to - * intermedia search engine so no configuration was left in the domain - * instantiation could be moved to the central core initializer - From old Initializer system: - - if (DomainObjectFactory.getInstantiator - (MimeType.BASE_DATA_OBJECT_TYPE) == null) { - DomainObjectInstantiator instMimeType = new DomainObjectInstantiator() { - public DomainObject doNewInstance(DataObject dataObject) { - return new MimeType(dataObject); - } - }; - DomainObjectFactory.registerInstantiator - (MimeType.BASE_DATA_OBJECT_TYPE, instMimeType); - } - -*/ e.getFactory().registerInstantiator (MimeType.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { @@ -269,23 +239,4 @@ s_log.info("Core init(DomainInitEvent) done"); } - /** - * - * @param e - */ -// public final void init(final LegacyInitEvent e) { -// super.init(e); - -// s_log.info("Running core init(LegacyInitEvent) ..."); - -// Session session = SessionManager.getSession(); -// TransactionContext txn = session.getTransactionContext(); -// txn.beginTxn(); -// CoreLoader.loadHost(); -// txn.commitTxn(); - -// FactoriesSetup.setupFactories(); - -// s_log.info("Core init(LegacyInitEvent) done"); -// } } Modified: trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/core/upgrade/Upgrade664.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -22,11 +22,6 @@ import com.arsdigita.loader.CoreLoader; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.kernel.PackageInstance; -import com.arsdigita.kernel.PackageInstanceCollection; -import com.arsdigita.kernel.PackageType; -import com.arsdigita.kernel.Resource; -import com.arsdigita.kernel.ResourceType; import com.arsdigita.packaging.Program; import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; @@ -91,18 +86,46 @@ tc.beginTxn(); - // Update core WebDeveloperSupport + // Update core Login application + // Previously login had been managed by a (virtual) root + // sitenode with login dispatcher associated. + // Login application is newly created, old sitenote deactivated. + CoreLoader.loadLoginApp(); + + + // Update core Admin application + // Old style package type already removed by sql script. // Create a (new type, legacy free) web.ApplicationType type // application - CoreLoader.loadWebDev(); + CoreLoader.loadAdminApp(); // Update core permission support + // Old style package type already removed by sql script. // Create a (new type, legacy free) web.ApplicationType type // application CoreLoader.loadPermissionsApp(); + // Update core WebDeveloperSupport + // Old style package type already removed by sql script. + // Create a (new type, legacy free) web.ApplicationType type + // application + CoreLoader.loadWebDev(); + + + // Note: Old PackageType sitenode removed. It's useless now + // because it is based on SiteNode / PackageType which is + // empty when all applications are migrated to new style + // legacy free applications. + // SQL script removes its table entries. + + + // Note 2: SQL script part of this update removes bebop + // PackageType. It had never been used and not instantiated. + // So no replacement is needed. + // SQL script removes its table entries. + tc.commitTxn(); } }.run(); Modified: trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -44,7 +44,6 @@ import com.arsdigita.ui.admin.Admin; import com.arsdigita.ui.login.Login; import com.arsdigita.ui.permissions.Permissions; -import com.arsdigita.ui.sitemap.SiteMap; import com.arsdigita.util.Assert; import com.arsdigita.util.StringUtils; import com.arsdigita.util.UncheckedWrapperException; @@ -272,18 +271,12 @@ s_log.debug("CoreLoader: Going to execute loadSubsite()."); loadSubsite(loadKernel()); - // !! s_log.debug("CoreLoader: Going to execute loadBebop()."); - // !! loadBebop(); - s_log.debug("CoreLoader: Going to execute loadLoginApp()."); loadLoginApp(); s_log.debug("CoreLoader: Going to execute loadAdminApp()."); loadAdminApp(); - s_log.debug("CoreLoader: Going to execute loadSiteMapAdminApp()."); - loadSiteMapAdminApp(null); - s_log.debug("CoreLoader: Going to execute loadPermissionsApp()."); loadPermissionsApp(); // new style legacy free @@ -308,8 +301,8 @@ * Subject to change. */ public static void loadHost() { - final HttpHost hhost = Web.getConfig().getHost(); + final HttpHost hhost = Web.getConfig().getHost(); Assert.exists(hhost, HttpHost.class); final Host host = Host.retrieve(hhost); @@ -330,11 +323,14 @@ // c.ad.search.lucene.Initializer (public final static Loader LOADER) // doesn't work! com.arsdigita.search.lucene.Initializer.LOADER.load(); - // - // As of version 6.6.0 release 2 refactored to the new initializer system - //--com.arsdigita.search.lucene.LegacyInitializer.LOADER.load(); + } + /** + * + * @param rootNode + * @deprecated will be removed without replacement. Naot needed anymore + */ private void loadSubsite(SiteNode rootNode) { s_log.debug("CoreLoader: Going to execute method loadSubsite()."); String sDispatcher = ""; @@ -363,6 +359,7 @@ /** * Create Root Site Node for loadSubsite() * @return root node + * @deprecated will be removed without replacement. Naot needed anymore */ private SiteNode loadKernel() { // Create Root Site Node @@ -454,28 +451,13 @@ } -// Not really used. Commented out in run() method -// NOTE: There is no dispatcher class assoziated and no mount (i.e. no -// site_nodes entry creeated). -// Update script 6.6.3 - 6.6.4 removes entries. -/* - private void loadBebop() { - // Create Package Types and Instances - - PackageType bebop = PackageType.create - ("bebop", "Bebop", "Bebops", - "http://arsdigita.com/bebop/"); - bebop.createInstance("Bebop Service"); - - } -*/ - - /** - * + * Setup Login application. Loads type into database and instances the + * single default instance. + * Has to be public access in order to enable script Upgrade664 to use it. * @return */ - private Application loadLoginApp() { + public static void loadLoginApp() { ApplicationType loginType = new ApplicationType("login", @@ -490,20 +472,15 @@ null); login.setDescription("CCM login instance"); - return login; } /** - * - * @return + * Setup core Admin application. Loads type into database and instances the + * single default instance. + * Has to be public access in order to enable script Upgrade664 to use it. */ - private Application loadAdminApp() { - // ApplicationType adminType = ApplicationType - // .createApplicationType("admin", - // "CCM Admin Application", - // Admin.BASE_DATA_OBJECT_TYPE); - // adminType.setDispatcherClass("com.arsdigita.ui.admin.AdminDispatcher"); + public static void loadAdminApp() { ApplicationType adminType = new ApplicationType("admin", @@ -512,53 +489,19 @@ adminType.save(); - - Application admin = Application.createApplication(adminType, "admin", "CCM Admin", null); admin.setDescription("CCM user and group administration instance"); - return admin; } /** - * - * @param parent + * Setup core Admin application. Loads type into database and instances the + * single default instance. + * Has to be public access in order to enable script Upgrade664 to use it. */ - private void loadSiteMapAdminApp(Application parent) { - - // ApplicationType sitemapType = ApplicationType - // .createApplicationType("sitemap", - // "SiteMap Admin Application", - // SiteMap.BASE_DATA_OBJECT_TYPE); - // sitemapType.setDispatcherClass("com.arsdigita.ui.sitemap.SiteMapDispatcher"); - - /* NOTE: - * The wording in the title parameter of ApplicationType determines - * the name of the subdirectory for the XSL stylesheets. - * It gets "urlized", i.e. trimming leading and trailing blanks and - * replacing blanks between words and illegal characters with an hyphen - * and converted to lower case. - * Example: "Sitemap" will become "sitemap". - */ - ApplicationType sitemapType = - new ApplicationType("Sitemap", - SiteMap.BASE_DATA_OBJECT_TYPE ); - - sitemapType.setDescription("CCM sitemap administration"); - - Application sitemap = Application.createApplication(sitemapType, - "sitemap", - "CCM Admin Sitemap", - parent); - sitemap.setDescription("CCM sitemap administration instance"); - } - - /** - * - */ public static void loadPermissionsApp() { /* NOTE: Modified: trunk/ccm-core/src/com/arsdigita/packaging/Loader.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/Loader.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/packaging/Loader.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -35,6 +35,7 @@ import com.arsdigita.util.Classes; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.parameter.ParameterReader; + import java.io.IOException; import java.io.InputStream; import java.sql.Connection; @@ -43,6 +44,7 @@ import java.util.Iterator; import java.util.List; import java.util.Set; + import org.apache.log4j.Logger; /** @@ -131,8 +133,6 @@ } } - // deprecated: - // public void loadData(Session ssn, ParameterLoader loader) { public void loadData(Session ssn, ParameterReader prd) { final List inits = m_info.getProvidedInitializers(); CompoundInitializer ini = new CompoundInitializer(); Modified: trunk/ccm-core/src/com/arsdigita/packaging/Unload.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/Unload.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/packaging/Unload.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -20,15 +20,18 @@ import com.arsdigita.runtime.CCMResourceManager; import com.arsdigita.util.Files; + import java.io.File; import java.io.FileFilter; import java.util.HashSet; import java.util.Set; + import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; + import org.apache.log4j.Logger; /** @@ -43,7 +46,6 @@ private static final Logger logger = Logger.getLogger(Unload.class); private static final Options OPTIONS = new Options(); - static { logger.debug("Static initalizer starting..."); OPTIONS.addOption @@ -56,7 +58,6 @@ } private static final Set EXCLUDE = new HashSet(); - static { logger.debug("Static initalizer starting..."); EXCLUDE.add("resin.conf"); Deleted: trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMap.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMap.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMap.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -1,65 +0,0 @@ -/* - * Copyright (C) 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.ui.sitemap; - -import com.arsdigita.web.Application; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.domain.DataObjectNotFoundException; - -import org.apache.log4j.Logger; - -/** - * Sitemap administration application. Currently a trivial - * subclass of com.arsdigita.web.Application - * @see com.arsdigita.web.Application - */ -public class SiteMap extends Application { - - private static final Logger s_log = Logger.getLogger(SiteMap.class); - - public static final String BASE_DATA_OBJECT_TYPE - = "com.arsdigita.ui.sitemap.SiteMap"; - - public SiteMap(DataObject obj) { - super(obj); - } - - public SiteMap(OID oid) - throws DataObjectNotFoundException { - - super(oid); - } - - /** - * Getter to retrieve the base database object type name - * - * @return base data aoject type as String - */ - @Override - protected String getBaseDataObjectType() { - return BASE_DATA_OBJECT_TYPE; - } - - @Override - public String getServletPath() { - return "/admin-sitemap"; - } - -} Deleted: trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapDispatcher.java.nolongerInUse 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapDispatcher.java.nolongerInUse 2012-04-22 16:22:59 UTC (rev 2295) @@ -1,182 +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.ui.sitemap; - - -import com.arsdigita.ui.util.GlobalizationUtil ; - -import com.arsdigita.bebop.page.BebopMapDispatcher; -import com.arsdigita.bebop.SplitPanel; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.BoxPanel; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.PageFactory; -import com.arsdigita.bebop.SingleSelectionModel; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.web.RedirectSignal; -import com.arsdigita.web.URL; -import com.arsdigita.web.Web; -import com.arsdigita.web.LoginSignal; -import com.arsdigita.kernel.SiteNode; -import com.arsdigita.kernel.User; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.kernel.security.UserContext; -import com.arsdigita.globalization.GlobalizedMessage; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; - -/** - * Dispatcher for SiteMap Admin functionality - * - * @version $Id: SiteMapDispatcher.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class SiteMapDispatcher extends BebopMapDispatcher { - - private static final Logger s_log = - Logger.getLogger(SiteMapDispatcher.class); - - static final String SEARCH_KEY = "search"; - - /** - * Constructor. Instantiates the subsite url/page mapping. - */ - public SiteMapDispatcher() { - super(); - - s_log.debug("Construct SiteMapDispatcher"); - - Map m = new HashMap(); - m.put("", buildAdminPage()); - m.put("denied", buildDeniedPage()); - setMap(m); - } - - /*** - * - * @param req - * @param resp - * @param ctx - * @throws IOException - * @throws javax.servlet.ServletException - */ - public void dispatch(HttpServletRequest req, - HttpServletResponse resp, - RequestContext ctx) - throws IOException, javax.servlet.ServletException { - /** - * Authenicate user. - */ - String requestURI = Web.getContext().getRequestURL().getRequestURI(); - - if (requestURI.endsWith("/denied")) { - super.dispatch(req, resp, ctx); - return; - } - - UserContext userCtx = Web.getUserContext(); - - // If the user is not logged in, then redirect to the log in page. - - if (!userCtx.isLoggedIn()) { - throw new LoginSignal(req); - } else { - // Check if user has an admin privilege. - String processedURL = ctx.getProcessedURLPart(); - - SiteNode node; - - node = SiteNode.getSiteNode(processedURL); - - User user = userCtx.getUser(); - - if (user == null) { - throw new RuntimeException("User does not exist"); - } - - PermissionDescriptor admin = new PermissionDescriptor - (PrivilegeDescriptor.ADMIN, node, user); - - // Turn off caching for everything... - DispatcherHelper.cacheDisable(resp); - - if (PermissionService.checkPermission(admin)) { - super.dispatch(req, resp, ctx); - } else { - final URL url = URL.there(req, node.getURL() + "denied"); - - throw new RedirectSignal(url, false); - } - } - } - - /** - * "Access Denied" page for the SiteMap. - */ - private Page buildDeniedPage() { - Page p = PageFactory.buildPage("admin", - new Label(new GlobalizedMessage - ("ui.admin.dispatcher.accessDenied", - "com.arsdigita.ui.admin.AdminResources" ))); - - Label label = new Label(GlobalizationUtil.globalize( - "ui.sitemap.access_denied_to_sitemap")); - label.setClassAttr("AccessDenied"); - p.add(label); - - p.lock(); - - return p; - } - - /** - * Admin Page for the SiteMap application - * @return - */ - private Page buildAdminPage() { - Page p = PageFactory.buildPage("admin", "Sitemap Administration"); - - SiteListing listing = new SiteListing(); - listing.setClassAttr("navbar"); - - SingleSelectionModel m = listing.getTree().getSelectionModel(); - SiteMapAdminPane details = new SiteMapAdminPane(m, listing.getCFGLink()); - - BoxPanel box = new BoxPanel(); - box.setClassAttr("main"); - box.add(details); - - SplitPanel panel = new SplitPanel(); - panel.setClassAttr("sidebarNavPanel"); - panel.setLeftComponent(listing); - panel.setRightComponent(box); - - p.add(panel); - p.lock(); - - return p; - } - -} Deleted: trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapServlet.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapServlet.java 2012-04-22 16:20:44 UTC (rev 2294) +++ trunk/ccm-core/src/com/arsdigita/ui/sitemap/SiteMapServlet.java 2012-04-22 16:22:59 UTC (rev 2295) @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2012 Peter Boy <pb...@ze...> 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.ui.sitemap; - -import com.arsdigita.bebop.BoxPanel; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.PageFactory; -import com.arsdigita.bebop.SingleSelectionModel; -import com.arsdigita.bebop.SplitPanel; -import com.arsdigita.bebop.TabbedPane; -import com.arsdigita.dispatcher.AccessDeniedException; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.Party; -import com.arsdigita.kernel.permissions.PermissionDescriptor; -import com.arsdigita.kernel.permissions.PermissionService; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.templating.PresentationManager; -import com.arsdigita.templating.Templating; -import com.arsdigita.util.Assert; -import com.arsdigita.web.Application; -import com.arsdigita.web.BaseApplicationServlet; -import com.arsdigita.web.LoginSignal; -import com.arsdigita.xml.Document; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.log4j.Logger; - -/** - * Core admin SiteMap Application Servlet class, central entry point to - * create and process the applications UI. - * - * We should have subclassed BebopApplicationServlet but couldn't overwrite - * doService() method to add permission checking. So we use our own page - * mapping. The general logic is the same as for BebopApplicationServlet. - * {@see com.arsdigita.bebop.page.BebopApplicationServlet} - * - * @author pb - */ -public class SiteMapServlet extends BaseApplicationServlet { - - private static final Logger s_log = Logger.getLogger( - SiteMapServlet.class.getName()); - - /** URL (pathinfo) -> Page object mapping. Based on it (and the http - * request url) the doService method to selects a page to display */ - private final Map m_pages = new HashMap(); - - - /** - * User extension point, overwrite this method to setup a URL - page mapping - * - * @throws ServletException - */ - @Override - public void doInit() throws ServletException { - - addPage("/", buildAdminIndexPage()); // index page at address ~/ds - // addPage("/index.jsp", buildIndexPage()); // index page at address ~/ds - - // addPage("/log4j", buildLog4jPage()); // Logger Adjuster at addr. ~/ds/log4j - // addPage("/config", buildConfigPage()); // config browser @ ~/ds/config - // cache table browser @ ~/ds/cache-table - // addPage("/cache-table", buildCacheTablePage()); - - // XXXX!! - // QueryLog is a class of its own in webdevsupport, based upon - // dispatcher.Disp and prints out all queries in a request - // put("query-log", new QueryLog()); - - // addPage("/request-info", buildRequestInfoPage()); - // addPage("/query-info", buildQueryInfoPage()); - // addPage("/query-plan", buildQueryPlanPage()); - - } - /** - * Central service method, checks for required permission, determines the - * requested page and passes the page object to PresentationManager. - */ - public final void doService(HttpServletRequest sreq, - HttpServletResponse sresp, - Application app) - throws ServletException, IOException { - - - - // /////// Some preparational steps /////////////// - - /* Determine access privilege: only logged in users may access DS */ - Party party = Kernel.getContext().getParty(); - if (party == null) { - throw new LoginSignal(sreq); - } - /* Determine access privilege: Admin privileges must be granted */ - PermissionDescriptor admin = new PermissionDescriptor - (PrivilegeDescriptor.ADMIN, app, party); - if (!PermissionService.checkPermission(admin)) { - throw new AccessDeniedException("User is not an administrator"); - } - /* Want admin to always show the latest stuff... */ - DispatcherHelper.cacheDisable(sresp); - - - // /////// Everything OK here - DO IT /////////////// - - String pathInfo = sreq.getPathInfo(); - Assert.exists(pathInfo, "String pathInfo"); - if (pathInfo.length() > 1 && pathInfo.endsWith("/")) { - /* NOTE: ServletAPI specifies, pathInfo may be empty or will - * start with a '/' character. It currently carries a - * trailing '/' if a "virtual" page, i.e. not a real jsp, but - * result of a servlet mapping. But Application requires url - * NOT to end with a trailing '/' for legacy free applications. */ - pathInfo = pathInfo.substring(0, pathInfo.length()-1); - } - - final Page page = (Page) m_pages.get(pathInfo); - - if (page != null) { - - final Document doc = page.buildDocument(sreq, sresp); - - PresentationManager pm = Templating.getPresentationManager(); - pm.servePage(doc, sreq, sresp); - - } else { - - sresp.sendError(404, "No such page for path " + pathInfo); - - } - - } - - /** - * Adds one Url-Page mapping to the internal mapping table. - * - * @param pathInfo url stub for a page to display - * @param page Page object to display - */ - private void addPage(final String pathInfo, final Page page) { - - Assert.exists(pathInfo, String.class); - Assert.exists(page, Page.class); - // Current Implementation requires pathInfo to start with a leading '/' - // SUN Servlet API specifies: "PathInfo *may be empty* or will start - // with a '/' character." - Assert.isTrue(pathInfo.startsWith("/"), "path starts not with '/'"); - - m_pages.put(pathInfo, page); - } - - - /** - * Index Page for the SiteMap application - * @return - */ - private Page buildAdminIndexPage() { - - Page p = PageFactory.buildPage("admin", "Sitemap Administration"); - - SiteListing listing = new SiteListing(); - listing.setClassAttr("navbar"); - - SingleSelectionModel m = listing.getTree().getSelectionModel(); - SiteMapAdminPane details = new SiteMapAdminPane(m, listing.getCFGLink()); - - BoxPanel box = new BoxPanel(); - box.setClassAttr("main"); - box.add(details); - - SplitPanel panel = new SplitPanel(); - panel.setClassAttr("sidebarNavPanel"); - panel.setLeftComponent(listing); - panel.setRightComponent(box); - - p.add(panel); - p.lock(); - - return p; - } - - -} |
Author: pboy Date: 2012-04-22 16:20:44 +0000 (Sun, 22 Apr 2012) New Revision: 2294 Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/6.6.0-6.6.1/ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-cat_aliases.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-ct_blacklist.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider_alias.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-siteproxy_provider.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-ldn-atoz/src/overview.html Removed: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-cat_aliases.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-ct_blacklist.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider_alias.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-siteproxy_provider.sql Modified: trunk/ccm-ldn-atoz/application.xml trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.3.0-6.3.1.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.5.0-6.6.0.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.3.0-6.3.1.sql trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.5.0-6.6.0.sql trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Loader.java Log: Package ccm-ldn-atoz now legacy free applicaktion, UPGRADE script provided. Modified: trunk/ccm-ldn-atoz/application.xml =================================================================== --- trunk/ccm-ldn-atoz/application.xml 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/application.xml 2012-04-22 16:20:44 UTC (rev 2294) @@ -2,18 +2,18 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-atoz" prettyName="A-Z" - version="6.6.0" + version="6.6.1" release="1" webapp="ROOT"> <ccm:dependencies> <ccm:requires name="ccm-core" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-navigation" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-aplaws" version="6.6.0" relation="ge"/> + <ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-navigation" version="6.6.0" relation="ge"/> - <ccm:requires name="ccm-ldn-subsite" version="6.6.0" relation="ge"/> <ccm:requires name="ccm-cms-types-siteproxy" version="6.6.0" relation="ge"/> </ccm:dependencies> <ccm:contacts> Deleted: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-cat_aliases.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-cat_aliases.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-cat_aliases.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,18 +0,0 @@ -create table atoz_cat_aliases ( - object_id NUMERIC not null - constraint atoz_cat_alias_obje_id_p_5h3fv - primary key, - provider_id INTEGER not null, - -- referential constraint for provider_id deferred due to circular dependencies - category_id INTEGER not null, - -- referential constraint for category_id deferred due to circular dependencies - letter CHAR(1) not null, - title VARCHAR(200) not null -); - -alter table atoz_cat_aliases add - constraint atoz_cat_alia_categ_id_f_smlu2 foreign key (category_id) - references cat_categories(category_id); -alter table atoz_cat_aliases add - constraint atoz_cat_alia_provi_id_f_c9mnf foreign key (provider_id) - references atoz_cat_provider(provider_id); Deleted: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-ct_blacklist.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-ct_blacklist.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-ct_blacklist.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,16 +0,0 @@ -create table atoz_cat_ct_blacklist_map ( - provider_id INTEGER not null, - -- referential constraint for provider_id deferred due to circular dependencies - type_id INTEGER not null, - -- referential constraint for type_id deferred due to circular dependencies - constraint atoz_cat_ct_bla_map_pr_p_rqpg1 - primary key(type_id, provider_id) -); - -alter table atoz_cat_ct_blacklist_map add - constraint atoz_cat_ct_bla_map_pr_f_b2b9h foreign key (provider_id) - references atoz_cat_provider(provider_id); -alter table atoz_cat_ct_blacklist_map add - constraint atoz_cat_ct_bla_map_ty_f_lb9wc foreign key (type_id) - references content_types(type_id); - Deleted: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,16 +0,0 @@ -create table atoz_item_provider ( - provider_id INTEGER not null - constraint atoz_ite_prov_provi_id_p_8kr86 - primary key, - -- referential constraint for provider_id deferred due to circular dependencies - category_id INTEGER not null, - -- referential constraint for category_id deferred due to circular dependencies - load_paths VARCHAR(4000) -); - -alter table atoz_item_provider add - constraint atoz_ite_prov_categ_id_f_dfhl8 foreign key (category_id) - references cat_categories(category_id); -alter table atoz_item_provider add - constraint atoz_ite_prov_provi_id_f_7b7k7 foreign key (provider_id) - references atoz_provider(provider_id); Deleted: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider_alias.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider_alias.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-item_provider_alias.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,26 +0,0 @@ - -create table atoz_item_aliases ( - alias_id INTEGER not null - constraint atoz_ite_alias_alia_id_p_7yshg - primary key, - -- referential constraint for alias_id deferred due to circular dependencies - provider_id INTEGER not null, - -- referential constraint for provider_id deferred due to circular dependencies - item_id INTEGER not null, - -- referential constraint for item_id deferred due to circular dependencies - title VARCHAR(200) not null, - letter CHAR(1) not null -); - -alter table atoz_item_aliases add - constraint atoz_ite_alia_provi_id_f_si8tg foreign key (provider_id) - references atoz_item_provider(provider_id); -alter table atoz_item_aliases add - constraint atoz_ite_alias_alia_id_f_spljy foreign key (alias_id) - references acs_objects(object_id); -alter table atoz_item_aliases add - constraint atoz_ite_aliase_ite_id_f__bqlu foreign key (item_id) - references cms_items(item_id); - - - Deleted: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-siteproxy_provider.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-siteproxy_provider.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/default/upgrade/add-siteproxy_provider.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,16 +0,0 @@ -create table atoz_siteproxy_provider ( - provider_id INTEGER not null - constraint atoz_site_prov_prov_id_p_p1eu6 - primary key, - -- referential constraint for provider_id deferred due to circular dependencies - category_id INTEGER not null - -- referential constraint for category_id deferred due to circular dependencies -); - -alter table atoz_siteproxy_provider add - constraint atoz_site_prov_cate_id_f_ubcwg foreign key (category_id) - references cat_categories(category_id); -alter table atoz_siteproxy_provider add - constraint atoz_site_prov_prov_id_f_3n5mw foreign key (provider_id) - references atoz_provider(provider_id); - Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,131 @@ +-- +-- 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 +-- +-- $Id: remove_legacy_entries.sql $ + +-- AtoZ is now initialized as a legacy free type of application so +-- entries in tables apm_package_types are no longer needed. + + +-- in case of AtoZ there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') + ) + ); + +-- delete all entries in site_nodes referring to a AtoZ instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') + ); + +-- delete all entries for AtoZ instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_congtext! + +-- delete all entries for AtoZ in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') ; + + +-- set package_id to null for all entries referring to a AtoZ instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like 'com.arsdigita.london.atoz.AtoZ') ; + +-- set package_id to null for all entries referring to a AtoZ instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like 'com.arsdigita.london.atoz.AtoZ' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-cat_aliases.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-cat_aliases.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-cat_aliases.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,18 @@ +create table atoz_cat_aliases ( + object_id NUMERIC not null + constraint atoz_cat_alias_obje_id_p_5h3fv + primary key, + provider_id INTEGER not null, + -- referential constraint for provider_id deferred due to circular dependencies + category_id INTEGER not null, + -- referential constraint for category_id deferred due to circular dependencies + letter CHAR(1) not null, + title VARCHAR(200) not null +); + +alter table atoz_cat_aliases add + constraint atoz_cat_alia_categ_id_f_smlu2 foreign key (category_id) + references cat_categories(category_id); +alter table atoz_cat_aliases add + constraint atoz_cat_alia_provi_id_f_c9mnf foreign key (provider_id) + references atoz_cat_provider(provider_id); Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-ct_blacklist.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-ct_blacklist.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-ct_blacklist.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,16 @@ +create table atoz_cat_ct_blacklist_map ( + provider_id INTEGER not null, + -- referential constraint for provider_id deferred due to circular dependencies + type_id INTEGER not null, + -- referential constraint for type_id deferred due to circular dependencies + constraint atoz_cat_ct_bla_map_pr_p_rqpg1 + primary key(type_id, provider_id) +); + +alter table atoz_cat_ct_blacklist_map add + constraint atoz_cat_ct_bla_map_pr_f_b2b9h foreign key (provider_id) + references atoz_cat_provider(provider_id); +alter table atoz_cat_ct_blacklist_map add + constraint atoz_cat_ct_bla_map_ty_f_lb9wc foreign key (type_id) + references content_types(type_id); + Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-ct_blacklist.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,16 @@ +create table atoz_item_provider ( + provider_id INTEGER not null + constraint atoz_ite_prov_provi_id_p_8kr86 + primary key, + -- referential constraint for provider_id deferred due to circular dependencies + category_id INTEGER not null, + -- referential constraint for category_id deferred due to circular dependencies + load_paths VARCHAR(4000) +); + +alter table atoz_item_provider add + constraint atoz_ite_prov_categ_id_f_dfhl8 foreign key (category_id) + references cat_categories(category_id); +alter table atoz_item_provider add + constraint atoz_ite_prov_provi_id_f_7b7k7 foreign key (provider_id) + references atoz_provider(provider_id); Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider_alias.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider_alias.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider_alias.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,26 @@ + +create table atoz_item_aliases ( + alias_id INTEGER not null + constraint atoz_ite_alias_alia_id_p_7yshg + primary key, + -- referential constraint for alias_id deferred due to circular dependencies + provider_id INTEGER not null, + -- referential constraint for provider_id deferred due to circular dependencies + item_id INTEGER not null, + -- referential constraint for item_id deferred due to circular dependencies + title VARCHAR(200) not null, + letter CHAR(1) not null +); + +alter table atoz_item_aliases add + constraint atoz_ite_alia_provi_id_f_si8tg foreign key (provider_id) + references atoz_item_provider(provider_id); +alter table atoz_item_aliases add + constraint atoz_ite_alias_alia_id_f_spljy foreign key (alias_id) + references acs_objects(object_id); +alter table atoz_item_aliases add + constraint atoz_ite_aliase_ite_id_f__bqlu foreign key (item_id) + references cms_items(item_id); + + + Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-item_provider_alias.sql ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-siteproxy_provider.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-siteproxy_provider.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-siteproxy_provider.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,16 @@ +create table atoz_siteproxy_provider ( + provider_id INTEGER not null + constraint atoz_site_prov_prov_id_p_p1eu6 + primary key, + -- referential constraint for provider_id deferred due to circular dependencies + category_id INTEGER not null + -- referential constraint for category_id deferred due to circular dependencies +); + +alter table atoz_siteproxy_provider add + constraint atoz_site_prov_cate_id_f_ubcwg foreign key (category_id) + references cat_categories(category_id); +alter table atoz_siteproxy_provider add + constraint atoz_site_prov_prov_id_f_3n5mw foreign key (provider_id) + references atoz_provider(provider_id); + Property changes on: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/default/add-siteproxy_provider.sql ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.3.0-6.3.1.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.3.0-6.3.1.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,2 +1,2 @@ -@@ ../default/upgrade/add-siteproxy_provider.sql -@@ ../default/upgrade/add-ct_blacklist.sql +@@ default/add-siteproxy_provider.sql +@@ default/add-ct_blacklist.sql Modified: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.5.0-6.6.0.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.5.0-6.6.0.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.5.0-6.6.0.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,4 +1,4 @@ -@@ ../default/upgrade/add-cat_aliases.sql +@@ default/add-cat_aliases.sql insert into atoz_cat_aliases (object_id, provider_id, category_id, letter, title) select acs_object_id_seq.nextval, m.provider_id, m.category_id, m.letter, m.title Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.0-6.6.1.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/oracle-se-6.6.0-6.6.1.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,23 @@ +-- +-- 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 +-- +-- $Id: oracle-se-6.6.0-6.6.1.sql $ + +-- AtoZ is now initialized as a legacy free type of application + +@@ default/6.6.0-6.6.1/remove_legacy_entries.sql + Modified: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.3.0-6.3.1.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.3.0-6.3.1.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.3.0-6.3.1.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,4 +1,4 @@ begin; -\i ../default/upgrade/add-siteproxy_provider.sql -\i ../default/upgrade/add-ct_blacklist.sql +\i default/add-siteproxy_provider.sql +\i default/add-ct_blacklist.sql commit; Modified: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.5.0-6.6.0.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.5.0-6.6.0.sql 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.5.0-6.6.0.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -1,6 +1,6 @@ begin; -\i ../default/upgrade/add-cat_aliases.sql +\i default/add-cat_aliases.sql insert into atoz_cat_aliases (object_id, provider_id, category_id, letter, title) select nextval('acs_object_id_seq'), m.provider_id, m.category_id, m.letter, m.title Added: trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.0-6.6.1.sql (rev 0) +++ trunk/ccm-ldn-atoz/sql/ccm-ldn-atoz/upgrade/postgres-6.6.0-6.6.1.sql 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,27 @@ +-- +-- 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 +-- +-- $Id: postgres-6.6.0-6.6.1.sql $ + +-- AtoZ is now initialized as a legacy free type of application + + +begin; + +\i default/6.6.0-6.6.1/remove_legacy_entries.sql + +commit; Modified: trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade =================================================================== --- trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/src/ccm-ldn-atoz.upgrade 2012-04-22 16:20:44 UTC (rev 2294) @@ -11,4 +11,8 @@ <version from="6.5.0" to="6.6.0"> <script sql="ccm-ldn-atoz/upgrade/::database::-6.5.0-6.6.0.sql"/> </version> + <version from="6.6.0" to="6.6.1"> + <!-- AtoZ now initialized as legacy free application --> + <script sql="ccm-ldn-atoz/upgrade/::database::-6.6.0-6.6.1.sql"/> + </version> </upgrade> Modified: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Initializer.java 2012-04-22 16:20:44 UTC (rev 2294) @@ -23,6 +23,7 @@ import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.domain.xml.TraversalHandler; +import com.arsdigita.kernel.ACSObjectInstantiator; import com.arsdigita.london.atoz.terms.DomainProvider; import com.arsdigita.london.atoz.ui.admin.CategoryProviderAdmin; import com.arsdigita.london.atoz.ui.admin.CategoryProviderForm; @@ -51,6 +52,7 @@ public class Initializer extends CompoundInitializer { public Initializer() { + final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); @@ -58,10 +60,24 @@ new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); } + /** + * + * @param evt + */ @Override public void init(DomainInitEvent evt) { super.init(evt); + /* Register object instantiator for AtoZ domain class */ + evt.getFactory().registerInstantiator + (AtoZ.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new AtoZ(dataObject); + } + } ); + DomainObjectFactory f = evt.getFactory(); f.registerInstantiator(AtoZCategoryAlias.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { Modified: trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Loader.java =================================================================== --- trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Loader.java 2012-04-22 15:45:23 UTC (rev 2293) +++ trunk/ccm-ldn-atoz/src/com/arsdigita/london/atoz/Loader.java 2012-04-22 16:20:44 UTC (rev 2294) @@ -28,6 +28,7 @@ import com.arsdigita.web.Application; import com.arsdigita.web.ApplicationSetup; import com.arsdigita.web.ApplicationType; + import org.apache.log4j.Logger; /** @@ -51,6 +52,8 @@ private void setupAtoZ() { + s_log.debug("Creating AtoZ application..."); +/* ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(AtoZ.BASE_DATA_OBJECT_TYPE); @@ -65,15 +68,28 @@ }); ApplicationType type = setup.run(); type.save(); +*/ + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "AtoZ" will become "atoz". */ + ApplicationType type = new ApplicationType("AtoZ", + AtoZ.BASE_DATA_OBJECT_TYPE ); + type.setDescription("A-Z of content."); + // type.setSingleton(true); + type.save(); if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/atoz/")) { - Application app = - Application.createApplication(type, - "atoz", - "AtoZ", - null); + Application app = Application.createApplication(type, + "atoz", + "AtoZ", + null); app.save(); } + s_log.debug("AtoZ application type created."); } } Added: trunk/ccm-ldn-atoz/src/overview.html =================================================================== --- trunk/ccm-ldn-atoz/src/overview.html (rev 0) +++ trunk/ccm-ldn-atoz/src/overview.html 2012-04-22 16:20:44 UTC (rev 2294) @@ -0,0 +1,60 @@ +<!-- + +README: This HTML page is the overview documentation comment for the +entire Core; javadoc copies everything inside the <body> into +the front page of the HTML documentation it produces. + +--> +<body> + + <h1>Purpose</h1> + <p> + The ccm-ldn-atoz package enables a site to present all it's content + in alphabetical order as an additional service to it's users. Usually + the theme provides a link to the page as part of its static elements. + </p> + + <h1>Status</h1> + <p> + Application is supported by the default internal theme, as well as by + the APLAWS standard theme. + </p> + <p> + Currently only English is available for public site and administration UI. + </p> + + + <h1>Recommendations</h1> + <p> </p> + + <h1>Additional Application Details</h1> + <p> </p> + + <h1>Usage</h1> + <p> + By default the application presents the A-Z list at ~/ccm/atoz/. + </p> + <p> + An administration interface is provided at ~/ccm/atoz/admin/. Here + you can configure the content to be listed by selecting an appropriate + content provider. + </p> + <p> + Currently available providers are: + </p> + <ul> + <li>ESD Toolkit Domain Provider</li> + <li>Item Provider</li> + <li>SiteProxy Provider</li> + <li>Catgegory Provider</li> + + </ul> + + + + <p> + Last modified: $Date: 2012/03/26 $ + </p> + +</body> +</html> Property changes on: trunk/ccm-ldn-atoz/src/overview.html ___________________________________________________________________ Added: svn:executable + |
Author: pboy Date: 2012-04-22 15:42:43 +0000 (Sun, 22 Apr 2012) New Revision: 2292 Added: trunk/ccm-core/pdl/com/arsdigita/ui/Login/ trunk/ccm-core/pdl/com/arsdigita/ui/Login/Login.pdl trunk/ccm-core/src/com/arsdigita/ui/login/DummyDispatcher.java trunk/ccm-core/src/com/arsdigita/ui/login/Login.java trunk/ccm-core/src/com/arsdigita/ui/login/LoginServlet.java trunk/ccm-core/src/com/arsdigita/ui/login/UserLoginForm.java trunk/ccm-core/web/themes/heirloom/apps/acs-subsite.deletemeSoon/ trunk/ccm-core/web/themes/heirloom/apps/acs-subsite.deletemeSoon/xsl/ trunk/ccm-core/web/themes/heirloom/apps/acs-subsite.deletemeSoon/xsl/index.xsl trunk/ccm-core/web/themes/heirloom/apps/login/ trunk/ccm-core/web/themes/heirloom/apps/login/xsl/ trunk/ccm-core/web/themes/heirloom/apps/login/xsl/index.xsl trunk/ccm-core/web/themes/heirloom/packages/admin/ trunk/ccm-core/web/themes/heirloom/packages/admin/xsl/ trunk/ccm-core/web/themes/heirloom/packages/admin/xsl/admin.xsl trunk/ccm-core/web/themes/heirloom/packages/admin/xsl/admin_en.xsl trunk/ccm-core/web/themes/heirloom/packages/admin/xsl/sitemap_en.xsl trunk/ccm-core/web/themes/heirloom/packages/admin/xsl/split-panel.xsl Removed: trunk/ccm-core/src/com/arsdigita/ui/login/SubsiteDispatcher.java trunk/ccm-core/src/com/arsdigita/ui/login/SubsiteResources.properties trunk/ccm-core/src/com/arsdigita/ui/login/SubsiteResources_de.properties trunk/ccm-core/src/com/arsdigita/ui/login/SubsiteResources_en.properties trunk/ccm-core/src/com/arsdigita/ui/login/SubsiteResources_fr.properties trunk/ccm-core/src/com/arsdigita/ui/login/UserRegistrationForm.java trunk/ccm-core/web/themes/heirloom/apps/acs-subsite/ trunk/ccm-core/web/themes/heirloom/packages/acs-admin/ Modified: trunk/ccm-core/src/com/arsdigita/bebop/form/CheckboxGroup.java trunk/ccm-core/src/com/arsdigita/bebop/page/BebopApplicationServlet.java trunk/ccm-core/src/com/arsdigita/core/Initializer.java trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig.java trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig_parameter.properties trunk/ccm-core/src/com/arsdigita/kernel/KernelHelper.java trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java trunk/ccm-core/src/com/arsdigita/packaging/Load.java trunk/ccm-core/src/com/arsdigita/ui/UI.java trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java trunk/ccm-core/src/com/arsdigita/ui/UIConfig_parameter.properties trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_fr.properties trunk/ccm-core/src/com/arsdigita/ui/login/RecoverPasswordPanel.java trunk/ccm-core/src/com/arsdigita/ui/login/UserForm.java trunk/ccm-core/src/com/arsdigita/ui/login/UserInfo.java trunk/ccm-core/src/com/arsdigita/ui/login/UserNewForm.java trunk/ccm-core/src/com/arsdigita/web/Application.java trunk/ccm-core/src/com/arsdigita/web/URL.java trunk/ccm-core/web/themes/heirloom/apps/admin/xsl/index.xsl trunk/ccm-core/web/themes/heirloom/packages/login/xsl/login_en.xsl Log: Core login package refactored as a new style legacy free application (previously package style node). Added: trunk/ccm-core/pdl/com/arsdigita/ui/Login/Login.pdl =================================================================== --- trunk/ccm-core/pdl/com/arsdigita/ui/Login/Login.pdl (rev 0) +++ trunk/ccm-core/pdl/com/arsdigita/ui/Login/Login.pdl 2012-04-22 15:42:43 UTC (rev 2292) @@ -0,0 +1,27 @@ +// +// 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 +// +// $Id: Login.pdl 1550 2012-03-22 11:50:59Z pboy $ +model com.arsdigita.ui.login; + +import com.arsdigita.web.Application; + +object type Login extends Application { + // Nothing to store yet + // reference key (login_app.application_id); +} + Property changes on: trunk/ccm-core/pdl/com/arsdigita/ui/Login/Login.pdl ___________________________________________________________________ Added: svn:executable + Modified: trunk/ccm-core/src/com/arsdigita/bebop/form/CheckboxGroup.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/form/CheckboxGroup.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/bebop/form/CheckboxGroup.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -56,6 +56,7 @@ /** The XML tag. * @return The tag to be used for the top level DOM element * generated for this type of Widget. */ + @Override protected String getElementTag() { return BEBOP_CHECKBOXGROUP; } Modified: trunk/ccm-core/src/com/arsdigita/bebop/page/BebopApplicationServlet.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/bebop/page/BebopApplicationServlet.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/bebop/page/BebopApplicationServlet.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -51,7 +51,7 @@ * This class is a servlet based version of BebopMapDispatcher and associated * classes and is generally used in the same way by legacy free applications. * - * Subclasses usually overwrite the doService method to create Page objects + * Subclasses usually overwrite the doInit() method to create Page objects * and use this.put method to construct the mapping. * * Subclasses may overwrite the doService method to add additional functionality, @@ -116,7 +116,9 @@ } /** - * disable client/middleware caching of specified page (Chris Gilbert). + * Adds the provided page as specified by its pathInfo information to an + * internal list of pages for which client/middleware caching will be + * disabled when serving the page (added by Chris Gilbert). * * @param pathInfo - the same path used to add the page when put was called */ @@ -156,6 +158,7 @@ if (m_clientCacheDisabledPages.contains(pathInfo)) { DispatcherHelper.cacheDisable(sresp); } + preprocessRequest(sreq, sresp, app, pathInfo); final Document doc = page.buildDocument(sreq, sresp); DeveloperSupport.endStage("Dispatcher page.buildDocument"); @@ -166,4 +169,18 @@ DeveloperSupport.endStage("Dispatcher presMgr.servePage"); } } + + /** + * Provides the opportunity for subclasses to do some preprocessing + * of a given url, before it is handed off to main service process. + * One typical action is to ensure permissions. + */ + protected void preprocessRequest(HttpServletRequest sreq, + HttpServletResponse sresp, + Application app, + String url) + throws ServletException, IOException { + // Nothing to do by default. + } + } Modified: trunk/ccm-core/src/com/arsdigita/core/Initializer.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/core/Initializer.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -52,6 +52,7 @@ import com.arsdigita.search.converter.WordConverter; import com.arsdigita.search.converter.TextConverter; +import com.arsdigita.ui.login.Login; import com.arsdigita.ui.permissions.Permissions; import com.arsdigita.webdevsupport.WebDevSupport; import org.apache.log4j.Logger; @@ -152,6 +153,15 @@ }); e.getFactory().registerInstantiator + (Login.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(final DataObject data) { + return new Login(data); + } + }); + + e.getFactory().registerInstantiator (Admin.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { @Override Modified: trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -36,8 +36,17 @@ private final Parameter m_staticURLPrefix; private final Parameter m_cachingActive; private final Parameter m_defaultExpiry; - private final Parameter m_defaultPageClass; + /** Default top-level container for all Bebop components and containersPage. + * to use for dispatching Bebop pages. A custom installation may provide + * it's own implementation. Use with care because all pages inherit from + * this class! + * Default is {@see com.arsdigita.bebop.Page} */ + private final Parameter m_defaultPageClass= new + StringParameter("waf.dispatcher.default_page_class", + Parameter.OPTIONAL, + "com.arsdigita.bebop.Page"); + public DispatcherConfig() { m_staticURLPrefix = new StringParameter ("waf.dispatcher.static_url_prefix", Parameter.REQUIRED, @@ -52,11 +61,6 @@ ("waf.dispatcher.default_expiry", Parameter.REQUIRED, new Integer(259200)); - m_defaultPageClass = new StringParameter - ("waf.dispatcher.default_page_class", - Parameter.OPTIONAL, - "com.arsdigita.bebop.Page"); - register(m_staticURLPrefix); register(m_cachingActive); register(m_defaultExpiry); @@ -90,6 +94,12 @@ return (Integer)get(m_defaultExpiry); } + /** + * Retrieve the top-level container for all Bebop components and + * containersPage to use by dispatcher. + * Most installation should use the provided default implementation in + * {@see com.arsdigita.bebop.Page} + */ public String getDefaultPageClass() { return (String)get(m_defaultPageClass); } Modified: trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig_parameter.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig_parameter.properties 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/dispatcher/DispatcherConfig_parameter.properties 2012-04-22 15:42:43 UTC (rev 2292) @@ -2,14 +2,18 @@ waf.dispatcher.static_url_prefix.purpose=Prefix used for serving static files waf.dispatcher.static_url_prefix.example=/STATIC/ waf.dispatcher.static_url_prefix.format=[url] + waf.dispatcher.is_caching_active.title=Dispatcher caching enabled waf.dispatcher.is_caching_active.purpose=Toggle whether or not to use HTTP/1.1 caching waf.dispatcher.is_caching_active.example=true waf.dispatcher.is_caching_active.format=true|false + waf.dispatcher.default_expiry.title=Default cache expiration waf.dispatcher.default_expiry.purpose=Set the default expiration time for HTTP caching waf.dispatcher.default_expiry.example=259200 waf.dispatcher.default_expiry.format=[integer] + waf.dispatcher.default_page_class.title=Default page class waf.dispatcher.default_page_class.purpose=the default page class waf.dispatcher.default_page_class.example=com.arsdigita.bebop.Page +waf.dispatcher.default_page_class.format=[String] Modified: trunk/ccm-core/src/com/arsdigita/kernel/KernelHelper.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/kernel/KernelHelper.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/kernel/KernelHelper.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -200,14 +200,6 @@ } /** - * @deprecated Use - * <code>Kernel.getConfig().getPrimaryUserIdentifier()</code> - */ - public static synchronized boolean emailIsPrimaryIdentifier() { - return Kernel.getConfig().getPrimaryUserIdentifier().equals("email"); - } - - /** * * * Fetches the currently logged in user, or null. This is a Modified: trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/kernel/UserAuthentication.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -494,8 +494,8 @@ } set("id", user.getID()); setAssociation("user", user); - set("primaryEmail", user.getPrimaryEmail().getEmailAddress()); - set("screenName", user.getScreenName()); + set("primaryEmail", user.getPrimaryEmail().getEmailAddress()); + set("screenName", user.getScreenName()); m_user = user; } @@ -509,10 +509,10 @@ * @return The login name used for the user. **/ private static String getLoginNameForUser(User user) { - if (KernelHelper.emailIsPrimaryIdentifier()) { - return user.getPrimaryEmail().getEmailAddress(); - } - return user.getScreenName(); + if (Kernel.getConfig().emailIsPrimaryIdentifier()) { + return user.getPrimaryEmail().getEmailAddress(); + } + return user.getScreenName(); } } Modified: trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/loader/CoreLoader.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -42,6 +42,7 @@ import com.arsdigita.runtime.ConfigError; import com.arsdigita.runtime.ScriptContext; import com.arsdigita.ui.admin.Admin; +import com.arsdigita.ui.login.Login; import com.arsdigita.ui.permissions.Permissions; import com.arsdigita.ui.sitemap.SiteMap; import com.arsdigita.util.Assert; @@ -57,8 +58,8 @@ import com.arsdigita.web.ApplicationType; import com.arsdigita.web.Host; import com.arsdigita.web.Web; +import com.arsdigita.webdevsupport.WebDevSupport; -import com.arsdigita.webdevsupport.WebDevSupport; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -127,7 +128,8 @@ private StringParameter m_dispatcher = new StringParameter ("waf.login.dispatcher", Parameter.OPTIONAL, - "com.arsdigita.ui.login.SubsiteDispatcher"); + "com.arsdigita.ui.login.DummyDispatcher"); + // "com.arsdigita.ui.login.SubsiteDispatcher"); private StringParameter m_resource = new StringParameter ("waf.mime.resource", Parameter.OPTIONAL, @@ -273,8 +275,8 @@ // !! s_log.debug("CoreLoader: Going to execute loadBebop()."); // !! loadBebop(); - s_log.debug("CoreLoader: Going to execute loadWebDev()."); - loadWebDev(); // new style legacy free + s_log.debug("CoreLoader: Going to execute loadLoginApp()."); + loadLoginApp(); s_log.debug("CoreLoader: Going to execute loadAdminApp()."); loadAdminApp(); @@ -285,6 +287,9 @@ s_log.debug("CoreLoader: Going to execute loadPermissionsApp()."); loadPermissionsApp(); // new style legacy free + s_log.debug("CoreLoader: Going to execute loadWebDev()."); + loadWebDev(); // new style legacy free + s_log.debug("CoreLoader: Going to execute loadPortal()."); loadPortal(); @@ -464,35 +469,31 @@ } */ + - /** - * Loads WebDeveloperSupport as a new style, legacy free application into - * database and instantiate the (only) application instance. - * - * Public static access needed by upgrade script Upgrade664 - * @return webDevType ApplicationType + * + * @return */ - public static void loadWebDev() { - - ApplicationType webDevType = - new ApplicationType("WebDev Support", - WebDevSupport.BASE_DATA_OBJECT_TYPE ); - webDevType.setDescription("WebDeveloper Support application"); - webDevType.save(); - - Application webDev = Application.createApplication(webDevType, - "ds", - "WebDeveloper Support", - null); - webDev.setDescription("The default WEB developer service instance."); - webDev.save(); + private Application loadLoginApp() { + + ApplicationType loginType = + new ApplicationType("login", + Login.BASE_DATA_OBJECT_TYPE ); + loginType.setDescription("CCM user login application"); + loginType.save(); - return; - } + Application login = Application.createApplication(loginType, + "register", + "CCM Login", + null); + login.setDescription("CCM login instance"); + return login; + } + /** * * @return @@ -585,6 +586,31 @@ } /** + * Loads WebDeveloperSupport as a new style, legacy free application into + * database and instantiate the (only) application instance. + * + * Public static access needed by upgrade script Upgrade664 + * @return webDevType ApplicationType + */ + public static void loadWebDev() { + + ApplicationType webDevType = + new ApplicationType("WebDev Support", + WebDevSupport.BASE_DATA_OBJECT_TYPE ); + webDevType.setDescription("WebDeveloper Support application"); + webDevType.save(); + + Application webDev = Application.createApplication(webDevType, + "ds", + "WebDeveloper Support", + null); + webDev.setDescription("The default WEB developer service instance."); + webDev.save(); + + return; + } + + /** * Load core's basic portal infrastructure. */ private void loadPortal() { Modified: trunk/ccm-core/src/com/arsdigita/packaging/Load.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/packaging/Load.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/packaging/Load.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -408,7 +408,8 @@ } if (!conflicts.isEmpty()) { - System.err.println("conflicting tables: " + conflicts); + System.err.println("conflicting tables (already exist): " + + conflicts); } if (conflicts.size() > 0 || missing.size() > 0) { Modified: trunk/ccm-core/src/com/arsdigita/ui/UI.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/UI.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/ui/UI.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -18,6 +18,8 @@ package com.arsdigita.ui; +import com.arsdigita.ui.login.Login; +import com.arsdigita.ui.login.LoginServlet; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; @@ -38,44 +40,14 @@ private static final UIConfig s_config = UIConfig.getConfig(); - /** (Relative) URL for systems public top level page. */ - // In old LegacyInitializer ROOT_PAGE_KEY =pagemap.root= register/ | portal/ + /** URL for systems public top level page (entry or start page). */ private static final String s_rootPageURL = s_config.getRootPage(); - /** (Relative) URL for systems login page. */ - private static final String s_loginURL = s_config.getLogin(); - /** (Relative) URL for systems logout page. */ - private static final String s_logoutURL = s_config.getLogout(); - /** - * */ - private static final String s_userRedirectURL = s_config.getUserRedirect(); - /** (Relative) URL for workspace page. */ + /** URL to page a user should be redirected to after login. */ + private static final String s_userRedirectURL = s_config.getUserRedirect(); + /** (Absolute) URL for workspace page. */ private static final String s_workspaceURL = s_config.getWorkspace(); - /** Root URL */ - // This address used to be determinded by - // SiteNode.getRootSiteNode().getURL(); - // It provides a sitenode without a name an without any parent, i.e. "/" - // There is no information whether the context path (in case we are not - // installed as root application (context) of the servlet(!) container). - // It does obviously NOT include the constant prefix, generated by the - // new dispatcher. - // - // Previously an variant had been used: - // SiteNode.getRootSiteNode().getURL(request); - // but according to a developers comment the latter is not save: - // "this isn't safe since you aren't neccessarily calling it from - // the root webapp - so we can't blindly prepend the context path - // from the current request." - // - // Sitenode is deprecated, web.Application should be used instead. But here - // there is no application to invoke, but we need the root part of the URL - // for a page to be prepended to its address. This depends on the - // installation, not on the request or the specific application. - // - // XXX must be generated from an installation config record. - private static final String s_rootURL = "/"; - /** * Provides a handle to the UI config record. * @@ -86,293 +58,71 @@ } /** - * Provides an absolute URL (leading slash) into the system top-level page. - * It is relative to document root without any constant prefix if there is - * one configured. + * Provides an absolute URL (leading slash) into the system top-level page + * (entry page / start page). It is relative to document root without any + * constant prefix if there is one configured. + * + * Method is typically called by servlets and especially by JSP's. + * + * Currently just a wrapper script to getRootPageURL() because req is + * currently ignored. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * Therefore the request parameter is not ignored! This variant is retained - * for backwards compatibility only. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) + * @param req HttpServletRequest, may be used to determin the context of + * the current thread (application), currently not used and + * introduced here for backwards compatibility * * @return URL for top-level page as String */ - // In old LegacyInitializer ROOT_PAGE_KEY = pagemap.root = register/ - // (usually modif. to portal/nav) public static String getRootPageURL(HttpServletRequest req) { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_rootPageURL); - } - - if ((s_rootURL == null) || (s_rootPageURL == null)) { - return null; - } - return s_rootURL + s_rootPageURL; + return getRootPageURL(); } /** - * Provides an absolute URL (leading slash) into the system top-level page. - * It is relative to document root without any constant prefix if there is - * one configured. + * Provides an absolute URL (leading slash) into the system top-level page + * (entry page / start page). It is relative to document root without any + * constant prefix if there is one configured. + * + * Method is typically called by servlets and especially by JSP's. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * * @return URL for top-level page as String */ - // In old LegacyInitializer ROOT_PAGE_KEY = register/ (modif. to portal/nav) public static String getRootPageURL() { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_rootPageURL); - } - - if ((s_rootURL == null) || (s_rootPageURL == null)) { - return null; - } - return s_rootURL + s_rootPageURL; - // return s_rootPageURL; + return s_rootPageURL; } /** - * Provides an absolute URL (leading slash) into the system login page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return URL for login page as String - */ - // In old LegacyInitializer - // LOGIN_PAGE_KEY = page.kernel.login = register/ - public static String getLoginPageURL() { - return s_rootURL + s_loginURL; - } - - /** - * Provides an absolute URL (leading slash) for a login expired info page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - // EXPIRED_PAGE_KEY =page.kernel.expired=register/login-expired/ - public static String getLoginExpiredPageURL() { - return s_rootURL + s_loginURL + "login-expired/"; - } - - /** - * Provides an absolute URL (leading slash) for a cookie explanation page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - //COOKIES_PAGE_KEY =page.kernel.cookies=register/explain-persistent-cookies/ - public static String getCookiesExplainPageURL() { - return s_rootURL + s_loginURL + "explain-persistent-cookies/"; - } - - /** - * Provides an absolute URL (leading slash) for a password recovery page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - // RECOVER_PAGE_KEY =page.kernel.recover = register/recover-password/ - public static String getRecoverPasswordPageURL() { - return s_rootURL + s_loginURL + "recover-password/"; - } - - /** - * Provides an absolute URL (leading slash) to a user profile editig page. - * It is relative to document root without any constant prefix if there is - * one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - // EDIT_PAGE_KEY = page.kernel.edit = register/edit-profile/ - public static String getEditUserProfilePageURL() { - return s_rootURL + s_loginURL + "edit-profile/"; - } - - /** - * Provides an absolute URL (leading slash) for an edit (change) password - * page. It is relative to document root without any constant prefix if - * there is one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. The - * leading slash it API change! It's impacts have to be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - // CHANGE_PAGE_KEY = page.kernel.change = register/change-password/ - public static String getChangePasswordPageURL() { - return s_rootURL + s_loginURL + "change-password/"; - } - - /** - * Provides an absolute URL (leading slash) to an optional new user - * registration page (accessible only if activated). It is relative to - * document root without any constant prefix if there is one configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return url String for new user registration page as String - */ - // In old LegacyInitializer - // NEWUSER_PAGE_KEY = page.kernel.newuser = register/new-user/ - public static String getNewUserPageURL() { - return s_rootURL + s_loginURL + "new-user/"; - } - - /** - * Provides an absolute URL (leading slash) for the system logout page. It - * is relative to document root without any constant prefix if there is one - * configured. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * - * @return URL for logout page as String - */ - // In old LegacyInitializer - // LOGOUT_PAGE_KEY =page.kernel.logout=register/logout/ - public static String getLogoutPageURL() { - return s_rootURL + s_logoutURL; - } - - /** * Provides the absolute URL of a page, which redirects an incomming request * based on some clients property, usually whether the user is logged in, * either to a general public page or to a user (client) specific page. - * + * * It is relative to document root including leading slash but without any * constant prefix if there is one configured. * - * It is used by the ccm index page (home/start page) ~/index.jsp. By default - * it is configured as "pvt/" which redirects to a user specific home page - * if the initial incomming request comes from a logged in user. - * Applications may configure a different page according to their specific - * purposes. e.g ccm-cms provides a page content/content-center-redirect.jsp - * which redirects a user to the content-center if logged in. + * It is typically used after login to redirect to an appropriate page, by + * default to /peremissions/. A site should configure an application + * to their specific purposes. e.g ccm-cms provides a page + * content-center/redirect.jsp which redirects a user to the content-center + * if logged in. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * Previous implementation of this method signature (no parameter) returned - * an url without leading slash. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * * @return full URL of a user redirect page, may be null */ - // In old LegacyInitializer - // LOGIN_REDIRECT_PAGE_KEY =page.kernel.login.redirect=pvt/ - // (usually modified to "content/content-center-redirect-page.jsp") public static String getUserRedirectURL() { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_userRedirectURL); - } - - if ((s_rootURL == null) || (s_userRedirectURL == null)) { - return null; - } - return s_rootURL + s_userRedirectURL; + return s_userRedirectURL; } /** - * Provides the absolute URL of a page, which redirects an incomming request - * based on some clients property, usually whether the user is logged in, - * either to a general public page or to a user (client) specific page. - * - * It is relative to document root including leading slash but without any - * constant prefix if there is one configured. - * - * It is used by the ccm index page (home/start page) ~/index.jsp. By default - * it is configured as "pvt/" which redirects to a user specific home page - * if the initial incomming request comes from a logged in user. - * Applications may configure a different page according to their specific - * purposes. e.g ccm-cms provides a page content/content-center-redirect.jsp + * Wrapper method for {@see getUserRedirectURL()} * which redirects a user to the content-center if logged in. + * + * Method is specifically used by various redirect JSP's. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * Previous implementation of this method signature (HTTPServletRequest) - * returned an url to a registration redirect page either starting with a - * slash for root context or the context path part. HTTPServletRequest is - * no longer significant here and method signature retained here for - * backwards compatibility only. - * * @param req HttpServletRequest, may be used to determin the context of * the current thread (application), currently not used and * introduced here for backwards compatibility * @return full URL of a user redirect page, may be null */ - // see comment at top about getRootURL(req) for details! - // In old LegacyInitializer - // LOGIN_REDIRECT_PAGE_KEY =page.kernel.login.redirect=pvt/ - // (usually modified to "content/content-center-redirect-page.jsp") public static String getUserRedirectURL(HttpServletRequest req) { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_userRedirectURL); - } - - if ((s_rootURL == null) || (s_userRedirectURL == null)) { - return null; - } - return s_rootURL + s_userRedirectURL; + return getUserRedirectURL(); } /** @@ -386,73 +136,99 @@ * defines a different page according to their specific purposes, e.g. * portal or navigation. * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * Previous implementation of this method signature (no parameter) returned - * an url without leading slash. - * The leading slash it API change! It's impacts have tp be checked. (2011-02) - * * @return URL for workspace page as String */ - // In old LegacyInitializer - // WORKSPACE_PAGE_KEY = page.kernel.workspace=pvt/ (mod- t0 portal/nav) public static String getWorkspaceURL() { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_workspaceURL); - } - - if ((s_rootURL == null) || (s_workspaceURL == null)) { - return null; - } - return s_rootURL + s_workspaceURL; + return s_workspaceURL; } /** * Provides the absolute URL for the system workspace page. * It is relative to document root including leading slash but without any * constant prefix if there is one configured. + * + * Method is typically called by servlets and especially by JSP's. + * + * Currently just a wrapper script to getWorkspaceURL() because req is + * currently ignored. * - * It is used by the user redirection page (see above) as redirection target - * if no logged in user exists or no user specific page is configured. By - * default it is configured as "pvt/" as well. An installation usually - * defines a different page according to their specific purposes, e.g. - * portal or navigation. - * - * XXX This implementation starts with a leading slash and ends with a slash. - * In previous configurations String urls began without a slash in order - * to be able to provide a full URL which also contains the context part. - * Since version 5.2 the context part is handled by (new) dispatcher. - * Previous implementation of this method signature (HTTPServletRequest) - * returned an url to a workspace page either starting with a - * slash for root context or the context path part. HTTPServletRequest is - * no longer significant here and method signature retained here for - * backwards compatibility only. - * - * * @param req HttpServletRequest, may be used to determin the context of * the current thread (application), currently not used and * introduced here for backwards compatibility + * * @return URL for workspace page as String */ // In old LegacyInitializer // WORKSPACE_PAGE_KEY = page.kernel.workspace=pvt/ (mod- t0 portal/nav) public static String getWorkspaceURL(HttpServletRequest req) { - if (s_log.isDebugEnabled()) { - s_log.debug("Root is " + s_rootURL + ", url is " + s_workspaceURL); - } + return getWorkspaceURL(); + } - if ((s_rootURL == null) || (s_workspaceURL == null)) { - return null; - } - return s_rootURL + s_workspaceURL; + + // //////////////////////////////////////////////////////////////////////// + // Various deprfecated methods, to be removed as soon as invoking code is + // refactored. + // //////////////////////////////////////////////////////////////////////// + + + /** + * Provides an absolute URL (leading slash) into the system login page. + * It is relative to document root without any constant prefix if there is + * one configured. + * + * @return URL for login page as String + * @deprecated use Login.getLoginPageURL()() instead + */ + public static String getLoginPageURL() { + return Login.getLoginPageURL(); } - // In old LegacyInitializer - // PERMISSION_PAGE_KEY = page.kernel.permission = permissions/ + /** + * Provides an absolute URL (leading slash) for a cookie explanation page. + * It is relative to document root without any constant prefix if there is + * one configured. + * + * @return url String for new user registration page as String + * @deprecated use LoginServlet.getCookiesExplainPageURL() instead + */ + public static String getCookiesExplainPageURL() { + return LoginServlet.getCookiesExplainPageURL(); + } - // In old LegacyInitializer - // PERM_SINGLE_PAGE_KEY = page.kernel.perm-single = permissions/one/ + /** + * Provides an absolute URL (leading slash) for a password recovery page. + * It is relative to document root without any constant prefix if there is + * one configured. + * + * @return url String for new user registration page as String + * @deprecated use LoginServlet.getRecoverPasswordPageURL() instead + */ + public static String getRecoverPasswordPageURL() { + return LoginServlet.getRecoverPasswordPageURL(); + } + /** + * Provides an absolute URL (leading slash) to a user profile editig page. + * It is relative to document root without any constant prefix if there is + * one configured. + * + * @return url String for new user registration page as String + * @deprecated use LoginServlet.getEditUserProfilePageURL() instead + */ + public static String getEditUserProfilePageURL() { + return LoginServlet.getEditUserProfilePageURL(); + } + + /** + * Provides an absolute URL (leading slash) for the system logout page. It + * is relative to document root without any constant prefix if there is one + * configured. + * + * @return URL for logout page as String + * @deprecated use LoginServlet.getLogoutPageURL() instead + */ + public static String getLogoutPageURL() { + return LoginServlet.getLogoutPageURL(); + } + } Modified: trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/ui/UIConfig.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -138,33 +138,23 @@ ); /** String containing the relative URL for the top level page - * (or entry page / home page) of the site, Without leading slash but with - * trailing slash in case of a directory. - * By default it is the login page, but usually the root page of the main - * presentation application, e.g. portal, navigation, forum, etc. */ - // Old initializer: waf.pagemap.root - private final Parameter m_rootPageURL = new StringParameter - ("core.ui.pagemap.root_page_url", Parameter.REQUIRED, "register/"); + * (or entry page / home page) of the site, Without leading slash but + * with trailing slash in case of a directory. + * By default it is the login page, but usually the root page of the + * main presentation application, e.g. portal, navigation, forum, etc. */ + private final Parameter m_rootPageURL = + new StringParameter("core.ui.pagemap.root_page_url", + Parameter.REQUIRED, "/register/"); - /**String containing the URL for the login page, Without leading slash but - * with trailing slash in case of a directory. */ - // Old initializer: waf.pagemap.login - private final Parameter m_loginURL = new StringParameter - ("core.ui.pagemap.login_url", Parameter.REQUIRED, "register/"); - - /** String containing the URL for the logout page, Without leading slash - * but with trailing slash in case of a directory. */ - // Old initializer: waf.pagemap.logout - private final Parameter m_logoutURL = new StringParameter - ("core.ui.pagemap.logout_url", Parameter.REQUIRED, "register/logout"); - - /** String containing the URL for a page which may perform a user specific - * redirect if logged in or to a general public page if not. */ - // Used to be LOGIN_REDIRECT_PAGE_KEY in old kernel/security/initializer - // parameter waf.pagemap.login_redirect = pvt/ - // XXX url pvt seems not to exist anymore! (pboy 2011-02-03) - private final Parameter m_userRedirectURL = new StringParameter - ("core.ui.pagemap.user_redirect_url", Parameter.REQUIRED, "pvt/"); + /** String containing the URL of a page, a servlet or a jsp, to which a + * user after login will be redirected to. + * In case of a jsp or servlet it may contain user specific logic to + * redirect to a page specific for the user or a group of users. + * By default it is the /permissions/ page, but usually it is an + * application like personal-portal or content-center. */ + private final Parameter m_userRedirectURL = + new StringParameter("core.ui.pagemap.user_redirect_url", + Parameter.REQUIRED, "/permissions/"); /** String containing the URL for the workspace of the site. */ // Old initializer: waf.pagemap.workspace @@ -185,8 +175,6 @@ register(m_applicationLayouts); register(m_rootPageURL); - register(m_loginURL); - register(m_logoutURL); register(m_userRedirectURL); register(m_workspaceURL); @@ -249,34 +237,27 @@ * @return root page url */ public String getRootPage() { - return (String)get(m_rootPageURL) ; + String rootPageURL = (String)get(m_rootPageURL) ; + // Previous configurations required NO leading slash. Just in case an + // old configuration is in place we have to translate. + return ( rootPageURL.startsWith("/") ? + rootPageURL : "/"+rootPageURL ); } /** - * Retrieve systems login page url. + * Retrieve systems user login redirect page url, that is the page, a + * servlet oder a JSP ti which a user is redirected to after login. + * By default it is the /permissions/ page, but usually it is an application + * like personal-portal or content-center. * - * @return login page url - */ - public String getLogin() { - return (String)get(m_loginURL) ; - } - - /** - * Retrieve systems logout page url. - * - * @return logout page url - */ - public String getLogout() { - return (String)get(m_logoutURL) ; - } - - /** - * Retrieve systems user login redirect page url. - * * @return user login redirect page url */ public String getUserRedirect() { - return (String)get(m_userRedirectURL) ; + String userRedirectURL = (String)get(m_userRedirectURL); + // Previous configurations required NO leading slash. Just in case an + // old configuration is in place we have to translate. + return ( userRedirectURL.startsWith("/") ? + userRedirectURL : "/"+userRedirectURL ); } /** @@ -285,7 +266,11 @@ * @return workspace page url */ public String getWorkspace() { - return (String)get(m_workspaceURL) ; + String workspaceURL = (String)get(m_workspaceURL); + // Previous configurations required NO leading slash. Just in case an + // old configuration is in place we have to translate. + return ( workspaceURL.startsWith("/") ? + workspaceURL : "/"+workspaceURL ); } } Modified: trunk/ccm-core/src/com/arsdigita/ui/UIConfig_parameter.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/UIConfig_parameter.properties 2012-04-22 15:41:24 UTC (rev 2291) +++ trunk/ccm-core/src/com/arsdigita/ui/UIConfig_parameter.properties 2012-04-22 15:42:43 UTC (rev 2292) @@ -13,16 +13,6 @@ core.ui.pagemap.root_page_url.example=register/ core.ui.pagemap.root_page_url.format=[string] -core.ui.pagemap.login_url.title=Login Page -core.ui.pagemap.login_url.purpose=Enter the relative URL for the Login page (to document root and without constant prefix if configured) -core.ui.pagemap.login_url.example=register/ -core.ui.pagemap.login_url.format=[string] - -core.ui.pagemap.logout_url.title=Logout Page -core.ui.pagemap.logout_url.purpose=Enter the relative URL for the Logout Page (to document root and without constant prefix if configured) -core.ui.pagemap.logout_url.example=register/logout -core.ui.pagemap.logout_url.format=[string] - core.ui.pagemap.user_redirect_url.title=User Redirect Page core.ui.pagemap.user_redirect_url.purpose=Enter the relative URL to a page which redirects the request according to the logged in user (if exists) core.ui.pagemap.user_redirect_url.example=pvt/ @@ -34,32 +24,6 @@ core.ui.pagemap.workspace_url.format=[string] - -#waf.pagemap.newuser.title=New User Page -#waf.pagemap.newuser.purpose=Enter the relative URL for the New User Page -#waf.pagemap.newuser.example=register/new-user -#waf.pagemap.newuser.format=[string] - -#waf.pagemap.cookies.title=Cookies Explanation Page -#waf.pagemap.cookies.purpose=Enter the relative URL for the Cookies explanation page -#waf.pagemap.cookies.example=register/explain-persistent-cookies -#waf.pagemap.cookies.format=[string] - -#waf.pagemap.change.title=Change Password Page -#waf.pagemap.change.purpose=Enter the relative URL for the Change Password Page -#waf.pagemap.change.example=register/change-password -#waf.pagemap.change.format=[string] - -#waf.pagemap.recover.title=Recover Password Page -#waf.pagemap.recover.purpose=Enter the relative URL for the Recover Password Page -#waf.pagemap.recover.example=register/recover-password -#waf.pagemap.recover.format=[string] - -#waf.pagemap.expired.title=Expired Login Page -#waf.pagemap.expired.purpose=Enter the relative URL for the expired login message -#waf.pagemap.expired.example=register/login-expired -#waf.pagemap.expired.format=[string] - #waf.pagemap.permission.title=Permissions Page #waf.pagemap.permission.purpose=Enter the relative URL for the main Permissions administration page #waf.pagemap.permission.example=permissions/ Added: trunk/ccm-core/src/com/arsdigita/ui/login/DummyDispatcher.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/DummyDispatcher.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/ui/login/DummyDispatcher.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -0,0 +1,171 @@ +/* + * 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.ui.login; + +import com.arsdigita.bebop.page.BebopMapDispatcher; +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.ElementComponent; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.PageFactory; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.ActionEvent; +// import com.arsdigita.dispatcher.Dispatcher; +// import com.arsdigita.dispatcher.DispatcherConfig; +// import com.arsdigita.dispatcher.DispatcherHelper; +// import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.kernel.Kernel; +// import com.arsdigita.kernel.security.LegacyInitializer; +import com.arsdigita.ui.UI; +import com.arsdigita.web.URL; +import com.arsdigita.web.ParameterMap; +import com.arsdigita.web.ReturnSignal; +import com.arsdigita.web.RedirectSignal; + +import java.util.HashMap; +import java.util.Map; +import com.arsdigita.dispatcher.Dispatcher; +import com.arsdigita.dispatcher.DispatcherConfig; +import com.arsdigita.dispatcher.RequestContext; +import java.io.IOException; +import com.arsdigita.dispatcher.DispatcherHelper; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.ServletException; + +import org.apache.log4j.Logger; + + +/** + * DummyDispatcher for the old acs-subsite package login package. + * Has to be deleted as soon as all application modules are legacy free! + * + * @author Sameer Ajmani + * @version $Id: SubsiteDispatcher.java 1225 2006-06-19 09:27:21Z apevec + **/ +public class DummyDispatcher extends BebopMapDispatcher { + + public static final String APPLICATION_NAME = "login"; + + private static final Logger s_log = + Logger.getLogger(DummyDispatcher.class.getName()); + + // define namespace URI + final static String SUBSITE_NS_URI = + "http://www.arsdigita.com/subsite/1.0"; + + /** Dispatcher map class to store url - page mapping */ + public class SubsiteDispatcherMap extends HashMap implements Map { + + public SubsiteDispatcherMap() { + super(); + // TODO Auto-generated constructor stub + } + } + + /** + * Constructor initializes dispatcher by registering URLs with bebop pages. + */ + public DummyDispatcher() { + s_log.debug("SubsiteDispatcher Constructor entered."); + + Map map = new SubsiteDispatcherMap(); + + // special-case the empty URL +// String redirect = LegacyInitializer.getURL(LegacyInitializer.ROOT_PAGE_KEY); + String redirect = UI.getRootPageURL(); + Dispatcher root = new RedirectDispatcher(redirect); + + map.put("", root); + map.put("index", root); + + + setMap(map); + } + + /** + * Adds <url, page> to the given map. If the URL represents a directory + * (ends with "/"), URL+"index" is also added to the map and URL-"/" is + * redirected to URL. + **/ + private void put(Map map, String url, Page page) { + // String url = LegacyInitializer.getURL(key); + if (url.startsWith("/")) { + // Currently the getter method provide a leading slash (API change) + // but the dispatcher needs an url without + // Needs to be checked when the old style sitenode based Dispatcher + // is eliminated. + url = url.substring(1); + } + map.put(url, page); + if (url.endsWith("/")) { + map.put(url+"index", page); + requireTrailingSlash(url.substring(0, url.length()-1)); + } + } + + @Override + protected void preprocessRequest(HttpServletRequest req, + HttpServletResponse resp, + RequestContext ctx, + String url) { + // Allow world caching for pages without authentication, + // ie, /register, /register/explain-persistent-cookies, + // /register/login-expired, /register/recover-password + // NB, although you'd think /register is cachable, it + // stores a timestamp in the login form :( + // + // url comes without leading "/" and we have to compensate for the + // leading slash provided by the UI.get... methods here. + if (("/"+url).equals(UI.getCookiesExplainPageURL()) || + // ("/"+url).equals(UI.getLoginExpiredPageURL()) || + ("/"+url).equals(UI.getRecoverPasswordPageURL()) ) { + DispatcherHelper.cacheForWorld(resp); + } else { + DispatcherHelper.cacheDisable(resp); + } + } + + + + private class RedirectDispatcher implements Dispatcher { + private String m_path; + + public RedirectDispatcher(String path) { + m_path = path; + } + + public void dispatch(final HttpServletRequest req, + final HttpServletResponse resp, + final RequestContext actx) + throws IOException, ServletException { + // URL requires that its path argument start with a /, + // while the old dispatcher stuff assumes paths do not + // start with a slash. We translate. + + final URL url = URL.there(req, + "/" + m_path, + new ParameterMap(req)); + + throw new RedirectSignal(url, false); + } + } +} Property changes on: trunk/ccm-core/src/com/arsdigita/ui/login/DummyDispatcher.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-core/src/com/arsdigita/ui/login/Login.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/Login.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/ui/login/Login.java 2012-04-22 15:42:43 UTC (rev 2292) @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2010 Peter Boy <pb...@ze...> All Rights Reserved. + * + * This library is free software; y... [truncated message content] |
Author: pboy Date: 2012-04-22 15:45:23 +0000 (Sun, 22 Apr 2012) New Revision: 2293 Added: trunk/ccm-docmgr/web/themes/heirloom/ trunk/ccm-docmgr/web/themes/heirloom/apps/ trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/ trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/ trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl trunk/ccm-docmgr/web/themes/heirloom/contenttypes/ trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocLink.xsl trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocument.xsl trunk/ccm-docmgr/web/themes/heirloom/packages/ trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/ trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/ trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docmgr-portlet.xsl trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docs.xsl trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docs_en.xsl trunk/ccm-ldn-util/src/com/arsdigita/london/util/cmd/MetadataPrinter.java trunk/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/adjust_app_properties.sql Removed: trunk/ccm-docmgr/etc/servlet-declarations.xml trunk/ccm-docmgr/etc/servlet-mappings.xml Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml trunk/ccm-docmgr/pdl/com/arsdigita/cms/docmgr/ui/query-ItemsInFolder.pg.pdl trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolder.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocMgrConfig.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/pslogin/PSSubsiteDispatcher.java trunk/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-subsite/sql/ccm-subsite/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-weblog/src/org/undp/weblog/Initializer.java Log: Adapted various packages to the modifications in core and cms, various minor fixes, docmgr refactored as new style legacy free application (partly). Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-04-22 15:45:23 UTC (rev 2293) @@ -28,7 +28,7 @@ core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.workspace_url=navigation/ -core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp +core.ui.pagemap.user_redirect_url=content-center/redirect.jsp ; workflow configuration waf.workflow.simple.alerts_enabled=true Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-04-22 15:45:23 UTC (rev 2293) @@ -124,8 +124,8 @@ </servlet> <servlet> - <servlet-name>webdevsupport</servlet-name> - <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> + <servlet-name>login</servlet-name> + <servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class> </servlet> <servlet> @@ -144,6 +144,11 @@ </servlet> <servlet> + <servlet-name>webdevsupport</servlet-name> + <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>oid-redirect</servlet-name> <servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class> </servlet> @@ -465,8 +470,8 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webdevsupport</servlet-name> - <url-pattern>/webdevsupport/*</url-pattern> + <servlet-name>login</servlet-name> + <url-pattern>/login/*</url-pattern> </servlet-mapping> <servlet-mapping> @@ -485,6 +490,11 @@ </servlet-mapping> <servlet-mapping> + <servlet-name>webdevsupport</servlet-name> + <url-pattern>/webdevsupport/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>oid-redirect</servlet-name> <url-pattern>/redirect/*</url-pattern> </servlet-mapping> Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-04-22 15:45:23 UTC (rev 2293) @@ -28,7 +28,7 @@ core.ui.pagemap.root_page_url=navigation/ core.ui.pagemap.workspace_url=navigation/ -core.ui.pagemap.user_redirect_url=content/content-center-redirect.jsp +core.ui.pagemap.user_redirect_url=content-center/redirect.jsp ; workflow configuration waf.workflow.simple.alerts_enabled=true @@ -57,6 +57,7 @@ ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS +com.arsdigita.cms.allow_content_create_in_section_listing=false com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.hide_admin_tabs=true Modified: trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-04-22 15:45:23 UTC (rev 2293) @@ -124,8 +124,8 @@ </servlet> <servlet> - <servlet-name>webdevsupport</servlet-name> - <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> + <servlet-name>login</servlet-name> + <servlet-class>com.arsdigita.ui.login.LoginServlet</servlet-class> </servlet> <servlet> @@ -144,6 +144,11 @@ </servlet> <servlet> + <servlet-name>webdevsupport</servlet-name> + <servlet-class>com.arsdigita.webdevsupport.WebDevSupportServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>oid-redirect</servlet-name> <servlet-class>com.arsdigita.web.OIDRedirectServlet</servlet-class> </servlet> @@ -465,8 +470,8 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>webdevsupport</servlet-name> - <url-pattern>/webdevsupport/*</url-pattern> + <servlet-name>login</servlet-name> + <url-pattern>/login/*</url-pattern> </servlet-mapping> <servlet-mapping> @@ -485,6 +490,11 @@ </servlet-mapping> <servlet-mapping> + <servlet-name>webdevsupport</servlet-name> + <url-pattern>/webdevsupport/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>oid-redirect</servlet-name> <url-pattern>/redirect/*</url-pattern> </servlet-mapping> Deleted: trunk/ccm-docmgr/etc/servlet-declarations.xml =================================================================== Deleted: trunk/ccm-docmgr/etc/servlet-mappings.xml =================================================================== Modified: trunk/ccm-docmgr/pdl/com/arsdigita/cms/docmgr/ui/query-ItemsInFolder.pg.pdl =================================================================== --- trunk/ccm-docmgr/pdl/com/arsdigita/cms/docmgr/ui/query-ItemsInFolder.pg.pdl 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/pdl/com/arsdigita/cms/docmgr/ui/query-ItemsInFolder.pg.pdl 2012-04-22 15:45:23 UTC (rev 2293) @@ -48,7 +48,7 @@ cms_items i, cms_folders f where - i.item_id = f.folder_id(+) + i.item_id = f.folder_id and i.parent_id = iif.item_id and i.version = :version and (exists (select 1 from cms_folders f where f.folder_id = i.item_id) @@ -57,31 +57,24 @@ ) and f.folder_id is null ) as cnti, - nvl2(pi.type_id, ( - select nvl(d.description, l.description) - from cms_items i, cms_documents d, cms_doc_links l - where - i.item_id = pi.item_id - and i.item_id = d.doc_id(+) - and i.item_id = l.link_id(+) - ), - (select description from cms_doc_folders where doc_id = iif.item_id) - ) as description, - (select dbms_lob.getLength(f.content) + + (select description from cms_doc_folders where doc_id = iif.item_id) + as description, + (select f.length from cms_documents d, cms_files f - where pi.item_id = d.doc_id(+) and f.file_id = d.asset_id) as length, + where pi.item_id = d.doc_id and f.file_id = d.asset_id) as length, (select m.label from cms_documents d, cms_assets a, cms_mime_types m - where pi.item_id = d.doc_id(+) and a.asset_id = d.asset_id and m.mime_type = a.mime_type + where pi.item_id = d.doc_id and a.asset_id = d.asset_id and m.mime_type = a.mime_type ) as mime_type, - (select d.last_modified_cached from cms_documents d where pi.item_id = d.doc_id(+)) as modified + (select d.last_modified_cached from cms_documents d where pi.item_id = d.doc_id) as modified from ( select a.object_type, a.display_name, a.default_domain_class, i.master_id, i.item_id, i.parent_id, i.version, i.name, case when exists (select 1 from cms_items where master_id = i.item_id) then 1 else 0 end as has_live_version, - case when 0 = nvl(f.folder_id, 0) then 0 else 1 end as is_folder, + case when 0 = COALESCE(f.folder_id, 0) then 0 else 1 end as is_folder, f.label from cms_items i, @@ -90,7 +83,7 @@ where i.item_id = a.object_id and - i.item_id = f.folder_id(+) + i.item_id = f.folder_id and i.parent_id = :parent and @@ -108,11 +101,11 @@ i.parent_id = b.bundle_id and i.language = b.default_language and p.item_id = i.item_id - and i.item_id = d.doc_id(+) - and i.item_id = l.link_id(+) + and i.item_id = d.doc_id + and i.item_id = l.link_id ) pi where - iif.item_id = pi.bundle_id(+) + iif.item_id = pi.bundle_id } map { item.id = iif.item_id; item.objectType = iif.object_type; Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolder.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolder.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolder.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -30,6 +30,7 @@ public class DocFolder extends Folder implements Resource { + /** Private Logger instance for debugging purpose. */ private final static org.apache.log4j.Logger s_log = org.apache.log4j.Logger.getLogger(DocFolder.class); Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocMgrConfig.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocMgrConfig.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocMgrConfig.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -31,43 +31,59 @@ private static final Logger s_log = Logger.getLogger(DocMgrConfig.class); - private Parameter m_contentSection; - private Parameter m_legacyFolderName; - private Parameter m_internalGroupID; - private Parameter m_rowsPerPage; - private Parameter m_legacyFolderID; + /** Private Object to hold one's own instance to return to users. */ + private static DocMgrConfig s_config; - public DocMgrConfig() { + /** + * Returns the singleton configuration record for DocMgr + * + * @return The <code>DocMgrConfig</code> record; it cannot be null + */ + public static synchronized DocMgrConfig getInstance() { + if (s_config == null) { + s_config = new DocMgrConfig(); + s_config.load(); + } - m_contentSection = new StringParameter + return s_config; + } + + // ///////////////////////////////////////////////////////////////////////// + // + // Parameter Sektion + + private Parameter m_contentSection = new StringParameter ("com.arsdigita.cms.docmgr.content_section", Parameter.REQUIRED, "content"); - - m_legacyFolderName = new StringParameter + private Parameter m_legacyFolderName = new StringParameter ("com.arsdigita.cms.docmgr.legacy_folder_name", Parameter.REQUIRED, "legacy"); - - m_legacyFolderID = new IntegerParameter + private Parameter m_legacyFolderID = new IntegerParameter ("com.arsdigita.cms.docmgr.legacy_folder_id", Parameter.REQUIRED, - "-200"); - - - m_internalGroupID = new IntegerParameter + -200); + private Parameter m_internalGroupID = new IntegerParameter ("com.arsdigita.cms.docmgr.internal_group_id", Parameter.REQUIRED, - "-200"); - - m_rowsPerPage = new IntegerParameter + -200); + private Parameter m_rowsPerPage = new IntegerParameter ("com.arsdigita.cms.docmgr.rows_per_page", Parameter.OPTIONAL, - "20"); + 20); + /** + * Constructor registers Parameters and reads repository file if exist. + * + * Do NOT instantiate this class directly using its constructor but use + * the provided getDocMgrConfig method above. + */ + public DocMgrConfig() { + register(m_contentSection); register(m_legacyFolderName); - register(m_legacyFolderID); + register(m_legacyFolderID); register(m_internalGroupID); register(m_rowsPerPage); Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -30,6 +30,7 @@ import com.arsdigita.persistence.DataObject; import com.arsdigita.portal.PortletType; import com.arsdigita.portal.apportlet.AppPortletSetup; +import com.arsdigita.portal.apportlet.AppPortletType; import com.arsdigita.runtime.ScriptContext; import com.arsdigita.web.ApplicationSetup; import com.arsdigita.web.ApplicationType; @@ -129,7 +130,7 @@ // formerly setupDocs() private ApplicationType loadDocRepositoryApplicationType() { - ApplicationSetup setup = new ApplicationSetup(s_log); +/* ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(Repository.BASE_DATA_OBJECT_TYPE); setup.setKey("cmsdocs"); setup.setTitle("Document Manager (CMS) Application"); @@ -145,6 +146,14 @@ }); return setup.run(); +*/ + /* Create new type legacy compatible application type */ + ApplicationType type = ApplicationType + .createApplicationType("cmsdocs", + "DocRepo", + Repository.BASE_DATA_OBJECT_TYPE); + type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DMDispatcher"); + type.setDescription("The document manager empowers users to share documents."); /* Legacy free initialization @@ -162,10 +171,11 @@ // type.setDescription // ("The document repository empowers users to share documents."); + return type; } private ApplicationType setupCategoryBrowsing() { - ApplicationSetup setup = new ApplicationSetup(s_log); +/* ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(DocumentCategoryBrowserApplication .BASE_DATA_OBJECT_TYPE); setup.setKey("cmsdocs-categories"); @@ -181,10 +191,20 @@ } }); return setup.run(); +*/ + /* Create new type legacy compatible application type */ + ApplicationType type = ApplicationType + .createApplicationType("cmsdocs-categories", + "Browse Documents Application", + DocumentCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + type.setDescription("Browse documents by category."); + return type; + } private ApplicationType setupLegacyCategoryBrowsing() { - ApplicationSetup setup = new ApplicationSetup(s_log); +/* ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(LegacyCategoryBrowserApplication .BASE_DATA_OBJECT_TYPE); setup.setKey("cmsdocs-categories-legacy"); @@ -200,7 +220,17 @@ } }); return setup.run(); +*/ + /* Create new type legacy compatible application type */ + ApplicationType type = ApplicationType + .createApplicationType("cmsdocs-categories-legacy", + "Taxonomy Browser", + LegacyCategoryBrowserApplication.BASE_DATA_OBJECT_TYPE); + type.setDispatcherClass("com.arsdigita.cms.docmgr.ui.DCNDispatcher"); + type.setDescription("Browse documents by category."); + return type; + } @@ -246,7 +276,7 @@ private void setupDocRepositoryPortlet(ApplicationType provider) { // Create the document repository portlet - AppPortletSetup setup = new AppPortletSetup(s_log); +/* AppPortletSetup setup = new AppPortletSetup(s_log); setup.setPortletObjectType(RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); setup.setTitle("Recently Updated Documents"); @@ -263,6 +293,16 @@ }); setup.run(); +*/ + AppPortletType type = AppPortletType.createAppPortletType( + "Portal Bookmarks", + PortletType.NARROW_PROFILE, + RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE); + // type.setProviderApplicationType(provider); + type.setProviderApplicationType(Repository.BASE_DATA_OBJECT_TYPE); + type.setDescription( + "Displays the most recent documents in the document repository."); + } Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -50,6 +50,10 @@ */ public class Repository extends Application { + + private static Logger s_log = + Logger.getLogger(Repository.class); + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.docmgr.Repository"; @@ -57,9 +61,6 @@ return BASE_DATA_OBJECT_TYPE; } - private static Logger s_log = - Logger.getLogger(Repository.class); - // pdl constants public static final String OWNER = "ownerID"; public static final String ROOT = "rootID"; Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocLinkInitializer.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -30,6 +30,7 @@ super("empty.pdl.mf", DocLink.BASE_DATA_OBJECT_TYPE); } + @Override public String getTraversalXML() { return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/DocLink.xml"; } @@ -41,8 +42,10 @@ * * @return fully qualified path info string relative to document root */ + @Override public String[] getStylesheets() { return new String[] { - "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" }; + "/themes/heirloom/contenttypes/DMDocLink.xsl" }; + // "/static/content-types/com/arsdigita/cms/docmgr/DocLink.xsl" }; } } Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/DocumentInitializer.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -23,6 +23,7 @@ super("ccm-docmgr.pdl.mf", Document.BASE_DATA_OBJECT_TYPE); } + @Override public String getTraversalXML() { return "/WEB-INF/traversal-adapters/com/arsdigita/cms/docmgr/Document.xml"; } @@ -34,8 +35,10 @@ * * @return fully qualified path info string reltive to document (context) root */ + @Override public String[] getStylesheets() { return new String[] { - "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" }; + "/themes/heirloom/contenttypes/DMDocument.xsl" }; + // "/static/content-types/com/arsdigita/cms/docmgr/Document.xsl" }; } } Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -50,9 +50,11 @@ * * @version $Revision: #11 $ $Date: 2004/01/14 $ */ - public class Initializer extends CompoundInitializer { + /** Private Logger instance for debugging purpose. */ + private static Logger s_log = Logger.getLogger(Initializer.class); + // private Configuration m_conf = new Configuration(); private static final String SEPARATOR = java.io.File.separator; @@ -65,9 +67,9 @@ public static final String INTERNAL_GROUP_ID = "internalGroupID"; public static final String LEGACY_FOLDER_NAME = "legacyFolderName"; - private static Logger s_log = - Logger.getLogger(Initializer.class); - + /** + * + */ public Initializer() { } @@ -78,11 +80,55 @@ // return m_conf; // } + /** + * + * @param e + */ @Override public void init(DomainInitEvent e) { s_log.debug("Document (CCM) Manager is Domain initializing ... "); - setupDomainFactory(); + /* Register REPOSITORY application type.*/ + e.getFactory().registerInstantiator( + Repository.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Repository(dataObject); + } + }); + + /* Register Portlet DocumentBrowser. */ + e.getFactory().registerInstantiator( + RecentUpdatedDocsPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new RecentUpdatedDocsPortlet(dataObject); + } + }); + + /* Set up domain object factories for basic document manager + * object types. */ + + DomainObjectFactory.registerInstantiator( + Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Document(dataObject); + } + } + ); + DomainObjectFactory.registerInstantiator( + DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new DocFolder(dataObject); + } + } + ); + + startup(); } @@ -98,15 +144,15 @@ .getTransactionContext(); txn.beginTxn(); - ApplicationType docsAppType = setupDocs(); - setupDocManagerPortlet(docsAppType); + // ApplicationType docsAppType = setupDocs(); + // setupDocManagerPortlet(docsAppType); - ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing(); - setupCategoryDocsPortlet(categoryBrowseDocsAppType); + // ApplicationType categoryBrowseDocsAppType = setupCategoryBrowsing(); + // setupCategoryDocsPortlet(categoryBrowseDocsAppType); - ApplicationType legacyCategoryBrowseDocsAppType = - setupLegacyCategoryBrowsing(); - setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType); + // ApplicationType legacyCategoryBrowseDocsAppType = + // setupLegacyCategoryBrowsing(); + // setupLegacyCategoryDocsPortlet(legacyCategoryBrowseDocsAppType); // de-activate search for now //SearchUtils.setSearcher @@ -240,28 +286,6 @@ setup.run(); } - /** - * Set up domain object factories for basic document manager - * object types. - */ - private void setupDomainFactory() { - DomainObjectFactory.registerInstantiator( - Document.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new Document(dataObject); - } - } - ); - DomainObjectFactory.registerInstantiator( - DocFolder.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { - @Override - public DomainObject doNewInstance(DataObject dataObject) { - return new DocFolder(dataObject); - } - } - ); - } /** * Shutdown the document manager. Modified: trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java =================================================================== --- trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java 2012-04-22 15:42:43 UTC (rev 2292) +++ trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/FolderTable.java 2012-04-22 15:45:23 UTC (rev 2293) @@ -109,6 +109,7 @@ addTableActionListener(this); } + @Override public void generateXML(PageState s, Element p) { long start = System.currentTimeMillis(); super.generateXML(s, p); @@ -117,6 +118,7 @@ } } + @Override public void register(Page p) { super.register(p); p.addComponentStateParam(this, m_sources); @@ -305,11 +307,17 @@ // } } +/** + * + * + */ class FolderTableModelBuilder extends LockableImpl implements TableModelBuilder { - private final static Logger s_log = Logger.getLogger(FolderTableModelBuilder.class); + private final static Logger s_log = + Logger.getLogger(FolderTableModelBuilder.class); - public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("MMMMMMMMMMM d, yyyy"); + public static final SimpleDateFormat dateFormatter = new + SimpleDateFormat("MMMMMMMMMMM d, yyyy"); private Tree m_tree; private FolderContentsTableForm m_parent; @@ -361,7 +369,8 @@ Folder parentFolder = new Folder(folderID); - m_collection = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.docmgr.ui.ItemsInFolder"); + m_collection = SessionManager.getSession().retrieveQuery( + "com.arsdigita.cms.docmgr.ui.ItemsInFolder"); m_collection.setParameter(Folder.PARENT, folderID); m_collection.setParameter(Folder.VERSION, parentFolder.getVersion()); m_collection.addOrder("isFolder desc"); @@ -375,24 +384,34 @@ m_parent.hideEmptyLabel(state); } - int maxPages = (int) (size / m_rowsPerPage) + (size % m_rowsPerPage > 0 ? 1 : 0); + int maxPages = (int) (size / m_rowsPerPage) + + (size % m_rowsPerPage > 0 ? 1 : 0); Integer pn = (Integer) state.getValue(m_parent.getPageNoParameter()); int pageNo = (pn == null ? 0 : pn.intValue()); int firstRowNo = ((int) (pageNo * m_rowsPerPage)) + 1; int lastRowNo = firstRowNo + m_rowsPerPage; if (s_log.isDebugEnabled()) { - s_log.debug("items count:" + size + "; items per page:" + m_rowsPerPage + "; max pages:" + maxPages + - "; pageNo:" + pageNo + "; first row no:" + firstRowNo + "; last row no:" + lastRowNo); + s_log.debug("items count:" + size + "; items per page:" + + m_rowsPerPage + "; max pages:" + maxPages + + "; pageNo:" + pageNo + "; first row no:" + + firstRowNo + "; last row no:" + lastRowNo); } m_collection.setRange(new Integer(firstRowNo), new Integer(lastRowNo)); - m_typeIdDocument = ContentType.findByAssociatedObjectType(Document.TYPE).getID(); - m_typeIdDocLink = ContentType.findByAssociatedObjectType(DocLink.TYPE).getID(); - m_typeIdDocFolder = ContentType.findByAssociatedObjectType(DocFolder.TYPE).getID(); + m_typeIdDocument = ContentType.findByAssociatedObjectType( + Document.TYPE).getID(); + m_typeIdDocLink = ContentType.findByAssociatedObjectType( + DocLink.TYPE).getID(); + m_typeIdDocFolder = ContentType.findByAssociatedObjectType( + DocFolder.TYPE).getID(); m_user = Web.getContext().getUser(); Application app = Web.getContext().getApplication(); - m_isManager = PermissionService.checkPermission(new PermissionDescriptor(PrivilegeDescriptor.ADMIN, app, m_user)); + m_isManager = PermissionService.checkPermission(new + PermissionDescriptor(PrivilegeDescriptor.ADMIN, + app, + m_user) + ); } public int getColumnCount() { @@ -439,8 +458,10 @@ } else if (isLink) { Repository rep = ((Document) resource).getRepository(); - String path = Web.getConfig().getDispatcherContextPath() + rep.getPath() + "/file?" + FILE_ID_PARAM_NAME + "=" - + resource.getID(); + String path = Web.getConfig().getDispatcherContextPath() + + rep.getPath() + "/file?" + + FILE_ID_PARAM_NAME + "=" + + resource.getID(); Link l = new Link((String) resource.getTitle(), path); link.add(l); } Added: trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl =================================================================== --- trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl (rev 0) +++ trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl 2012-04-22 15:45:23 UTC (rev 2293) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" + version="1.0"> + + <xsl:import href="../../../packages/docmgr/xsl/docs.xsl"/> + +</xsl:stylesheet> Property changes on: trunk/ccm-docmgr/web/themes/heirloom/apps/cmsdocs/xsl/index.xsl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocLink.xsl =================================================================== --- trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocLink.xsl (rev 0) +++ trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocLink.xsl 2012-04-22 15:45:23 UTC (rev 2293) @@ -0,0 +1,10 @@ +<!DOCTYPE stylesheet [ +<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum --> +]> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + version="1.0"> + +</xsl:stylesheet> + Property changes on: trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocLink.xsl ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocument.xsl =================================================================== --- trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocument.xsl (rev 0) +++ trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocument.xsl 2012-04-22 15:45:23 UTC (rev 2293) @@ -0,0 +1,10 @@ +<!DOCTYPE stylesheet [ +<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum --> +]> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + version="1.0"> + +</xsl:stylesheet> + Property changes on: trunk/ccm-docmgr/web/themes/heirloom/contenttypes/DMDocument.xsl ___________________________________________________________________ Added: svn:executable + * Added: trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docmgr-portlet.xsl =================================================================== --- trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docmgr-portlet.xsl (rev 0) +++ trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docmgr-portlet.xsl 2012-04-22 15:45:23 UTC (rev 2293) @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:forum="http://www.arsdigita.com/forum/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:portlet="http://www.uk.arsdigita.com/portlet/1.0" + xmlns:portalserver="http://www.redhat.com/portalserver/1.0" + version="1.0"> + + <xsl:output method="html"/> + + <xsl:template match="bebop:portlet[@bebop:classname='com.arsdigita.cms.docmgr.ui.LegacyCategoryDocsNavigatorPortlet' and //bebop:page/@id='viewWorkspace']"> + <H3><xsl:value-of select="@title" /></H3> + <xsl:apply-templates /> + </xsl:template> + + <xsl:template match="bebop:portlet[@bebop:classname='com.arsdigita.cms.docmgr.ui.RecentUpdatedDocsPortletRenderer' and //bebop:page/@id='viewWorkspace']"> + <xsl:choose> + <xsl:when test="(../@style='W') or + ((../@style='WN') and (@cellNumber='1')) or + ((../@style='NW') and (@cellNumber='2')) or + ((../@style='WN') and (@cellNumber='3')) or + ((../@style='NWN') and (@cellNumber='2')) or + ((../@style='NNN') and (@cellNumber='1'))"> + <H3><xsl:value-of select="@title" /></H3> + + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + + <tr> + <td class="bglight"><b>5 Most Recent Items</b></td> + <td width="100" align="right" class="bglight"><b>Size</b></td> + <td width="100" align="right" class="bglight"><b>Modified</b></td> + </tr> + + <xsl:for-each select="descendant-or-self::bebop:tbody/bebop:trow"> + <xsl:if test="position()<='5'"> + <tr> + <td class="bglight"> + <a href="{./bebop:cell[6]/bebop:link/@href}" title="Download this document"><xsl:value-of select="./bebop:cell[1]/bebop:link/bebop:label" /></a> + </td> + <td width="100" align="right" class="bglight"> + <xsl:apply-templates select="./bebop:cell[3]"/> + </td> + <td width="100" align="right" class="bglight"> + <xsl:call-template name="docmgrDate"> + <xsl:with-param name="date" select="./bebop:cell[5]/bebop:label" /> + </xsl:call-template> + </td> + </tr> + </xsl:if> + </xsl:for-each> + + <xsl:if test="contains(descendant-or-self::bebop:link[@class='actionLink']/bebop:label, 'New Document')"> + <tr> + <td colspan="3"> + <a href="{./bebop:gridPanel/bebop:panelRow[1]/bebop:cell/bebop:link[@class='actionLink']/@href}">add a document</a> + </td> + </tr> + </xsl:if> + + <tr> + <td colspan="3"> + <a href="{@applicationlink}">view all documents</a> + </td> + </tr> + + </table> + + </xsl:when> + <xsl:otherwise> + + <H3><xsl:value-of select="@title" /></H3> + <p>5 Most Recent Items</p> + <ul> + + <xsl:for-each select="descendant-or-self::bebop:tbody/bebop:trow"> + <xsl:if test="position()<='5'"> + <li> + <a href="{./bebop:cell[6]/bebop:link/@href}" title="Download this document"><xsl:value-of select="./bebop:cell[1]/bebop:link/bebop:label" /></a> + </li> + </xsl:if> + </xsl:for-each> + + </ul> + + <xsl:if test="contains(descendant-or-self::bebop:link[@class='actionLink']/bebop:label, 'New Document')"> + <div> + <a href="{./bebop:gridPanel/bebop:panelRow[1]/bebop:cell/bebop:link[@class='actionLink']/@href}">add a document</a> + </div> + </xsl:if> + + <div> + <a href="{@applicationlink}">view all documents</a> + </div> + + </xsl:otherwise> + </xsl:choose> + + </xsl:template> + + <xsl:template name="docmgrDate"> + <xsl:param name="date" /> + + <xsl:if test="string($date)!='null'"> + <xsl:if test="string-length($date)!='0'"> + + <!-- Day --> + <xsl:variable name="day-month" select="substring-before($date, '/0')"/> + <xsl:variable name="day" select="substring-after($day-month, '/')"/> + <xsl:variable name="month" select="substring-before($day-month, '/')"/> + <xsl:variable name="year" select="substring-after($date, '/0')"/> + + <xsl:if test="string-length($day)='1'"> + <xsl:text>0</xsl:text> + </xsl:if> + <xsl:value-of select="$day" /> + <xsl:text>-</xsl:text> + + <!-- Month --> + <xsl:choose> + <xsl:when test="$month='1'">01</xsl:when> + <xsl:when test="$month='2'">02</xsl:when> + <xsl:when test="$month='3'">03</xsl:when> + <xsl:when test="$month='4'">04</xsl:when> + <xsl:when test="$month='5'">05</xsl:when> + <xsl:when test="$month='6'">06</xsl:when> + <xsl:when test="$month='7'">07</xsl:when> + <xsl:when test="$month='8'">08</xsl:when> + <xsl:when test="$month='9'">09</xsl:when> + <xsl:when test="$month='10'">10</xsl:when> + <xsl:when test="$month='11'">11</xsl:when> + <xsl:when test="$month='12'">12</xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose><xsl:text>-</xsl:text>200<xsl:value-of select="substring($year, 1, 2 )" /> + </xsl:if> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docmgr-portlet.xsl ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docs.xsl =================================================================== --- trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docs.xsl (rev 0) +++ trunk/ccm-docmgr/web/themes/heirloom/packages/docmgr/xsl/docs.xsl 2012-04-22 15:45:23 UTC (rev 2293) @@ -0,0 +1,598 @@ +<?xml version="1.0"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + xmlns:admin="http://www.arsdigita.com/admin-ui/1.0" + xmlns:docs="http://www.redhat.com/docs/1.0"> + + + <xsl:import href="../../cms/xsl/cms.xsl"/> + <xsl:import href="../../acs-admin/xsl/admin_en.xsl"/> + <xsl:import href="../../categorization/xsl/categorization.xsl"/> + <xsl:import href="../../bebop/xsl/DimensionalNavbar.xsl"/> + <xsl:import href="../../toolbox/xsl/ControlBar.xsl"/> + + <xsl:output method="html" indent="yes"/> + + <xsl:param name="internal-theme"/> + + + <xsl:template match="bebop:page[@class='DOCS']" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + <html> + <head> + <title><xsl:value-of select="bebop:title"/></title> + <!-- + <link href="/css/acs-master.css" rel="stylesheet" type="text/css"/> + <link href="/packages/portalserver/www/css/portalserver.css" rel="stylesheet" type="text/css"/> + <style type="text/css"> + BODY { background: white; color: black} + .main {background-color: #ffffff;} + table.globalHeader { background-color: rgb(225,225,225);} + table.bottomRule { background: rgb(162,30,30);} + table.topRuleNoTabs { background: rgb(162,30,30);} + table.topRuleUnderTabs { background: rgb(162,30,30);} + </style> + --> + <link rel="stylesheet" type="text/css" + href="{$internal-theme}/css/acs-master.css" /> + <link rel="stylesheet" type="text/css" + href="{$internal-theme}/packages/cms/xml/admin/cms-admin.css" /> + </head> + + <body> + <xsl:apply-templates select="docs:header"/> + <xsl:apply-templates select="docs:body"/> + <xsl:apply-templates select="docs:footer"/> + <xsl:apply-templates select="bebop:structure"/> + </body> + </html> + </xsl:template> + + + <!-- ContextBar formatting --> + <xsl:template match="bebop:boxPanel[@class='ContextBar']"> + <xsl:apply-imports/> + <hr /> + </xsl:template> + + <!-- Table with alternate color for each column. --> + <xsl:template match="bebop:table[@class='AlternateTable']" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + <table> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + <xsl:apply-templates select="bebop:thead"/> + <xsl:for-each select="bebop:tbody"> + <xsl:call-template name="AlternateTableBody"/> + </xsl:for-each> + </table> + </xsl:template> + + <xsl:template name="AlternateTableBody" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + <tbody> + <xsl:for-each select="bebop:trow"> + <tr> + <xsl:attribute name="bgcolor"> + <xsl:choose> + <xsl:when test="position() mod 2">#e1d5b0</xsl:when> + <xsl:otherwise>#ffffff</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:for-each select="bebop:cell"> + <td> + <xsl:for-each select="@align|@valign|@colspan|@width"> + <xsl:attribute name="{local-name()}"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + <xsl:apply-templates/> + </td> + </xsl:for-each> + </tr> + </xsl:for-each> + </tbody> + </xsl:template> + + <xsl:template match="bebop:label[@class='isFile']"> + <img src="{$internal-theme}/images/file.gif" border="0"> + <xsl:attribute name="alt"> + <xsl:apply-templates/> + </xsl:attribute> + </img> + <xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="bebop:label[@class='isFolder']"> + <img src="{$internal-theme}/images/folder.gif" border="0"> + <xsl:attribute name="alt"> + <xsl:apply-templates/> + </xsl:attribute> + </img> + <xsl:text> </xsl:text> + </xsl:template> + + + <xsl:template name="write-node"> + <xsl:param name="node"/> + <xsl:param name="total-indent"/> + <xsl:param name="level-indent">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:param> + <xsl:for-each select="$node"> + <tr> + <td> + <xsl:attribute name="class"> + <xsl:choose> + <xsl:when test="count(./bebop:label[@weight='b'])>0">split_pane_left_item_selected</xsl:when> + <xsl:otherwise>split_pane_left_item</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:value-of disable-output-escaping="yes" select="$total-indent"/> + + <xsl:choose> + <xsl:when test="@collapsed='t'"> + <a href="{@href}"> + <img alt="Expand" border="0" height="11" width="11"> + <xsl:attribute name="src"> + <xsl:value-of select="//@assets"/>{$internal-theme}/images/plus-box.gif</xsl:attribute> + </img> + </a> + </xsl:when> + <xsl:when test="@expanded='t'"> + <a href="{@href}"> + <img alt="Collapse" border="0" height="11" width="11"> + <xsl:attribute name="src"> + <xsl:value-of select="//@assets"/>{$internal-theme}/images/minus-box.gif</xsl:attribute> + </img> + </a> + </xsl:when> + <xsl:when test="@radioGroup='t'"> + <input type="radio"> + <xsl:attribute name="name"> + <xsl:value-of select="@radioGroupName"/> + </xsl:attribute> + <xsl:attribute name="value"> + <xsl:value-of select="@resourceID"/> + </xsl:attribute> + </input> + <img alt="folder" border="0" height="24" width="24"> + <xsl:attribute name="src"> + <xsl:value-of select="//@assets"/>{$internal-theme}/images/folder.gif</xsl:attribute> + </img> + </xsl:when> + <xsl:when test="@radioGroup='f'"> + <xsl:text>     + </xsl:text> + <img alt="folder" border="0" height="24" width="24"> + <xsl:attribute name="src"> + <xsl:value-of select="//@assets"/>{$internal-theme}/images/folder.gif</xsl:attribute> + </img> + </xsl:when> + + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[position()=1]"/> + </td> + </tr> + <xsl:for-each select="bebop:t_node"> + <xsl:call-template name="write-node"> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="total-indent"> + <xsl:copy-of select="$total-indent"/> + <xsl:copy-of select="$level-indent"/> + </xsl:with-param> + </xsl:call-template> + </xsl:for-each> + + <!-- This adds a little space each time we move up in the hierarchy. --> + <xsl:if test="count(bebop:t_node)>0"> + <tr> + <td> + <table cellspacing="0" cellpadding="0" border="0"> + <tr> + <td height="2"></td> + </tr> + </table> + </td> + </tr> + </xsl:if> + </xsl:for-each> + </xsl:template> + + <xsl:template match="docs:error-label" + xmlns:docs="http://www.arsdigita.com/docs/1.0"> + <xsl:choose> + <xsl:when test="@action='copy'"> + Unable to copy on following items. + </xsl:when> + <xsl:when test="@action='move'"> + Unable to move on following items. + </xsl:when> + <xsl:when test="@action='delete'"> + Unable to delete on following items. + </xsl:when> + </xsl:choose> + <ul> + <xsl:for-each select="docs:item"> + <li><b><xsl:value-of select="@name"/></b></li> + </xsl:for-each> + </ul> + </xsl:template> + + <xsl:template match="docs:file-info"> + <table> + <tr> + <td>Name:</td> + <td><xsl:value-of select="docs:name"/></td> + </tr> + <tr> + <td>Description:</td> + <td><xsl:value-of select="docs:description"/></td> + </tr> + <tr> + <td>Size:</td> + <td><xsl:value-of select="docs:size"/></td> + </tr> + <tr> + <td>Type:</td> + <td><xsl:value-of select="docs:type"/></td> + </tr> + <tr> + <td>Last Modified:</td> + <td><xsl:value-of select="docs:last-modified"/></td> + </tr> + + <tr> + <td>Revision:</td> + <td><xsl:value-of select="docs:revision"/></td> + </tr> + <tr> + <td>Author:</td> + <td><xsl:value-of select="docs:author"/></td> + </tr> + + <tr> + <td>URI:</td> + <td> + <a href="{docs:uri}"> + <xsl:value-of select="docs:uri"/> + </a> + </td> + </tr> + + </table> + + </xsl:template> + + <xsl:template match="docs:header"> + + <table id="global-header"> + <tr> + <td id="context"> + <xsl:if test="bebop:dimensionalNavbar[@class = 'portalNavbar']"> + <xsl:apply-templates select="bebop:dimensionalNavbar[@class = 'portalNavbar']"/> + </xsl:if> + </td> + <td> + <table id="global-links"> + <tr> + <td style="margin: 0; border: 0; padding: 0; padding-right: 18px;"> + </td> + <td class="global-link-icon"> + <a href="{../docs:global/bebop:link[@class = 'signoutLink']/@href}"> + <img src="{$internal-theme}/images/lock.png" height="18" width="14"/> + </a> + </td> + <td class="global-link"> + <a href="{../docs:global/bebop:link[@class = 'signoutLink']/@href}"> + Sign out + </a> + </td> + </tr> + </table> + </td> + </tr> + </table> + + <table width="100%" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td bgcolor="#878175"> + <table cellspacing="0" cellpadding="0" border="0"> + <tr> + <td height="1"></td> + </tr> + </table> + </td> + </tr> + </table> + + <table class="setInside"> + <tr> + <td class="setInside"> + <table class="localHeader"> + <tr> + <td class="localTitle"> + <xsl:value-of select="../bebop:title"/> + </td> + <td class="localControl"> + <xsl:apply-templates select="bebop:link[@class = 'portalControlProfileLink']"/> + <xsl:apply-templates select="bebop:link[@class = 'portalControl']"/> + </td> + </tr> + </table> + </td> + </tr> + </table> + </xsl:template> + + <xsl:template match="docs:body"> + <table class="setInside"><tr><td class="setInside"> + + <!-- XXX once we make portal tabs generate XML just like ordinary tabs, this rule repeat can go away. --> + + <xsl:variable name="portalTabs" select="bebop:list[@class = 'portalTabs']"/> + <xsl:choose> + <xsl:when test="count($portalTabs/bebop:cell) > 1"> + <!-- + If there is only one tab in this portal, don't bother to + display it. + --> + + <table cellpadding="0" cellspacing="0" border="0" class="tabs"> + <tr valign="bottom"> + <td class="trimSpace"><xsl:text> </xsl:text></td> + <xsl:for-each select="$portalTabs/bebop:cell"> + <xsl:choose> + <xsl:when test="@selected"> + <!-- start currently active tab --> + <td class="tabBeginning"><xsl:text>  </xsl:text></td> + <td class="activeTab" nowrap="nowrap"><xsl:value-of select="bebop:portal/@title"/></td> + <td class="tabEnd"><xsl:text>  </xsl:text></td> + <td class="trimSpace"><xsl:text> </xsl:text></td> + <!-- end currently active tab --> + </xsl:when> + <xsl:otherwise> + <!-- start inactive tab --> + <td> + <table cellpadding="0" cellspacing="0" border="0"> + <tr height="3"> + <td> + <img src="{$internal-theme}/images/spacer.gif" height="3"/> + </td> + </tr> + <tr height="23"> + <td class="tabBeginningOff"><xsl:text>  </xsl:text></td> + <td class="inactiveTab" nowrap="nowrap"><xsl:apply-templates select="bebop:link"/></td> + <td class="tabEndOff"><xsl:text>  </xsl:text></td> + </tr> + </table> + <td class="trimSpace"><xsl:text> </xsl:text></td> + </td> + <!-- end inactive tab --> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <td class="trimSpace" width="100%"><xsl:text> </xsl:text></td> + </tr> + </table> + + <table class="topRuleUnderTabs"> + <tr><td></td></tr> + </table> + </xsl:when> + <xsl:when test="not(bebop:tabbedPane)"> + <table class="topRuleNoTabs"> + <tr><td></td></tr> + </table> + </xsl:when> + </xsl:choose> + + <xsl:apply-templates/> + + <!-- end of div class="setInside" --> + </td></tr></table> + + <table class="bottomRule"> + <tr><td></td></tr> + </table> + +</xsl:template> + +<xsl:template match="bebop:splitPanel"> + <table class="splitPanel"> + <xsl:if test="not(bebop:cell/bebop:label[text() = '&nbsp;'])"> + <tr> + <td colspan="3" class="splitPanelHeader"> + <table width="100%" cellspacing="4" cellpadding="0" border="0"> + <tr><td><xsl:apply-templates select="bebop:cell[1]"/></td></tr> + </table> + </td> + </tr> + <tr> + <td colspan="3" class="inactiveTabColor" height="2"> + <img src="{$internal-theme}/images/spacer.gif" height="2"/> + </td> + </tr> + </xsl:if> + <tr> + <td class="splitPanelLeft"> + <table width="100%" cellspacing="4" cellpadding="0" border="0"> + <tr><td><xsl:apply-templates select="bebop:cell[2]"/></td></tr> + </table> + </td> + <td class="inactiveTabColor" width="2"> + <img src="{$internal-theme}/images/spacer.gif" width="2"/> + </td> + <td class="splitPanelRight"> + <table width="100%" cellspacing="4" cellpadding="0" border="0"> + <tr><td><xsl:apply-templates select="bebop:cell[3]"/></td></tr> + </table> + </td> + </tr> + </table> +</xsl:template> + +<xsl:template match="bebop:tabbedPane"> + <xsl:variable name="tabs" select="bebop:tabStrip/bebop:tab"/> + + <table cellpadding="0" cellspacing="0" border="0" class="tabs"> + <tr> + <td class="trimSpace"><xsl:text> </xsl:text></td> + <xsl:for-each select="$tabs"> + <xsl:choose> + <xsl:when test="@current = 't'"> + <!-- start currently active tab --> + <td class="tabBeginning"><xsl:text>  </xsl:text></td> + <td class="activeTab" nowrap="nowrap"><xsl:value-of select="bebop:label"/></td> + <td class="tabEnd"><xsl:text>  </xsl:text></td> + <td class="trimSpace"><xsl:text> </xsl:text></td> + <!-- end currently active tab --> + </xsl:when> + <xsl:otherwise> + <!-- start inactive tab --> + <td> + <table cellpadding="0" cellspacing="0" border="0"> + <tr height="3"><td></td></tr> + <tr height="23"> + <td class="tabBeginningOff"><xsl:text>  </xsl:text></td> + <td class="inactiveTab" nowrap="nowrap"><a href="{@href}"><xsl:apply-templates select="bebop:label"/></a> + </td> + <td class="tabEndOff"><xsl:text>  </xsl:text></td> + </tr> + </table> + <td class="trimSpace"><xsl:text> </xsl:text></td> + </td> + <!-- end inactive tab --> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + <td class="trimSpace" width="100%"><xsl:text> </xsl:text></td> + </tr> + </table> + + <table class="topRuleUnderTabs"> + <tr><td></td></tr> + </table> + + <xsl:apply-templates select="bebop:currentPane/*"/> +</xsl:template> + +<xsl:template match="bebop:table" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + <table class="fancy"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + <xsl:apply-templates select="bebop:thead"/> + <xsl:apply-templates select="bebop:tbody"/> + </table> +</xsl:template> + +<xsl:template match="bebop:table[@class='plain']" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0"> + <table> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:for-each> + <xsl:apply-templates select="bebop:thead"/> + <xsl:apply-templates select="bebop:tbody"/> + </table> +</xsl:template> + +<!-- The template below overrides bebop Link.xsl action link spec so that +we can have a different image --> +<xsl:template name="bebop:actionLink" match="bebop:link[@class='actionLink']"> + <!-- Begin Image --> + + <!-- Image JavaScript --> + <script LANGUAGE="JavaScript"> + <![CDATA[ <!-- begin script ]]> + + <!-- This is ugly, but I need the whole output on one line =p --> + <![CDATA[ document.write(']]><a href="{@href}" onclick="{@onclick}"><img src="{$internal-theme}/images/action-generic.png" border="0" width="11" height="11"><xsl:attribute name="alt"><xsl:apply-templates mode="javascript-mode"/></xsl:attribute></img><![CDATA[')]]> + <![CDATA[ document.write(']]></a><![CDATA[')]]> + <![CDATA[ // end script --> ]]> + </script> + + <!-- Image No JavaScript --> + <script LANGUAGE="JavaScript"> + <![CDATA[ <!-- begin script ]]> + <![CDATA[document.write("\<!--") ]]> + <![CDATA[ // end script --> ]]> + </script> + + <a href="{@href_no_javascript}"> + <img src="{$internal-theme}/images/action-generic.png" border="0" + width="11" height="11"> + <xsl:attribute name="alt"> + <xsl:apply-templates/> + </xsl:attribute> + </img> + </a> + + <script LANGUAGE="JavaScript"> + <![CDATA[ <!-- begin script ]]> + <![CDATA[document.write("\<!--") ]]> + <![CDATA[ // end script --> ]]> + ... [truncated message content] |
From: <pb...@fe...> - 2012-04-22 16:00:54
|
Author: pboy Date: 2012-04-22 15:41:24 +0000 (Sun, 22 Apr 2012) New Revision: 2291 Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java trunk/ccm-cms/web/templates/ccm-cms/content-center/ trunk/ccm-cms/web/templates/ccm-cms/content-center/redirect.jsp Removed: trunk/ccm-cms/web/templates/ccm-cms/content-section/content-center-redirect.jsp Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.5-6.6.6.sql trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.5-6.6.6.sql trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java trunk/ccm-cms/src/com/arsdigita/cms/PublishedLink.java trunk/ccm-cms/src/com/arsdigita/cms/Service.java trunk/ccm-cms/src/com/arsdigita/cms/VersionCopier.java trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPersonBundle.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPersonContactCollection.java trunk/ccm-cms/web/themes/heirloom/packages/cms/xsl/cms-admin.xsl Log: ccm-cms publishing technique renewed and enhanced, content-center redirect.jsp now independent from the name von any content section. Added: trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql (rev 0) +++ trunk/ccm-cms/sql/ccm-cms/default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql 2012-04-22 15:41:24 UTC (rev 2291) @@ -0,0 +1,34 @@ +-- +-- Copyright (C) 2011 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 +-- +-- $Id: adjust_app_properties.sql $ + +-- ccm-cms ContentSection is now initialized as a legacy free type of +-- application. +-- Application properties as title have to be adjusted in order to make +-- XSL style sheets locatable. + + +-- Rename title from CMS Content Section to just Content Section +update application_types + set title='Content Section' + where title like 'CMS Content Section'; + +-- Adjust description +update application_types + set description='The CMS Content Section application.' + where title like 'Content Section'; \ No newline at end of file Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.5-6.6.6.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.5-6.6.6.sql 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.5-6.6.6.sql 2012-04-22 15:41:24 UTC (rev 2291) @@ -21,3 +21,4 @@ PROMPT Red Hat Enterprise CMS 6.6.5 -> 6.6.6 Upgrade Script (Oracle) @@ ../default/upgrade/6.6.5-6.6.6/remove_legacy_entries.sql +@@ ../default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql Modified: trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.5-6.6.6.sql =================================================================== --- trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.5-6.6.6.sql 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.5-6.6.6.sql 2012-04-22 15:41:24 UTC (rev 2291) @@ -24,5 +24,6 @@ begin; \i ../default/upgrade/6.6.5-6.6.6/remove_legacy_entries.sql +\i ../default/upgrade/6.6.5-6.6.6/adjust_app_properties.sql commit; Added: trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java (rev 0) +++ trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -0,0 +1,20 @@ +package com.arsdigita.cms; + +import com.arsdigita.domain.DomainObject; +import com.arsdigita.persistence.metadata.Property; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public interface AssociationCopier { + + boolean copyReverseProperty(CustomCopy source, + DomainObject target, + Property property, + DomainObject value, + ItemCopier copier); + + +} Property changes on: trunk/ccm-cms/src/com/arsdigita/cms/AssociationCopier.java ___________________________________________________________________ Added: svn:keywords + URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id Header Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSConfig.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -152,10 +152,9 @@ * Path is relative to webapp root. */ private final Parameter m_templateRootPath = - new StringParameter( - "com.arsdigita.cms.template_root_path", - Parameter.REQUIRED, - "/templates/ccm-cms/content-section"); + new StringParameter("com.arsdigita.cms.template_root_path", + Parameter.REQUIRED, + "/templates/ccm-cms/content-section"); // up to version 6.6.4 // "/packages/content-section/templates"); @@ -175,10 +174,9 @@ * specifications. Path is relative to webapp root. */ private final Parameter m_itemAdapters = - new ResourceParameter( - "com.arsdigita.cms.item_adapters", - Parameter.REQUIRED, - "/WEB-INF/resources/cms-item-adapters.xml"); + new ResourceParameter("com.arsdigita.cms.item_adapters", + Parameter.REQUIRED, + "/WEB-INF/resources/cms-item-adapters.xml"); // URL resource: protocol handler removal: END /** * Use streamlined content creation: upon item creation, Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -371,7 +371,7 @@ /** * @return the base PDL object type for this item. Child classes should - * override this method to return the correct value + * override this method to return the correct value */ @Override public String getBaseDataObjectType() { @@ -382,6 +382,7 @@ * Publicized getter method for use by metadata forms. * * @param key + * * @return */ @Override @@ -392,8 +393,7 @@ /** * Public setter method for use by metadata forms. * - * @param key - * @param value + * @param key param value */ @Override public void set(final String key, final Object value) { @@ -403,8 +403,8 @@ /** * Public add for use by metadata forms. * - * @param propertyName - * @param dobj + * @param propertyName param dobj + * * @return */ @Override @@ -415,8 +415,7 @@ /** * Public remove for use by metadata forms * - * @param propertyName - * @param dobj + * @param propertyName param dobj */ @Override public void remove(String propertyName, DomainObject dobj) { @@ -617,8 +616,7 @@ * * The item's root is the ancestor reachable through repeated * <code>getParent()</code> calls whose parent is - * <code>null</code>. This is usually a folder, but may be any - * { + * <code>null</code>. This is usually a folder, but may be any { * * @see com.arsdigita.kernel.ACSObject}. * @@ -695,6 +693,7 @@ * * @param includeSelf a * <code>boolean</code> value. + * * @return the items on the path to the root folder. */ public ItemCollection getPathInfo(boolean includeSelf) { @@ -762,8 +761,7 @@ * <code>true</code> if this item is a * <code>DRAFT</code> version. * - * @return - * <code>true</code> if this item is a + * @return < code>true</code> if this item is a * <code>DRAFT</code> version */ public boolean isDraftVersion() { @@ -801,6 +799,7 @@ * * @return the working version representation of the * <code>ContentItem</code>, possibly this item + * * @deprecated use {@link #getDraftVersion()} instead */ public ContentItem getWorkingVersion() { @@ -812,8 +811,7 @@ * <code>true</code> if this item is a * <code>PENDING</code> version. * - * @return - * <code>true</code> if + * @return < code>true</code> if * <code>this</code> is one of the pending versions */ public boolean isPendingVersion() { @@ -916,8 +914,7 @@ * <code>true</code> if this item is a * <code>LIVE</code> version. * - * @return - * <code>true</code> if + * @return < code>true</code> if * <code>this</code> is the live version */ public boolean isLiveVersion() { @@ -1068,8 +1065,7 @@ * not necessarily the live version nor is this method to be confused with * isPublished. * - * @return - * <code>true<code> if this content item has a live + * @return < code>true<code> if this content item has a live * version, or if it <em>is</em> the live version */ public boolean isLive() { @@ -1080,7 +1076,7 @@ * Makes an item live or not live. * * @param version the version which should become live, null to make the - * item non-live + * item non-live */ public void setLive(final ContentItem version) { if (s_log.isDebugEnabled()) { @@ -1143,7 +1139,7 @@ s_log.debug("Deleting old live version"); oldVersion.delete(); - PublishedLink.refreshOnUnpublish(this); + PublishedLink.refreshOnUnpublish(this); } if (parent instanceof ContentBundle || parent instanceof Folder) { @@ -1171,7 +1167,7 @@ save(); - PublishedLink.updateLiveLinks(version); + PublishedLink.updateLiveLinks(version); save(); // publish item (as template or html pages) to the file @@ -1185,9 +1181,9 @@ /** * Schedules an item for publication. * - * @param cycleDef The lifecycle definition + * @param cycleDef The lifecycle definition * @param startDate The time to schedule the start of the lifecycle. If - * null, use the current time as the start date. + * null, use the current time as the start date. * * @return the new pending version */ @@ -1545,6 +1541,7 @@ * 'non-finalness' of this method should be considered deprecated. * * @return the live version for this item + * * @see #copyServicesFrom(ContentItem) */ public ContentItem copy() { @@ -1560,10 +1557,11 @@ * associations from the copy to point to the copies of original items. <p> * NOTE: This method will save the item and all of its unpublished subitems. * - * @param newParent The new parent item for this item + * @param newParent The new parent item for this item * @param copyServices Copy services if true * * @return the new copy of the item + * * @see #copyServicesFrom(ContentItem) */ final public ContentItem copy(final ContentItem newParent, @@ -1616,6 +1614,7 @@ * language of the copy. * * @param language + * * @return */ protected ContentItem makeCopy(String language) { @@ -1644,6 +1643,7 @@ * * @param source the * <code>ContentItem</code> whose services will be copied + * * @see #copy() */ public void copyServicesFrom(final ContentItem source) { @@ -1659,7 +1659,8 @@ * subitems. * * @param cycle the lifecycle to use. A null cycle implies that a live - * version should be created. + * version should be created. + * * @return the new pending version for this item */ protected ContentItem createPendingVersion(final Lifecycle cycle) { @@ -1704,10 +1705,12 @@ } setLive(pending); + ContentBundle draftBundle = getBundle(); ContentBundle liveBundle = pending.getBundle(); - if (draftBundle != null && liveBundle != null && !liveBundle. - isLiveVersion()) { + if ((draftBundle != null) + && (liveBundle != null) + && (!liveBundle.isLiveVersion())) { draftBundle.promotePendingVersion(liveBundle); } @@ -1841,12 +1844,13 @@ * <code>false</code> to indicate that the copier should continue to handle * the association normally. * - * @param source the source CustomCopy item + * @param source the source CustomCopy item * @param property the property to copy - * @param copier a temporary class that is able to copy a child item - * correctly. + * @param copier a temporary class that is able to copy a child item + * correctly. + * * @return true if the property was copied; false to indicate that regular - * metadata-driven methods should be used to copy the property. + * metadata-driven methods should be used to copy the property. */ public boolean copyProperty(final CustomCopy source, final Property property, @@ -1882,50 +1886,53 @@ == ItemCopier.VERSION_COPY) { if (parent instanceof ContentBundle) { - ContentBundle bundle = (ContentBundle) parent; - ContentBundle liveBundle = (ContentBundle) bundle. - getPublicVersion(); + final ContentBundle bundle = (ContentBundle) parent; + final ContentBundle oldLiveBundle = + (ContentBundle) bundle.getPublicVersion(); //jensp 2012-03-07 Changes to the ContentBundle were not //published because the ContentBundle was not republished. //Moved the next lines out of the if below to enable //republishing of the ContentBundle - liveBundle = - (ContentBundle) bundle.createPendingVersion(null); - if (liveBundle == null) { - } else { - Set liveCatSet = new HashSet(); - Set draftCatSet = new HashSet(); - - CategoryCollection liveCategories = - liveBundle.getCategoryCollection(); - while (liveCategories.next()) { - liveCatSet.add(liveCategories.getCategory()); + final ContentBundle liveBundle = + (ContentBundle) bundle. + createPendingVersion(null); + /* + * if (liveBundle == null) { } else { Set liveCatSet = new + * HashSet(); Set draftCatSet = new HashSet(); + * + * CategoryCollection liveCategories = + * liveBundle.getCategoryCollection(); while + * (liveCategories.next()) { + * liveCatSet.add(liveCategories.getCategory()); } + * liveCategories.close(); + * + * CategoryCollection draftCategories = + * bundle.getCategoryCollection(); while + * (draftCategories.next()) { + * draftCatSet.add(draftCategories.getCategory()); } + * draftCategories.close(); + * + * Set catsToRemove = new HashSet(liveCatSet); + * catsToRemove.removeAll(draftCatSet); Set catsToAdd = new + * HashSet(draftCatSet); catsToAdd.removeAll(liveCatSet); + * + * Iterator removeIter = catsToRemove.iterator(); while + * (removeIter.hasNext()) { liveBundle.removeCategory( + * (Category) removeIter.next()); } Iterator addIter = + * catsToAdd.iterator(); while (addIter.hasNext()) { + * liveBundle.addCategory((Category) addIter.next()); } + * + * } + */ + if (oldLiveBundle != null) { + final ItemCollection instances = oldLiveBundle. + getInstances(); + while (instances.next()) { + liveBundle.addInstance( + instances.getContentItem()); } - liveCategories.close(); + } - CategoryCollection draftCategories = - bundle.getCategoryCollection(); - while (draftCategories.next()) { - draftCatSet.add(draftCategories.getCategory()); - } - draftCategories.close(); - - Set catsToRemove = new HashSet(liveCatSet); - catsToRemove.removeAll(draftCatSet); - Set catsToAdd = new HashSet(draftCatSet); - catsToAdd.removeAll(liveCatSet); - - Iterator removeIter = catsToRemove.iterator(); - while (removeIter.hasNext()) { - liveBundle.removeCategory( - (Category) removeIter.next()); - } - Iterator addIter = catsToAdd.iterator(); - while (addIter.hasNext()) { - liveBundle.addCategory((Category) addIter.next()); - } - - } setBundle(liveBundle); return true; } else if (parent instanceof Folder) { @@ -1953,7 +1960,7 @@ * processing of services. * * @return true to tell the object copier to stop copying services for this - * item, false otherwise + * item, false otherwise */ public boolean copyServices(ContentItem srcItem) { return false; @@ -2206,7 +2213,7 @@ * generators returned by this method will may be null. </p> * * @return A list of all extra XML Generators for lists views of this - * content item. + * content item. */ public List<ExtraXMLGenerator> getExtraListXMLGenerators() { return new ArrayList<ExtraXMLGenerator>(); Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -255,8 +255,8 @@ * it contains the static prefix (if one is configured, "ccm" by default) * and must not be used to construct an url for internal links! * - * @return The URL of the site node on which the content section is mounted. - * This URL includes the webapp context path. + * @return The URL where the content section is mounted. + * This URL includes the webapp context path. */ public String getURL() { String sURL = null; Modified: trunk/ccm-cms/src/com/arsdigita/cms/PublishedLink.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/PublishedLink.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/PublishedLink.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -34,6 +34,7 @@ import com.arsdigita.persistence.metadata.ObjectType; import com.arsdigita.persistence.metadata.Property; import com.arsdigita.util.Assert; +import com.arsdigita.util.UncheckedWrapperException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -48,9 +49,8 @@ import java.util.Set; /** - * This class represents an association between a pending or live - * ContentItem (or one of its components) and a separate top-level - * Contenttem. + * This class represents an association between a pending or live ContentItem + * (or one of its components) and a separate top-level Contenttem. * */ class PublishedLink extends DomainObject { @@ -64,7 +64,7 @@ static final String DRAFT_TARGET = "draftTarget"; static final String LINK_ATTRIBUTES = "linkAttributes"; static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.PublishedLink"; + "com.arsdigita.cms.PublishedLink"; @Override protected String getBaseDataObjectType() { @@ -72,8 +72,9 @@ } /** - * Default constructor. The contained <code>DataObject</code> is - * initialized with a new <code>DataObject</code> with an + * Default constructor. The contained + * <code>DataObject</code> is initialized with a new + * <code>DataObject</code> with an * <code>ObjectType</code> of "PublishedLink". * * @see com.arsdigita.domain.DomainObject#DomainObject(String) @@ -94,11 +95,13 @@ } /** - * Constructor. The contained <code>DataObject</code> is retrieved - * from the persistent storage mechanism with an <code>OID</code> - * specified by <i>oid</i>. + * Constructor. The contained + * <code>DataObject</code> is retrieved from the persistent storage + * mechanism with an + * <code>OID</code> specified by <i>oid</i>. * - * @param oid The <code>OID</code> for the retrieved + * @param oid The + * <code>OID</code> for the retrieved * <code>DataObject</code>. * * @see com.arsdigita.domain.DomainObject#DomainObject(OID) @@ -110,37 +113,44 @@ } /** - * Creates new PublishedLink unless one already exists for the - * specified source, target, and property + * Creates new PublishedLink unless one already exists for the specified + * source, target, and property * - * @param sourceMasterItem the top-level pending or live <code>ContentItem</code> which - * this <code>PublishedLink</code> is a component of. + * @param sourceMasterItem the top-level pending or live + * <code>ContentItem</code> which this + * <code>PublishedLink</code> is a component of. * @param linkSource the immediate source of this - * <code>PublishedLink</code>, a component of the sourceMasterItem - * (or the item itself) - * @param propertyName the Property name for this <code>PublishedLink</code> - * @param linkTarget the top-level draft <code>ContentItem</code> which - * is the target of this <code>PublishedLink</code> . + * <code>PublishedLink</code>, a component of the sourceMasterItem (or the + * item itself) + * @param propertyName the Property name for this + * <code>PublishedLink</code> + * @param linkTarget the top-level draft + * <code>ContentItem</code> which is the target of this + * <code>PublishedLink</code> . * - * @return the newly-created PublishedLink, or the existing one if - * one already exists for these items. + * @return the newly-created PublishedLink, or the existing one if one + * already exists for these items. */ static PublishedLink create(ContentItem sourceMasterItem, - DomainObject linkSource, - String propertyName, - ContentItem linkTarget, - ContentItem sourceObject) { + DomainObject linkSource, + String propertyName, + ContentItem linkTarget, + ContentItem sourceObject) { OID oid = new OID(BASE_DATA_OBJECT_TYPE); - oid.set(SOURCE_MASTER_ITEM, DomainServiceInterfaceExposer.getDataObject(sourceMasterItem)); + oid.set(SOURCE_MASTER_ITEM, DomainServiceInterfaceExposer.getDataObject( + sourceMasterItem)); oid.set(PROPERTY_NAME, propertyName); - oid.set(DRAFT_TARGET, DomainServiceInterfaceExposer.getDataObject(linkTarget)); + oid.set(DRAFT_TARGET, DomainServiceInterfaceExposer.getDataObject( + linkTarget)); // this will need to be refactored if we switch to OID link sourcess if (linkSource instanceof ACSObject) { - oid.set(PENDING_SOURCE, DomainServiceInterfaceExposer.getDataObject(linkSource)); + oid.set(PENDING_SOURCE, DomainServiceInterfaceExposer.getDataObject( + linkSource)); } else { - Assert.fail("Cannot set PublishedLink source " + linkSource + "; it is not an " - + "ACSObject"); + Assert.fail("Cannot set PublishedLink source " + linkSource + + "; it is not an " + + "ACSObject"); } PublishedLink link = null; @@ -150,14 +160,17 @@ link = new PublishedLink(SessionManager.getSession().create(oid)); } - if ((sourceObject != null) && sourceObject.getObjectType().getProperty(propertyName).isCollection()) { + if ((sourceObject != null) && sourceObject.getObjectType().getProperty( + propertyName).isCollection()) { - DataCollection coll = (DataCollection) sourceObject.get(propertyName + "@link"); + DataCollection coll = (DataCollection) sourceObject.get(propertyName + + "@link"); while (coll.next()) { DataObject linkObj = coll.getDataObject(); - if (linkTarget.getOID().equals(((DataObject) linkObj.getOID().get(propertyName)).getOID())) { + if (linkTarget.getOID().equals(((DataObject) linkObj.getOID(). + get(propertyName)).getOID())) { link.saveLinkAttributes(linkObj); coll.close(); } @@ -168,24 +181,28 @@ } /** - * Returns the top-level pending or live <code>ContentItem</code> which - * this <code>PublishedLink</code> is a component of. + * Returns the top-level pending or live + * <code>ContentItem</code> which this + * <code>PublishedLink</code> is a component of. * - * @return the top-level pending or live <code>ContentItem</code> which - * this <code>PublishedLink</code> is a component of. + * @return the top-level pending or live + * <code>ContentItem</code> which this + * <code>PublishedLink</code> is a component of. * */ ContentItem getSourceMasterItem() { final DataObject item = (DataObject) get(SOURCE_MASTER_ITEM); return item == null ? null - : (ContentItem) DomainObjectFactory.newInstance((DataObject) item); + : (ContentItem) DomainObjectFactory.newInstance((DataObject) item); } /** - * Returns the immediate source of this <code>PublishedLink</code> + * Returns the immediate source of this + * <code>PublishedLink</code> * - * @return the immediate source of this <code>PublishedLink</code> + * @return the immediate source of this + * <code>PublishedLink</code> * */ DomainObject getLinkSource() { @@ -193,13 +210,15 @@ final DataObject item = (DataObject) get(PENDING_SOURCE); return item == null ? null - : DomainObjectFactory.newInstance((DataObject) item); + : DomainObjectFactory.newInstance((DataObject) item); } /** - * Returns the Property name for this <code>PublishedLink</code> + * Returns the Property name for this + * <code>PublishedLink</code> * - * @return the Property name for this <code>PublishedLink</code> + * @return the Property name for this + * <code>PublishedLink</code> * */ String getPropertyName() { @@ -207,27 +226,29 @@ } /** - * Returns the top-level draft <code>ContentItem</code> which - * is the target of this <code>PublishedLink</code> . + * Returns the top-level draft + * <code>ContentItem</code> which is the target of this + * <code>PublishedLink</code> . * - * @return the top-level draft <code>ContentItem</code> which - * is the target of this <code>PublishedLink</code> . + * @return the top-level draft + * <code>ContentItem</code> which is the target of this + * <code>PublishedLink</code> . * */ ContentItem getLinkTarget() { final DataObject item = (DataObject) get(DRAFT_TARGET); return item == null ? null - : (ContentItem) DomainObjectFactory.newInstance((DataObject) item); + : (ContentItem) DomainObjectFactory.newInstance((DataObject) item); } /** - * Updates live associations based on PublishedLinks which either - * point <em>from</em> or <em>to</em> the given - * <code>ContentItem</code>. If both ends of the link are now - * live, the live-live association will be updated. In addition, - * for links <em>to</em> this new live item, the source of the - * link is refreshed via <code>QueueManager.queueRepublish</code>. + * Updates live associations based on PublishedLinks which either point + * <em>from</em> or <em>to</em> the given + * <code>ContentItem</code>. If both ends of the link are now live, the + * live-live association will be updated. In addition, for links <em>to</em> + * this new live item, the source of the link is refreshed via + * <code>QueueManager.queueRepublish</code>. * * @param item The item which was just published */ @@ -238,7 +259,8 @@ ContentItem draftItem = item.getDraftVersion(); DataCollection linksToItem = session.retrieve(BASE_DATA_OBJECT_TYPE); linksToItem.addEqualsFilter(DRAFT_TARGET + ".id", draftItem.getID()); - linksToItem.addEqualsFilter(SOURCE_MASTER_ITEM + "." + ContentItem.VERSION, ContentItem.LIVE); + linksToItem.addEqualsFilter(SOURCE_MASTER_ITEM + "." + + ContentItem.VERSION, ContentItem.LIVE); updateLiveLinksFromCollection(linksToItem, itemsToRefresh); linksToItem.close(); @@ -250,14 +272,16 @@ Iterator refreshIterator = itemsToRefresh.iterator(); while (refreshIterator.hasNext()) { OID oid = (OID) refreshIterator.next(); - ContentItem refreshItem = (ContentItem) DomainObjectFactory.newInstance(oid); + ContentItem refreshItem = (ContentItem) DomainObjectFactory. + newInstance(oid); if (refreshItem.canPublishToFS()) { QueueManager.queueRepublish(refreshItem); } } } - private static void updateLiveLinksFromCollection(DataCollection coll, Set itemsToRefresh) { + private static void updateLiveLinksFromCollection(DataCollection coll, + Set itemsToRefresh) { while (coll.next()) { // will change w/ OID references DataObject master = (DataObject) coll.get(SOURCE_MASTER_ITEM); @@ -272,7 +296,8 @@ DataObject target = null; DataObject draftTarget = (DataObject) coll.get(DRAFT_TARGET); DataAssociationCursor targetVersions = - ((DataAssociation) draftTarget.get(ContentItem.VERSIONS)).cursor(); + ((DataAssociation) draftTarget.get( + ContentItem.VERSIONS)).cursor(); targetVersions.addEqualsFilter(ContentItem.VERSION, ContentItem.LIVE); if (targetVersions.next()) { target = targetVersions.getDataObject(); @@ -281,7 +306,8 @@ if (target != null) { ObjectType ot = src.getObjectType(); Property prop = ot.getProperty(propertyName); - Assert.exists(prop, propertyName + " for type " + ot.getQualifiedName() + ", ID: " + src.get("id")); + Assert.exists(prop, propertyName + " for type " + ot. + getQualifiedName() + ", ID: " + src.get("id")); if (prop.isCollection()) { DataAssociation da = (DataAssociation) src.get(propertyName); setLinkAttributesForLiveLink(da.add(target), linkAttributes); @@ -297,8 +323,8 @@ } /** - * At unpublish time, for links <em>to</em> this unpublished item, - * the source of the link is refreshed via + * At unpublish time, for links <em>to</em> this unpublished item, the + * source of the link is refreshed via * <code>QueueManager.queueRepublish</code>. * * @param item The item which was just published @@ -309,7 +335,8 @@ DataCollection linksToItem = session.retrieve(BASE_DATA_OBJECT_TYPE); linksToItem.addEqualsFilter(DRAFT_TARGET + ".id", item.getID()); - linksToItem.addEqualsFilter(SOURCE_MASTER_ITEM + "." + ContentItem.VERSION, ContentItem.LIVE); + linksToItem.addEqualsFilter(SOURCE_MASTER_ITEM + "." + + ContentItem.VERSION, ContentItem.LIVE); while (linksToItem.next()) { // will change w/ OID references DataObject master = (DataObject) linksToItem.get(SOURCE_MASTER_ITEM); @@ -320,7 +347,8 @@ Iterator refreshIterator = itemsToRefresh.iterator(); while (refreshIterator.hasNext()) { OID oid = (OID) refreshIterator.next(); - ContentItem refreshItem = (ContentItem) DomainObjectFactory.newInstance(oid); + ContentItem refreshItem = (ContentItem) DomainObjectFactory. + newInstance(oid); if (refreshItem.canPublishToFS()) { QueueManager.queueRepublish(refreshItem); } @@ -351,13 +379,15 @@ ObjectOutputStream out = new ObjectOutputStream(data); out.writeObject(linkAttributes); } catch (IOException ex) { + throw new UncheckedWrapperException(ex); } set(LINK_ATTRIBUTES, data.toByteArray()); } } - private static void setLinkAttributesForLiveLink(DataObject link, byte[] linkAttributes) { + private static void setLinkAttributesForLiveLink(DataObject link, + byte[] linkAttributes) { if (linkAttributes != null) { ByteArrayInputStream data = null; @@ -386,7 +416,8 @@ String propertyName = (String) keys.next(); Object value = (Object) attributes.get(propertyName); - if (link.getObjectType().hasDeclaredProperty(propertyName) && link.getSession() != null) { + if (link.getObjectType().hasDeclaredProperty(propertyName) + && link.getSession() != null) { link.set(propertyName, value); } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/Service.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -45,6 +45,7 @@ */ public class Service extends Application { + /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(Service.class); // pdl stuff (constants) Modified: trunk/ccm-cms/src/com/arsdigita/cms/VersionCopier.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/VersionCopier.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/VersionCopier.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -30,9 +30,10 @@ import java.util.HashSet; /** - * Extends <code>ObjectCopier</code> to create a live version for an - * item. Clones the item, making sure that live versions of all subitems - * point only to other live versions. + * Extends + * <code>ObjectCopier</code> to create a live version for an item. Clones the + * item, making sure that live versions of all subitems point only to other live + * versions. * * @author <a href="mailto:sfr...@ar...">Stanislav Freidin</a> * @version $Id$ @@ -47,7 +48,8 @@ private OID m_topLevelSourceOID = null; /** - * Creates a new <code>VersionCopier</code> with a given Lifecycle + * Creates a new + * <code>VersionCopier</code> with a given Lifecycle * * @param lifecycle The Lifecycle */ @@ -57,7 +59,8 @@ } /** - * Creates a new <code>VersionCopier</code> with no Lifecycle + * Creates a new + * <code>VersionCopier</code> with no Lifecycle */ VersionCopier() { m_traversedComponents = new HashSet(); @@ -65,14 +68,13 @@ } /** - * Copy a {@link ContentItem}, along with all of its component - * sub-objects, and return the copy. Note that the categories to - * which the source item belongs are not automatically transferred - * to the copy; the user must call {@link #copyServices(ContentItem, - * ContentItem)} in order to transfer the categories and other - * services. + * Copy a {@link ContentItem}, along with all of its component sub-objects, + * and return the copy. Note that the categories to which the source item + * belongs are not automatically transferred to the copy; the user must call {@link #copyServices(ContentItem, + * ContentItem)} in order to transfer the categories and other services. * * @param item the item to be copied + * * @return a copy of the item */ @Override @@ -126,11 +128,12 @@ } /** - * Kicks off the copying process. Creates a copy by value of - * <code>source</code> and then traverses its associations and - * repeats the process. + * Kicks off the copying process. Creates a copy by value of + * <code>source</code> and then traverses its associations and repeats the + * process. * - * @param source the <code>DomainObject</code> from which to copy + * @param source the + * <code>DomainObject</code> from which to copy */ @Override public DomainObject copy(final DomainObject object) { @@ -141,36 +144,33 @@ } /** - * Copies properties. This method is called from {@link - * #copy(DomainObject)} for each property of the object being - * copied. + * Copies properties. This method is called from {@link + * #copy(DomainObject)} for each property of the object being copied. * - * Copying behavior depends on the following: - * <dl> - * <dt> <code>object instanceof ContentItem && prop.isComponent()</code></dt> - * <dd> Copy ContentItem recursively, setting the version attribute, etc.</dd> - * <dt> <code>object instanceof ContentItem && + * Copying behavior depends on the following: <dl> <dt> + * <code>object instanceof ContentItem && prop.isComponent()</code></dt> + * <dd> Copy ContentItem recursively, setting the version attribute, + * etc.</dd> <dt> + * <code>object instanceof ContentItem && * !prop.isComponent() (and target is an already-traversed - * component of the top-level item )</code></dt> - * <dd> Return reference to already-created copy of this item</dd> - * <dt> <code>object instanceof ContentItem && + * component of the top-level item )</code></dt> <dd> Return reference to + * already-created copy of this item</dd> <dt> + * <code>object instanceof ContentItem && * !prop.isComponent() && prop.isRequired (and target is not an already-traversed - * component of the top-level item )</code></dt> - * <dd> Assert failure: required top-level item associations are - * not allowed here.</dd> - * <dt> <code>object instanceof ContentItem && + * component of the top-level item )</code></dt> <dd> Assert failure: + * required top-level item associations are not allowed here.</dd> <dt> + * <code>object instanceof ContentItem && * !prop.isComponent() && !prop.isRequired (and target is not an already-traversed - * component of the top-level item )</code></dt> - * <dd> Create PublishedLink for association; return null</dd> - * <dt> <code>!object instanceof ContentItem </code></dt> - * <dd> object is not a ContentItem, rely on default DomainCopier - * behavior</dd> - * </dl> + * component of the top-level item )</code></dt> <dd> Create PublishedLink + * for association; return null</dd> <dt> + * <code>!object instanceof ContentItem </code></dt> <dd> object is not a + * ContentItem, rely on default DomainCopier behavior</dd> </dl> * - * @param source the <code>DomainObject</code> being copied + * @param source the + * <code>DomainObject</code> being copied * @param target the new copy - * @param prop the <code>Property</code> currently under - * consideration + * @param prop the + * <code>Property</code> currently under consideration */ @Override protected DomainObject copy(final DomainObject source, @@ -197,6 +197,8 @@ item.assertDraft(); } + + if (prop.isComponent()) { s_log.debug("The property is a component; creating a " + "live or pending version"); @@ -221,13 +223,19 @@ + "PublishedLink for the item"); if (source instanceof ContentItem) { - PublishedLink.create((ContentItem) getCopy( - m_topLevelSourceOID), target, prop.getName(), item, - (ContentItem) source); + PublishedLink.create( + (ContentItem) getCopy(m_topLevelSourceOID), + target, + prop.getName(), + item, + (ContentItem) source); } else { - PublishedLink.create((ContentItem) getCopy( - m_topLevelSourceOID), target, prop.getName(), item, - null); + PublishedLink.create( + (ContentItem) getCopy(m_topLevelSourceOID), + target, + prop.getName(), + item, + null); } m_trace.exit("copy", null); Modified: trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -96,7 +96,9 @@ requireTrailingSlash(""); /** Set Template base path for JSP's */ - m_templatePath = ContentSection.getConfig().getTemplateRoot(); + // ToDo: Make it configurable by an appropriate config registry entry! +// m_templatePath = CMS.getConfig().getTemplateRoot(); + m_templatePath = "/templates/ccm-cms/content-center"; Assert.exists(m_templatePath, String.class); Assert.isTrue(m_templatePath.startsWith("/"), "template-path must start with '/'"); @@ -139,15 +141,20 @@ } // Check user access. - checkUserAccess(sreq, sresp); + // checkUserAccess(sreq, sresp); ResourceHandler page = getResource(url); if ( page != null ) { + + // Check user access. + checkUserAccess(sreq, sresp); // Serve the page. page.init(); page.dispatch(sreq, sresp, ctx); } else { // Fall back on the JSP application dispatcher. + // NOTE: The JSP must ensure the proper authentication and + // authorisation if required! if (s_log.isInfoEnabled()) { s_log.info("NO page registered to serve the requst url."); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -39,27 +39,31 @@ RelationAttributeInterface { private static final Logger logger = Logger.getLogger(GenericContact.class); - /** PDL property names */ + /** + * PDL property names + */ public static final String PERSON = "person"; // public static final String CONTACT_TYPE = ""; public static final String ADDRESS = "address"; public static final String CONTACT_ENTRIES = "contactentries"; - public static final String CONTACTS_KEY = GenericPersonContactCollection.CONTACTS_KEY; - - private static final String RELATION_ATTRIBUTES = "person.link_key:GenericContactTypes;contactentries.key:GenericContactEntryKeys"; - + public static final String CONTACTS_KEY = + GenericPersonContactCollection.CONTACTS_KEY; + private static final String RELATION_ATTRIBUTES = + "person.link_key:GenericContactTypes;contactentries.key:GenericContactEntryKeys"; // Config private static final GenericContactConfig s_config = - new GenericContactConfig(); + new GenericContactConfig(); static { logger.debug("Static initializer is starting..."); s_config.load(); logger.debug("Static initializer finished"); } - /** Data object type for this domain object */ + /** + * Data object type for this domain object + */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.GenericContact"; + "com.arsdigita.cms.contenttypes.GenericContact"; public GenericContact() { super(BASE_DATA_OBJECT_TYPE); @@ -81,7 +85,7 @@ public GenericContact(String type) { super(type); - //unsetPerson(); + //unsetPerson(); } @Override @@ -90,7 +94,7 @@ Assert.exists(getContentType(), ContentType.class); } - + /** * Retrieves the current configuration */ @@ -101,47 +105,43 @@ public GenericContactBundle getGenericContactBundle() { return (GenericContactBundle) getContentBundle(); } - + /////////////////////////////////////////////////////////////// // accessors // Get the person for this contact public GenericPerson getPerson() { - /*DataCollection collection; + /* + * DataCollection collection; + * + * collection = (DataCollection) get(PERSON); + * + * if (collection.size() == 0) { return null; } else { DataObject dobj; + * + * collection.next(); dobj = collection.getDataObject(); + * + * // Close Collection to prevent an open ResultSet collection.close(); + * + * return (GenericPerson) DomainObjectFactory.newInstance(dobj); + } + */ - collection = (DataCollection) get(PERSON); - - if (collection.size() == 0) { - return null; - } else { - DataObject dobj; - - collection.next(); - dobj = collection.getDataObject(); - - // Close Collection to prevent an open ResultSet - collection.close(); - - return (GenericPerson) DomainObjectFactory.newInstance(dobj); - }*/ - return getGenericContactBundle().getPerson(); } // Set the person for this contact public void setPerson(GenericPerson person, String contactType) { //set(PERSON, person); - /*if (getPerson() != null) { - unsetPerson(); + /* + * if (getPerson() != null) { unsetPerson(); } + * + * if (person != null) { Assert.exists(person, GenericPerson.class); + * DataObject link = add(PERSON, person); + * link.set(GenericPerson.CONTACTS_KEY, contactType); + * link.set(GenericPerson.CONTACTS_ORDER, new + * BigDecimal(person.getContacts().size())); link.save(); } + */ - if (person != null) { - Assert.exists(person, GenericPerson.class); - DataObject link = add(PERSON, person); - link.set(GenericPerson.CONTACTS_KEY, contactType); - link.set(GenericPerson.CONTACTS_ORDER, new BigDecimal(person.getContacts().size())); - link.save(); - }*/ - getGenericContactBundle().setPerson(person, contactType); } @@ -157,12 +157,12 @@ // Unset the address for this contact public void unsetPerson() { //set(PERSON, null); - /*GenericPerson oldPerson; - oldPerson = getPerson(); - if (oldPerson != null) { - remove(PERSON, oldPerson); - }*/ - + /* + * GenericPerson oldPerson; oldPerson = getPerson(); if (oldPerson != + * null) { remove(PERSON, oldPerson); + } + */ + getGenericContactBundle().unsetPerson(); } @@ -204,8 +204,8 @@ GenericPerson person = getPerson(); - if(person != null) { - GenericPersonContactCollection collection = person.getContacts(); + if (person != null) { + GenericPersonContactCollection collection = person.getContacts(); collection.next(); String contactType = (String) collection.getContactType(); @@ -221,8 +221,8 @@ public void setContactType(String contactType) { GenericPerson person = getPerson(); - if(person != null) { - GenericPersonContactCollection collection = person.getContacts(); + if (person != null) { + GenericPersonContactCollection collection = person.getContacts(); collection.next(); DataObject link = (DataObject) collection.get("link"); link.set(CONTACTS_KEY, contactType); @@ -249,9 +249,9 @@ @Override public boolean hasRelationAttributeProperty(String propertyName) { StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";"); - while(strTok.hasMoreTokens()) { + while (strTok.hasMoreTokens()) { String token = strTok.nextToken(); - if(token.startsWith(propertyName + ".")) { + if (token.startsWith(propertyName + ".")) { return true; } } @@ -266,10 +266,11 @@ @Override public String getRelationAttributeKeyName(String propertyName) { StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";"); - while(strTok.hasMoreTokens()) { + while (strTok.hasMoreTokens()) { String token = strTok.nextToken(); - if(token.startsWith(propertyName + ".")) { - return token.substring(token.indexOf(".") + 1, token.indexOf(":")); + if (token.startsWith(propertyName + ".")) { + return token.substring(token.indexOf(".") + 1, + token.indexOf(":")); } } return null; @@ -278,9 +279,9 @@ @Override public String getRelationAttributeName(String propertyName) { StringTokenizer strTok = new StringTokenizer(RELATION_ATTRIBUTES, ";"); - while(strTok.hasMoreTokens()) { + while (strTok.hasMoreTokens()) { String token = strTok.nextToken(); - if(token.startsWith(propertyName + ".")) { + if (token.startsWith(propertyName + ".")) { return token.substring(token.indexOf(":") + 1); } } @@ -291,5 +292,4 @@ public String getRelationAttributeKey(String propertyName) { return null; } - } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactBundle.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -2,11 +2,14 @@ import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.CustomCopy; +import com.arsdigita.cms.ItemCopier; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.metadata.Property; import com.arsdigita.util.Assert; import java.math.BigDecimal; @@ -15,7 +18,8 @@ * @author Jens Pelzetter * @version $Id$ */ -public class GenericContactBundle extends ContentBundle { +public class GenericContactBundle + extends ContentBundle { public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.GenericContactBundle"; @@ -30,27 +34,86 @@ setContentType(primary.getContentType()); addInstance(primary); - super.setName(primary.getName()); + super.setName(primary.getName()); } public GenericContactBundle(final OID oid) throws DataObjectNotFoundException { - super(oid); + super(oid); } public GenericContactBundle(final BigDecimal id) throws DataObjectNotFoundException { - super(new OID(BASE_DATA_OBJECT_TYPE, id)); + super(new OID(BASE_DATA_OBJECT_TYPE, id)); } public GenericContactBundle(final DataObject dobj) { - super(dobj); + super(dobj); } public GenericContactBundle(final String type) { super(type); } + + /** + * <p> Copy association properties. These are for example the associations + * between GenericPerson and GenericContact, or between + * GenericOrganizationalUnit and GenericPerson. </p> + * + * @param source param property param copier + * @param property + * @param copier + * + * @return + */ + @Override + public boolean copyProperty(final CustomCopy source, + final Property property, + final ItemCopier copier) { + final String attribute = property.getName(); + if (copier.getCopyType() == ItemCopier.VERSION_COPY) { + final GenericContactBundle contactBundle = + (GenericContactBundle) source; + if (PERSON.equals(attribute)) { + + final DataCollection persons = (DataCollection) contactBundle. + get(PERSON); + + while (persons.next()) { + createPersonAssoc(persons); + } + + return true; + } else { + return super.copyProperty(source, property, copier); + } + } else { + return super.copyProperty(source, property, copier); + } + } + + private void createPersonAssoc(final DataCollection persons) { + final GenericPersonBundle draftPerson = + (GenericPersonBundle) DomainObjectFactory. + newInstance( + persons.getDataObject()); + final GenericPersonBundle livePerson = + (GenericPersonBundle) draftPerson. + getLiveVersion(); + + if (livePerson != null) { + final DataObject link = add(PERSON, livePerson); + + link.set(GenericPerson.CONTACTS_KEY, + persons.get(GenericPersonContactCollection.CONTACTS_KEY)); + link.set(GenericPerson.CONTACTS_ORDER, + persons.get(GenericPersonContactCollection.CONTACTS_ORDER)); + + link.save(); + } + } + public GenericPerson getPerson() { DataCollection collection; @@ -90,7 +153,7 @@ } } - public void unsetPerson() { + public void unsetPerson() { GenericPerson oldPerson; oldPerson = getPerson(); if (oldPerson != null) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -429,7 +429,8 @@ try { conn.rollback(); } catch (SQLException ex1) { - System.out.println("Rollback failed."); + System.err.println("Rollback failed."); + ex1.printStackTrace(System.err); } } @@ -437,7 +438,7 @@ try { conn.close(); } catch (SQLException ex) { - System.err.println("Failed to close JDBC connectio."); + System.err.println("Failed to close JDBC connection."); printStackTrace(ex); } } Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-03-11 09:49:19 UTC (rev 2290) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java 2012-04-22 15:41:24 UTC (rev 2291) @@ -18,19 +18,18 @@ */ pack... [truncated message content] |
From: <pb...@fe...> - 2012-03-11 09:49:32
|
Author: pboy Date: 2012-03-11 09:49:19 +0000 (Sun, 11 Mar 2012) New Revision: 2290 Modified: trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/ArticleSection.pdl trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ArticleSection.java trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/ImageUploadSection.java trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionEditForm.java trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java Log: Fixed publishing / republishing, UI improvement: module MPA deprecated Images Asset replaced by ReusableImageAsset. Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentItem.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -184,6 +184,7 @@ * @author Jack Chung * @author Michael Pih * @author Stanislav Freidin <sfr...@re...> + * @author Jens Pelzetter * * @version $Id$ */ @@ -440,7 +441,8 @@ } } - /* * + /* + * * * removed cg - object observer sets context based on parent whenever parent * is updated * @@ -616,8 +618,10 @@ * The item's root is the ancestor reachable through repeated * <code>getParent()</code> calls whose parent is * <code>null</code>. This is usually a folder, but may be any - * {@see com.arsdigita.kernel.ACSObject}. + * { * + * @see com.arsdigita.kernel.ACSObject}. + * * Note that the name of the root folder of the content section where the * item resides is not included in the path. * @@ -1881,9 +1885,13 @@ ContentBundle bundle = (ContentBundle) parent; ContentBundle liveBundle = (ContentBundle) bundle. getPublicVersion(); + //jensp 2012-03-07 Changes to the ContentBundle were not + //published because the ContentBundle was not republished. + //Moved the next lines out of the if below to enable + //republishing of the ContentBundle + liveBundle = + (ContentBundle) bundle.createPendingVersion(null); if (liveBundle == null) { - liveBundle = - (ContentBundle) bundle.createPendingVersion(null); } else { Set liveCatSet = new HashSet(); Set draftCatSet = new HashSet(); @@ -2197,8 +2205,8 @@ * {@link #getExtraXMLGenerators()}. But beware: The page state passed to * generators returned by this method will may be null. </p> * - * @return A list of all extra XML Generators for lists views of - * this content item. + * @return A list of all extra XML Generators for lists views of this + * content item. */ public List<ExtraXMLGenerator> getExtraListXMLGenerators() { return new ArrayList<ExtraXMLGenerator>(); Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactAddressPropertiesStep.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -69,11 +69,11 @@ localize(), new EditAddressWorkflowLockedComponentAccess( reattachAddressSheet, itemModel), reattachAddressSheet. getSaveCancelSection().getCancelButton()); - add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil. + /*add(EDIT_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil. globalize("cms.contenttypes.ui.contact.edit_address").localize(), new EditAddressWorkflowLockedComponentAccess(editAddressSheet, itemModel), - editAddressSheet.getSaveCancelSection().getCancelButton()); + editAddressSheet.getSaveCancelSection().getCancelButton());*/ add(DELETE_ADDRESS_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.contact.delete_address").localize(), Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -44,6 +44,7 @@ import com.arsdigita.cms.CMS; import com.arsdigita.cms.CMSConfig; import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.Workspace; @@ -304,7 +305,7 @@ newInstance(OID.valueOf(itemOid)); PublishLock.getInstance().lock(item); republish(item, false); - PublishLock.getInstance().unlock(item); + PublishLock.getInstance().unlock(item); } } } @@ -593,7 +594,7 @@ private void doRepublish() { final ContentItem item = (ContentItem) DomainObjectFactory. newInstance(OID.valueOf(itemOid)); - republish(item, false); + republish(item, false); } public void run() { @@ -623,7 +624,7 @@ private void doRepublishAndReset() { final ContentItem item = (ContentItem) DomainObjectFactory. newInstance(OID.valueOf(itemOid)); - republish(item, true); + republish(item, true); } public void run() { Modified: trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/ArticleSection.pdl =================================================================== --- trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/ArticleSection.pdl 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms-types-mparticle/pdl/com/arsdigita/content-types/ArticleSection.pdl 2012-03-11 09:49:19 UTC (rev 2290) @@ -21,7 +21,7 @@ import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.TextAsset; -import com.arsdigita.cms.ImageAsset; +import com.arsdigita.cms.ReusableImageAsset; // object type to hold sections for multi-part article content type @@ -32,8 +32,8 @@ component TextAsset[0..1] text = join ct_mp_sections.text to cms_text.text_id; - component ImageAsset[0..1] image = join ct_mp_sections.image - to cms_images.image_id; + component ReusableImageAsset[0..1] image = join ct_mp_sections.image + to cms_images.image_id; reference key (ct_mp_sections.section_id); } Modified: trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ArticleSection.java =================================================================== --- trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ArticleSection.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ArticleSection.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -18,22 +18,16 @@ */ package com.arsdigita.cms.contenttypes; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ImageAsset; -import com.arsdigita.cms.TextAsset; -import com.arsdigita.kernel.ACSObject; +import com.arsdigita.cms.*; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.ACSObject; import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; - +import java.math.BigDecimal; import org.apache.log4j.Logger; -import java.math.BigDecimal; - /** * Represents a section within a MultiPartArticle * @@ -63,7 +57,7 @@ * * @param id the id of the object to retrieve */ - public ArticleSection(BigDecimal id) + public ArticleSection(BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } @@ -73,7 +67,7 @@ * * @param id the id of the object to retrieve */ - public ArticleSection(OID id) + public ArticleSection(OID id) throws DataObjectNotFoundException { super(id); } @@ -100,7 +94,7 @@ } /** Accessor. Get this item's rank in the set of ArticleSections */ - + public Integer getRank() { return (Integer)get(RANK); } @@ -109,7 +103,7 @@ public void setRank(Integer rank) { set(RANK, rank); - } + } public MultiPartArticle getMPArticle() { DataObject obj = (DataObject) get( MP_ARTICLE ); @@ -130,21 +124,21 @@ } /** Accessor. Get the image associated with this item. */ - public ImageAsset getImage() { + public ReusableImageAsset getImage() { if ( get(IMAGE) == null ) { return null; } - return new ImageAsset((DataObject)get(IMAGE)); + return new ReusableImageAsset((DataObject)get(IMAGE)); } /** Mutator. Set the image associated with this item. */ - public void setImage(ImageAsset image) { + public void setImage(ReusableImageAsset image) { setAssociation(IMAGE, image); } public void initialize() { super.initialize(); - + if (isNew()) { set(PAGE_BREAK, Boolean.FALSE); } @@ -160,30 +154,30 @@ /** * Depending on config parameter, either return the title - * of the section - * + * of the section + * * OR - * - * return the title of the section at the top of the + * + * return the title of the section at the top of the * page on which the current section appears unless - * the whole multipart article appears on one page, + * the whole multipart article appears on one page, * in which case null is returned. */ public String getPageTitle() { - + if (MultiPartArticle.getConfig().useSectionTitle()) { return getTitle(); } - + s_log.debug("retrieve pageTitle for section " + getTitle() + " ranked " + getRank()); MultiPartArticle parent = getMPArticle(); - - // is this a single page article? either page break on last section, + + // is this a single page article? either page break on last section, // or no page breaks - - + + // boolean argument means order by rank ascending - no argument - // currently means ascending, but specify here in case that + // currently means ascending, but specify here in case that // changes ArticleSectionCollection sections = parent.getSections(true); sections.addEqualsFilter(PAGE_BREAK, Boolean.TRUE); @@ -195,36 +189,36 @@ sections.close(); int lastSection = parent.getMaxRank(); s_log.debug("last section of article is ranked " + lastSection); - + if (firstPageBreak == null || firstPageBreak.intValue() == lastSection) { s_log.debug("this is a single page article"); return null; } else { s_log.debug("this article has more than one page"); } - + // okay - this article has more than one page - lets find the page break // before this section and then the section following that page break // boolean argument means order by rank descending - + sections = parent.getSections(false); sections.addEqualsFilter(PAGE_BREAK, Boolean.TRUE); sections.addFilter( sections.getFilterFactory().lessThan(RANK, getRank(), true)); - + Integer topOfPageRank = new Integer(1); if (sections.next()) { topOfPageRank = new Integer(sections.getArticleSection().getRank().intValue() + 1); - s_log.debug("Found top of page rank: " + s_log.debug("Found top of page rank: " + topOfPageRank.intValue()); } else { - // If no page breaks before this section then we must be on + // If no page breaks before this section then we must be on // page one. s_log.debug("This section is on first page."); } sections.close(); - - // Get 'clean' + + // Get 'clean' sections = parent.getSections(false); sections.addEqualsFilter(RANK, topOfPageRank); String sectionTitle= null; @@ -232,10 +226,10 @@ sectionTitle = sections.getArticleSection().getTitle(); s_log.debug("Found page/section title: " + sectionTitle); } - + return sectionTitle; } - + /** * As sections don't have their own summary, return the parent's search * summary. @@ -269,7 +263,7 @@ /** * This overrides the method on ContentItem, the API of which * says that this method can return a null eg. if the method is - * called on an Article's ImageAsset. + * called on an Article's ReusableImageAsset. * * However there seems to be a problem with ArticleSections returning * null when they shouldn't. If that happens we are going to look up the Modified: trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/ImageUploadSection.java =================================================================== --- trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/ImageUploadSection.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/ImageUploadSection.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -29,8 +29,8 @@ import com.arsdigita.bebop.form.FileUpload; import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.form.TextField; -import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.ReusableImageAsset; import com.arsdigita.cms.ui.ImageDisplay; import com.arsdigita.cms.contenttypes.util.MPArticleGlobalizationUtil; import com.arsdigita.dispatcher.MultipartHttpServletRequest; @@ -61,7 +61,7 @@ * * @param panel the panel used to lay out the components */ - public ImageUploadSection(String name, + public ImageUploadSection(String name, ItemSelectionModel selImage, Container panel) { super(panel); @@ -76,7 +76,7 @@ add(m_currentImage); add(m_imageDisplay); m_spacer = new Label(""); - add(m_spacer); + add(m_spacer); m_deleteImage = new Submit("Delete Image"); add(m_deleteImage); add(new Label( @@ -113,7 +113,7 @@ FormData data = event.getFormData(); PageState state = event.getPageState(); - ImageAsset image = (ImageAsset)m_selImage.getSelectedObject(state); + ReusableImageAsset image = (ReusableImageAsset)m_selImage.getSelectedObject(state); m_currentImage.setVisible(state, false); m_imageDisplay.setVisible(state, false); @@ -162,16 +162,16 @@ * Process the image upload. Should be called form the form * process listener. */ - public ImageAsset processImageUpload(FormSectionEvent event) { - ImageAsset a = null; + public ReusableImageAsset processImageUpload(FormSectionEvent event) { + ReusableImageAsset a = null; FormData data = event.getFormData(); File image = getImage(event); if ( image != null ) { try { - a = new ImageAsset(); - a.loadFromFile(getImageFilename(event), image, ImageAsset.MIME_JPEG); + a = new ReusableImageAsset(); + a.loadFromFile(getImageFilename(event), image, ReusableImageAsset.MIME_JPEG); a.setDescription((String)data.get(m_name + CAPTION)); } catch ( Exception ex ) { log.error("Could not load " + getImageFilename(event)); Modified: trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionEditForm.java =================================================================== --- trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionEditForm.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-cms-types-mparticle/src/com/arsdigita/cms/contenttypes/ui/mparticle/SectionEditForm.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -37,7 +37,7 @@ import com.arsdigita.bebop.parameters.BigDecimalParameter; import com.arsdigita.bebop.parameters.NotNullValidationListener; import com.arsdigita.bebop.parameters.TrimmedStringParameter; -import com.arsdigita.cms.ImageAsset; +import com.arsdigita.cms.ReusableImageAsset; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.TextAsset; import com.arsdigita.cms.contenttypes.ArticleSection; @@ -109,8 +109,8 @@ m_container = container; m_imageParam = new BigDecimalParameter(IMAGE_PARAM); - m_selImage = new ItemSelectionModel(ImageAsset.class.getName(), - ImageAsset.BASE_DATA_OBJECT_TYPE, + m_selImage = new ItemSelectionModel(ReusableImageAsset.class.getName(), + ReusableImageAsset.BASE_DATA_OBJECT_TYPE, m_imageParam); m_textParam = new BigDecimalParameter(TEXT_PARAM); @@ -168,7 +168,7 @@ add(new Label(MPArticleGlobalizationUtil .globalize("cms.contenttypes.ui.mparticle.body_text")), ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); - CMSDHTMLEditor textWidget = + CMSDHTMLEditor textWidget = new CMSDHTMLEditor(new TrimmedStringParameter(TEXT)); textWidget.setRows(40); textWidget.setCols(70); @@ -177,7 +177,7 @@ ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH); add(new Label(MPArticleGlobalizationUtil - .globalize("cms.contenttypes.ui.mparticle.image")), + .globalize("cms.contenttypes.ui.mparticle.image")), ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); m_imageUpload = new ImageUploadSection("image", m_selImage); @@ -195,43 +195,43 @@ * into the form fields. */ private class SectionInitListener implements FormInitListener { - public void init( FormSectionEvent event ) + public void init( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); m_selImage.setSelectedObject(state, null); m_selText.setSelectedObject(state,null); - - + + if ( m_selSection.getSelectedKey(state) != null ) { BigDecimal id = new BigDecimal(m_selSection .getSelectedKey(state).toString()); try { // retrieve the selected Section from the persistence layer ArticleSection section = new ArticleSection(id); - + data.put(TITLE, section.getTitle()); - + TextAsset t = section.getText(); if ( t != null ) { m_selText.setSelectedObject(state, t); data.put(TEXT, t.getText()); } - - ImageAsset img = section.getImage(); + + ReusableImageAsset img = section.getImage(); if (img != null) { m_selImage.setSelectedObject(state, img); } - + if (section.isPageBreak()) { data.put(PAGE_BREAK, new Object[] { "true" }); } - + } catch ( DataObjectNotFoundException ex ) { log.error("Section(" + id + ") could not be found"); } } - + // Wait until the image selection model is updated before // initializing the image section m_imageUpload.initImageUpload(event); @@ -244,10 +244,10 @@ * cancel button. If they did, don't continue with the form. */ private class SectionSubmissionListener implements FormSubmissionListener { - public void submitted( FormSectionEvent event ) + public void submitted( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); - + if ( m_saveCancelSection.getCancelButton() .isSelected(state) && m_container != null) { m_container.onlyShowComponent( @@ -267,7 +267,7 @@ } catch ( DataObjectNotFoundException ex ) { log.error("Section(" + id + ") could not be found"); } - + } } } @@ -277,52 +277,52 @@ * assign it to the current MultiPartArticle. */ private class SectionProcessListener implements FormProcessListener { - public void process( FormSectionEvent event ) + public void process( FormSectionEvent event ) throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); - + // retrieve the current MultiPartArticle BigDecimal id = new BigDecimal( m_selArticle.getSelectedKey(state).toString()); MultiPartArticle article = null; - + try { article = new MultiPartArticle(id); } catch ( DataObjectNotFoundException ex ) { throw new UncheckedWrapperException(ex); } - - + + // get the selected section to update or create a new one ArticleSection section = (ArticleSection) m_selSection.getSelectedObject(state); if ( section == null ) { - section = createSection(event, article); + section = createSection(event, article); article.addSection(section); } - + section.setTitle((String)data.get(TITLE)); - + Object[] pageBreakVal = (Object[])data.get(PAGE_BREAK); boolean pageBreak; - if (pageBreakVal == null || - pageBreakVal.length == 0 || + if (pageBreakVal == null || + pageBreakVal.length == 0 || !"true".equals(pageBreakVal[0])) { pageBreak = false; } else { pageBreak = true; } section.setPageBreak(pageBreak); - + // get the image asset - ImageAsset imageAsset = m_imageUpload.processImageUpload(event); - if ( imageAsset != null ) { - section.setImage(imageAsset); - m_selImage.setSelectedObject(state, imageAsset); + ReusableImageAsset reusableImageAsset = m_imageUpload.processImageUpload(event); + if ( reusableImageAsset != null ) { + section.setImage(reusableImageAsset); + m_selImage.setSelectedObject(state, reusableImageAsset); } - - + + // get the text asset TextAsset textAsset = (TextAsset)m_selText.getSelectedObject(state); if ( textAsset == null ) { @@ -331,27 +331,27 @@ m_selText.setSelectedObject(state, textAsset); section.setText(textAsset); } - + String text = (String)data.get(TEXT); if ( text == null ) { text = ""; } - + textAsset.setText(text); if ( m_container != null) { m_container.onlyShowComponent( - state, + state, MultiPartArticleViewSections.SECTION_TABLE+ m_container.getTypeIDStr()); } } } - - + + /** * Utility method to create a Section from the form data supplied. */ - protected ArticleSection createSection(FormSectionEvent event, + protected ArticleSection createSection(FormSectionEvent event, MultiPartArticle article) { PageState state = event.getPageState(); Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java 2012-03-11 09:45:10 UTC (rev 2289) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainObjectFactory.java 2012-03-11 09:49:19 UTC (rev 2290) @@ -34,34 +34,31 @@ import org.apache.log4j.Logger; /** - * This is a factory class to support instantiation of an appropriate - * domain object class from a given data object. - * <p> - * The architecture of the persistence and domain layers intentionally - * does not impose a simple one-to-one correspondence between data object - * types and domain object classes. It is possible for multiple domain - * object classes to encapsulate a given data object. It is also possible - * that a single domain object class can encapsulate data objects of - * different types. The primary factory design objectives are: + * This is a factory class to support instantiation of an appropriate domain + * object class from a given data object. <p> The architecture of the + * persistence and domain layers intentionally does not impose a simple + * one-to-one correspondence between data object types and domain object + * classes. It is possible for multiple domain object classes to encapsulate a + * given data object. It is also possible that a single domain object class can + * encapsulate data objects of different types. The primary factory design + * objectives are: * - * <ol> - * <li> It should be easy for developers to produce a domain object from - * a given data object when it cannot be determined at compile time - * which domain object class should be instantiated. + * <ol> <li> It should be easy for developers to produce a domain object from a + * given data object when it cannot be determined at compile time which domain + * object class should be instantiated. * - * <li> The process of instantiating a domain object given a data object - * should be as flexible as possible by delegating to custom code, called - * a <code>DomainObjectInstantiator</code>, that can make use of any - * properties of the given data object. + * <li> The process of instantiating a domain object given a data object should + * be as flexible as possible by delegating to custom code, called a + * <code>DomainObjectInstantiator</code>, that can make use of any properties of + * the given data object. * - * <li> A data object of type X is not supported by the factory - * unless some <code>DomainObjectInstantiator</code> has been registered - * with the factory for type X, and even then, it may be possible for - * the instantiator code to examine other properties of the data object - * and decide that the given data object is not supported (presumably - * because there is no sensible way to choose which domain object class - * should be instantiated for the particular data object). - * </ol> + * <li> A data object of type X is not supported by the factory unless some + * <code>DomainObjectInstantiator</code> has been registered with the factory + * for type X, and even then, it may be possible for the instantiator code to + * examine other properties of the data object and decide that the given data + * object is not supported (presumably because there is no sensible way to + * choose which domain object class should be instantiated for the particular + * data object). </ol> * * @see DomainObjectInstantiator * @see com.arsdigita.persistence.DataObject @@ -70,35 +67,42 @@ * @author Oumi Mehrotra * @version 1.0 * @version $Id$ - **/ + * + */ public class DomainObjectFactory { - /** map of registered instantiators, keyed by data object type. */ + /** + * map of registered instantiators, keyed by data object type. + */ private static Map s_instantiators = new HashMap(); + /** + * private logger instance. + */ + private static final Logger s_log = Logger.getLogger( + DomainObjectFactory.class); - /** private logger instance. */ - private static final Logger s_log = Logger.getLogger(DomainObjectFactory.class); - /** * Instantiates a domain object given a data object. * * <p>The process of instantiating the domain object involves delegating to - * a {@link DomainObjectInstantiator}. The instantiator may use any + * a {@link DomainObjectInstantiator}. The instantiator may use any * information about the DataObject to produce the appropriate domain * object.</p> - * + * * <p>The result may be null if there is no instantiator registered for the - * dataObjectType of the specified <code>dataObject</code>, OR if the registered - * instantiator does not support instantiation of the specified + * dataObjectType of the specified + * <code>dataObject</code>, OR if the registered instantiator does not + * support instantiation of the specified * <code>dataObject</code>.</p> * - * @param dataObject The data object from which to instantiate - * a domain object. + * @param dataObject The data object from which to instantiate a domain + * object. * - * @return A domain object that encapuslates the given dataObject. Returns - * <code>null</code>, if called with the <code>null</code> data object - * parameter. The result may also be <code>null</code> if no domain object - * could be instantiated for the given data object. + * @return A domain object that encapuslates the given dataObject. Returns + * <code>null</code>, if called with the + * <code>null</code> data object parameter. The result may also be + * <code>null</code> if no domain object could be instantiated for the given + * data object. * * @throws InstantiatorNotFoundException if no Instantiator could be found * @throws PersistenceException @@ -109,28 +113,34 @@ public static DomainObject newInstance(DataObject dataObject) throws PersistenceException, InstantiatorNotFoundException { - if ( dataObject == null ) { return null; } + if (dataObject == null) { + return null; + } if (s_log.isInfoEnabled()) { s_log.info("Instantiating " + dataObject.getOID()); } - /* A instantiator may delegate to another instantiator depending on the - data object. That other instantiator may in turn delegate to - a different instantiator, and so on. We get the final instantiator - by recursed calls to resolveInstantiator until the returned - instantiator doesn't change. */ + /* + * A instantiator may delegate to another instantiator depending on the + * data object. That other instantiator may in turn delegate to a + * different instantiator, and so on. We get the final instantiator by + * recursed calls to resolveInstantiator until the returned instantiator + * doesn't change. + */ DomainObjectInstantiator delegator = null; DomainObjectInstantiator delegate = - getInstantiator(dataObject.getObjectType()); + getInstantiator(dataObject.getObjectType()); if (s_log.isDebugEnabled()) { s_log.debug("Initial delegate " + delegate); } - /* keep calling resolveInstantiator until the result doesn't change */ - while (delegate!=null && delegate != delegator) { + /* + * keep calling resolveInstantiator until the result doesn't change + */ + while (delegate != null && delegate != delegator) { delegator = delegate; delegate = delegator.resolveInstantiator(dataObject); if (s_log.isDebugEnabled()) { @@ -139,9 +149,8 @@ } if (delegate == null) { - throw new InstantiatorNotFoundException ( - "No instantiator found for dataObject " + dataObject - ); + throw new InstantiatorNotFoundException( + "No instantiator found for dataObject " + dataObject); } if (s_log.isDebugEnabled()) { @@ -151,14 +160,14 @@ } /** - * Instantiate a domain object given an OID. This method is a wrapper - * around newInstance(DataObject). + * Instantiate a domain object given an OID. This method is a wrapper around + * newInstance(DataObject). * - * @param oid the oid of the data object for which to instantiate - * a domain object. + * @param oid the oid of the data object for which to instantiate a domain + * object. * - * @return A domain object that encapuslates the dataObject identified - * by <i>oid</i>. The result may be null if no domain object could be + * @return A domain object that encapuslates the dataObject identified by + * <i>oid</i>. The result may be null if no domain object could be * instantiated for the specified data object. * * @throws DataObjectNotFoundException if object could not be retrieved. @@ -168,23 +177,24 @@ * @see DomainObject */ public static DomainObject newInstance(OID oid) - throws InstantiatorNotFoundException { + throws InstantiatorNotFoundException { - if ( oid == null ) { return null; } + if (oid == null) { + return null; + } Session session = SessionManager.getSession(); if (session == null) { - throw new RuntimeException("Could not retrieve a session from " + - "the session manager while instantiating " + - "a class with OID = " + oid.toString()); + throw new RuntimeException("Could not retrieve a session from " + + "the session manager while instantiating " + + "a class with OID = " + oid.toString()); } - DataObject dataObject=session.retrieve(oid); + DataObject dataObject = session.retrieve(oid); if (dataObject == null) { - throw new DataObjectNotFoundException - ("Could not retrieve a DataObject with " + - "OID = " + oid.toString()); + throw new DataObjectNotFoundException("Could not retrieve a DataObject with " + + "OID = " + oid.toString()); } return newInstance(dataObject); @@ -192,28 +202,27 @@ } /** - * Register an instantiator for the data object type specified - * by <i>dataObjectType</i>. The registered instantiator will be - * used by newInstance() for data objects whose type is equal to - * the type specified by <i>dataObjectType</i>. That is, - * when <code>newInstance(x)</code> is executued, the specified - * <i>instantiator</i> will be used if the specified - * <i>dataObjectType</i> is equal to <code>x.getObjectType()</code>. + * Register an instantiator for the data object type specified by + * <i>dataObjectType</i>. The registered instantiator will be used by + * newInstance() for data objects whose type is equal to the type specified + * by <i>dataObjectType</i>. That is, when + * <code>newInstance(x)</code> is executued, the specified + * <i>instantiator</i> will be used if the specified <i>dataObjectType</i> + * is equal to + * <code>x.getObjectType()</code>. * - * <p> - * Any object type that does not have an instantiator registered with + * <p> Any object type that does not have an instantiator registered with * this factory is not supported by the factory. * - * <p> - * If another instantiator was already registered for the specified + * <p> If another instantiator was already registered for the specified * object type, the previous instantiator is replaced and returned. * - * @param dataObjectType The data object type for which to register - * the instantiator specified by <i>instantiator</i> + * @param dataObjectType The data object type for which to register the + * instantiator specified by <i>instantiator</i> * - * @param instantiator The instantiator that will handle data objects - * of the data object type specified by <i>dataObjectType</i> when - * newInstance() is called. + * @param instantiator The instantiator that will handle data objects of the + * data object type specified by <i>dataObjectType</i> when newInstance() is + * called. * * @pre dataObjectType!= null * @@ -227,16 +236,15 @@ * @see com.arsdigita.persistence.DataObject * @see DomainObject */ - public synchronized static DomainObjectInstantiator - registerInstantiator(ObjectType dataObjectType, - DomainObjectInstantiator instantiator) - { + public synchronized static DomainObjectInstantiator registerInstantiator( + ObjectType dataObjectType, + DomainObjectInstantiator instantiator) { if (null == dataObjectType) { throw new InstantiatorRegistryException("null", instantiator); } - return (DomainObjectInstantiator) - s_instantiators.put(dataObjectType, instantiator); + return (DomainObjectInstantiator) s_instantiators.put(dataObjectType, + instantiator); } /** @@ -244,26 +252,27 @@ * <code>registerInstantiator(ObjectType, DomainObjectInstantiator)</code>. * * @param dataObjectType The fully qualified name of the data object type - * for which to register the specified <i>instantiator</i>. - * The qualified name is the model name followed by a '.' - * followed by the object type name (e.g. "com.arsdigita.kernel.Party"). + * for which to register the specified <i>instantiator</i>. The qualified + * name is the model name followed by a '.' followed by the object type name + * (e.g. "com.arsdigita.kernel.Party"). * - * @param instantiator The instantiator that will handle data objects - * of the type specified by <i>typeName</i> when this newInstance() is - * called. + * @param instantiator The instantiator that will handle data objects of the + * type specified by <i>typeName</i> when this newInstance() is called. * - * @pre SessionManager.getMetadataRoot().getObjectType(dataObjectType) != null + * @pre SessionManager.getMetadataRoot().getObjectType(dataObjectType) != + * null * * @return DomainObjectInstantiator The previous instantiator that was * registered with this factory for this object type. * - * @throws InstantiatorRegistryException if the dataObjectType does not exist + * @throws InstantiatorRegistryException if the dataObjectType does not + * exist * * @see #registerInstantiator(ObjectType, DomainObjectInstantiator) */ public static DomainObjectInstantiator registerInstantiator( - String dataObjectType, - DomainObjectInstantiator instantiator) { + String dataObjectType, + DomainObjectInstantiator instantiator) { MetadataRoot meta = SessionManager.getMetadataRoot(); ObjectType objectType = meta.getObjectType(dataObjectType); @@ -276,21 +285,19 @@ /** * Get the registered instantiator for the specified object type. * - * @param dataObjectType The data object type whose registered - * instantiator is to be returned + * @param dataObjectType The data object type whose registered instantiator + * is to be returned * * @return The instantiator that is registered for the specified object * type. * * @see #registerInstantiator(ObjectType,DomainObjectInstantiator) */ - public synchronized static DomainObjectInstantiator - getRegisteredInstantiator(ObjectType dataObjectType) - { + public synchronized static DomainObjectInstantiator getRegisteredInstantiator( + ObjectType dataObjectType) { return (DomainObjectInstantiator) s_instantiators.get(dataObjectType); } - /** * Wrapper around getRegisteredInstantiator(ObjectType). * @@ -298,54 +305,52 @@ * whose registered instantiator is to be returned * * @return The instantiator that is registered for the specified object - * type. The qualified name is the model name followed by a '.' - * followed by the object type name (e.g. "com.arsdigita.kernel.Party"). + * type. The qualified name is the model name followed by a '.' followed by + * the object type name (e.g. "com.arsdigita.kernel.Party"). * * @see #getRegisteredInstantiator(ObjectType) * @see #registerInstantiator(ObjectType,DomainObjectInstantiator) */ - public synchronized static DomainObjectInstantiator - getRegisteredInstantiator(String dataObjectType) - { + public synchronized static DomainObjectInstantiator getRegisteredInstantiator( + String dataObjectType) { MetadataRoot meta = SessionManager.getMetadataRoot(); return getRegisteredInstantiator(meta.getObjectType(dataObjectType)); } - /** - * Get the registered or inherited instantiator for the specified - * object type. That is, get the instantiator that is registered - * for the specified object type or its closest supertype that has - * a registered instantiator (or null if there is no supertype that - * has a registered instantiator). + * Get the registered or inherited instantiator for the specified object + * type. That is, get the instantiator that is registered for the specified + * object type or its closest supertype that has a registered instantiator + * (or null if there is no supertype that has a registered instantiator). * - * @param dataObjectType The data object type whose registered or - * inherited instantiator is to be returned + * @param dataObjectType The data object type whose registered or inherited + * instantiator is to be returned * - * @return The registered or inherited instantiator for the specified - * object type. + * @return The registered or inherited instantiator for the specified object + * type. * * @see #registerInstantiator(ObjectType,DomainObjectInstantiator) */ - public synchronized static DomainObjectInstantiator - getInstantiator(ObjectType dataObjectType) - { + public synchronized static DomainObjectInstantiator getInstantiator( + ObjectType dataObjectType) { ObjectType type = dataObjectType; if (s_log.isDebugEnabled()) { s_log.debug("Initial type " + (type == null ? null : type.getName())); } - while (type!=null && !s_instantiators.containsKey(type)) { + while (type != null && !s_instantiators.containsKey(type)) { type = type.getSupertype(); if (s_log.isDebugEnabled()) { - s_log.debug("Parent type " + (type == null ? null : type.getName())); + s_log.debug("Parent type " + (type == null ? null + : type.getName())); } } if (s_log.isDebugEnabled()) { s_log.debug("Final type " + (type == null ? null : type.getName())); } if (type != null) { - DomainObjectInstantiator instantiator = (DomainObjectInstantiator) - s_instantiators.get(type); + DomainObjectInstantiator instantiator = + (DomainObjectInstantiator) s_instantiators. + get(type); if (s_log.isDebugEnabled()) { s_log.debug("Found instantiator " + instantiator); } @@ -361,26 +366,23 @@ * @param dataObjectType The fully qualified name of the data object type * whose registered or inherited instantiator is to be returned * - * @return The registered or inherited instantiator for the specified - * object type. The qualified name is the model name followed by a '.' - * followed by the object type name (e.g. "com.arsdigita.kernel.Party"). + * @return The registered or inherited instantiator for the specified object + * type. The qualified name is the model name followed by a '.' followed by + * the object type name (e.g. "com.arsdigita.kernel.Party"). * * @see #getInstantiator(ObjectType) * @see #registerInstantiator(ObjectType,DomainObjectInstantiator) */ - public synchronized static DomainObjectInstantiator - getInstantiator(String dataObjectType) - { + public synchronized static DomainObjectInstantiator getInstantiator( + String dataObjectType) { MetadataRoot meta = SessionManager.getMetadataRoot(); return getInstantiator(meta.getObjectType(dataObjectType)); } /** - * Package scope method for clearing the factory of registered instantiators. - * <P> - * It is ONLY for use by Domain TestCases. - * <P> - * If you use this method outside that context, YOU WILL BE FLOGGED!! + * Package scope method for clearing the factory of registered + * instantiators. <P> It is ONLY for use by Domain TestCases. <P> If you use + * this method outside that context, YOU WILL BE FLOGGED!! */ static synchronized void resetFactory() { s_instantiators = new HashMap(); |
Author: pboy Date: 2012-03-11 09:45:10 +0000 (Sun, 11 Mar 2012) New Revision: 2289 Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java trunk/ccm-bookmarks/web/WEB-INF/ trunk/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Loader.java trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/ trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/ trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/6.6.0-6.6.1/ trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/6.6.0-6.6.1/drop_app_table.sql trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/6.6.0-6.6.1/upd_cms_tables.sql trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-ldn-search/sql/ccm-ldn-search/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-ldn-search/src/ccm-ldn-search.upgrade trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchWorkerServlet.java.nolongerInUse Removed: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchWorkerServlet.java Modified: trunk/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java trunk/ccm-bookmarks/src/ccm-bookmarks.load trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java trunk/ccm-bundle/bundles/demo/cfg/integration.properties trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml trunk/ccm-bundle/bundles/devel/cfg/integration.properties trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java trunk/ccm-core/src/com/arsdigita/domain/DomainObject.java trunk/ccm-core/src/com/arsdigita/portal/PortletType.java trunk/ccm-core/src/com/arsdigita/portal/apportlet/AppPortlet.java trunk/ccm-core/src/com/arsdigita/portal/apportlet/AppPortletType.java trunk/ccm-core/src/com/arsdigita/ui/admin/Admin.java trunk/ccm-core/src/com/arsdigita/ui/admin/AdminServlet.java trunk/ccm-docmgr/application.xml trunk/ccm-docmgr/src/ccm-docmgr.config trunk/ccm-docmgr/src/ccm-docmgr.load trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/DocFolder.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/installer/Initializer.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/ui/DocmgrBasePage.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DocrepoBasePage.java trunk/ccm-formbuilder-pdf/src/com/arsdigita/formbuilder/pdf/Converter.java trunk/ccm-formbuilder-pdf/src/com/arsdigita/formbuilder/pdf/Initializer.java trunk/ccm-formbuilder-pdf/src/com/arsdigita/formbuilder/pdf/Loader.java trunk/ccm-formbuilder-pdf/src/com/arsdigita/formbuilder/pdf/PDFConfig.java trunk/ccm-formbuilder-pdf/web/WEB-INF/web.ccm-formbuilder-pdf.xml trunk/ccm-ldn-aplaws/bundles/custom/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/extended/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/extended/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/standard/cfg/integration.properties trunk/ccm-ldn-aplaws/bundles/standard/cfg/web.xml trunk/ccm-ldn-search/application.xml trunk/ccm-ldn-search/pdl/com/arsdigita/london/search/Search.pdl trunk/ccm-ldn-search/src/com/arsdigita/london/search/Initializer.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/Loader.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/RemoteSearcher.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/Search.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchConfig.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/SearchJobQueue.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/SponsoredLink.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/spider/DocumentManager.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/spider/Scheduler.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/SimpleQueryComponent.java trunk/ccm-ldn-search/src/com/arsdigita/london/search/ui/SimpleSearchPane.java trunk/ccm-ldn-search/web/WEB-INF/web.ccm-ldn-search.xml trunk/ccm-ldn-search/web/templates/ccm-ldn-search/index.jsp trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSiteServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml trunk/ccm-themedirector/src/com/arsdigita/themedirector/Initializer.java Log: Modules ccm-ldn-search, ccm-http-auth, ccm-bookmarks now legacy free types of applications. Update scripts required but not yet provided. Module ccm-ldn-search now number of remote background scripts 0 by default (i.e. deactivating remote search), because it is only seldom used. Modified: trunk/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl =================================================================== --- trunk/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-auth-http/pdl/com/arsdigita/auth/http/HTTPAuth.pdl 2012-03-11 09:45:10 UTC (rev 2289) @@ -20,5 +20,6 @@ import com.arsdigita.web.Application; object type HTTPAuth extends Application { - reference key (auth_http.application_id); + // reference key (auth_http.application_id); + // nothing to store here } Modified: trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java =================================================================== --- trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-auth-http/src/com/arsdigita/auth/http/Loader.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -18,33 +18,31 @@ package com.arsdigita.auth.http; -import com.arsdigita.loader.PackageLoader; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.User; - +import com.arsdigita.loader.PackageLoader; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.SessionManager; - import com.arsdigita.runtime.ScriptContext; - import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; - import com.arsdigita.web.ApplicationType; import com.arsdigita.web.Application; import org.apache.log4j.Logger; /** - * Loads the HTTP Auth application and type + * <p>Executes nonrecurring at install time and loads (installs and initializes) + * the HTTP Auth application and type persistently into database.</p> * * @author Daniel Berrange * @version $Id$ */ public class Loader extends PackageLoader { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger(Loader.class); private StringParameter m_adminEmail = new StringParameter @@ -53,40 +51,77 @@ ("auth.http.admin_identifier", Parameter.REQUIRED, null); + /** + * Constructor registers parameters + */ public Loader() { + register(m_adminEmail); register(m_adminIdent); + loadInfo(); + } + + /** + * + * @param ctx + */ public void run(final ScriptContext ctx) { new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); + setupAdministrator(); setupHTTPAuth(); } }.run(); } + /** + * Loads HTTPAuth type as a legacy free type of application and + * instantiates a (single) default instance. + */ private void setupHTTPAuth() { +/* ApplicationType type = ApplicationType .createApplicationType("auth-http", "CCM HTTP Authentication Admin", HTTPAuth.BASE_DATA_OBJECT_TYPE); +*/ + + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Auth HTTP" will become "auth-http". */ + ApplicationType type = new ApplicationType("Auth HTTP", + HTTPAuth.BASE_DATA_OBJECT_TYPE ); + type.setDescription("CCM HTTP authentication administration"); + type.save(); Application admin = Application.retrieveApplicationForPath("/admin/"); - Application app = - Application.createApplication(type, - "auth-http", - "CCM HTTP Authentication Admin", - admin); + Application app = Application + .createApplication(type, + "auth-http", + "CCM HTTP Authentication Admin", + admin); + app.save(); } + /** + * + */ private void setupAdministrator() { - DataCollection coll = SessionManager.getSession().retrieve - ( User.BASE_DATA_OBJECT_TYPE ); + + s_log.warn("Administrator eMail is retrieved as: " + getAdminEmail()); + + DataCollection coll = SessionManager.getSession() + .retrieve(User.BASE_DATA_OBJECT_TYPE); coll.addEqualsFilter( "primaryEmail", getAdminEmail() ); if (!coll.next()) { @@ -98,6 +133,7 @@ User admin = User.retrieve( coll.getDataObject() ); coll.close(); + s_log.warn("Administrator is retrieved as: " + admin); UserLogin login = UserLogin.findByUser(admin); if (login == null) { @@ -106,10 +142,18 @@ } } + /** + * + * @return + */ private String getAdminEmail() { return (String) get(m_adminEmail); } + /** + * + * @return + */ private String getAdminIdentifier() { return (String) get(m_adminIdent); } Modified: trunk/ccm-bookmarks/src/ccm-bookmarks.load =================================================================== --- trunk/ccm-bookmarks/src/ccm-bookmarks.load 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/ccm-bookmarks.load 2012-03-11 09:45:10 UTC (rev 2289) @@ -9,5 +9,6 @@ </provides> <scripts> <schema directory="ccm-bookmarks"/> + <data class="com.arsdigita.bookmarks.Loader"/> </scripts> </load> Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmark.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -28,16 +28,15 @@ import java.math.BigDecimal; /** - * A bookmark. + * Represents a single bookmark. * * @author Jim Parsons - * */ public class Bookmark extends ACSObject { private static final int SORT_KEY_JUMP = 10; - private BookmarkApplication m_bmrkapp = null; + private Bookmarks m_bmrkapp = null; /** * The type of the {@link com.arsdigita.persistence.DataObject} @@ -45,7 +44,7 @@ * com.arsdigita.domain.DomainObject}. */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.Bookmark"; + "com.arsdigita.workspace.Bookmark"; protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; @@ -105,17 +104,17 @@ return Bookmark.retrieveBookmark(dataObject); } - public BookmarkApplication getBookmarkApplication() { + public Bookmarks getBookmarkApplication() { if(m_bmrkapp == null) { DataObject bmrkdata = (DataObject)get("bookmarkapp"); if(bmrkdata != null) { - m_bmrkapp = new BookmarkApplication(bmrkdata); + m_bmrkapp = new Bookmarks(bmrkdata); } } return m_bmrkapp; } - public void setBookmarkApplication(BookmarkApplication bmrkapp) { + public void setBookmarkApplication(Bookmarks bmrkapp) { m_bmrkapp = bmrkapp; setAssociation("bookmarkapp",bmrkapp); } Deleted: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkApplication.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. - * - * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html - * - * 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.bookmarks; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.DataAssociation; -import com.arsdigita.persistence.PersistenceException; -import com.arsdigita.web.Application; - -import java.math.BigDecimal; - -/** - * BookmarkApplication class. - * - * @author dennis - * @version $Id: BookmarkApplication.java#3 2003/07/10 14:47:30 $ - */ -public class BookmarkApplication extends Application { - - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.BookmarkApplication"; - - private static final int SORT_KEY_JUMP = 10; - - protected String getBaseDataObjectType() { - return BASE_DATA_OBJECT_TYPE; - } - private static final org.apache.log4j.Logger log = - org.apache.log4j.Logger.getLogger(BookmarkApplication.class); - - public BookmarkApplication(OID oid) throws DataObjectNotFoundException { - super(oid); - } - - public BookmarkApplication(BigDecimal key) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, key)); - } - - public BookmarkApplication(DataObject dataObject) { - super(dataObject); - } - - /** - * Use this instead of the constructor to create new Bookmark - * Application objects - */ - public static BookmarkApplication create(String urlName, String title, - Application parent) { - return (BookmarkApplication) Application.createApplication - (BASE_DATA_OBJECT_TYPE, urlName, title, parent); - } - - public Bookmark createBookmark(String name, String URLString) { - - Bookmark bmrk = new Bookmark(name,URLString); - bmrk.setBookmarkApplication(this); - return bmrk; - } - - public void removeBookmark(Bookmark bmrk) { - remove("bookmarks", bmrk); - } - - public BookmarkCollection getBookmarks() { - DataAssociation bmrksdata = (DataAssociation)get("bookmarks"); - BookmarkCollection bmrks = - new BookmarkCollection(bmrksdata.getDataCollection()); - bmrks.addOrder("sortKey"); - return bmrks; - } - - public void swapBookmarkWithPrevious(Bookmark b) throws PersistenceException { - int newKey = b.getSortKey() - (SORT_KEY_JUMP + 1); - b.setSortKey(newKey); - - b.save(); - - normalizeBookmarkSortKeys(); - } - - public void swapBookmarkWithNext(Bookmark b) throws PersistenceException { - int newKey = b.getSortKey() + (SORT_KEY_JUMP + 1); - b.setSortKey(newKey); - - b.save(); - - normalizeBookmarkSortKeys(); - } - - public void normalizeBookmarkSortKeys() { - Bookmark b; - - BookmarkCollection bColl = getBookmarks(); - - for (int index = SORT_KEY_JUMP; bColl.next(); index += SORT_KEY_JUMP) { - b = bColl.getBookmark(); - b.setSortKey(index); - b.save(); - } - } -} Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkCollection.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -24,8 +24,8 @@ /** + * Represents a collection of single bookmarks * - * */ public class BookmarkCollection extends DomainCollection { Deleted: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarkDispatcher.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. - * - * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html - * - * 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.bookmarks; - -import com.arsdigita.bookmarks.ui.BookmarkEditPane; -import com.arsdigita.bookmarks.ui.BookmarkBasePage; - -import com.arsdigita.bebop.page.BebopMapDispatcher; -import com.arsdigita.bebop.Page; - -import java.util.HashMap; -import java.util.Map; -import org.apache.log4j.Logger; - -/** - * Bookmark dispatcher for both Bebop-backed and other URLs. - * - * @author Jim Parsons - */ - -public class BookmarkDispatcher extends BebopMapDispatcher { - - - private static final Logger s_log = - Logger.getLogger(BookmarkDispatcher.class); - - public BookmarkDispatcher() { - super(); - - Map m = new HashMap(); - - Page index = buildIndexPage(); - - m.put("", index); - - setMap(m); - } - - private Page buildIndexPage() { - BookmarkBasePage p = new BookmarkBasePage(); - - p.addRequestListener(new ApplicationAuthenticationListener("admin")); - p.getBody().add(new BookmarkEditPane()); - - p.lock(); - return p; - } - - -} Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.bookmarks; + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.persistence.DataAssociation; +import com.arsdigita.persistence.PersistenceException; +import com.arsdigita.web.Application; + +import java.math.BigDecimal; + +/** + * Bookmarks application domain class. + * Central entry point into the bookmarks application. + * @author dennis + * @version $Id: Bookmarks.java#3 2003/07/10 14:47:30 $ + */ +public class Bookmarks extends Application { + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.workspace.BookmarkApplication"; + + private static final int SORT_KEY_JUMP = 10; + + @Override + protected String getBaseDataObjectType() { + return BASE_DATA_OBJECT_TYPE; + } + private static final org.apache.log4j.Logger log = + org.apache.log4j.Logger.getLogger(Bookmarks.class); + + public Bookmarks(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public Bookmarks(BigDecimal key) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, key)); + } + + public Bookmarks(DataObject dataObject) { + super(dataObject); + } + + /** + * Use this instead of the constructor to create new Bookmark + * Application objects + */ + public static Bookmarks create(String urlName, String title, + Application parent) { + return (Bookmarks) Application.createApplication + (BASE_DATA_OBJECT_TYPE, urlName, title, parent); + } + + public Bookmark createBookmark(String name, String URLString) { + + Bookmark bmrk = new Bookmark(name,URLString); + bmrk.setBookmarkApplication(this); + return bmrk; + } + + public void removeBookmark(Bookmark bmrk) { + remove("bookmarks", bmrk); + } + + public BookmarkCollection getBookmarks() { + DataAssociation bmrksdata = (DataAssociation)get("bookmarks"); + BookmarkCollection bmrks = + new BookmarkCollection(bmrksdata.getDataCollection()); + bmrks.addOrder("sortKey"); + return bmrks; + } + + public void swapBookmarkWithPrevious(Bookmark b) throws PersistenceException { + int newKey = b.getSortKey() - (SORT_KEY_JUMP + 1); + b.setSortKey(newKey); + + b.save(); + + normalizeBookmarkSortKeys(); + } + + public void swapBookmarkWithNext(Bookmark b) throws PersistenceException { + int newKey = b.getSortKey() + (SORT_KEY_JUMP + 1); + b.setSortKey(newKey); + + b.save(); + + normalizeBookmarkSortKeys(); + } + + public void normalizeBookmarkSortKeys() { + Bookmark b; + + BookmarkCollection bColl = getBookmarks(); + + for (int index = SORT_KEY_JUMP; bColl.next(); index += SORT_KEY_JUMP) { + b = bColl.getBookmark(); + b.setSortKey(index); + b.save(); + } + } + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended for versions newer + * than 1.0.4) you may use a standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>bookmarks</servlet-name> + * <servlet-class>com.arsdigita.bookmarks.BookmarksServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>bookmarks</servlet-name> + * <url-pattern>/bookmarks/*</url-pattern> + * </servlet-mapping> + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/bookmarks/"; + } + +} Property changes on: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Bookmarks.java ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse 2012-03-11 09:45:10 UTC (rev 2289) @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved. + * + * The contents of this file are subject to the CCM 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.redhat.com/licenses/ccmpl.html + * + * 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.bookmarks; + +import com.arsdigita.bookmarks.ui.BookmarkEditPane; +import com.arsdigita.bookmarks.ui.BookmarkBasePage; + +import com.arsdigita.bebop.page.BebopMapDispatcher; +import com.arsdigita.bebop.Page; + +import java.util.HashMap; +import java.util.Map; +import org.apache.log4j.Logger; + +/** + * Bookmark dispatcher for both Bebop-backed and other URLs. + * + * @author Jim Parsons + */ + +public class BookmarksDispatcher extends BebopMapDispatcher { + + + private static final Logger s_log = + Logger.getLogger(BookmarksDispatcher.class); + + public BookmarksDispatcher() { + super(); + + Map m = new HashMap(); + + Page index = buildIndexPage(); + + m.put("", index); + + setMap(m); + } + + private Page buildIndexPage() { + BookmarkBasePage p = new BookmarkBasePage(); + + p.addRequestListener(new ApplicationAuthenticationListener("admin")); + p.getBody().add(new BookmarkEditPane()); + + p.lock(); + return p; + } + + +} Property changes on: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksDispatcher.java.nolongerInUse ___________________________________________________________________ Added: svn:executable + Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/BookmarksServlet.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2012 Peter Boy <pb...@ze...> 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.bookmarks; + +import com.arsdigita.bebop.Page; +import com.arsdigita.bookmarks.ui.BookmarkBasePage; +import com.arsdigita.bookmarks.ui.BookmarkEditPane; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.templating.Templating; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; +import com.arsdigita.xml.Document; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + + +/** + * Web Developer Support Application Servlet class, central entry point to + * create and process the applications UI. + * + * We should have subclassed BebopApplicationServlet but couldn't overwrite + * doService() method to add permission checking. So we use our own page + * mapping. The general logic is the same as for BebopApplicationServlet. + * {@see com.arsdigita.bebop.page.BebopApplicationServlet} + * + * @author pb + */ +public class BookmarksServlet extends BaseApplicationServlet { + + /** Logger instance for debugging */ + private static final Logger s_log = Logger.getLogger(BookmarksServlet.class); + + private Page adminPage; + + /** + * User extension point, overwrite this method to setup a URL - page mapping + * + * @throws ServletException + */ + @Override + public void doInit() throws ServletException { + + adminPage = buildAdminPage(); + + } + + + /** + * Central service method, checks for required permission, determines the + * requested page and passes the page object to PresentationManager. + */ + public final void doService(HttpServletRequest sreq, + HttpServletResponse sresp, + Application app) + throws ServletException, IOException { + + if (adminPage != null) { + + final Document doc = adminPage.buildDocument(sreq, sresp); + + PresentationManager pm = Templating.getPresentationManager(); + pm.servePage(doc, sreq, sresp); + + } else { + + sresp.sendError(404, "No such page."); + + } + + } + + /** + * + * @return + */ + private Page buildAdminPage() { + + BookmarkBasePage p = new BookmarkBasePage(); + + p.addRequestListener(new ApplicationAuthenticationListener("admin")); + p.getBody().add(new BookmarkEditPane()); + + p.lock(); + + return p; + } + + +} Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -18,46 +18,34 @@ package com.arsdigita.bookmarks; +import com.arsdigita.bookmarks.ui.BookmarkPortlet; import com.arsdigita.db.DbHelper; import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.persistence.SessionManager; -// unused import com.arsdigita.persistence.OID; -import com.arsdigita.web.*; import com.arsdigita.kernel.*; -// unused import com.arsdigita.sitenode.*; -import com.arsdigita.bookmarks.ui.*; -// unused import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObject; -// import com.arsdigita.initializer.Configuration; -// unused import com.arsdigita.initializer.InitializationException; -// unused import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; -import com.arsdigita.portal.PortletType; -import com.arsdigita.portal.apportlet.AppPortletSetup; import com.arsdigita.runtime.CompoundInitializer; -// unused import com.arsdigita.runtime.DataInitEvent; import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; -// unusd import com.arsdigita.util.Assert; + import org.apache.log4j.Logger; /** - * <p><strong>Experimental</strong></p> * * @author <a href="mailto:jpa...@re...">Jim Parsons</a> */ public class Initializer extends CompoundInitializer { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = Logger.getLogger (Initializer.class); - // required by Old Initializer. - // private Configuration m_conf = new Configuration(); - + /** + * + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); @@ -69,70 +57,34 @@ } + /** + * + * @param e + */ @Override public void init(DomainInitEvent e) { s_log.info("Bookmarks app is initializing using .init(DomainInitEvent e)"); - // setupDomainFactory(); + super.init(e); - TransactionContext txn = SessionManager.getSession() - .getTransactionContext(); - txn.beginTxn(); - setupBookmarks(); - txn.commitTxn(); - s_log.info("Bookamrks Initializer completed."); - } - - - -// public final void doStartup() { -// s_log.warn("Initializing Bookmarks..."); - -// TransactionContext txn = -// SessionManager.getSession().getTransactionContext(); - -// txn.beginTxn(); - -// setupBookmarks(); - -// txn.commitTxn(); - -// } - - private void setupBookmarks() { - - ApplicationSetup appsetup = new ApplicationSetup(s_log); - appsetup.setApplicationObjectType( BookmarkApplication.BASE_DATA_OBJECT_TYPE); - appsetup.setKey("bookmarks"); - appsetup.setTitle("Bookmarks Application"); - appsetup.setDescription("Bookmarks for a Portal"); - appsetup.setDispatcherClass("com.arsdigita.bookmarks.BookmarkDispatcher"); - appsetup.setPortalApplication(true); - appsetup.setInstantiator(new ACSObjectInstantiator() { - protected DomainObject doNewInstance(DataObject dataObject) { - return new BookmarkApplication(dataObject); + /* Register object instantiator for Bookmarks Application */ + e.getFactory().registerInstantiator( + Bookmarks.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dataObject) { + return new Bookmarks(dataObject); } }); - ApplicationType bmrkAppType = appsetup.run(); + /* Register object instantiator for Bookmarks Portlet */ + e.getFactory().registerInstantiator( + BookmarkPortlet.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + public DomainObject doNewInstance(DataObject dataObject) { + return new BookmarkPortlet(dataObject); + } + }); - - AppPortletSetup setup = new AppPortletSetup(s_log); - - setup.setPortletObjectType - (BookmarkPortlet.BASE_DATA_OBJECT_TYPE); - setup.setTitle("Portal Bookmarks"); - setup.setDescription("Displays bookmarks for this portal."); - setup.setProfile(PortletType.NARROW_PROFILE); - setup.setPortalApplication(false); - setup.setProviderApplicationType(bmrkAppType); - setup.setInstantiator(new ACSObjectInstantiator() { - public DomainObject doNewInstance(DataObject dataObject) { - return new BookmarkPortlet(dataObject); - } - }); - setup.run(); } - -// public final void doShutdown() {} } Added: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java (rev 0) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Loader.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2012 Peter Boy <pb...@ze...> 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.bookmarks; + + +import com.arsdigita.bookmarks.ui.BookmarkPortlet; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelExcursion; +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.portal.PortletType; +import com.arsdigita.portal.apportlet.AppPortletType; +import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.web.ApplicationType; +import com.arsdigita.web.Application; + +import org.apache.log4j.Logger; + +/** + * <p>Executes nonrecurring at install time and loads (installs and initializes) + * the HTTP Auth application and type persistently into database.</p> + * + * @author Daniel Berrange + * @version $Id: Loader.java 287 2005-02-22 00:29:02Z sskracic $ + */ + +/** + * + * @author pb + */ +public class Loader extends PackageLoader { + + /** Creates a s_logging category with name = full name of class */ + private static final Logger s_log = Logger.getLogger(Loader.class); + + /** + * + * @param ctx + */ + public void run(final ScriptContext ctx) { + new KernelExcursion() { + public void excurse() { + setEffectiveParty(Kernel.getSystemParty()); + + ApplicationType bmrkAppType = loadBookmarksApp(); + loadBookmarksPortlet(bmrkAppType); + setupDefaultBookmarkApplicationInstance(); + + } + }.run(); + } + + /** + * Load the Bookmarks application into persistent storage. + * + * @return Bookmarks application type, requirred to load the portlet type + */ + private ApplicationType loadBookmarksApp() { + + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Bookmarks" will become "bookmarks". */ + ApplicationType type = new ApplicationType("Bookmarks", + Bookmarks.BASE_DATA_OBJECT_TYPE ); + + type.setDescription("Bookmarks for a Portal"); + type.save(); + + return type; + } + + private void loadBookmarksPortlet(ApplicationType bmrkAppType ) { + + AppPortletType type = AppPortletType.createAppPortletType( + "Portal Bookmarks", + PortletType.NARROW_PROFILE, + BookmarkPortlet.BASE_DATA_OBJECT_TYPE); + type.setProviderApplicationType(bmrkAppType); + type.setDescription("Displays bookmarks for this portal."); + + } + + + /** + * Instantiates the Bookmarks application admin instance. + * + */ + public static void setupDefaultBookmarkApplicationInstance() { + + /* Determine a parent application. Bookmarks admin page will be + * installed beyond the admin's applications URL. */ + Application admin = Application.retrieveApplicationForPath("/admin/"); + + // create application instance + // Whether a legacy compatible or a legacy free application is + // created depends on the type of ApplicationType above. No need to + // modify anything here in the migration process + // old-style package key used as url fragment where to install the instance + s_log.debug("Creating BookmarkApplication instance ..."); + + Bookmarks app = Bookmarks.create("bookmarks", "Bookmarks", admin); + + s_log.debug("Bookmarks instance " + " created."); + s_log.debug("Done loading bookmarks."); + } + +} Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkBasePage.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -117,10 +117,12 @@ } + @Override public void lock() { + buildPage(); + super.lock(); - super.lock(); } // Only the PortalPage.lock() should invoke this @@ -342,8 +344,10 @@ Application parent = app.getParentApplication(); - link.setChild(new Label(parent.getTitle())); - link.setTarget(parent.getPath()); + if (parent != null) { + link.setChild(new Label(parent.getTitle())); + link.setTarget(parent.getPath()); + } } } Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkEditPane.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -18,7 +18,7 @@ import com.arsdigita.bookmarks.util.GlobalizationUtil; import com.arsdigita.bookmarks.BookmarkCollection; -import com.arsdigita.bookmarks.BookmarkApplication; +import com.arsdigita.bookmarks.Bookmarks; import com.arsdigita.bookmarks.Bookmark; import com.arsdigita.web.Application; @@ -89,7 +89,7 @@ BookmarkCollection m_bmrks; Bookmark m_bmrk; public BmrkListModel(PageState s) { - BookmarkApplication bmrkapp = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks bmrkapp = (Bookmarks)Application.getCurrentApplication(s.getRequest()); m_bmrks = bmrkapp.getBookmarks(); } public boolean next() { @@ -129,7 +129,7 @@ m_prtlRL = new RequestLocal() { protected Object initialValue(PageState ps) { - return (BookmarkApplication)Application.getCurrentApplication( + return (Bookmarks)Application.getCurrentApplication( ps.getRequest()); } }; @@ -181,7 +181,7 @@ public void validate(FormSectionEvent ev) { // check that the user has permission to create bookmarks. PageState ps = ev.getPageState(); - BookmarkApplication ba = (BookmarkApplication)m_prtlRL.get(ps); + Bookmarks ba = (Bookmarks)m_prtlRL.get(ps); ba.assertPrivilege(PrivilegeDescriptor.CREATE); } }); @@ -190,7 +190,7 @@ addForm.addProcessListener(new FormProcessListener() { public void process(FormSectionEvent ev) { PageState ps = ev.getPageState(); - final BookmarkApplication ba = (BookmarkApplication)m_prtlRL.get(ps); + final Bookmarks ba = (Bookmarks)m_prtlRL.get(ps); final Bookmark newBmrk = new Bookmark(newBmrkName.getValue(ps).toString(), newBmrkURL.getValue(ps).toString()); @@ -252,7 +252,7 @@ public Component getComponent(List list, PageState state, Object value, String key, int index, boolean isSelected) { - BookmarkApplication app = (BookmarkApplication) Web.getContext() + Bookmarks app = (Bookmarks) Web.getContext() .getApplication(); BookmarkCollection bColl = app.getBookmarks(); final long size = bColl.size(); @@ -303,13 +303,13 @@ if (EVENT_SWAP_UP.equals(name)) { BigDecimal bID = new BigDecimal(bIDstr); Bookmark b = Bookmark.retrieveBookmark(bID); - BookmarkApplication bApp = b.getBookmarkApplication(); + Bookmarks bApp = b.getBookmarkApplication(); bApp.swapBookmarkWithPrevious(b); } else if (EVENT_SWAP_DOWN.equals(name)) { BigDecimal bID = new BigDecimal(bIDstr); Bookmark b = Bookmark.retrieveBookmark(bID); - BookmarkApplication bApp = b.getBookmarkApplication(); + Bookmarks bApp = b.getBookmarkApplication(); bApp.swapBookmarkWithNext(b); } else { @@ -536,7 +536,7 @@ BigDecimal bd = new BigDecimal((String) getSelectionModel().getSelectedKey(s)); Bookmark bmrk = Bookmark.retrieveBookmark(bd); - BookmarkApplication ba = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks ba = (Bookmarks)Application.getCurrentApplication(s.getRequest()); bmrk.setName(bookmarkName.getValue(s).toString()); bmrk.setURL(bookmarkURL.getValue(s).toString()); bmrk.setDescription(bookmarkDescription.getValue(s).toString()); @@ -592,7 +592,7 @@ if(button.isSelected(s)) { BigDecimal bmrkID = new BigDecimal((String)getSelectionModel().getSelectedKey(s)); Bookmark bmrk = Bookmark.retrieveBookmark(bmrkID); - BookmarkApplication bmrkapp = (BookmarkApplication)Application.getCurrentApplication(s.getRequest()); + Bookmarks bmrkapp = (Bookmarks)Application.getCurrentApplication(s.getRequest()); bmrkapp.removeBookmark(bmrk); getSelectionModel().clearSelection(s); reset(s); Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/ui/BookmarkPortlet.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -23,7 +23,7 @@ import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.portal.AbstractPortletRenderer; -import com.arsdigita.bookmarks.BookmarkApplication; +import com.arsdigita.bookmarks.Bookmarks; import com.arsdigita.bookmarks.BookmarkCollection; import com.arsdigita.bookmarks.util.GlobalizationUtil; import com.arsdigita.kernel.permissions.PermissionDescriptor; @@ -44,44 +44,82 @@ */ public class BookmarkPortlet extends AppPortlet { + /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(BookmarkPortlet.class); + /** PDL stuff - Data Object */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.workspace.BookmarkPortlet"; + "com.arsdigita.workspace.BookmarkPortlet"; + /** + * Provide the Data Object Type. + * @return DataObjectType as String + */ + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } + /** + * Constructor + * + * @param dataObject + */ public BookmarkPortlet(DataObject dataObject) { super(dataObject); } + /** + * + * @return + */ + @Override public String getZoomURL() { Application app = getParentApplication(); if (!PermissionService.checkPermission( - new PermissionDescriptor(PrivilegeDescriptor.READ, app, Web.getContext().getUser()))) { + new PermissionDescriptor(PrivilegeDescriptor.READ, + app, + Web.getContext().getUser()))) { return null; } return (URL.getDispatcherPath() + app.getPrimaryURL()); } + /** + * + * @return + */ + @Override protected AbstractPortletRenderer doGetPortletRenderer() { return new BookmarkPortletRenderer(this); } } +/** + * + * + */ class BookmarkPortletRenderer extends AbstractPortletRenderer { + private BookmarkPortlet m_portlet; + /** + * + * @param portlet + */ public BookmarkPortletRenderer (BookmarkPortlet portlet) { m_portlet = portlet; } + /** + * + * @param pageState + * @param parentElement + */ protected void generateBodyXML(PageState pageState, Element parentElement) { - BookmarkApplication bmrkapp = - (BookmarkApplication)m_portlet.getParentApplication(); + Bookmarks bmrkapp = + (Bookmarks)m_portlet.getParentApplication(); // Variables used cursorwise. int counter; Added: trunk/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml =================================================================== --- trunk/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml (rev 0) +++ trunk/ccm-bookmarks/web/WEB-INF/web.ccm-bookmarks.xml 2012-03-11 09:45:10 UTC (rev 2289) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <!-- Servlets for the docrepo applications --> + <servlet> + <servlet-name>bookmarks</servlet-name> + <servlet-class>com.arsdigita.bookmarks.BookmarksServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>bookmarks</servlet-name> + <url-pattern>/bookmarks/*</url-pattern> + </servlet-mapping> + +</web-app> \ No newline at end of file Modified: trunk/ccm-bundle/bundles/demo/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bundle/bundles/demo/cfg/integration.properties 2012-03-11 09:45:10 UTC (rev 2289) @@ -108,6 +108,8 @@ # ccm-search application com.arsdigita.london.search.show_sponsored_links=true +; Comment this out or increase the num_of_threads iv you really use remote search +com.arsdigita.london.search.num_threads=0 # ccm-subsite application Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-03-11 09:45:10 UTC (rev 2289) @@ -268,12 +268,6 @@ <!-- module ccm-ldn-search - servlet declarations BEGIN --> <servlet> - <servlet-name>worker</servlet-name> - <servlet-class>com.arsdigita.london.search.SearchWorkerServlet</servlet-class> - <load-on-startup>4</load-on-startup> - </servlet> - - <servlet> <servlet-name>search-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> Modified: trunk/ccm-bundle/bundles/devel/cfg/integration.properties =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bundle/bundles/devel/cfg/integration.properties 2012-03-11 09:45:10 UTC (rev 2289) @@ -108,6 +108,8 @@ # ccm-search application com.arsdigita.london.search.show_sponsored_links=true +; Comment this out or increase the num_of_threads iv you really use remote search +com.arsdigita.london.search.num_threads=0 # ccm-subsite application Modified: trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-03-11 09:45:10 UTC (rev 2289) @@ -268,12 +268,6 @@ <!-- module ccm-ldn-search - servlet declarations BEGIN --> <servlet> - <servlet-name>worker</servlet-name> - <servlet-class>com.arsdigita.london.search.SearchWorkerServlet</servlet-class> - <load-on-startup>4</load-on-startup> - </servlet> - - <servlet> <servlet-name>search-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -57,7 +57,6 @@ import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; import com.arsdigita.runtime.CompoundInitializer; -// import com.arsdigita.runtime.ConfigError; import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; @@ -80,11 +79,9 @@ import com.arsdigita.cms.util.LanguageUtil; import com.arsdigita.kernel.Kernel; -// For Id. -// import java.math.BigDecimal; - import org.apache.log4j.Logger; + /** * The main CMS initializer, executed recurringly at each system startup. * Modified: trunk/ccm-core/src/com/arsdigita/domain/DomainObject.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/domain/DomainObject.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-core/src/com/arsdigita/domain/DomainObject.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -341,17 +341,16 @@ } /** - * Set an association DomainObjects DataObject. - * This should only be used inside of a setXXX - * method. + * Set an association DomainObjects DataObject. This should only be used + * inside of a setXXX method. * <p> - * Specificall, this method should only be used to set - * associations whose multiplicity is 0..1 or 1..1. - * If the upper bound of the multiplicity is greater than 1 - * then the {@link #add(String, DataObject)} method should be used. + * Specifically, this method should only be used to set associations + * whose multiplicity is 0..1 or 1..1. + * If the upper bound of the multiplicity is greater than 1 then the + * {@link #add(String, DataObject)} method should be used. * * @see com.arsdigita.persistence.DataObject#set(String, Object) - **/ + */ protected void setAssociation(String attr, DomainObject dobj) { set(attr, dobj == null ? null : dobj.m_dataObject); } @@ -515,8 +514,9 @@ * whether the object is new, modified, deleted, or unknown. Unknown is for * objects that have been invalidated. */ + @Override public String toString() { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); OID oid = getOID(); if ( oid != null ) { result.append(oid.toString()); @@ -586,37 +586,47 @@ private DomainObject getDomainObject() { return DomainObject.this; } + @Override public void set(DataObject object, String property, Object previous, Object value) { } + @Override public void add(DataObject object, String property, DataObject value) { } + @Override public void remove(DataObject object, String property, DataObject value) { } + @Override public void clear(DataObject object, String property) { } + @Override public void beforeSave(DataObject object) { getDomainObject().beforeSave(); } + @Override public void afterSave(DataObject object) { getDomainObject().afterSave(); } + @Override public void beforeDelete(DataObject object) { getDomainObject().beforeDelete(); } + @Override public void afterDelete(DataObject object) { getDomainObject().afterDelete(); } + @Override public int hashCode() { return getDomainObject().hashCode(); } + @Override public boolean equals(Object other) { if (other instanceof SaveObserver) { return getDomainObject().equals( @@ -639,6 +649,7 @@ return false; } + @Override public String toString() { return "Save observer for: " + getDomainObject().getOID() + " (" + super.toString() + ")"; Modified: trunk/ccm-core/src/com/arsdigita/portal/PortletType.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/portal/PortletType.java 2012-03-11 09:24:59 UTC (rev 2288) +++ trunk/ccm-core/src/com/arsdigita/portal/PortletType.java 2012-03-11 09:45:10 UTC (rev 2289) @@ -109,19 +109,7 @@ Assert.exists(title, "title"); Assert.exists(profile, "profile"); Assert.exists(portletObjectType, "portletObjectType"); -/* Portal now legacy free. To be deleted when transistion is completed. - PackageType packageType = null; - // is com.arsdigita.portal.Portal initialized - try { - packageType = PackageType.findByKey("portal"); - } catch (DataObjectNotFoundException nfe) { - String message = - "The PackageType 'portal' is not installed. It must be " + - "installed in order to create a new PortletType."; - s_cat.error(message); - throw new IllegalStateException(message); - } -*/ + // is com.arsdigita.portal.Portal initialized? if ( !ResourceType.isInstalled(Portal.BASE_DATA_OBJECT_TYPE) ) { String message = Modified: trunk/ccm-core/src/com/arsdigita/portal/apportlet... [truncated message content] |
From: <pb...@fe...> - 2012-03-11 09:25:11
|
Author: pboy Date: 2012-03-11 09:24:59 +0000 (Sun, 11 Mar 2012) New Revision: 2288 Modified: trunk/ccm-core/src/com/arsdigita/ui/login/ChangePasswordForm.java trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources.properties trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_de.properties trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_en.properties trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_fr.properties Log: UI improvement, added intruductionary text and user name to changePassword form. Modified: trunk/ccm-core/src/com/arsdigita/ui/login/ChangePasswordForm.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/ChangePasswordForm.java 2012-03-11 09:22:35 UTC (rev 2287) +++ trunk/ccm-core/src/com/arsdigita/ui/login/ChangePasswordForm.java 2012-03-11 09:24:59 UTC (rev 2288) @@ -44,42 +44,43 @@ import com.arsdigita.web.URL; import com.arsdigita.web.ReturnSignal; import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.Party; import com.arsdigita.kernel.User; import com.arsdigita.kernel.UserAuthentication; import com.arsdigita.kernel.security.RecoveryLoginModule; import com.arsdigita.mail.Mail; import com.arsdigita.util.UncheckedWrapperException; +import java.lang.reflect.Array; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; /** * A Form that allows a user to change their password by entering their old - * password, a new password, and a confirmation of their new password. - * Requires that the user is logged in. Requires that new password differ - * from old and meet strong password requirements. If the user is - * recovering from a lost password (UserContext.isRecovering() is true), - * does not require or display the old password parameter and does not - * require that new password differ from old. Mails the user to notify of - * password change. Redirects user to workspace or return_url if set. + * password, a new password, and a confirmation of their new password. Requires + * that the user is logged in. Requires that new password differ from old and + * meet strong password requirements. If the user is recovering from a lost + * password (UserContext.isRecovering() is true), does not require or display + * the old password parameter and does not require that new password differ from + * old. Mails the user to notify of password change. Redirects user to workspace + * or return_url if set. * * @author Sameer Ajmani - **/ + * + */ public class ChangePasswordForm extends Form - implements FormProcessListener, - FormValidationListener { + implements FormProcessListener, + FormValidationListener { private static final Logger s_log = - Logger.getLogger(ChangePasswordForm.class.getName()); - + Logger.getLogger(ChangePasswordForm.class.getName()); final static String CHANGE_PASSWORD_FORM_NAME = "change-password"; final static String OLD_PASSWORD_PARAM_NAME = "old-password"; final static String NEW_PASSWORD_PARAM_NAME = "new-password"; final static String CONFIRM_PASSWORD_PARAM_NAME = "confirm-password"; final static String RETURN_URL_PARAM_NAME = - LoginHelper.RETURN_URL_PARAM_NAME; - + LoginHelper.RETURN_URL_PARAM_NAME; private UserAuthenticationListener m_listener = - new UserAuthenticationListener(); + new UserAuthenticationListener(); private Hidden m_returnURL; private Hidden m_recovery; private Label m_oldPasswordLabel; @@ -95,13 +96,14 @@ super.register(p); p.addRequestListener(m_listener); p.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - boolean visible = !isRecovering(); - m_oldPasswordLabel.setVisible(state, visible); - m_oldPassword.setVisible(state, visible); - } - }); + + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + boolean visible = !isRecovering(); + m_oldPasswordLabel.setVisible(state, visible); + m_oldPassword.setVisible(state, visible); + } + }); } public ChangePasswordForm(Container panel) { @@ -112,8 +114,7 @@ addProcessListener(this); // save the recovery credential as a hidden parameter - m_recovery = new Hidden(new StringParameter - (RecoveryLoginModule.getParamName())); + m_recovery = new Hidden(new StringParameter(RecoveryLoginModule.getParamName())); m_recovery.setPassIn(true); add(m_recovery); @@ -122,10 +123,28 @@ m_returnURL.setPassIn(true); add(m_returnURL); + + Party party = Kernel.getContext().getParty(); + + if (party != null && party instanceof User) { + User user = (User) party; + user.getPersonName().toString(); + + // Add a describtive text and the user name to the form for user comfort + Label greeting = new Label( + LoginHelper.getMessage("login.changePasswortForm.greeting", + new Object[] { user.getPersonName().toString() } ) + ); + + greeting.setFontWeight(Label.BOLD); + greeting.setClassAttr("greeting"); + add(greeting); + } + + add(new Label(LoginHelper.getMessage("login.changePasswortForm.introText"))); + // old password - m_oldPasswordLabel = new Label - (LoginHelper.getMessage - ("login.changePasswordForm.oldPasswordLabel")); + m_oldPasswordLabel = new Label(LoginHelper.getMessage("login.changePasswordForm.oldPasswordLabel")); add(m_oldPasswordLabel); m_oldPassword = new Password(OLD_PASSWORD_PARAM_NAME); // don't use NotNullValidationListener because @@ -133,93 +152,79 @@ add(m_oldPassword); // new password - Object[] params = new Object[] { - new Integer(PasswordValidationListener.MIN_LENGTH) }; - add(new Label(LoginHelper.getMessage - ("login.changePasswordForm.newPasswordLabel", params))); + Object[] params = new Object[]{ + new Integer(PasswordValidationListener.MIN_LENGTH)}; + add(new Label(LoginHelper.getMessage("login.changePasswordForm.newPasswordLabel", params))); m_newPassword = new Password(NEW_PASSWORD_PARAM_NAME); - m_newPassword.addValidationListener - (new PasswordValidationListener()); + m_newPassword.addValidationListener(new PasswordValidationListener()); add(m_newPassword); // confirm new password - add(new Label(LoginHelper.getMessage - ("login.changePasswordForm.confirmPasswordLabel"))); + add(new Label(LoginHelper.getMessage("login.changePasswordForm.confirmPasswordLabel"))); m_confirmPassword = new Password(CONFIRM_PASSWORD_PARAM_NAME); // don't use PasswordValidationListener to avoid duplicate errors - m_confirmPassword.addValidationListener - (new NotNullValidationListener()); + m_confirmPassword.addValidationListener(new NotNullValidationListener()); add(m_confirmPassword); // submit - add(new Submit(LoginHelper.getMessage - ("login.changePasswordForm.submit")), - ColumnPanel.CENTER | ColumnPanel.FULL_WIDTH); + add(new Submit(LoginHelper.getMessage("login.changePasswordForm.submit")), + ColumnPanel.CENTER | ColumnPanel.FULL_WIDTH); } public void validate(FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); try { // get user object if (!m_listener.isLoggedIn(state)) { // this error should never appear - data.addError(LoginHelper.localize - ("login.changePasswordForm.noUserError", - state.getRequest())); + data.addError(LoginHelper.localize("login.changePasswordForm.noUserError", + state.getRequest())); return; } User user = m_listener.getUser(state); // get parameter values - String oldPassword = (String)m_oldPassword.getValue(state); - String newPassword = (String)m_newPassword.getValue(state); - String confirmPassword = (String) - m_confirmPassword.getValue(state); + String oldPassword = (String) m_oldPassword.getValue(state); + String newPassword = (String) m_newPassword.getValue(state); + String confirmPassword = (String) m_confirmPassword.getValue(state); // check old password unless recovering if (!isRecovering()) { try { // The old password can never be null or contain leading or // trailing slashes. - if (oldPassword == null || - !oldPassword.trim().equals(oldPassword)) { - data.addError - (OLD_PASSWORD_PARAM_NAME, LoginHelper.localize - ("login.changePasswordForm.badPasswordError", - state.getRequest())); + if (oldPassword == null + || !oldPassword.trim().equals(oldPassword)) { + data.addError(OLD_PASSWORD_PARAM_NAME, LoginHelper.localize("login.changePasswordForm.badPasswordError", + state.getRequest())); return; } // TODO: avoid loading UserAuthentication in both // validate() and process() stages UserAuthentication auth = - UserAuthentication.retrieveForUser(user); + UserAuthentication.retrieveForUser(user); if (!auth.isValidPassword(oldPassword)) { - data.addError - (OLD_PASSWORD_PARAM_NAME, LoginHelper.localize - ("login.changePasswordForm.badPasswordError", - state.getRequest())); + data.addError(OLD_PASSWORD_PARAM_NAME, LoginHelper.localize("login.changePasswordForm.badPasswordError", + state.getRequest())); return; } } catch (DataObjectNotFoundException e) { - throw new UncheckedWrapperException - ("Could not get UserAuthentication", e); + throw new UncheckedWrapperException("Could not get UserAuthentication", e); } } // check new password if (newPassword.equals(oldPassword)) { - data.addError(NEW_PASSWORD_PARAM_NAME, LoginHelper.localize - ("login.changePasswordForm.mustDifferError", - state.getRequest())); + data.addError(NEW_PASSWORD_PARAM_NAME, LoginHelper.localize("login.changePasswordForm.mustDifferError", + state.getRequest())); return; } if (!newPassword.equals(confirmPassword)) { - data.addError(CONFIRM_PASSWORD_PARAM_NAME, LoginHelper.localize - ("login.changePasswordForm.mustMatchError", - state.getRequest())); + data.addError(CONFIRM_PASSWORD_PARAM_NAME, LoginHelper.localize("login.changePasswordForm.mustMatchError", + state.getRequest())); return; } } finally { @@ -233,16 +238,15 @@ } public void process(FormSectionEvent event) - throws FormProcessException { + throws FormProcessException { PageState state = event.getPageState(); FormData data = event.getFormData(); // get user object if (!m_listener.isLoggedIn(state)) { // this error should never appear (checked in validate) - data.addError(LoginHelper.localize - ("login.changePasswordForm.noUserError", - state.getRequest())); + data.addError(LoginHelper.localize("login.changePasswordForm.noUserError", + state.getRequest())); return; } User user = m_listener.getUser(state); @@ -250,14 +254,13 @@ // set new password try { UserAuthentication auth = - UserAuthentication.retrieveForUser(user); - String newPassword = (String)m_newPassword.getValue(state); + UserAuthentication.retrieveForUser(user); + String newPassword = (String) m_newPassword.getValue(state); auth.setPassword(newPassword); s_log.debug("committing password change"); auth.save(); } catch (DataObjectNotFoundException e) { - throw new UncheckedWrapperException - ("Could not get UserAuthentication", e); + throw new UncheckedWrapperException("Could not get UserAuthentication", e); } // mail report to user @@ -267,17 +270,17 @@ HttpServletRequest req = state.getRequest(); String to = - user.getPrimaryEmail().toString(); + user.getPrimaryEmail().toString(); String from = - Kernel.getSecurityConfig().getAdminContactEmail(); + Kernel.getSecurityConfig().getAdminContactEmail(); String name = - user.getPersonName().getGivenName(); + user.getPersonName().getGivenName(); String subject = - LoginHelper.localize("login.changePasswordForm.mailSubject", req); + LoginHelper.localize("login.changePasswordForm.mailSubject", req); String body = - LoginHelper.localize("login.changePasswordForm.mailBody", - new Object[] { name }, - req); + LoginHelper.localize("login.changePasswordForm.mailBody", + new Object[]{name}, + req); // try to send the message, but don't throw the exception // if it fails so that the password change is comitted @@ -289,9 +292,9 @@ s_log.error("Could not notify user of password change", e); } } else { - s_log.debug("Could not notify user of password change: " + - "null email, user ID: " + - user.getID()); + s_log.debug("Could not notify user of password change: " + + "null email, user ID: " + + user.getID()); } final HttpServletRequest req = state.getRequest(); Modified: trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources.properties 2012-03-11 09:22:35 UTC (rev 2287) +++ trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources.properties 2012-03-11 09:24:59 UTC (rev 2288) @@ -60,3 +60,5 @@ login.error.badEmail=Unrecognized email address login.error.bannedEmail=User cannot currently access system login.error.loginFail=Login failed +login.changePasswortForm.greeting=Welcome {0} +login.changePasswortForm.introText=To change your passwort please fill out this form. Modified: trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_de.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_de.properties 2012-03-11 09:22:35 UTC (rev 2287) +++ trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_de.properties 2012-03-11 09:24:59 UTC (rev 2288) @@ -1,10 +1,10 @@ login.userEditPage.title=Profil bearbeiten -login.userEditPage.changePasswordLink=Passwort \u00E4ndern -login.workspacePage.title=Ihr pers\u00F6nlicher Bereich +login.userEditPage.changePasswordLink=Passwort \u00e4ndern +login.workspacePage.title=Ihr pers\u00f6nlicher Bereich login.explainCookiesPage.title=E-Mail Adresse und Passwort werden gesichert login.userInfo.logoutLink=Abmelden login.userInfo.editProfileLink=Profil bearbeiten -login.userInfo.changePasswordLink=Passwort \u00E4ndern +login.userInfo.changePasswordLink=Passwort \u00e4ndern login.userRegistrationForm.title=Anmelden login.userRegistrationForm.email=Ihre E-Mail Adresse\: login.userRegistrationForm.screenName=Ihr Benutzername\: @@ -14,49 +14,51 @@ login.userRegistrationForm.forgotPasswordLink=Passwort vergessen? login.userRegistrationForm.newUserRegister=Neue Benutzer registrieren sich hier login.userNewForm.title=Registrieren -login.userNewForm.aboutYouSectionHeader=<h3>\u00DCber mich</h3> +login.userNewForm.aboutYouSectionHeader=<h3>\u00dcber mich</h3> login.userNewForm.securitySectionHeader=<h3>Sicherheit</h3> -login.userNewForm.securityBlurb=Wie ben\u00F6tigen ein Passwort, um Ihre Identit\u00E4t und Beitr\u00E4ge zu Foren und anderen Aktivit\u00E4ten zu sch\u00FCtzen. -login.userNewForm.passwordBlurb=W\u00E4hlen Sie ein Passwort aus Gru\u00DFbuchstaben, Kleinbuchstaben, Zahlen und anderen Zeichen. Wenn sie es vergessen, unterst\u00FCtzt Sie der Server bei der Festlegung eines neuen. -login.userNewForm.questionBlurb=Wir ben\u00F6tigen eine individuelle Frage und Antwort um sicher zu gehen, dass nur Sie das Passwort \u00E4ndern k\u00F6nnen. +login.userNewForm.securityBlurb=Wie ben\u00f6tigen ein Passwort, um Ihre Identit\u00e4t und Beitr\u00e4ge zu Foren und anderen Aktivit\u00e4ten zu sch\u00fctzen. +login.userNewForm.passwordBlurb=W\u00e4hlen Sie ein Passwort aus Gru\u00dfbuchstaben, Kleinbuchstaben, Zahlen und anderen Zeichen. Wenn sie es vergessen, unterst\u00fctzt Sie der Server bei der Festlegung eines neuen. +login.userNewForm.questionBlurb=Wir ben\u00f6tigen eine individuelle Frage und Antwort um sicher zu gehen, dass nur Sie das Passwort \u00e4ndern k\u00f6nnen. login.changePasswordForm.oldPasswordLabel=Altes Passwort\: login.changePasswordForm.newPasswordLabel=Neues Passwort (mindestens {0} Zeichen, keine Leertaste)\: -login.changePasswordForm.confirmPasswordLabel=Passwort best\u00E4tigen\: -login.changePasswordForm.submit=Ausf\u00FChren +login.changePasswordForm.confirmPasswordLabel=Passwort best\u00e4tigen\: +login.changePasswordForm.submit=Ausf\u00fchren login.changePasswordForm.noUserError=Benutzer ist nicht angemeldet login.changePasswordForm.badPasswordError=Falsches Passwort login.changePasswordForm.mustDifferError=Das neue Passwort muss sich vom bisherigen unterscheiden -login.changePasswordForm.mustMatchError=Die neuen Passw\u00F6rter m\u00FCssen gleich sein -login.changePasswordForm.mailSubject=Ihr Passwort wurde ge\u00E4ndert. -login.changePasswordForm.mailBody=Hallo {0},\n\nIhr Passwort wurde erfolgreich ge\u00E4ndert.\nWenn Sie Ihr Passwort nicht \u00E4ndern wollten,\nmelden Sie bitte diese Mail an uns. -login.changePasswordPage.title=Passwort \u00C4nderung -login.recoverPassword.mailSubject=\u00C4ndern Sie das Passwort -login.recoverPassword.mailBody=Hallo {0},\n\nKlicken Sie auf diese URL oder kopieren Sie sie in Ihren Browser, um Ihr Passwort zu \u00E4ndern\:\n{1} +login.changePasswordForm.mustMatchError=Die neuen Passw\u00f6rter m\u00fcssen gleich sein +login.changePasswordForm.mailSubject=Ihr Passwort wurde ge\u00e4ndert. +login.changePasswordForm.mailBody=Hallo {0},\n\nIhr Passwort wurde erfolgreich ge\u00e4ndert.\nWenn Sie Ihr Passwort nicht \u00e4ndern wollten,\nmelden Sie bitte diese Mail an uns. +login.changePasswordPage.title=Passwort \u00c4nderung +login.recoverPassword.mailSubject=\u00c4ndern Sie das Passwort +login.recoverPassword.mailBody=Hallo {0},\n\nKlicken Sie auf diese URL oder kopieren Sie sie in Ihren Browser, um Ihr Passwort zu \u00e4ndern\:\n{1} login.recoverPasswordPage.title=Passwort holen login.loginExpiredPage.title=Anmeldung abgelaufen -login.loginExpiredPage.before=Der Anmeldebildschirm ist nicht mehr g\u00FCltig +login.loginExpiredPage.before=Der Anmeldebildschirm ist nicht mehr g\u00fcltig login.loginExpiredPage.link=Anmeldung login.loginExpiredPage.after= erneut. login.passwordValidation.minLengthError=Passwort muss aus mindestens {0} Zeichen bestehen login.passwordValidation.whitespaceError=Das Passwort darf kein Leerzeichen enthalten -login.passwordValidation.minTypesError=Das Passwort muss aus {0} dieser 4 Typen gestehen\: Gro\u00DFbuchstaben, Kleinbuchstaben, Ziffern, andere Zeichen -login.submit=Ausf\u00FChren +login.passwordValidation.minTypesError=Das Passwort muss aus {0} dieser 4 Typen gestehen\: Gro\u00dfbuchstaben, Kleinbuchstaben, Ziffern, andere Zeichen +login.submit=Ausf\u00fchren login.primaryEmail=E-Mail Adresse\: login.additionalEmail=Weitere E-Mail\: login.firstName=Vorname\: login.lastName=Nachname\: login.password=Passwort (mindestens {0} Zeichen, kein Leerzeichen)\: -login.passwordConfirm=Passwort best\u00E4tigen\: +login.passwordConfirm=Passwort best\u00e4tigen\: login.passwordQuestion=Frage\: login.passwordAnswer=Antwort\: -login.url=URL der pers\u00F6nlichen Homepage\: +login.url=URL der pers\u00f6nlichen Homepage\: login.screenName=Benutzername\: login.bio=Biographie\: login.error.duplicateScreenName=Ein anderer Benutzer verwendet diesen Namen login.error.duplicateEmail=Ein anderer Nutzer verwendet diese E-Mail Adresse -login.error.mismatchPassword=Die neuen Passw\u00F6rter m\u00FCssen gleich sein +login.error.mismatchPassword=Die neuen Passw\u00f6rter m\u00fcssen gleich sein login.error.badPassword=Falsches Passwort login.error.badAnswer=Falsche Antwort -login.error.badEmail=Ung\u00FCltige E-Mail Adresse +login.error.badEmail=Ung\u00fcltige E-Mail Adresse login.error.bannedEmail=Benutzer kann zur Zeit das System nicht nutzen login.error.loginFail=Anmeldung nicht erfolgreich +login.changePasswortForm.greeting=Willkommen {0} +login.changePasswortForm.introText=Um ihr Passwort zu \u00e4ndern, f\u00fcllen sie bitte das folgende Formular aus. Modified: trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_en.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_en.properties 2012-03-11 09:22:35 UTC (rev 2287) +++ trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_en.properties 2012-03-11 09:24:59 UTC (rev 2288) @@ -60,3 +60,5 @@ login.error.badEmail=Unrecognized email address login.error.bannedEmail=User cannot currently access system login.error.loginFail=Login failed +login.changePasswortForm.greeting=Welcome {0} +login.changePasswortForm.introText=To change your passwort please fill out this form. Modified: trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_fr.properties =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_fr.properties 2012-03-11 09:22:35 UTC (rev 2287) +++ trunk/ccm-core/src/com/arsdigita/ui/login/LoginResources_fr.properties 2012-03-11 09:24:59 UTC (rev 2288) @@ -2,7 +2,7 @@ login.userEditPage.changePasswordLink=Modifier le mot de passe login.workspacePage.title=Votre espace de travail login.explainCookiesPage.title=Enregistrement de l'adresse de messagerie et du mot de passe -login.userInfo.logoutLink=Dnnexion +login.userInfo.logoutLink=D\u00e9connexion login.userInfo.editProfileLink=Modifier ce profil login.userInfo.changePasswordLink=Modifier le mot de passe login.userRegistrationForm.title=Se connecter @@ -11,49 +11,51 @@ login.userRegistrationForm.password=Votre mot de passe login.userRegistrationForm.cookieOption=Retenir ce mot de passe? login.userRegistrationForm.explainCookieLink=(aide) -login.userRegistrationForm.forgotPasswordLink=Vous avez oubliotre mot de passe? -login.userNewForm.title=Cr votre compte +login.userRegistrationForm.forgotPasswordLink=Vous avez oubli\u00e9 votre mot de passe? +login.userNewForm.title=Cr\u00e9er votre compte login.userNewForm.aboutYouSectionHeader=<h3>A propos de vous</h3> -login.userNewForm.securitySectionHeader=<h3>Securith3> -login.userNewForm.securityBlurb=Merci de nous fournir un mot de passe afin que nous puissions protr votre indentitorsque vous participez aux Quiz, aux forum de discussions et aux autres activitcommunes sur notre site. -login.userNewForm.passwordBlurb=Choisissez un mot de passe qui contienne un mnge de majuscules, de minuscules, de chiffres et d'autres caracts. Si vous oubliez votre mot de passe, notre serveur vous aidera e remplacer par un nouveau -login.userNewForm.questionBlurb=Merci de nous indiquer une question (et sa rnse) aquelle vous seul pouvez rndre pour que nous puission nous assurer que vous serez le seul ouvoir changer votre mot de passe +login.userNewForm.securitySectionHeader=<h3>Securit\u00e9</h3> +login.userNewForm.securityBlurb=Merci de nous fournir un mot de passe afin que nous puissions prot\u00e9ger votre indentit\u00e9 lorsque vous participez aux Quiz, aux forum de discussions et aux autres activit\u00e9s communes sur notre site. +login.userNewForm.passwordBlurb=Choisissez un mot de passe qui contienne un m\u00e9lange de majuscules, de minuscules, de chiffres et d'autres caract\u00e8res. Si vous oubliez votre mot de passe, notre serveur vous aidera \u00e0 le remplacer par un nouveau +login.userNewForm.questionBlurb=Merci de nous indiquer une question (et sa r\u00e9ponse) \u00e0 laquelle vous seul pouvez r\u00e9pondre pour que nous puission nous assurer que vous serez le seul \u00e0 pouvoir changer votre mot de passe login.changePasswordForm.oldPasswordLabel=Ancien mot de passe : -login.changePasswordForm.newPasswordLabel=Nouveau mot de passe (au moins {0} caract et pas d'espace): +login.changePasswordForm.newPasswordLabel=Nouveau mot de passe (au moins {0} caract\u00e8re et pas d'espace): login.changePasswordForm.confirmPasswordLabel=Confirmation du nouveau mot de passe login.changePasswordForm.submit=Soumettre -login.changePasswordForm.noUserError=L'utilisateur n'est pas connectlogin.changePasswordForm.badPasswordError=Mot de passe erronlogin.changePasswordForm.mustDifferError=Le nouveau mot de passe doit e diffnt de l'ancien -login.changePasswordForm.mustMatchError=Le nouveau mot de passe doit e identique dans la zone de confirmation -login.changePasswordForm.mailSubject=Votre mot de passe a modifilogin.changePasswordForm.mailBody=Cher {0}, \n\n Votre mot de passe a modifivec succ\nSi vous n'avez pas souhaithanger votre mot de passe,\nmerci de rndre e message en faisant part de ce probl. +login.changePasswordForm.noUserError=L'utilisateur n'est pas connect\u00e9 +login.changePasswordForm.badPasswordError=Mot de passe erron\u00e9 +login.changePasswordForm.mustDifferError=Le nouveau mot de passe doit \u00eatre diff\u00e9rent de l'ancien +login.changePasswordForm.mustMatchError=Le nouveau mot de passe doit \u00eatre identique dans la zone de confirmation +login.changePasswordForm.mailSubject=Votre mot de passe a \u00e9t\u00e9 modifi\u00e9 +login.changePasswordForm.mailBody=Cher {0}, \n\n Votre mot de passe a \u00e9t\u00e9 modifi\u00e9 avec succ\u00e8s.\nSi vous n'avez pas souhait\u00e9 changer votre mot de passe,\nmerci de r\u00e9pondre \u00e0 ce message en faisant part de ce probl\u00e8me. login.changePasswordPage.title=Modifier le mot de passe login.recoverPassword.mailSubject=Modifier votre mot de passe login.recoverPassword.mailBody=Cher {0},\n\nCliquer sur cet URL ou recopiez le dans la barre d'adresse de votre navigateur pour modifier votre mot de passe:\n{1} -login.recoverPasswordPage.title=Rpr le mot de passe -login.loginExpiredPage.title=Votre connexion a expirlogin.loginExpiredPage.before=La page de connexion a expirMerci\u0020 +login.recoverPasswordPage.title=R\u00e9cup\u00e9rer le mot de passe +login.loginExpiredPage.title=Votre connexion a expir\u00e9 +login.loginExpiredPage.before=La page de connexion a expir\u00e9. Merci\u0020 login.loginExpiredPage.link=de vous connecter -login.loginExpiredPage.after=\u0020ouveau -login.passwordValidation.minLengthError=Le mot de passe doit faire au minimum {0} caracts de long +login.loginExpiredPage.after=\u0020\u00e0 nouveau +login.passwordValidation.minLengthError=Le mot de passe doit faire au minimum {0} caract\u00e8res de long login.passwordValidation.whitespaceError=Le mot de passe ne doit pas contenir d'espace -login.passwordValidation.minTypesError=Le mot de passe doit contenir {0} de ces 4 types de caracts : majuscule, minuscule, chiffre ou autre symbole +login.passwordValidation.minTypesError=Le mot de passe doit contenir {0} de ces 4 types de caract\u00e8res : majuscule, minuscule, chiffre ou autre symbole login.submit=Soumettre login.primaryEmail=Adresse de messagerie: -login.additionalEmail=Adresse de messagerie supplntaire -login.firstName=Prm: +login.additionalEmail=Adresse de messagerie suppl\u00e9mentaire +login.firstName=Pr\u00e9nom: login.lastName=Nom: -login.password=Mot de passe (au moins {0} caract et pas d'espace): +login.password=Mot de passe (au moins {0} caract\u00e8re et pas d'espace): login.passwordConfirm=Confirmation du mot de passe login.passwordQuestion=Question: -login.passwordAnswer=Rnse: +login.passwordAnswer=R\u00e9ponse: login.url=URL de votre site web personnel login.screenName=Votre pseudonyme: login.bio=Biographie: -login.error.duplicateScreenName=Un autre utilisateur utilise d ce pseudonyme -login.error.duplicateEmail=Un autre utilisateur nous a d donner cette adresse de messagerie -login.error.mismatchPassword=Le nouveau mot de passe doit e identique dans la zone de confirmation -login.error.badPassword=Mot de passe erronlogin.error.badAnswer=Rnse erron+login.error.duplicateScreenName=Un autre utilisateur utilise d\u00e9j\u00e0 ce pseudonyme +login.error.duplicateEmail=Un autre utilisateur nous a d\u00e9j\u00e0 donner cette adresse de messagerie +login.error.mismatchPassword=Le nouveau mot de passe doit \u00eatre identique dans la zone de confirmation +login.error.badPassword=Mot de passe erron\u00e9 +login.error.badAnswer=R\u00e9ponse erron\u00e9e login.error.badEmail=Cette adresse de messagerie est inconnue +login.changePasswortForm.greeting= +login.changePasswortForm.introText= |
Author: pboy Date: 2012-03-11 09:22:35 +0000 (Sun, 11 Mar 2012) New Revision: 2287 Added: trunk/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSiteServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreatorServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalSiteMapServlet.java trunk/ccm-portalserver/web/WEB-INF/ trunk/ccm-portalserver/web/WEB-INF/web.ccm-portalserver.xml trunk/ccm-portalserver/web/themes/heirloom/apps/portal-site/ trunk/ccm-portalserver/web/themes/heirloom/apps/portal-site/xsl/ trunk/ccm-portalserver/web/themes/heirloom/apps/portal-site/xsl/index.xsl Removed: trunk/ccm-core/src/com/arsdigita/ui/admin/SitemapAdministrationTab.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ECMPresentationManager.java.nolongerInUse trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalServlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/ui/ trunk/ccm-portalserver/web/themes/heirloom/apps/portalsite/ Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java trunk/ccm-core/src/com/arsdigita/ui/admin/AdminConstants.java trunk/ccm-core/src/com/arsdigita/ui/admin/AdminServlet.java trunk/ccm-core/src/com/arsdigita/ui/admin/UserBrowsePane.java trunk/ccm-core/src/com/arsdigita/util/Assert.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSite.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdmin.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/MyItemsApplication.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/MyPortalsPortlet.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortal.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalConfig.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreator.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalCreatorDispatcher.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalDispatcher.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/personal/PersonalPortalHomePage.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/PortalDispatcher.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/PortalHomePage.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalCreator.java trunk/ccm-portalserver/src/com/arsdigita/portalserver/ui/admin/PortalSiteMap.java trunk/ccm-portalserver/web/themes/heirloom/apps/personal-portal-creator/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/apps/personal-portal/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/apps/portal-admin/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/apps/portal-archive/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/apps/portal-create/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/apps/portal-sitemap/xsl/index.xsl trunk/ccm-portalserver/web/themes/heirloom/packages/portalserver/xsl/portalserver.xsl trunk/ccm-portalserver/web/themes/heirloom/packages/portalserver/xsl/ui.xsl trunk/ccm-weblog/src/org/undp/weblog/Initializer.java Log: Module ccm-portalserver now legacy free type of application. Application PersonalPortalSite carries still a but. No update script required because never distributed as part of aplaws. Modified: trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java =================================================================== --- trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-bookmarks/src/com/arsdigita/bookmarks/Initializer.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -26,7 +26,6 @@ import com.arsdigita.web.*; import com.arsdigita.kernel.*; // unused import com.arsdigita.sitenode.*; -import com.arsdigita.bookmarks.*; import com.arsdigita.bookmarks.ui.*; // unused import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObject; Modified: trunk/ccm-core/src/com/arsdigita/ui/admin/AdminConstants.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/admin/AdminConstants.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-core/src/com/arsdigita/ui/admin/AdminConstants.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -63,8 +63,8 @@ (new GlobalizedMessage("ui.admin.tab.group.title", BUNDLE_NAME)); - Label SITEMAP_TAB_TITLE = new Label - (new GlobalizedMessage("ui.admin.tab.sitemap.title", + Label APPLICATIONS_TAB_TITLE = new Label + (new GlobalizedMessage("ui.admin.tab.applications.title", BUNDLE_NAME)); GlobalizedMessage USER_NAVBAR_TITLE = @@ -104,8 +104,8 @@ BigDecimalParameter GROUP_ID_PARAM = new BigDecimalParameter("group_id"); - BigDecimalParameter SITEMAP_ID_PARAM = - new BigDecimalParameter("sitemap_id"); + BigDecimalParameter APPLICATIONS_ID_PARAM = + new BigDecimalParameter("application_id"); BigDecimalParameter USER_ID_PARAM = new BigDecimalParameter("user_id"); Modified: trunk/ccm-core/src/com/arsdigita/ui/admin/AdminServlet.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/admin/AdminServlet.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-core/src/com/arsdigita/ui/admin/AdminServlet.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -48,10 +48,6 @@ import org.apache.log4j.Logger; -// We need NonEscapedTableCellRenderer -// Currently part of (thisPackage) Dispatcher.java -// When the class will we deleted we must copy first! - /** * Web Developer Support Application Servlet class, central entry point to * create and process the applications UI. @@ -85,20 +81,6 @@ addPage("/", buildAdminIndexPage()); // index page at address ~/ds // addPage("/index.jsp", buildIndexPage()); // index page at address ~/ds - // addPage("/log4j", buildLog4jPage()); // Logger Adjuster at addr. ~/ds/log4j - // addPage("/config", buildConfigPage()); // config browser @ ~/ds/config - // cache table browser @ ~/ds/cache-table - // addPage("/cache-table", buildCacheTablePage()); - - // XXXX!! - // QueryLog is a class of its own in webdevsupport, based upon - // dispatcher.Disp and prints out all queries in a request - // put("query-log", new QueryLog()); - - // addPage("/request-info", buildRequestInfoPage()); - // addPage("/query-info", buildQueryInfoPage()); - // addPage("/query-plan", buildQueryPlanPage()); - } @@ -188,7 +170,7 @@ p.addGlobalStateParam(USER_ID_PARAM); p.addGlobalStateParam(GROUP_ID_PARAM); - // p.addGlobalStateParam(SITEMAP_ID_PARAM); + // p.addGlobalStateParam(APPLICATIONS_ID_PARAM); /** * Create User split panel. @@ -217,8 +199,8 @@ /* * Create group administration panel */ - // SitemapAdministrationTab sitemapAdministrationTab = - // new SitemapAdministrationTab(); + // ApplicationsAdministrationTab appsAdministrationTab = + // new ApplicationsAdministrationTab(); // Create the Admin's page tab bar, currently 2 elements: user & groups TabbedPane tb = new TabbedPane(); @@ -226,11 +208,11 @@ tb.addTab(USER_TAB_TITLE, userSplitPanel); tb.addTab(GROUP_TAB_TITLE, groupAdministrationTab); - // tb.addTab(SITEMAP_TAB_TITLE, sitemapAdministrationTab); + // tb.addTab(APPLICATIONS_TAB_TITLE, appsAdministrationTab); browsePane.setTabbedPane(tb); browsePane.setGroupAdministrationTab(groupAdministrationTab); - // browsePane.setSitemapAdministrationTab(sitemapAdministrationTab); + // browsePane.setAppsAdministrationTab(appsAdministrationTab); p.add(tb); p.lock(); Added: trunk/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java (rev 0) +++ trunk/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.ui.admin; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SingleSelectionModel; +import com.arsdigita.bebop.SplitPanel; +import com.arsdigita.bebop.event.ChangeEvent; +import com.arsdigita.bebop.event.ChangeListener; +import com.arsdigita.globalization.GlobalizedMessage; +import com.arsdigita.ui.sitemap.SiteListing; +import com.arsdigita.ui.sitemap.SiteMapAdminPane; + +import java.math.BigDecimal; + +/** + * + * @author pb + */ +public class ApplicationsAdministrationTab extends BoxPanel + implements AdminConstants, ChangeListener { + + private GlobalizedMessage m_title; + + + /** + * Constructor + */ + public ApplicationsAdministrationTab() { + + // m_title = "TEST für ein neues Pannel"; + setClassAttr("sidebarNavPanel"); + setAttribute("navbar-title", "Sitemap"); + // m_componentList = new ArrayList(); + // m_keys = new ArrayList(); + SiteListing listing = new SiteListing(); + listing.setClassAttr("navbar"); + + SingleSelectionModel m = listing.getTree().getSelectionModel(); + SiteMapAdminPane details = new SiteMapAdminPane(m, listing.getCFGLink()); + + BoxPanel box = new BoxPanel(); + box.setClassAttr("main"); + box.add(details); + + SplitPanel panel = new SplitPanel(); + panel.setClassAttr("sidebarNavPanel"); + panel.setLeftComponent(listing); + panel.setRightComponent(box); + + + } + + /** + * + * @param e + */ + public void stateChanged(ChangeEvent e) { + + PageState ps = e.getPageState(); + // String key = (String) m_tree.getSelectedKey(ps); + // added cg - reset existing group add panel to the search screen + // when a new group is selected from the tree + // ps.setValue(GROUP_ID_PARAM, new BigDecimal(key)); + // int selectedIndex = Integer.parseInt((String) m_list.getSelectedKey(ps)); + // setTab(selectedIndex, ps); + } + + + +} Deleted: trunk/ccm-core/src/com/arsdigita/ui/admin/SitemapAdministrationTab.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/admin/SitemapAdministrationTab.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-core/src/com/arsdigita/ui/admin/SitemapAdministrationTab.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -1,74 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.arsdigita.ui.admin; - -import com.arsdigita.bebop.BoxPanel; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.SingleSelectionModel; -import com.arsdigita.bebop.SplitPanel; -import com.arsdigita.bebop.event.ChangeEvent; -import com.arsdigita.bebop.event.ChangeListener; -import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.ui.sitemap.SiteListing; -import com.arsdigita.ui.sitemap.SiteMapAdminPane; - -import java.math.BigDecimal; - -/** - * - * @author pb - */ -public class SitemapAdministrationTab extends BoxPanel - implements AdminConstants, ChangeListener { - - private GlobalizedMessage m_title; - - - /** - * Constructor - */ - public SitemapAdministrationTab() { - - // m_title = "TEST für ein neues Pannel"; - setClassAttr("sidebarNavPanel"); - setAttribute("navbar-title", "Sitemap"); - // m_componentList = new ArrayList(); - // m_keys = new ArrayList(); - SiteListing listing = new SiteListing(); - listing.setClassAttr("navbar"); - - SingleSelectionModel m = listing.getTree().getSelectionModel(); - SiteMapAdminPane details = new SiteMapAdminPane(m, listing.getCFGLink()); - - BoxPanel box = new BoxPanel(); - box.setClassAttr("main"); - box.add(details); - - SplitPanel panel = new SplitPanel(); - panel.setClassAttr("sidebarNavPanel"); - panel.setLeftComponent(listing); - panel.setRightComponent(box); - - - } - - /** - * - * @param e - */ - public void stateChanged(ChangeEvent e) { - - PageState ps = e.getPageState(); - // String key = (String) m_tree.getSelectedKey(ps); - // added cg - reset existing group add panel to the search screen - // when a new group is selected from the tree - // ps.setValue(GROUP_ID_PARAM, new BigDecimal(key)); - // int selectedIndex = Integer.parseInt((String) m_list.getSelectedKey(ps)); - // setTab(selectedIndex, ps); - } - - - -} Modified: trunk/ccm-core/src/com/arsdigita/ui/admin/UserBrowsePane.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/ui/admin/UserBrowsePane.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-core/src/com/arsdigita/ui/admin/UserBrowsePane.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -102,7 +102,7 @@ private Component m_extremeActionPanel; private Component m_userDeleteFailedPanel; private GroupAdministrationTab m_groupAdministrationTab; - private SitemapAdministrationTab m_sitemapAdministrationTab; + private ApplicationsAdministrationTab m_sitemapAdministrationTab; private TabbedPane m_tabbedPane; private List m_groupList = null; @@ -556,7 +556,7 @@ m_groupAdministrationTab = groupAdministrationTab; } - public void setSitemapAdministrationTab(SitemapAdministrationTab + public void setSitemapAdministrationTab(ApplicationsAdministrationTab sitemapAdministrationTab) { m_sitemapAdministrationTab = sitemapAdministrationTab; } Modified: trunk/ccm-core/src/com/arsdigita/util/Assert.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/util/Assert.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-core/src/com/arsdigita/util/Assert.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -226,8 +226,8 @@ * <code>object</code> * @throws AssertionError if the object is null */ - public static final void exists(final Object object, - final Class clacc) { + public static void exists(final Object object, + final Class clacc) { if (object == null) { final String message = clacc.getName() + " is null"; @@ -245,8 +245,8 @@ * * @throws AssertionError if the object is null */ - public static final void exists(final Object object, - final String label) { + public static void exists(final Object object, + final String label) { if (object == null) { final String message = label != null && label.trim().length() > 0 Deleted: trunk/ccm-portalserver/src/com/arsdigita/portalserver/ECMPresentationManager.java.nolongerInUse =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/ECMPresentationManager.java.nolongerInUse 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/ECMPresentationManager.java.nolongerInUse 2012-03-11 09:22:35 UTC (rev 2287) @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2002-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.portalserver; - -import com.arsdigita.bebop.page.PageTransformer; -import com.arsdigita.persistence.*; -import com.arsdigita.kernel.*; -import com.arsdigita.sitenode.*; -import com.arsdigita.web.*; -import java.util.*; - -/** - * ECMPresentationManager - * - * @author <a href="mailto:rh...@mi...">rh...@mi...</a> - * @version $Revision: #5 $ $Date: 2004/08/17 $ - * @version $Id: ECMPresentationManager.java pboy $ - **/ - -public class ECMPresentationManager extends PageTransformer { - - - private static Map m_sheets = new HashMap(); - - protected synchronized Stylesheet findStylesheet(SiteNode node, Locale l, - String outputType) { - TransactionContext ctx = - SessionManager.getSession().getTransactionContext(); - - boolean commit = false; - if (!ctx.inTxn()) { - ctx.beginTxn(); - commit = true; - } - - String key = l + "." + outputType; - - Stylesheet result = (Stylesheet) m_sheets.get(key); - - if (result == null || !result.isValid()) { - ApplicationType type = - ApplicationType.retrieveApplicationTypeForApplication( - PortalSite.BASE_DATA_OBJECT_TYPE); - PackageType pkg = type.getPackageType(); - result = pkg.getStylesheet(l, outputType); - result.disconnect(); - m_sheets.put(key, result); - } - - if (commit) { - ctx.commitTxn(); - } - - return result; - } - -} Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/Loader.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -20,7 +20,6 @@ package com.arsdigita.portalserver; -// import com.arsdigita.db.*; import com.arsdigita.domain.*; import com.arsdigita.kernel.ACSObjectInstantiator; import com.arsdigita.kernel.Kernel; @@ -43,7 +42,6 @@ import com.arsdigita.runtime.*; import com.arsdigita.web.Application; -import com.arsdigita.web.ApplicationSetup; import com.arsdigita.web.ApplicationType; // USED BY loadSubsite() which es meant to replace the applications mounted @@ -138,81 +136,29 @@ */ private void loadPortalSiteApplicationType() { - // Step 1: Create an application type for portalserver - // Try: new style legacy free application - // ApplicationType type = - // new ApplicationType("Portal Site", // creates portalsite as - // // module name for XSL - // PortalSite.BASE_DATA_OBJECT_TYPE ); - // type.setDescription - // ("A Portal Site is a center for content aggregation. It usually" + - // "has its own set of applications, such as a discussion forum" + - // "and content items, as well as a list of participants."); - -/* s_log.info("PackageType 'portalsite' is not installed. " + - "Installing now..."); - - // Stylesheet stylesheet = Stylesheet.createStylesheet - // ("/packages/portalserver/xsl/portalserver.xsl"); - - PackageType packageType = PackageType.create - ("portalsite", "PortalSite", "PortalSites", - "http://arsdigita.com/portalsite"); - // packageType.addStylesheet(stylesheet); - packageType.setDispatcherClass - ("com.arsdigita.portalserver.ui.PortalDispatcher"); - packageType.save(); -*/ - //Step 2: Create themes - // buildDefaultThemes(); - - // Step 3: Create legacy compatible ApplicationType + /* First try: create a new style, legacy compatible application */ +/* ApplicationType type = ApplicationType.createApplicationType( "portalsite", "Portal Site", PortalSite.BASE_DATA_OBJECT_TYPE); - type.setDescription - ("A Portal Site is a center for content aggregation. It usually" + - "has its own set of applications, such as a discussion forum " + - "and content items, as well as a list of participants."); // Current code requires an apps specific dispatcher class. Has to be // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.ui.PortalDispatcher"); + +*/ -/* - ApplicationSetup setup = new ApplicationSetup(s_log); + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Portal Site", // title + PortalSite.BASE_DATA_OBJECT_TYPE ); - setup.setApplicationObjectType(PortalSite.BASE_DATA_OBJECT_TYPE); - // setup.setPackageType(packageType); - setup.setKey("portalsite"); - setup.setTitle("Portal Site"); - setup.setDescription - ("A Portal Site is a center for content aggregation. It usually" + - "has its own set of applications, such as a discussion forum" + + type.setDescription + ("A Portal Site is a center for content aggregation. It usually" + + "has its own set of applications, such as a discussion forum " + "and content items, as well as a list of participants."); - setup.setDispatcherClass - ("com.arsdigita.portalserver.ui.PortalDispatcher"); - setup.setPortalApplication(false); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new PortalSite(dataObject); - } - }); - setup.run(); -*/ - /* Should not be requiered here - DomainObjectFactory.registerInstantiator( - Role.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { - public DomainObject doNewInstance(DataObject dataObject) { - return new Role(dataObject); - } - } - ); - * - */ - + type.save(); } /** @@ -284,37 +230,23 @@ // in applications mit primary_url=/portal-admin/ // in acs_object mit default_domain_class=c.ad.ps.admin.PSAdmin und // object_type=c.ad.admin.CWAdmin, ebenfalls wg. BASE_DATA_OBJ_TYPE - +/* ApplicationType type = ApplicationType.createApplicationType( "portal-admin", "Portal Server Site Administration", PSAdmin.BASE_DATA_OBJECT_TYPE); - type.setDescription ("Displays common administration tasks."); // Current code requires an apps specific dispatcher class. Has to be // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.admin.ui.Dispatcher"); -/* - ApplicationSetup setup = new ApplicationSetup(s_log); +*/ + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Portal Admin", // title + PSAdmin.BASE_DATA_OBJECT_TYPE ); - setup.setApplicationObjectType(PSAdmin.BASE_DATA_OBJECT_TYPE); - setup.setTitle("Portal Server Site Administration"); - setup.setDescription("Displays common administration tasks."); - setup.setPortalApplication(false); - setup.setKey("portal-admin"); - // db based stylesheets no longer used. - // setup.setStylesheet("/packages/portalserver/xsl/portalserver.xsl"); - setup.setDispatcherClass("com.arsdigita.portalserver.admin.ui.Dispatcher"); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new PSAdmin(dataObject); - } - }); - // setupAdminInstance(setup.run()); - setup.run(); - // setupPortalSiteAdminInstance(setup.run()) - */ + type.setDescription ("Displays common administration tasks."); + type.save(); } @@ -327,6 +259,7 @@ private void loadPortalCreatorApplicationType() { // formerly private ApplicationType setupPortalCreator() { in ui.admin.Initializer +/* ApplicationType type = ApplicationType.createApplicationType( "portal-create", "Portal Creator", @@ -336,26 +269,16 @@ // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.ui.admin.PortalCreateDispatcher"); -/* - ApplicationSetup setup = new ApplicationSetup(s_log); - setup.setApplicationObjectType(PortalCreator.BASE_DATA_OBJECT_TYPE); - setup.setTitle("Portal Creator"); - setup.setDescription("Creates portals."); - setup.setWorkspaceApplication(false); - setup.setKey("portal-create"); -// setup.setStylesheet("/packages/portalserver/xsl/portalserver.xsl"); - setup.setDispatcherClass( - "com.arsdigita.portalserver.ui.admin.PortalCreateDispatcher"); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new PortalCreator(dataObject); - } - }); - - setup.run(); - // return setup.run(); */ + + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Portal Creator", // title + PortalCreator.BASE_DATA_OBJECT_TYPE ); + + type.setDescription ("Creates portals."); + type.save(); + } @@ -366,16 +289,17 @@ private void loadPortalSitemapApplicationType() { // formerly private ApplicationType setupPortalSitemapper() { +/* ApplicationType type = ApplicationType.createApplicationType( "portal-sitemap", "Portal Site Map", PortalSiteMap.BASE_DATA_OBJECT_TYPE); - type.setDescription ("Displays and manages Portals."); // Current code requires an apps specific dispatcher class. Has to be // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.ui.admin.PortalSiteMapDispatcher"); +*/ /* ApplicationSetup setup = new ApplicationSetup(s_log); setup.setApplicationObjectType(PortalSiteMap.BASE_DATA_OBJECT_TYPE); setup.setTitle("Portal Site Map"); @@ -394,9 +318,18 @@ setup.run(); */ // return setup.run(); - } + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Portal SiteMap", // title + PortalSiteMap.BASE_DATA_OBJECT_TYPE ); + type.setDescription ("Displays and manages Portals."); + type.save(); + + } + + /* FORMERLY personal.Initializer */ @@ -407,7 +340,7 @@ private void loadPersonalPortalCreatorApplicationType() { // private ApplicationType loadPersonalPortalCreatorApplicationType() { // formerly private ApplicationType setupPersonalPortalCreatorApplication() { - +/* ApplicationType type = ApplicationType.createApplicationType( "personal-portal-creator", "Personal Portal Creator", @@ -417,67 +350,41 @@ // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.personal.PersonalPortalCreatorDispatcher"); +*/ - // return type; + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Personal Portal Creator", // title + PersonalPortalCreator.BASE_DATA_OBJECT_TYPE ); -/* ApplicationSetup setup = new ApplicationSetup(s_log); + type.setDescription ("Displays and manages Portals."); + type.save(); - setup.setApplicationObjectType - (PersonalPortalCreator.BASE_DATA_OBJECT_TYPE); - setup.setKey("personal-portal-creator"); - setup.setTitle("Personal Portal Creator"); - setup.setDescription("Responsible for creating personal portals."); - // db based stylesheets nolonger used - // setup.setStylesheet("/packages/portalserver/xsl/portalserver.xsl"); - setup.setDispatcherClass - ("com.arsdigita.portalserver.personal.PersonalPortalCreatorDispatcher"); - setup.setPortalApplication(false); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new PersonalPortalCreator(dataObject); - } - }); + } - return setup.run(); */ - } - private void loadPersonalPortalApplicationType() { // private ApplicationType loadPersonalPortalApplicationType() { // formerly private ApplicationType setupPersonalPortalApplication() { - +/* ApplicationType type = ApplicationType.createApplicationType( "personal-portal", "Personal Portal", PersonalPortal.BASE_DATA_OBJECT_TYPE); - type.setDescription ("A portal for an individual."); // Current code requires an apps specific dispatcher class. Has to be // modified to be able to create a legacy free app type. type.setDispatcherClass ("com.arsdigita.portalserver.personal.PersonalPortalDispatcher"); +*/ + // Try: new style legacy free application + ApplicationType type = new + ApplicationType("Personal Portal", // title + PersonalPortal.BASE_DATA_OBJECT_TYPE ); + type.setDescription ("A portal for an individual."); + type.save(); -/* ApplicationSetup setup = new ApplicationSetup(s_log); - - setup.setApplicationObjectType(PersonalPortal.BASE_DATA_OBJECT_TYPE); - setup.setKey("personal-portal"); - setup.setTitle("Personal Portal"); - setup.setDescription("A portal for an individual."); - // setup.setStylesheet("/packages/portalserver/xsl/portalserver.xsl"); - setup.setDispatcherClass - ("com.arsdigita.portalserver.personal.PersonalPortalDispatcher"); - setup.setPortalApplication(false); - setup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new PersonalPortal(dataObject); - } - }); - - ApplicationType type = setup.run(); - - // XXX This must go after setup.run(). Need more elegant approach. +/* // XXX This must go after setup.run(). Need more elegant approach. // pboy: uses ResourceType.registerResourceTypeConfig() which registers // in a hash map. Therefore: not suitable for a loader, may have to be // moved into initializer! @@ -492,27 +399,22 @@ // S e t u p o f P O R T A L a p p l i c a t i o n s // // //////////////////////////////////////////////////////////////////////// + + + /** + * Instantiate an application of type PortalSite with site wide administration + * tools. + */ private void setupAdminPortal() { - // First check, whether an instance of /administration / is already - // installed. - // Running in a Loader, this is just impossible. So we can create - // /administration/ immediately - // try { - // SiteNode sn = SiteNode.getSiteNode("/administration", false); - // if (!"administration".equals(sn.getName())) { - PortalSite ps = PortalSite.createPortalSite( - "administration", "Administration", null); - ps.setMission("Administration Portal"); - ps.save(); - // } - // } catch (DataObjectNotFoundException e) { - // Assert.fail(e.getMessage()); - // } + PortalSite ps = PortalSite.createPortalSite("administration", + "Administration", + null); + ps.setMission("Administration Portal"); + ps.save(); + } - /* FORMERLY admin.Initializer */ - /** * Setup an PortalServer Administration Instance as legacy compatible * application. Deleted: trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalServlet.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalServlet.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalServlet.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2002-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.portalserver; - -import com.arsdigita.bebop.Page; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.portalserver.ui.PortalHomePage; -import com.arsdigita.portalserver.ui.PortalParticipants; -import com.arsdigita.portalserver.ui.admin.PortalAdminPage; -import com.arsdigita.templating.PresentationManager; -import com.arsdigita.templating.Templating; -import com.arsdigita.web.Application; -import com.arsdigita.web.BaseApplicationServlet; -import com.arsdigita.xml.Document; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.log4j.Logger; - -/** - * - * @author Justin Ross <<a href="mailto:jr...@re...">jr...@re...</a>> - * @version $Id: PortalServlet.java pboy $ - */ -public class PortalServlet extends BaseApplicationServlet { - - private static final Logger s_log = Logger.getLogger - (PortalServlet.class); - - private static final PresentationManager s_presManager = - Templating.getPresentationManager(); - - private static Page s_homePage = new PortalHomePage(); - private static Page s_particPage = PortalParticipants.createPage(); - private static Page s_adminPage = null; - - static { - TransactionContext ctx = SessionManager.getSession().getTransactionContext(); - ctx.beginTxn(); - - s_adminPage = new PortalAdminPage(); - - ctx.commitTxn(); - } - - public void doService(HttpServletRequest sreq, - HttpServletResponse sresp, - Application app) - throws ServletException, IOException { - s_log.debug("PortalServlet.doService called for request '" + - sreq.getRequestURI() + "'"); - - String path = sreq.getServletPath(); - Document doc = null; - - if (path.endsWith("participants")) { - doc = s_particPage.buildDocument(sreq, sresp); - } else if (path.endsWith("admin")) { - doc = s_adminPage.buildDocument(sreq, sresp); - } else { - doc = s_homePage.buildDocument(sreq, sresp); - } - - s_presManager.servePage(doc, sreq, sresp); - } -} Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSite.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSite.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSite.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -45,6 +45,7 @@ import com.arsdigita.web.ApplicationCollection; import com.arsdigita.web.ApplicationType; +import com.arsdigita.web.URL; import java.math.BigDecimal; import java.util.Calendar; import java.util.Date; @@ -104,6 +105,10 @@ super(dataObject); } + /** + * + * Do we really need this when PortalSite is a new style application? + */ @Override protected void initialize() { super.initialize(); @@ -122,6 +127,14 @@ } } + /** + * + * @param urlName + * @param title + * @param parent + * @param inheritPermissions + * @return + */ public static PortalSite createPortalSite (String urlName, String title, PortalSite parent, boolean inheritPermissions) { @@ -147,7 +160,10 @@ /** - * Creates an Instance ot ApplicationType PortalSite as a legacy free + * Creates an Instance ot ApplicationType PortalSite + * Whether is is a legacy free or a legacy compatible application depends + * on the property of its application type. Nothing to adjust here for that. + * * application. * @param urlName * @param title @@ -158,19 +174,18 @@ String title, PortalSite parent) { - ApplicationType type = - ApplicationType.retrieveApplicationTypeForApplication - (BASE_DATA_OBJECT_TYPE); + ApplicationType type = ApplicationType + .retrieveApplicationTypeForApplication + (BASE_DATA_OBJECT_TYPE); + /* Uses class Application's create method. Type of created application + * depends on the type of ApplicationType */ PortalSite ps = (PortalSite) Application.createApplication - (type, urlName, title, parent); + (type, urlName, title, parent); ps.setUnarchived(); - ps.setDraft(false); - ps.setCreationDate(); - ps.setPersonalizable(false); return ps; @@ -217,30 +232,6 @@ return portalsiteCollection; } - /** - * - * @param siteNode - * @return Can return null. - */ -/* OBVIOUSLY NO LONGER USED - public static PortalSite retrievePortalSiteForSiteNode(SiteNode siteNode) { - DataQuery query = SessionManager.getSession().retrieveQuery - ("com.arsdigita.workspace.workspaceForSiteNodeID"); - - query.setParameter("siteNodeID", siteNode.getID()); - - PortalSite portalsite = null; - - if (query.next()) { - DataObject dataObject = (DataObject) query.get("workspace"); - portalsite = PortalSite.retrievePortalSite(dataObject); - } - - query.close(); - - return portalsite; - } -*/ // Can return null. public static PortalSite retrievePortalSite(BigDecimal id) { return (PortalSite) Application.retrieveApplication(id); @@ -445,15 +436,19 @@ return currentPortalSite; } - private static PortalSite - doGetCurrentPortalSite(HttpServletRequest request) { + /** + * + * @param request + * @return + */ + private static PortalSite doGetCurrentPortalSite(HttpServletRequest req) { // First, assume that the user is at a PortalSite already, // since we can save a query if we're right. This logic will // not make sense if we find that this method is called mostly // from sub applications of a portal site, since it incurs an // extra query in that case. - Application application = Application.getCurrentApplication(request); + Application application = Application.getCurrentApplication(req); if (application instanceof PortalSite) { return (PortalSite) application; @@ -472,22 +467,29 @@ } } + /** + * + * @return + */ public static PortalSiteCollection getRootPortalSites() { + DataQuery query = SessionManager.getSession().retrieveQuery ("com.arsdigita.workspace.rootWorkspaces"); DataCollection collection = new DataQueryDataCollectionAdapter(query, "workspace"); - query.close(); PortalSiteCollection psc = new PortalSiteCollection(collection); - psc.filterForUnarchived(); return psc; } + /** + * + * @return + */ public static PortalSiteCollection getAllRootPortalSites() { DataQuery query = SessionManager.getSession().retrieveQuery ("com.arsdigita.workspace.rootWorkspaces"); @@ -505,10 +507,18 @@ return new PortalSiteCollection(collection); } + /** + * + * @param portalsite + */ public void addRelatedPortalSite(PortalSite portalsite) { add("relatedWorkspace", portalsite); } + /** + * + * @param portalsite + */ public void removeRelatedPortalSite(PortalSite portalsite) { remove("relatedWorkspace", portalsite); } @@ -636,6 +646,10 @@ } } + /** + * + * @return + */ public PartyCollection getParticipants() { return new PartyCollection( ((DataAssociation) get("participants")).cursor()); @@ -768,7 +782,11 @@ remove("workspaceTab",ptab); } - // Can return null. + /** + * + * + * @return (Can return null.) + */ public PortalTabCollection getTabsForPortalSite() { DataAssociation association = (DataAssociation)get("workspaceTab"); @@ -918,6 +936,9 @@ return (Date)get("archiveDate"); } + /** + * + */ public void archive() { Party p; @@ -1022,6 +1043,12 @@ return result.listIterator(); } + /** + * + * @param ps + * @param user + * @return + */ public static PortalSite createSubPortal(PortalSite ps, User user) { String urlfrag = "U-" + user.getID().toString(); PortalSite psite = createPortalSite(urlfrag,ps.getDisplayName(),ps); @@ -1081,4 +1108,43 @@ return psite; } + /** + * Returns the path name of the location of the applications servlet/JSP. + * + * Application implementations may overwrite this method to provide an + * application specific location, especially if an application (module) is + * to be installed along with others in one context. + * + * If you install the module into its own context you may use a standard + * location. In most cases though all modules (applications) of an + * webapplication should be installed into one context. + * + * Frequently it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>applicationName-files</servlet-name> + * <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + * <init-param> + * <param-name>template-path</param-name> + * <param-value>/templates/ccm-applicationName</param-value> + * </init-param> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>applicationName-files</servlet-name> + * <url-pattern>/ccm-applicationName/files/*</url-pattern> + * </servlet-mapping> + * + * NOTE: According to Servlet API the path always starts with a leading '/' + * and includes either the servlet name or a path to the servlet, but does + * not include any extra path information or a query string. Returns an + * empry string ("") is the servlet used was matched using the "/*" pattern. + * + * @return path name to the applications servlet/JSP + */ + @Override + public String getServletPath() { + return URL.SERVLET_DIR + "/portalsite"; + } + } Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSiteServlet.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSiteServlet.java (rev 0) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/PortalSiteServlet.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2002-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.portalserver; + +import com.arsdigita.bebop.Page; +import com.arsdigita.portalserver.ui.PortalHomePage; +import com.arsdigita.portalserver.ui.PortalParticipants; +import com.arsdigita.portalserver.ui.admin.PortalAdminPage; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.templating.Templating; +import com.arsdigita.util.Assert; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; +import com.arsdigita.xml.Document; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + + +/** + * Portal Site Application Servlet class, central entry point to create and + * process the applications UI. + * + * @author Justin Ross <<a href="mailto:jr...@re...">jr...@re...</a>> + * @author Peter Boy <a href="mailto:pb...@ze..."> + * @version $Id: PortalSiteServlet.java pboy $ + */ +public class PortalSiteServlet extends BaseApplicationServlet { + + private static final Logger s_log = Logger.getLogger(PortalSiteServlet.class); + + private static final PresentationManager s_presManager = + Templating.getPresentationManager(); + + private static Page s_homePage = new PortalHomePage(); + private static Page s_particPage = PortalParticipants.createPage(); + private static Page s_adminPage = s_adminPage = new PortalAdminPage(); + + /** + * + * @param sreq + * @param sresp + * @param app + * @throws ServletException + * @throws IOException + */ + public void doService(HttpServletRequest sreq, + HttpServletResponse sresp, + Application app) + throws ServletException, IOException { + s_log.debug("PortalServlet.doService called for request '" + + sreq.getRequestURI() + "'"); + + String pathInfo = sreq.getPathInfo(); + Assert.exists(pathInfo, "String pathInfo"); + if (pathInfo.length() > 1 && pathInfo.endsWith("/")) { + /* NOTE: ServletAPI specifies, pathInfo may be empty or will + * start with a '/' character. It currently carries a + * trailing '/' if a "virtual" page, i.e. not a real jsp, but + * result of a servlet mapping. But Application requires url + * NOT to end with a trailing '/' for legacy free applications. */ + pathInfo = pathInfo.substring(0, pathInfo.length()-1); + } + Document doc = null; + + if (pathInfo.endsWith("participants")) { + doc = s_particPage.buildDocument(sreq, sresp); + } else if (pathInfo.endsWith("admin")) { + doc = s_adminPage.buildDocument(sreq, sresp); + } else { + doc = s_homePage.buildDocument(sreq, sresp); + } + + s_presManager.servePage(doc, sreq, sresp); + } +} Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java (rev 0) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/Dispatcher.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.portalserver.admin; + +// import com.arsdigita.bebop.*; +import com.arsdigita.portalserver.admin.PSAdminPage; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.page.BebopMapDispatcher; +import java.util.*; + +/** + * Dispatcher + * + * @author <a href="mailto:rh...@mi...">rh...@mi...</a> + * @version $Revision: #3 $ $Date: 2004/08/17 $ + **/ + +public class Dispatcher extends BebopMapDispatcher { + + public final static String versionId = "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/Dispatcher.java#3 $ by $Author: dennis $, $DateTime: 2004/08/17 23:19:25 $"; + + public Dispatcher() { + Map m = new HashMap(); + Page index = new PSAdminPage(); + index.lock(); + m.put("", index); + m.put("index.jsp", index); + m.put("index.html", index); + setMap(m); + } + +} Modified: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdmin.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdmin.java 2012-03-11 09:14:14 UTC (rev 2286) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdmin.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -21,6 +21,7 @@ // import com.arsdigita.portalserver.*; import com.arsdigita.web.Application; import com.arsdigita.persistence.*; +import com.arsdigita.web.URL; import org.apache.log4j.Logger; /** @@ -36,6 +37,7 @@ */ public class PSAdmin extends Application { + /** Logger instance for debugging */ private static final Logger s_log = Logger.getLogger(PSAdmin.class); public static final String BASE_DATA_OBJECT_TYPE = @@ -49,4 +51,44 @@ public PSAdmin(DataObject dataObject) { super(dataObject); } + + /** + * Returns the path name of the location of the applications servlet/JSP. + * + * Application implementations may overwrite this method to provide an + * application specific location, especially if an application (module) is + * to be installed along with others in one context. + * + * If you install the module into its own context you may use a standard + * location. In most cases though all modules (applications) of an + * webapplication should be installed into one context. + * + * Frequently it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>applicationName-files</servlet-name> + * <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> + * <init-param> + * <param-name>template-path</param-name> + * <param-value>/templates/ccm-applicationName</param-value> + * </init-param> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>applicationName-files</servlet-name> + * <url-pattern>/ccm-applicationName/files/*</url-pattern> + * </servlet-mapping> + * + * NOTE: According to Servlet API the path always starts with a leading '/' + * and includes either the servlet name or a path to the servlet, but does + * not include any extra path information or a query string. Returns an + * empry string ("") is the servlet used was matched using the "/*" pattern. + * + * @return path name to the applications servlet/JSP + */ + @Override + public String getServletPath() { + return URL.SERVLET_DIR + "/psadmin"; + } + } Added: trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java =================================================================== --- trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java (rev 0) +++ trunk/ccm-portalserver/src/com/arsdigita/portalserver/admin/PSAdminPage.java 2012-03-11 09:22:35 UTC (rev 2287) @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.portalserver.admin; + +import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationCollection; +import com.arsdigita.bebop.table.*; +import com.arsdigita.bebop.*; +import com.arsdigita.dispatcher.*; +import com.arsdigita.portalserver.*; +import com.arsdigita.portalserver.PortalPage; +import com.arsdigita.toolbox.ui.*; +import org.apache.log4j.Logger; + +import com.arsdigita.xml.Document; +import com.arsdigita.xml.Element; + +/** + * PSAdminPage + * - + * This class is the UI component for Portal-admin. + * + * @author <a href="mailto:rh...@mi...">rh...@mi...</a> + * @version $Revision: #8 $ $Date: 2004/08/17 $ + */ +class PSAdminPage extends PortalPage { + public static final String versionId = + "$Id: //portalserver/dev/src/com/arsdigita/portalserver/admin/ui/AdminPage.java#8 $" + + "$Author: dennis $" + + "$DateTime: 2004/08/17 23:19:25 $"; + + BoxPanel m_bpanel; + + private static Logger s_log = Logger.getLogger + (PSAdminPage.class.getName()); + + private RequestLocal m_children = new RequestLocal() { + public Object initialValue(PageState ps) { + Application app = Application.getCurrentApplication + (DispatcherHelper.getRequest()); + return app.getChildApplications(); + } + }; + + public PSAdminPage() { + getHeader().setIdAttr("admin"); + } + + protected void buildContextBar() { + DimensionalNavbar navbar = new DimensionalNavbar(); + + navbar.setClassAttr("portalNavbar"); + + navbar.add(new Link(new PersonalPortalLinkPrinter())); + + navbar.add(new Label(new CurrentApplicationLabelPrinter())); + + getHeader().add(navbar); + } + + /** + * This method outputs a list of links to admin functionality. + */ + + protected void buildBody(Container body) { + + m_bpanel = new BoxPanel(); + m_bpanel.setClassAttr("portaladminapps"); + body.add(m_bpanel); + Link portalCreateLink = new Link("Create Top-Level Portals", + "/portal-admin/portal-create"); + Link portalSiteMapLink = new Link("Manage Portals", + "/portal-admin/portal-sitemap"); + Link managePeopleLink = new Link("Manage Users and Groups", + "/admin"); + m_bpanel.add(portalCreateLink); + m_bpanel.add(portalSiteMapLink); + m_bpanel.add(managePeopleLink); + } + + /** + * This method is called by the generateXML() method of the parent + * class, and writes a CSS style block into the output. + */ + + public void addStyleBlock(PageState state, Document parent) { + PortalSite psite = PortalSite.getCurrentPortalSite(state.getRequest()); + + StringBuffer buffer = new StringBuffer(); + + buffer.append("<STYLE type=\"text/css\"> <!--"); + + + buffer.append(" table.globalHeader { background-color: rgb(225,225,225);} "); + + buffer.append(" table.bottomRule { background: rgb(... [truncated message content] |
Author: pboy Date: 2012-03-11 09:14:14 +0000 (Sun, 11 Mar 2012) New Revision: 2286 Added: trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java.nolongerInUse trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ServiceDispatcher..nolongerInUse trunk/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl Removed: trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ServiceDispatcher.java trunk/ccm-core/src/com/arsdigita/templating/LegacyStylesheetResolver.java.nolongerInUse trunk/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml trunk/ccm-cms-assets-fileattachment/src/com/arsdigita/cms/contentassets/ui/FileAttachmentModelBuilder.java trunk/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ui/ImageStepDisplay.java trunk/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationImageStep.java trunk/ccm-cms/src/com/arsdigita/cms/CMS.java trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java trunk/ccm-cms/src/com/arsdigita/cms/Loader.java trunk/ccm-cms/src/com/arsdigita/cms/Service.java trunk/ccm-cms/src/com/arsdigita/cms/ServiceServlet.java trunk/ccm-cms/src/com/arsdigita/cms/Workspace.java trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ItemDispatcher.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/MultilingualItemResolver.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleItemResolver.java trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java trunk/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemNavbar.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentItemRenderer.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionNavbar.java trunk/ccm-cms/src/com/arsdigita/cms/ui/GlobalNavigation.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ImageBrowser.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ImageDisplay.java trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchWidget.java trunk/ccm-cms/src/com/arsdigita/cms/ui/SectionConfigurationPage.java trunk/ccm-cms/src/com/arsdigita/cms/ui/WorkspaceContextBar.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/lifecycle/ItemLifecycleSelectForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/portlet/TaskPortletRenderer.java trunk/ccm-cms/src/com/arsdigita/cms/ui/templates/CategoryTemplates.java trunk/ccm-cms/src/com/arsdigita/cms/ui/workflow/TaskFinishForm.java trunk/ccm-core/src/com/arsdigita/categorization/Categorization.java trunk/ccm-core/src/com/arsdigita/templating/ApplicationPatternGenerator.java trunk/ccm-core/src/com/arsdigita/templating/URLPatternGenerator.java trunk/ccm-core/src/com/arsdigita/ui/login/UserInfo.java trunk/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java trunk/ccm-core/src/com/arsdigita/web/URL.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/Repository.java trunk/ccm-docmgr/src/com/arsdigita/cms/docmgr/dispatcher/MultilingualDocumentResolver.java trunk/ccm-ldn-aplaws/bundles/custom/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/demo/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/devel/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/extended/cfg/web.xml trunk/ccm-ldn-aplaws/bundles/standard/cfg/web.xml trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/importer/TermItemBuilder.java trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/Survey.java trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SimpleSurveyPanel.java trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/SurveyTable.java trunk/ccm-simplesurvey/src/com/arsdigita/simplesurvey/ui/admin/AdminSurveyTable.java trunk/ccm-webpage/src/com/arsdigita/cms/webpage/ui/WebpageCMSEditorPage.java trunk/ccm-webpage/src/com/arsdigita/cms/webpage/ui/WebpagePreviewPage.java Log: Module ccm-cms cms-service and cms-workspace (content-center) now legacy free type of application. Module ccm-cms is now completely legacy free. Update script not yet included. Modified: trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-bundle/bundles/demo/cfg/web-sci.xml 2012-03-11 09:14:14 UTC (rev 2286) @@ -32,7 +32,7 @@ <filter> <filter-name>shortcuts</filter-name> - <filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> </filter> <filter> @@ -52,6 +52,7 @@ </filter-mapping> --> + <filter-mapping> <filter-name>subsite</filter-name> <url-pattern>/*</url-pattern> @@ -158,11 +159,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <servlet> + <servlet-name>content-center</servlet-name> + <servlet-class>com.arsdigita.cms.WorkspaceServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>content-section</servlet-name> <servlet-class>com.arsdigita.cms.ContentSectionServlet</servlet-class> </servlet> <servlet> + <servlet-name>cms-service</servlet-name> + <servlet-class>com.arsdigita.cms.ServiceServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>content-type-xsl</servlet-name> <servlet-class>com.arsdigita.cms.dispatcher.ContentTypeXSLServlet</servlet-class> </servlet> @@ -280,13 +291,13 @@ </servlet> <!-- module ccm-ldn-search - servlet declarations END --> - <!-- module ccm-ldn-shortcuts - servlet definitions --> + <!-- module ccm-shortcuts - servlet definitions --> <servlet> <servlet-name>shortcuts-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-shortcuts</param-value> + <param-value>/templates/ccm-shortcuts</param-value> </init-param> </servlet> @@ -386,10 +397,10 @@ </servlet-mapping> <!-- module ccm-ldn-search - servlet mappings END --> - <!-- module ccm-ldn-shortcuts - servlet mappings --> + <!-- module ccm-shortcuts - servlet mappings --> <servlet-mapping> <servlet-name>shortcuts-files</servlet-name> - <url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> </servlet-mapping> <!-- module ccm-subsite - servlet mappings BEGIN --> @@ -495,11 +506,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <servlet-mapping> + <servlet-name>content-center</servlet-name> + <url-pattern>/templates/servlet/content-center/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>content-section</servlet-name> - <url-pattern>/themes/servlet/content-section/*</url-pattern> + <url-pattern>/templates/servlet/content-section/*</url-pattern> </servlet-mapping> <servlet-mapping> + <servlet-name>cms-service</servlet-name> + <url-pattern>/templates/servlet/cms-service/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>content-item-xsl</servlet-name> <url-pattern>/templates/servlet/content-item/*</url-pattern> </servlet-mapping> Modified: trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml =================================================================== --- trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-bundle/bundles/devel/cfg/web-sci.xml 2012-03-11 09:14:14 UTC (rev 2286) @@ -32,7 +32,7 @@ <filter> <filter-name>shortcuts</filter-name> - <filter-class>com.arsdigita.london.shortcuts.ShortcutFilter</filter-class> + <filter-class>com.arsdigita.shortcuts.ShortcutFilter</filter-class> </filter> <filter> @@ -52,6 +52,7 @@ </filter-mapping> --> + <filter-mapping> <filter-name>subsite</filter-name> <url-pattern>/*</url-pattern> @@ -158,11 +159,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <servlet> + <servlet-name>content-center</servlet-name> + <servlet-class>com.arsdigita.cms.WorkspaceServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>content-section</servlet-name> <servlet-class>com.arsdigita.cms.ContentSectionServlet</servlet-class> </servlet> <servlet> + <servlet-name>cms-service</servlet-name> + <servlet-class>com.arsdigita.cms.ServiceServlet</servlet-class> + </servlet> + + <servlet> <servlet-name>content-type-xsl</servlet-name> <servlet-class>com.arsdigita.cms.dispatcher.ContentTypeXSLServlet</servlet-class> </servlet> @@ -280,13 +291,13 @@ </servlet> <!-- module ccm-ldn-search - servlet declarations END --> - <!-- module ccm-ldn-shortcuts - servlet definitions --> + <!-- module ccm-shortcuts - servlet definitions --> <servlet> <servlet-name>shortcuts-files</servlet-name> <servlet-class>com.arsdigita.web.ApplicationFileServlet</servlet-class> <init-param> <param-name>template-path</param-name> - <param-value>/templates/ccm-ldn-shortcuts</param-value> + <param-value>/templates/ccm-shortcuts</param-value> </init-param> </servlet> @@ -386,10 +397,10 @@ </servlet-mapping> <!-- module ccm-ldn-search - servlet mappings END --> - <!-- module ccm-ldn-shortcuts - servlet mappings --> + <!-- module ccm-shortcuts - servlet mappings --> <servlet-mapping> <servlet-name>shortcuts-files</servlet-name> - <url-pattern>/ccm-ldn-shortcuts/files/*</url-pattern> + <url-pattern>/ccm-shortcuts/files/*</url-pattern> </servlet-mapping> <!-- module ccm-subsite - servlet mappings BEGIN --> @@ -495,11 +506,21 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <servlet-mapping> + <servlet-name>content-center</servlet-name> + <url-pattern>/templates/servlet/content-center/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>content-section</servlet-name> - <url-pattern>/themes/servlet/content-section/*</url-pattern> + <url-pattern>/templates/servlet/content-section/*</url-pattern> </servlet-mapping> <servlet-mapping> + <servlet-name>cms-service</servlet-name> + <url-pattern>/templates/servlet/cms-service/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>content-item-xsl</servlet-name> <url-pattern>/templates/servlet/content-item/*</url-pattern> </servlet-mapping> Added: trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl =================================================================== --- trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl (rev 0) +++ trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl 2012-03-11 09:14:14 UTC (rev 2286) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + xmlns:ui="http://www.arsdigita.com/ui/1.0" + xmlns:aplaws="http://www.arsdigita.com/aplaws/1.0" + exclude-result-prefixes="bebop cms ui aplaws xsl" + version="1.0"> + + <xsl:import href="../../heirloom/apps/content-section/xsl/content-admin.xsl"/> + <xsl:import href="../../heirloom/packages/bebop/xsl/dcp.xsl"/> + + <xsl:import href="category-step.xsl"/> + + <xsl:param name="theme-prefix" /> + <xsl:param name="internal-theme" /> + + <xsl:variable name="here"><xsl:value-of select="$internal-theme"/>/packages/cms/xml/admin/page</xsl:variable> + + <xsl:template name="cat-widget-cat-name"> + <xsl:value-of select="@name"/> + + <xsl:if test="@pid and @domain='LGSL'"> + (<xsl:value-of select="@pid"/>) + </xsl:if> + </xsl:template> + + + <xsl:template match="bebop:page[@class = 'cms-admin']"> + <html xmlns:deditor="http://www.arsdigita.com/deditor/1.0"> + <head> + <title><xsl:value-of select="bebop:title"/></title> + <link rel="stylesheet" type="text/css" href="{$internal-theme}/css/acs-master.css"/> + <link rel="stylesheet" type="text/css" href="{$internal-theme}/packages/cms/xsl/admin/cms-admin.css"/> + </head> + <body> + <xsl:call-template name="bebop:dcpJavascript"/> + <table id="global-header"> + <tr> + <td id="logo"><img src="{$theme-prefix}/images/aplaws-logo-small.png" height="30" width="30"/></td> + <td id="context"><xsl:apply-templates select="bebop:contextBar"/></td> + <td style="margin: 0; color: #3f3f3f; border: 0; padding: 0; padding-right: 18px;">Welcome <strong><xsl:value-of select="@name" /></strong></td> + <td> + <table id="global-links"> + <tr> + <td class="global-link-icon"><a href="{cms:globalNavigation/cms:workspace/@href}"><img src="{$internal-theme}/images/home.png" height="18" width="18"/></a></td> + <td class="global-link"><a href="{cms:globalNavigation/cms:workspace/@href}">Home</a></td> + + <td class="global-link-icon"><a href="{cms:globalNavigation/cms:signOut/@href}"><img src="{$internal-theme}/images/lock.png" height="18" width="14"/></a></td> + <td class="global-link"><a href="{cms:globalNavigation/cms:signOut/@href}">Logout</a></td> + </tr> + </table> + </td> + </tr> + </table> + <div id="page-title"><xsl:value-of select="bebop:title"/></div> + <xsl:if test="bebop:link[@id = 'preview_link']"> + <xsl:choose> + <xsl:when test="bebop:link[@target]"> + <div style="float: right; margin-right: 12px"><a target="{bebop:link/@target}" href="{bebop:link[@id = 'preview_link']/@href}"><xsl:value-of select="bebop:link[@id = 'preview_link']/bebop:label"/></a></div> + </xsl:when> + <xsl:otherwise> + <div style="float: right; margin-right: 12px"><a href="{bebop:link[@id = 'preview_link']/@href}"><xsl:value-of select="bebop:link[@id = 'preview_link']/bebop:label"/></a></div> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + <div><xsl:apply-templates select="*[@id = 'page-body']"/></div> + <xsl:choose> + <xsl:when test="bebop:structure"> + <div><xsl:apply-templates select="bebop:structure"/></div> + </xsl:when> + <xsl:when test="ui:debugPanel"> + <div><xsl:apply-templates select="ui:debugPanel"/></div> + </xsl:when> + </xsl:choose> + </body> + </html> + </xsl:template> + +</xsl:stylesheet> Deleted: trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl =================================================================== --- trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl 2012-03-11 09:14:14 UTC (rev 2286) @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:bebop="http://www.arsdigita.com/bebop/1.0" - xmlns:cms="http://www.arsdigita.com/cms/1.0" - xmlns:ui="http://www.arsdigita.com/ui/1.0" - xmlns:aplaws="http://www.arsdigita.com/aplaws/1.0" - exclude-result-prefixes="bebop cms ui aplaws xsl" - version="1.0"> - - <xsl:import href="../../heirloom/apps/content-section/xsl/content-admin.xsl"/> - <xsl:import href="../../heirloom/packages/bebop/xsl/dcp.xsl"/> - - <xsl:import href="category-step.xsl"/> - - <xsl:param name="theme-prefix" /> - <xsl:param name="internal-theme" /> - - <xsl:variable name="here"><xsl:value-of select="$internal-theme"/>/packages/cms/xml/admin/page</xsl:variable> - - <xsl:template name="cat-widget-cat-name"> - <xsl:value-of select="@name"/> - - <xsl:if test="@pid and @domain='LGSL'"> - (<xsl:value-of select="@pid"/>) - </xsl:if> - </xsl:template> - - - <xsl:template match="bebop:page[@class = 'cms-admin']"> - <html xmlns:deditor="http://www.arsdigita.com/deditor/1.0"> - <head> - <title><xsl:value-of select="bebop:title"/></title> - <link rel="stylesheet" type="text/css" href="{$internal-theme}/css/acs-master.css"/> - <link rel="stylesheet" type="text/css" href="{$internal-theme}/packages/cms/xsl/admin/cms-admin.css"/> - </head> - <body> - <xsl:call-template name="bebop:dcpJavascript"/> - <table id="global-header"> - <tr> - <td id="logo"><img src="{$theme-prefix}/images/aplaws-logo-small.png" height="30" width="30"/></td> - <td id="context"><xsl:apply-templates select="bebop:contextBar"/></td> - <td style="margin: 0; color: #3f3f3f; border: 0; padding: 0; padding-right: 18px;">Welcome <strong><xsl:value-of select="@name" /></strong></td> - <td> - <table id="global-links"> - <tr> - <td class="global-link-icon"><a href="{cms:globalNavigation/cms:workspace/@href}"><img src="{$internal-theme}/images/home.png" height="18" width="18"/></a></td> - <td class="global-link"><a href="{cms:globalNavigation/cms:workspace/@href}">Home</a></td> - - <td class="global-link-icon"><a href="{cms:globalNavigation/cms:signOut/@href}"><img src="{$internal-theme}/images/lock.png" height="18" width="14"/></a></td> - <td class="global-link"><a href="{cms:globalNavigation/cms:signOut/@href}">Logout</a></td> - </tr> - </table> - </td> - </tr> - </table> - <div id="page-title"><xsl:value-of select="bebop:title"/></div> - <xsl:if test="bebop:link[@id = 'preview_link']"> - <xsl:choose> - <xsl:when test="bebop:link[@target]"> - <div style="float: right; margin-right: 12px"><a target="{bebop:link/@target}" href="{bebop:link[@id = 'preview_link']/@href}"><xsl:value-of select="bebop:link[@id = 'preview_link']/bebop:label"/></a></div> - </xsl:when> - <xsl:otherwise> - <div style="float: right; margin-right: 12px"><a href="{bebop:link[@id = 'preview_link']/@href}"><xsl:value-of select="bebop:link[@id = 'preview_link']/bebop:label"/></a></div> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - <div><xsl:apply-templates select="*[@id = 'page-body']"/></div> - <xsl:choose> - <xsl:when test="bebop:structure"> - <div><xsl:apply-templates select="bebop:structure"/></div> - </xsl:when> - <xsl:when test="ui:debugPanel"> - <div><xsl:apply-templates select="ui:debugPanel"/></div> - </xsl:when> - </xsl:choose> - </body> - </html> - </xsl:template> - -</xsl:stylesheet> Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMS.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMS.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMS.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -18,6 +18,7 @@ */ package com.arsdigita.cms; +import com.arsdigita.bebop.PageState; import org.apache.log4j.Logger; /** @@ -87,4 +88,16 @@ static final void setContext(CMSContext context) { s_context.set(context); } + + /** + * Fetch the security manager. + * + * @param state The page state + * @return The SecurityManager for the content section + */ + public static SecurityManager getSecurityManager(PageState state) { + ContentSection section = CMS.getContext().getContentSection(); + return new SecurityManager(section); + } + } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/ContentSection.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -33,7 +33,6 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.globalization.Locale; import com.arsdigita.kernel.Group; -import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.persistence.CompoundFilter; import com.arsdigita.persistence.DataAssociation; @@ -51,12 +50,13 @@ import com.arsdigita.web.Web; import com.arsdigita.workflow.simple.TaskCollection; import com.arsdigita.workflow.simple.WorkflowTemplate; -import org.apache.log4j.Logger; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.StringTokenizer; + import org.apache.log4j.Level; +import org.apache.log4j.Logger; /** * <p>A content section represents a collection of content that is @@ -919,68 +919,30 @@ // // Finding a content section. // + /** * Looks up the section given the SiteNode. * - * @param node The site node + * @param path * @return The content section - * @pre ( node != null ) + * @pre ( path != null ) * @post ( return != null ) */ - public static ContentSection getSectionFromNode(SiteNode node) + public static ContentSection getSectionForPath(String path) throws DataObjectNotFoundException { - return (ContentSection) retrieveApplicationForSiteNode(node); - -// BigDecimal sectionId = null; -// -// PackageInstance pkg = node.getPackageInstance(); -// if ( pkg == null ) { -// throw new DataObjectNotFoundException( -// "No package instance for node_id=" + node.getID().toString()); -// } -// -// return getSectionFromPackage(pkg); + return (ContentSection) retrieveApplicationForPath(path); } -// /** -// * Looks up the section given the PackageInstance. -// * -// * @param pkg The package instance -// * @return The content section ID -// * @pre ( pkg != null ) -// * @post ( return != null ) -// */ -// public static ContentSection getSectionFromPackage(PackageInstance pkg) -// throws DataObjectNotFoundException { -// -// ContentSection section = null; -// -// final String query = "com.arsdigita.cms.getSectionFromPackage"; -// DataQuery dq = SessionManager.getSession().retrieveQuery(query); -// dq.setParameter("packageId", pkg.getID()); -// if ( dq.next() ) { -// DataObject dobj = (DataObject) dq.get("section"); -// if ( dobj != null ) { -// section = (ContentSection) DomainObjectFactory.newInstance(dobj); -// } -// dq.close(); -// } else { -// throw new DataObjectNotFoundException( -// "Failed to fetch a content section for the current package " + -// "instance. [package_id =" + pkg.getID().toString() + "]"); -// } -// return section; -// } /** * Get the content section for an item. * - * @deprecated use {@link ContentItem#getContentSection} instead - * * @pre item != null * @post return != null * @param item A content item * @return The content section of an item + * + * @deprecated use {@link ContentItem#getContentSection} instead */ public static ContentSection getContentSection(ContentItem item) throws DataObjectNotFoundException { @@ -991,11 +953,11 @@ /** * Get the content section for a folder. * - * @deprecated use {@link ContentItem#getContentSection} instead * @pre item != null * @post return != null * @param folder A content folder * @return The content section of the folder + * @deprecated use {@link ContentItem#getContentSection} instead */ public static ContentSection getContentSection(Folder folder) throws DataObjectNotFoundException { Modified: trunk/ccm-cms/src/com/arsdigita/cms/Loader.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/Loader.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -55,8 +55,8 @@ // Next Try // Refactor using legacy compatible web/Application and ApplicationSetup *DONE* // Refactor content-section als legacy free application *DONE* -// Refactor workspace (content-center) as a legacy free application -// Refactor cms-service as a legacy free application +// Refactor workspace (content-center) as a legacy free application *DONE* +// Refactor cms-service as a legacy free application *DONE* /** * <p>Executes nonrecurring at install time and loads (installs and initializes) @@ -130,6 +130,9 @@ s_log.debug("CMS.loader (Constructor) completed"); } + /** + * + */ public void run(final ScriptContext ctx) { s_log.debug("CMS.loader.run() invoked"); @@ -138,38 +141,22 @@ public void excurse() { setEffectiveParty(Kernel.getSystemParty()); - // 2 - step 1b) Setup the Workspace package. - // loadWorkspacePackage(); // using old stype - // new style: + // Step 1) Setup the CMS Workspace ApplicationType appType = loadWorkspaceApplicationType(); setupDefaultWorkspaceApplicationInstance(appType); - // 3 - step 1c) Setup the CMS global services package. - // loadServicePackage(); // using olde style - // new style: + // Step 2) Setup the CMS global services appType = loadServiceApplicationType(); setupDefaultServiceApplicationInstance(appType); - // 4 - step 1d) Load the content-center page mappings - // Wrong! Is Initializer task, must be done each startup, in - // any way not a Loader task. It is here for reference - // purpose during migration of the whole CMS to new style. - // loadContentCenterMapping(s_conf.getContentCenterMap() ); - - // 5) load (cms internal) content type definition(s) - // Used to be step 2 in former enterprise.init file + // Step 3) load (cms internal) content type definition(s) loadContentTypeDefinitions(s_conf.getCTDefFiles()); - // 6) Load CMS (content section) package application instance - // Used to be step 4 in former enterprise.init file - // (step 3 being initialize publishToFile, not to handle in Loader) - // Implemented by - // com.arsdigita.cms.installer.SectionInitializer + // Step 4) Load CMS content section // Loads content section application type and instance in one step loadContentSection( (String[]) get(m_contentSectionNames) ); - // Loading CMS portlets - // Used to be step 7 (last step) in former enterprise.init + // Step 5) Loading CMS portlets s_log.debug("CMS.loader going to load portlets"); ContentDirectoryPortlet.loadPortletType(); ContentItemPortlet.loadPortletType(); @@ -197,13 +184,25 @@ public static ApplicationType loadWorkspaceApplicationType() { s_log.debug("Creating CMS Workspace..."); - /* Create new stype legacy compatible application type */ - ApplicationType type = ApplicationType - .createApplicationType(Workspace.PACKAGE_KEY, - Workspace.INSTANCE_NAME, - Workspace.BASE_DATA_OBJECT_TYPE); + /* Create new type legacy compatible application type */ + // ApplicationType type = ApplicationType + // .createApplicationType(Workspace.PACKAGE_KEY, + // Workspace.INSTANCE_NAME, + // Workspace.BASE_DATA_OBJECT_TYPE); + // type.setDispatcherClass(Workspace.DISPATCHER_CLASS); + + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Content Center" will become "content-center". */ + ApplicationType type = new + ApplicationType(Workspace.INSTANCE_NAME, + Workspace.BASE_DATA_OBJECT_TYPE ); + type.setDescription("The content center workspace for content creators."); - type.setDispatcherClass(Workspace.DISPATCHER_CLASS); type.save(); s_log.debug("CMS Workspace type created."); @@ -263,7 +262,7 @@ // there is only one // appsetup.setDescription("Services to store global resources and assets."); // old style / legacy compatible properties -// appsetup.setKey(Service.PACKAGE_KEY); +// appsetup.setKey(Service.PRIMARY_URL_STUB); // appsetup.setDispatcherClass(Service.DISPATCHER_CLASS); // appsetup.setSingleton(true); // appsetup.setPortalApplication(false); @@ -277,16 +276,27 @@ // ApplicationType serviceType = appsetup.run(); // serviceType.save(); // ////////////// Current style to create app type /////////////// - /* Create new stype legacy compatible application type */ - ApplicationType serviceType = ApplicationType - .createApplicationType(Service.PACKAGE_KEY, - Service.INSTANCE_NAME, - Service.BASE_DATA_OBJECT_TYPE); - serviceType.setDescription("Services to store global resources and assets."); - serviceType.setDispatcherClass(Service.DISPATCHER_CLASS); - serviceType.save(); + /* Create new type legacy compatible application type */ + // ApplicationType type = ApplicationType + // .createApplicationType(Service.PRIMARY_URL_STUB, + // Service.INSTANCE_NAME, + // Service.BASE_DATA_OBJECT_TYPE); + // type.setDispatcherClass(Service.DISPATCHER_CLASS); - return serviceType; + /* Create new type legacy free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "CMS Service" will become "cms-service". */ + ApplicationType type = new ApplicationType("CMS Service", + Service.BASE_DATA_OBJECT_TYPE ); + + type.setDescription("Services to store global resources and assets."); + type.save(); + + return type; } @@ -299,10 +309,10 @@ // create legacy compatible application instance, // old-style package key used as url fragment where to install the instance Service app = (Service) Application.createApplication( - serviceType, // type - Service.PACKAGE_KEY, // url fragment - Service.INSTANCE_NAME,// title - null); // parent + serviceType, // type + Service.PRIMARY_URL_STUB, // url fragment + "CMS Service Instance", // title + null); // parent app.setDescription("The default CMS service instance."); app.save(); Modified: trunk/ccm-cms/src/com/arsdigita/cms/Service.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/Service.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -18,13 +18,14 @@ */ package com.arsdigita.cms; +import com.arsdigita.cms.dispatcher.StreamAsset; +import com.arsdigita.cms.dispatcher.StreamImage; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; -// import com.arsdigita.persistence.DataAssociation; -// import com.arsdigita.persistence.PersistenceException; import com.arsdigita.web.Application; +import com.arsdigita.web.URL; import java.math.BigDecimal; import org.apache.log4j.Logger; @@ -51,10 +52,9 @@ "com.arsdigita.cms.Service"; // general constants - public static final String PACKAGE_KEY = "cms-service"; - public static final String INSTANCE_NAME = "CMS Service"; - public static final String DISPATCHER_CLASS = - "com.arsdigita.cms.dispatcher.ServiceDispatcher"; + public static final String PRIMARY_URL_STUB = "cms-service"; + // public static final String DISPATCHER_CLASS = + // "com.arsdigita.cms.dispatcher.ServiceDispatcher"; // Service has no direct user interface, therefore no styesheet // public final static String STYLESHEET = // "/packages/content-section/xsl/content-center.xsl"; @@ -97,12 +97,66 @@ return BASE_DATA_OBJECT_TYPE; } + + public static String getURL() { + return "/" + PRIMARY_URL_STUB + "/"; + } + + /** + * Constuct a URL which serves a binary asset. + * + * @param asset The binary asset + * @return the URL which will serve the specified binary asset + */ + public static String getAssetURL(BinaryAsset asset) { + return getAssetURL(asset.getID()); + } + + /** + * Constuct a URL which serves a binary asset. + * + * @param assetId The asset ID + * @return the URL which will serve the specified binary asset + */ + public static String getAssetURL(BigDecimal assetId) { + StringBuilder buf = new StringBuilder(Service.getURL() ); + buf.append("stream/asset?"); + buf.append(StreamAsset.ASSET_ID).append("=").append(assetId); + return buf.toString(); + } + + + + /** + * Constuct a URL which serves an image. + * + * @param asset The image asset whose image is to be served + * @return the URL which will serve the specified image asset + */ + public static String getImageURL(ImageAsset asset) { + StringBuilder buf = new StringBuilder(Service.getURL() ); + buf.append("stream/image/?"); + buf.append(StreamImage.IMAGE_ID).append("=").append(asset.getID()); + return buf.toString(); + } + + /** + * The URL to log out. + * @return The logout URL + */ + public static String getLogoutURL() { + StringBuilder buf = new StringBuilder(Service.getURL() ); + buf.append("logout"); + return buf.toString(); + } + + /** * This is called when the application is created. */ public static Service create(String urlName, - String title, - Application parent) { + String title, + Application parent) { Service app = (Service) Application.createApplication (BASE_DATA_OBJECT_TYPE, urlName, title, parent); @@ -112,5 +166,10 @@ return app; } + @Override + public String getServletPath() { + return URL.SERVLET_DIR + "/cms-service"; + } + } Modified: trunk/ccm-cms/src/com/arsdigita/cms/ServiceServlet.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ServiceServlet.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/ServiceServlet.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -51,6 +51,15 @@ * URLs of the available services are stored in a XML file which is processed * into a cache of services on a request by request basis (lazy loading). * + * ServiceServlet is called by BaseApplicationServlet which has determined that + * ServiceServlet is associated with a request URL. + * + * The CMS Service determines whether a <tt>Page</tt> has been registered to + * the URL and if so passes the request to that page. + * + * If no <tt>Page</tt> is registered to the URL, then the CMS Service hands + * the request to the TemplateResolver to find an appropriate JSP file. + * * @author Peter Boy <pb...@ba...> * @version $Id: ServiceServlet.java 2161 2011-02-02 00:16:13Z pboy $ */ @@ -68,9 +77,7 @@ /** Mapping between a relative URL and the class name of a ResourceHandler.*/ private static HashMap s_pageClasses = new HashMap(); - /** - * Instantiated ResourceHandler cache. This allows for lazy loading. - */ + /** Instantiated ResourceHandler cache. This allows for lazy loading. */ private static SimpleCache s_pages = new SimpleCache(); /** List of URLs which require a trailing slash. These are required for @@ -80,6 +87,7 @@ /** Path to directory containg ccm-cms template files */ private String m_templatePath; + /** Resolvers to find templages (JSP) and other stuff stored in file system.*/ private ApplicationFileResolver m_resolver; @@ -101,20 +109,21 @@ /* Process mapping file. */ readFromFile(MAP_FILE); + /** Set Template base path for JSP's */ m_templatePath = ContentSection.getConfig().getTemplateRoot(); Assert.exists(m_templatePath, String.class); Assert.isTrue(m_templatePath.startsWith("/"), "template-path must start with '/'"); Assert.isTrue(!m_templatePath.endsWith("/"), "template-path must not end with '/'"); + /** Set TemplateResolver class */ m_resolver = Web.getConfig().getApplicationFileResolver(); } /** * Implements the (abstract) doService method of BaseApplicationServlet to - * create the perform the services. - * + * perform the services. * @see com.arsdigita.web.BaseApplicationServlet#doService * (HttpServletRequest, HttpServletResponse, Application) */ @@ -143,7 +152,7 @@ // Check user access. // Deprecated and here implemented as a No-OP method! - /* heckUserAccess(request, response, actx); */ + /* checkUserAccess(request, response, actx); */ ResourceHandler page = getResource(url); if ( page != null ) { @@ -152,15 +161,10 @@ page.dispatch(sreq, sresp, ctx); } else { // Fall back on the JSP application dispatcher. - // m_notFoundHandler.dispatch(request, response, actx); if (s_log.isInfoEnabled()) { - s_log.info("NOT serving content item"); + s_log.info("NO page registered to serve the requst url."); } - /* Store content section in http request to make it available - * or admin index,jsp */ - // sreq.setAttribute(CONTENT_SECTION, section); - RequestDispatcher rd = m_resolver.resolve(m_templatePath, sreq, sresp, app); if (rd != null) { @@ -170,7 +174,6 @@ sreq = DispatcherHelper.restoreOriginalRequest(sreq); rd.forward(sreq,sresp); } else { - // sresp.sendError(404, packageURL + " not found on this server."); sresp.sendError(404, requestUri + " not found on this server."); } Modified: trunk/ccm-cms/src/com/arsdigita/cms/Workspace.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Workspace.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/Workspace.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -21,15 +21,15 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataObject; import com.arsdigita.persistence.OID; -// import com.arsdigita.persistence.DataAssociation; -// import com.arsdigita.persistence.PersistenceException; import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationCollection; +import com.arsdigita.web.ApplicationType; +import com.arsdigita.web.URL; import java.math.BigDecimal; import org.apache.log4j.Logger; -// WORK IN PROGRESS !! /** * Application domain class for the CMS module user entry page (content-center) @@ -48,10 +48,8 @@ // general constants public static final String PACKAGE_KEY = "content-center"; public static final String INSTANCE_NAME = "Content Center"; - public static final String DISPATCHER_CLASS = - "com.arsdigita.cms.dispatcher.ContentCenterDispatcher"; - public final static String STYLESHEET = - "/packages/content-section/xsl/content-center.xsl"; +// public static final String DISPATCHER_CLASS = +// "com.arsdigita.cms.dispatcher.ContentCenterDispatcher"; /** * Constructor retrieving a workspace from the database usings its OID. @@ -107,4 +105,74 @@ return app; } + /** + * Returns an instance of the Workspace application. There must not more + * than one instance exist. May return null. + */ + public static Application getInstance() { + ApplicationType workspaceType = ApplicationType. + retrieveApplicationTypeForApplication(BASE_DATA_OBJECT_TYPE); + if ( workspaceType == null ) { return null; } + + ApplicationCollection apps = Application.retrieveAllApplications(); + apps.addEqualsFilter("resourceType.id", workspaceType.getID()); + if ( !apps.next() ) { return null; } + + Application result = apps.getApplication(); + apps.close(); + return result; + } + + /** + * Fetch the location (URL) of the CMS Workspace. There must not more than + * one instance exist. + * + * @return The URL of the CMS Workspace (currently including trailing slash) + */ + public static String getURL() { + + Application app = Workspace.getInstance(); + if (app == null) { + return null; + } else { + String url = (String) app.getPrimaryURL(); + return url; + } + } + + /** + * Returns the path name of the location of the applications servlet/JSP. + * + * Application implementations should overwrite this method to provide an + * application specific location, especially if an application (module) is + * to be installed along with others in one context. + * + * If you install the module into its own context you may use a standard + * location. In most cases though all modules (applications) of an + * webapplication should be installed into one context. + * + * Frequently it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>content-center</servlet-name> + * <servlet-class>com.arsdigita.cms.WorkspaceServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>content-center</servlet-name> + * <url-pattern>/ccm-applicationName/content-center/*</url-pattern> + * </servlet-mapping> + * + * NOTE: According to Servlet API the path always starts with a leading '/' + * and includes either the servlet name or a path to the servlet, but does + * not include any extra path information or a query string. Returns an + * empry string ("") is the servlet used was matched using the "/*" pattern. + * + * @return path name to the applications servlet/JSP + */ + @Override + public String getServletPath() { + return URL.SERVLET_DIR + "/content-center"; + } + } Modified: trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -19,12 +19,17 @@ package com.arsdigita.cms; +import com.arsdigita.cms.dispatcher.ResourceHandler; import com.arsdigita.cms.dispatcher.SimpleCache; import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.dispatcher.DispatcherHelper; +import com.arsdigita.dispatcher.RequestContext; import com.arsdigita.kernel.security.UserContext; import com.arsdigita.kernel.security.Util; import com.arsdigita.ui.login.LoginHelper; +import com.arsdigita.util.Assert; import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationFileResolver; import com.arsdigita.web.BaseApplicationServlet; import com.arsdigita.web.LoginSignal; @@ -33,6 +38,8 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; +import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -55,7 +62,7 @@ /** The path of the file that maps resources. */ public final static String DEFAULT_MAP_FILE = - "/WEB-INF/resources/content-center-map.xml"; + "/WEB-INF/resources/content-center-old-map.xml"; /** Mapping between a relative URL and the class name of a ResourceHandler.*/ private static HashMap s_pageClasses = WorkspaceSetup.getURLToClassMap(); @@ -69,11 +76,40 @@ // private Dispatcher m_notFoundHandler; private ArrayList m_trailingSlashList = new ArrayList(); + /** Path to directory containg ccm-cms template files */ + private String m_templatePath; + /** Resolvers to find templages (JSP) and other stuff stored in file system.*/ + private ApplicationFileResolver m_resolver; + /** + * Use parent's class initialization extension point to perform additional + * initialisation tasks. + */ + @Override + protected void doInit() { + if (s_log.isDebugEnabled()) { + s_log.info("starting doInit method"); + } + m_trailingSlashList = new ArrayList(); + requireTrailingSlash(""); + + /** Set Template base path for JSP's */ + m_templatePath = ContentSection.getConfig().getTemplateRoot(); + Assert.exists(m_templatePath, String.class); + Assert.isTrue(m_templatePath.startsWith("/"), + "template-path must start with '/'"); + Assert.isTrue(!m_templatePath.endsWith("/"), + "template-path must not end with '/'"); + /** Set TemplateResolver class */ + m_resolver = Web.getConfig().getApplicationFileResolver(); + } + + + /** * Implements the (abstract) doService method of BaseApplicationServlet to - * create the Worspace page. + * create the Workspace page. * * @see com.arsdigita.web.BaseApplicationServlet#doService * (HttpServletRequest, HttpServletResponse, Application) @@ -88,9 +124,48 @@ } DeveloperSupport.startStage("ContentCenterServlet.doService"); + Workspace workspace = (Workspace) app; + + RequestContext ctx = DispatcherHelper.getRequestContext(); + String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext + String originalUrl = ctx.getOriginalURL(); + String requestUri = sreq.getRequestURI(); + + // An empty remaining URL or a URL which doesn't end in trailing slash: + // probably want to redirect. + if ( m_trailingSlashList.contains(url) && !originalUrl.endsWith("/") ) { + DispatcherHelper.sendRedirect(sresp, originalUrl + "/"); + return; + } + // Check user access. checkUserAccess(sreq, sresp); + ResourceHandler page = getResource(url); + if ( page != null ) { + // Serve the page. + page.init(); + page.dispatch(sreq, sresp, ctx); + } else { + // Fall back on the JSP application dispatcher. + if (s_log.isInfoEnabled()) { + s_log.info("NO page registered to serve the requst url."); + } + + RequestDispatcher rd = m_resolver.resolve(m_templatePath, + sreq, sresp, app); + if (rd != null) { + if (s_log.isDebugEnabled()) { + s_log.debug("Got dispatcher " + rd); + } + sreq = DispatcherHelper.restoreOriginalRequest(sreq); + rd.forward(sreq,sresp); + } else { + sresp.sendError(404, requestUri + " not found on this server."); + } + + } + DeveloperSupport.endStage("ContentCenterServlet.doService"); if (s_log.isDebugEnabled()) { @@ -98,10 +173,88 @@ } } + /** + * Service Method returns the URL stub for the class name, + * can return null if not mapped + */ + public static String getURLStubForClass(String classname) { + s_log.debug("Getting URL Stub for : " + classname); + Iterator itr = s_pageURLs.keySet().iterator(); + while (itr.hasNext()) { + String classname2 = (String)itr.next(); + s_log.debug("key: " + classname + " value: " + + (String)s_pageURLs.get(classname2)); + } + String url = (String)s_pageURLs.get(classname); + return url; + } + + /** + * Fetch a page based on the URL stub. + * + * @param url The URL stub following the site-node URL + * @return A ResourceHandler or null if none exists. + * @pre (url != null) + */ + protected ResourceHandler getResource(String url) throws ServletException { + + // First check the pages cache for existing pages. + ResourceHandler page = (ResourceHandler) s_pages.get(url); + if ( page == null ) { + + // Next check if the URL maps to a page class. + String pageClassName = (String) s_pageClasses.get(url); + if ( pageClassName != null ) { + + Class pageClass; + try { + pageClass = Class.forName(pageClassName); + } catch (ClassNotFoundException e) { + s_log.error("error fetching class for ResourceHandler", e); + throw new ServletException(e); + } + + // Try and instantiate the page. + try { + page = (ResourceHandler) pageClass.newInstance(); + } catch (InstantiationException e) { + s_log.error("error instantiating a ResourceHandler", e); + throw new ServletException(e); + } catch (IllegalAccessException e) { + s_log.error("error instantiating a ResourceHandler", e); + throw new ServletException(e); + } + + page.init(); + s_pages.put(url, page); + } + } + return page; + } + + /** + * Map a page to a URL. + * + * @param url The URL + * @param className The name of the ResourceHandler class + * @pre (url != null && className != null) + */ + protected void addResource(String url, String className) { + s_pageClasses.put(url, className); + s_pageURLs.put(className, url); + } + + /** + * Release the page at the specified URL. + * + * @param url The URL + * @pre (url != null) + */ + public static void releaseResource(String url) { + s_pages.remove(url); + } + - - - /** * Verify that the user is logged in and is able to view the * page. Subclasses can override this method if they need to, but @@ -145,4 +298,17 @@ } } + /** + * Adds a URL to the list of URLs that are required to have trailing + * slashes. A request for url will be redirected to url + "/" + * if the original URL request (what you see in your browser) + * doesn't include a trailing slash. This is required for + * creating virtual directories, so that relative URLs and redirects + * work. + */ + // public void requireTrailingSlash(String url) { + private void requireTrailingSlash(String url) { + m_trailingSlashList.add(url); + } + } Modified: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSDispatcher.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -32,7 +32,6 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.kernel.ACSObjectCache; import com.arsdigita.kernel.KernelHelper; -import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.User; import com.arsdigita.web.LoginSignal; import com.arsdigita.web.URL; @@ -451,8 +450,7 @@ } // Fetch the current site node from the URL. - SiteNode sn = SiteNode.getSiteNode(url); - ContentSection section = ContentSection.getSectionFromNode(sn); + ContentSection section = ContentSection.getSectionForPath(url); return section; } Modified: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -27,6 +27,7 @@ import com.arsdigita.cms.CMSExcursion; import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ContentSectionServlet; import com.arsdigita.cms.SecurityManager; import com.arsdigita.developersupport.DeveloperSupport; import com.arsdigita.dispatcher.RequestContext; @@ -194,7 +195,8 @@ */ public ContentSection getContentSection(HttpServletRequest request) { // Resets all content sections associations. - return ContentSectionDispatcher.getContentSection(request); + // return ContentSectionDispatcher.getContentSection(request); + return ContentSectionServlet.getContentSection(request); } /** Deleted: trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java 2012-03-11 09:12:45 UTC (rev 2285) +++ trunk/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java 2012-03-11 09:14:14 UTC (rev 2286) @@ -1,301 +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.cms.dispatcher; - -import com.arsdigita.cms.WorkspaceSetup; -// import com.arsdigita.cms.util.PageClassConfigHandler; -import com.arsdigita.developersupport.DeveloperSupport; -import com.arsdigita.dispatcher.Dispatcher; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.JSPApplicationDispatcher; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.kernel.security.Util; -import com.arsdigita.kernel.security.UserContext; -import com.arsdigita.ui.login.LoginHelper; -import com.arsdigita.util.LockableImpl; -import com.arsdigita.web.LoginSignal; -import com.arsdigita.web.Web; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; - - -/** - * <p> The CMS Workspace Dispatcher serves all request made within the - * Content Center application. This dispatcher is called by the Subsite - * dispatcher.</p> - * - * <p>Here are the steps for a request to - * <tt>http://yourserver/content-center/cheese</tt>:</p> - * - * <ol> - * <li><p>A client sends a request to the web server, which passes it on to - * the global ACS dispatcher.</p></li> - * - * <li><p>The global ACS dispatcher examines the first part of the URL, - * notices that the Content Center application is mounted at - * <tt>/content-center</tt> and hands the request to the CMS - * Workspace dispatcher.</p></li> - * - * <li><p>The CMS Workspace dispatcher determines whether a <tt>Page</tt> - * has been registered to the URL <tt>/cheese</tt>.</p></li> - * - * <li><p>If no <tt>Page</tt> is registered to the URL <tt>/cheese</tt>, - * then the CMS Workspace dispatcher hands the request to the - * {@link com.arsdigita.dispatcher.JSPApplicationDispatcher}.</p></li> - * </ol> - * - * @author Michael Pih (pi...@ar...) - * @version $Id$ - */ -public class ContentCenterDispatcher extends LockableImpl - implements Dispatcher { - - /** - * The path of the file that maps resources. - */ - public final s... [truncated message content] |
From: <pb...@fe...> - 2012-03-11 09:13:01
|
Author: pboy Date: 2012-03-11 09:12:45 +0000 (Sun, 11 Mar 2012) New Revision: 2285 Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/package.html trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java.nolongerInUse trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRServlet.java trunk/ccm-docrepo/web/WEB-INF/web.ccm-docrepo.xml Removed: trunk/ccm-docrepo/doc/ trunk/ccm-docrepo/etc/ trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java Modified: trunk/ccm-docrepo/CHANGELOG trunk/ccm-docrepo/application.xml trunk/ccm-docrepo/pdl/com/arsdigita/docrepo/query-getRepositoriesView.pg.pdl trunk/ccm-docrepo/src/com/arsdigita/docrepo/Loader.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/BrowsePane.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRConstants.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRUtils.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DocrepoBasePage.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/RepositoriesTable.java Log: Module ccm-docrepo now legacy free type of application. Modified: trunk/ccm-docrepo/CHANGELOG =================================================================== --- trunk/ccm-docrepo/CHANGELOG 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/CHANGELOG 2012-03-11 09:12:45 UTC (rev 2285) @@ -1,4 +1,11 @@ +February 27, 2012 +================= + +Package ccm-docrepo is now initialized as a new style, legacy free application. +An update is not necessary because has not been part of distribution yet. + April 14, 2011 +============== Package ccm-docmgr from Byline repository copied and integrated in ccm/aplaws as an test environment. Modified: trunk/ccm-docrepo/application.xml =================================================================== --- trunk/ccm-docrepo/application.xml 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/application.xml 2012-03-11 09:12:45 UTC (rev 2285) @@ -3,7 +3,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-docrepo" prettyName="Red Hat Document Repository Application" - version="6.6.0" + version="6.6.1" release="1"> <ccm:dependencies> @@ -16,6 +16,9 @@ </ccm:contacts> <ccm:description> + The document repository is an online file storage system for + collaborative file sharing within groups. + </ccm:description> </ccm:application> Modified: trunk/ccm-docrepo/pdl/com/arsdigita/docrepo/query-getRepositoriesView.pg.pdl =================================================================== --- trunk/ccm-docrepo/pdl/com/arsdigita/docrepo/query-getRepositoriesView.pg.pdl 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/pdl/com/arsdigita/docrepo/query-getRepositoriesView.pg.pdl 2012-03-11 09:12:45 UTC (rev 2285) @@ -26,7 +26,7 @@ select distinct dr_repositories.repository_id, coalesce(dm.repository_id, null, 0, 1) as mounted, - dr_repository_num_files(docs_repositories.root_id) as num_files + dr_repository_num_files(dr_repositories.root_id) as num_files from dr_repositories left join (select repository_id from docs_mounted where party_id = :userID) dm Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Loader.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Loader.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Loader.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -86,17 +86,31 @@ */ private void loadDocRepositoryApplicationType() { - ApplicationType type = ApplicationType.createApplicationType( - "docrepo", - "Document Repository", - Repository.BASE_DATA_OBJECT_TYPE); - type.setDescription - ("The document repository empowers users to share documents."); + /* Legacy compatible initialization */ + // ApplicationType type = ApplicationType.createApplicationType( + // "docrepo", + // "Document Repository", + // Repository.BASE_DATA_OBJECT_TYPE); // Current code requires an apps specific dispatcher class. Has to be // modified to be able to create a legacy free app type. - type.setDispatcherClass - ("com.arsdigita.docrepo.ui.DRDispatcher"); + // type.setDispatcherClass + // ("com.arsdigita.docrepo.ui.DRDispatcher"); + /* Legacy free initialization + * NOTE: The wording in the title parameter of ApplicationType determines + * the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and replacing + * blanks between words and illegal characters with an hyphen and converted + * to lower case. + * Example: "DocRepo" will become "docrepo". + */ + ApplicationType type = new + ApplicationType("DocRepo", + Repository.BASE_DATA_OBJECT_TYPE ); + + type.setDescription + ("The document repository empowers users to share documents."); + } Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -104,7 +104,7 @@ } /** - * Retreives a repository from the database usings its OID. + * Constructor retrieves a repository from the database usings its OID. * * @param oid the OID of the repository */ @@ -324,4 +324,33 @@ } return null; } + /** + * Returns the servletPath part of the URL to the application servlet. + * (see Servlet API specification or web.URL for more information) + * + * The method overwrites the super class to provide an application specific + * location for servlets/JSP. This is necessary if you whish to install the + * module (application) along with others in one context. If you install the + * module into its own context (no longer recommended for versions newer + * than 1.0.4) you may use a standard location. + * + * Usually it is a symbolic name/path, which will be mapped in the web.xml + * to the real location in the file system. Example: + * <servlet> + * <servlet-name>docrepo</servlet-name> + * <servlet-class>com.arsdigita.docrepo.RepositoryServlet</servlet-class> + * </servlet> + * + * <servlet-mapping> + * <servlet-name>docrepo</servlet-name> + * <url-pattern>/docrepo/*</url-pattern> + * </servlet-mapping> + * + * @return ServelPath of the applications servlet + */ + @Override + public String getServletPath() { + return "/docrepo/"; + } + } Deleted: trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2011 Peter boy (pb...@ba... - * - * 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.docrepo; - -import com.arsdigita.bebop.ActionLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.PageState; -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.page.BebopApplicationServlet; -import com.arsdigita.bebop.page.BebopMapDispatcher; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.docrepo.File; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.web.Web; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.util.UncheckedWrapperException; -import org.apache.log4j.Category; - -import java.io.*; -import java.math.BigDecimal; - -import javax.servlet.ServletException; -import org.apache.log4j.Logger; - -/** - * - * @author pb - */ -public class RepositoryServlet extends BebopApplicationServlet { - - /** Private logger instance to faciliate debugging procedures */ - private static final Logger s_log = Logger.getLogger(RepositoryServlet.class); - - - /** - * Servlet Initialisation, builds the UI elements (various panes) - * @throws ServletException - */ - @Override - public void init() throws ServletException { - super.init(); - s_log.debug("creating DocRepo page"); - - -// Page index = buildIndexPage(); -// Page admin = buildAdminIndexPage(); - -// put("/", index); -// put("/index.jsp", index); -// put("/one.jsp", index); - - // put("admin", admin); - // put("admin/index.jsp", admin); - - } - - - - -} Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/package.html =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/package.html (rev 0) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/package.html 2012-03-11 09:12:45 UTC (rev 2285) @@ -0,0 +1,16 @@ +<html> +<head> +<title>com.arsdigita.docrepo</title> +</head> +<body> + +<p> +The document repository is an online file storage system for collaborative +file sharing within groups. + +</p> + +</body> +</html> + + Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/BrowsePane.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/BrowsePane.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/BrowsePane.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -65,7 +65,7 @@ * @author <mailto href="Ste...@co...">Stefan Deusch</a> */ class BrowsePane extends ModalContainer - implements DRConstants, ChangeListener, RequestListener { + implements DRConstants, ChangeListener, RequestListener { private Component m_folderContent; private Component m_destinationFolderPanel; @@ -76,7 +76,7 @@ private ErrorMessageLabel m_errorMsgLabel; private Container m_mainBrowseContainer; - private TabbedPane m_mainTabPane; +// private TabbedPane m_mainTabPane; private Tree m_tree; @@ -92,11 +92,11 @@ public BrowsePane() { - m_mainTabPane = new TabbedPane(); + // m_mainTabPane = new TabbedPane(); m_mainBrowseContainer = new BoxPanel(); - m_mainTabPane.addTab(WS_BROWSE_TITLE, - m_mainBrowseContainer); + // m_mainTabPane.addTab(WS_BROWSE_TITLE, + // m_mainBrowseContainer); m_mainBrowseContainer.setClassAttr("sidebarNavPanel"); //m_mainBrowseContainer.setAttribute("navbar-title", "Folders"); @@ -120,7 +120,8 @@ m_mainBrowseContainer.add(rightSide); - add(m_mainTabPane); + // add(m_mainTabPane); + add(m_mainBrowseContainer); m_newFileForm = makeFileUploadForm(); add(m_newFileForm); @@ -344,7 +345,8 @@ } public void displayFolderContentPanel(PageState state) { - setVisibleComponent(state, m_mainTabPane); + // setVisibleComponent(state, m_mainTabPane); + setVisibleComponent(state, m_mainBrowseContainer); } public void displayDestinationFolderPanel(PageState state, Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRConstants.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRConstants.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRConstants.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -29,7 +29,7 @@ * @author <mailto href="Ste...@co...">Stefan Deusch</a> */ -public interface DRConstants { +interface DRConstants { // PDL vars String FOLDER_ID = "folderID"; Deleted: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -1,296 +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.docrepo.ui; - - -import com.arsdigita.bebop.ActionLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Page; -import com.arsdigita.bebop.PageState; -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.page.BebopMapDispatcher; -import com.arsdigita.dispatcher.DispatcherHelper; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.dispatcher.RequestContext; -import com.arsdigita.docrepo.File; -import com.arsdigita.kernel.permissions.PrivilegeDescriptor; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.web.Web; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.util.UncheckedWrapperException; -import org.apache.log4j.Category; - -import java.io.*; -import java.math.BigDecimal; - -/** - * Dispatcher for document repository application. - * - * @author <mailto href="Ste...@co...">Stefan Deusch</a> - * @version $Id: DRDispatcher.java pboy $ - */ - -public class DRDispatcher extends BebopMapDispatcher implements DRConstants { - - private static Category s_log = Category.getInstance - (DRDispatcher.class.getName()); - - /** - * Default constructor instantiating the URL-page map. - */ - public DRDispatcher() { - addPage("", buildDMIndexPage(), true); - addPage("file", buildFileInfoPage()); - } - - /** - * Build index page for the document repository, - */ - - private Page buildDMIndexPage() { - - Page page = new DocrepoBasePage(); - - /** - * Create main administration tab. - */ - TabbedPane tabbedPane = new TabbedPane(); - tabbedPane.setIdAttr("page-body"); - - tabbedPane.addTab(WS_BROWSE_TITLE, new BrowsePane()); - - /* - * Disable Repositories tab because - * Still need to decide what to do with mounting - * repository, since repository are now application.*/ - tabbedPane.addTab(WS_REPOSITORIES_TITLE, new RepositoryPane()); - - - - //p.add(new BrowsePane()); - page.add(tabbedPane); - page.lock(); - - return page; - } - - - /** - * Build page for the administration of one file. - * (Implementation according to wireframes at) - */ - private Page buildFileInfoPage() { - - DocrepoBasePage p = new DocrepoBasePage() { - // need to override this to show the File name - @Override - protected void buildTitle() { - Label title = new Label(); - title.addPrintListener(new PrintListener() { - public void prepare(PrintEvent e) { - PageState state = e.getPageState(); - Label t = (Label) e.getTarget(); - BigDecimal fid = - (BigDecimal) state.getValue(FILE_ID_PARAM); - if (fid!=null) { - t.setLabel - (DRUtils.getFile(fid).getName()); - } - } - }); - setTitle(title); - } - }; - - /* Temporary fix to sdm #204233, NavBar of Application allows only - one URL per application, so here we add a Link back to the parent folder - */ - Label backLinkLabel = GO_BACK_LABEL; - backLinkLabel.addPrintListener(new PrintListener() { - public void prepare(PrintEvent e) { - PageState state = e.getPageState(); - - Label t= (Label) e.getTarget(); - String fixed = t.getLabel(e.getPageState()); - String url = Web.getContext().getApplication().getTitle(); - - t.setLabel(fixed + " " + url); - }}); - ActionLink backLink = new ActionLink(backLinkLabel); - backLink.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - PageState state = e.getPageState(); - String url = Web.getContext().getApplication().getPath(); - BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); - - if (fid != null) { - url = url + "?d_id="+fid; - } - /* - BigDecimal pid = null; - BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); - if (fid!=null) { - pid = DRUtils.getFile(fid).getParentResource().getID(); - } - */ - try { - DispatcherHelper.sendRedirect(state.getRequest(), - state.getResponse(), - url); - } catch (IOException iox) { - throw new RuntimeException("Redirect to Application failed" - +iox); - } - }}); - backLink.setClassAttr("actionLink"); - p.add(backLink); - - // create main File-Info tabs - TabbedPane tb = new TabbedPane(); - tb.setIdAttr("page-body"); - - tb.addTab(FILE_INFO_PROPERTIES_TITLE, new FileInfoPropertiesPane(p)); - tb.addTab(FILE_INFO_HISTORY_TITLE, new FileInfoHistoryPane()); - - /* - * Disable Links tab because we have not - * decided how to link other KnItems to a document. - * 01/04/02 Stefan Deusch - * - tb.addTab(FILE_INFO_LINKS_TITLE, new FileInfoLinksPane()); - */ - p.add(tb); - p.lock(); - - return p; - } - - /** - * convenience wrapper method that allows to register a "" page - * for an index page, if the isIndex flag is try - */ - private void addPage(String url, Page p, boolean isIndex) { - if (isIndex) { - super.addPage("", p); - } - super.addPage(url, p); - } - - /** - * - * @param req - * @param resp - * @param ctx - * @throws IOException - * @throws javax.servlet.ServletException - */ - public void dispatch(javax.servlet.http.HttpServletRequest req, - javax.servlet.http.HttpServletResponse resp, - RequestContext ctx) - throws IOException, javax.servlet.ServletException { - - String url = req.getRequestURI(); - int index = url.lastIndexOf("/download/"); - - if (index > 0) { - s_log.debug("Downloading"); - String str = req.getParameter(FILE_ID_PARAM.getName()); - if (str != null) { - BigDecimal id = new BigDecimal(str); - - File file = null; - try { - file = new File(id); - } catch(DataObjectNotFoundException nfe) { - throw new ObjectNotFoundException( - "The requested file no longer exists."); - } - - //Check to see if current user is allowed to read this file - file.assertPrivilege(PrivilegeDescriptor.READ); - - String mimetype = file.getContentType(); - if (mimetype == null) { - mimetype = File.DEFAULT_MIME_TYPE; - } - - - resp.setContentType(mimetype); - - InputStream is; - final String transaction = req.getParameter("trans_id"); - if (transaction == null || transaction.equals("current")) { - is = file.getInputStream(); - } else { - is = getFileRevision(transaction); - } - - sendToOutput(is, resp.getOutputStream()); - - } - } else { - s_log.debug("dispatching"); - super.dispatch(req, resp, ctx); - } - - } - - private static void sendToOutput(InputStream is, OutputStream os) { - byte[] buf = new byte[8192]; // 8k buffer - - try { - int sz = 0; - while ((sz = is.read(buf, 0 , 8192)) != -1) { - os.write(buf, 0, sz); - } - } catch (IOException iox) { - iox.printStackTrace(); - throw new UncheckedWrapperException("IO Error streaming file", iox); - } finally { - try { - is.close(); - os.close(); - } catch(IOException iox2) { } - } - - } - - private static InputStream getFileRevision(String transaction) { - BigDecimal transactionID = new BigDecimal(transaction); - - Session session = SessionManager.getSession(); - DataQuery query = session.retrieveQuery - ("com.arsdigita.docrepo.getFileRevisionBlob"); - query.setParameter("transactionID", transactionID); - InputStream is = null; - if (query.next()) { - Object blob = query.get("content"); - is = new ByteArrayInputStream((byte[]) blob); - } - - return is; - } - -} Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java.nolongerInUse =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java.nolongerInUse (rev 0) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRDispatcher.java.nolongerInUse 2012-03-11 09:12:45 UTC (rev 2285) @@ -0,0 +1,296 @@ +/* + * 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.docrepo.ui; + + +import com.arsdigita.bebop.ActionLink; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +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.page.BebopMapDispatcher; +import com.arsdigita.dispatcher.DispatcherHelper; +import com.arsdigita.dispatcher.ObjectNotFoundException; +import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.docrepo.File; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.web.Web; +import com.arsdigita.persistence.Session; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.DataQuery; +import com.arsdigita.util.UncheckedWrapperException; +import org.apache.log4j.Category; + +import java.io.*; +import java.math.BigDecimal; + +/** + * Dispatcher for document repository application. + * + * @author <mailto href="Ste...@co...">Stefan Deusch</a> + * @version $Id: DRDispatcher.java pboy $ + */ + +public class DRDispatcher extends BebopMapDispatcher implements DRConstants { + + private static Category s_log = Category.getInstance + (DRDispatcher.class.getName()); + + /** + * Default constructor instantiating the URL-page map. + */ + public DRDispatcher() { + addPage("", buildDMIndexPage(), true); + addPage("file", buildFileInfoPage()); + } + + /** + * Build index page for the document repository, + */ + + private Page buildDMIndexPage() { + + Page page = new DocrepoBasePage(); + + /** + * Create main administration tab. + */ + TabbedPane tabbedPane = new TabbedPane(); + tabbedPane.setIdAttr("page-body"); + + tabbedPane.addTab(WS_BROWSE_TITLE, new BrowsePane()); + + /* + * Disable Repositories tab because + * Still need to decide what to do with mounting + * repository, since repository are now application.*/ + tabbedPane.addTab(WS_REPOSITORIES_TITLE, new RepositoryPane()); + + + + //p.add(new BrowsePane()); + page.add(tabbedPane); + page.lock(); + + return page; + } + + + /** + * Build page for the administration of one file. + * (Implementation according to wireframes at) + */ + private Page buildFileInfoPage() { + + DocrepoBasePage p = new DocrepoBasePage() { + // need to override this to show the File name + @Override + protected void buildTitle() { + Label title = new Label(); + title.addPrintListener(new PrintListener() { + public void prepare(PrintEvent e) { + PageState state = e.getPageState(); + Label t = (Label) e.getTarget(); + BigDecimal fid = + (BigDecimal) state.getValue(FILE_ID_PARAM); + if (fid!=null) { + t.setLabel + (DRUtils.getFile(fid).getName()); + } + } + }); + setTitle(title); + } + }; + + /* Temporary fix to sdm #204233, NavBar of Application allows only + one URL per application, so here we add a Link back to the parent folder + */ + Label backLinkLabel = GO_BACK_LABEL; + backLinkLabel.addPrintListener(new PrintListener() { + public void prepare(PrintEvent e) { + PageState state = e.getPageState(); + + Label t= (Label) e.getTarget(); + String fixed = t.getLabel(e.getPageState()); + String url = Web.getContext().getApplication().getTitle(); + + t.setLabel(fixed + " " + url); + }}); + ActionLink backLink = new ActionLink(backLinkLabel); + backLink.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + String url = Web.getContext().getApplication().getPath(); + BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); + + if (fid != null) { + url = url + "?d_id="+fid; + } + /* + BigDecimal pid = null; + BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); + if (fid!=null) { + pid = DRUtils.getFile(fid).getParentResource().getID(); + } + */ + try { + DispatcherHelper.sendRedirect(state.getRequest(), + state.getResponse(), + url); + } catch (IOException iox) { + throw new RuntimeException("Redirect to Application failed" + +iox); + } + }}); + backLink.setClassAttr("actionLink"); + p.add(backLink); + + // create main File-Info tabs + TabbedPane tb = new TabbedPane(); + tb.setIdAttr("page-body"); + + tb.addTab(FILE_INFO_PROPERTIES_TITLE, new FileInfoPropertiesPane(p)); + tb.addTab(FILE_INFO_HISTORY_TITLE, new FileInfoHistoryPane()); + + /* + * Disable Links tab because we have not + * decided how to link other KnItems to a document. + * 01/04/02 Stefan Deusch + * + tb.addTab(FILE_INFO_LINKS_TITLE, new FileInfoLinksPane()); + */ + p.add(tb); + p.lock(); + + return p; + } + + /** + * convenience wrapper method that allows to register a "" page + * for an index page, if the isIndex flag is try + */ + private void addPage(String url, Page p, boolean isIndex) { + if (isIndex) { + super.addPage("", p); + } + super.addPage(url, p); + } + + /** + * + * @param req + * @param resp + * @param ctx + * @throws IOException + * @throws javax.servlet.ServletException + */ + public void dispatch(javax.servlet.http.HttpServletRequest req, + javax.servlet.http.HttpServletResponse resp, + RequestContext ctx) + throws IOException, javax.servlet.ServletException { + + String url = req.getRequestURI(); + int index = url.lastIndexOf("/download/"); + + if (index > 0) { + s_log.debug("Downloading"); + String str = req.getParameter(FILE_ID_PARAM.getName()); + if (str != null) { + BigDecimal id = new BigDecimal(str); + + File file = null; + try { + file = new File(id); + } catch(DataObjectNotFoundException nfe) { + throw new ObjectNotFoundException( + "The requested file no longer exists."); + } + + //Check to see if current user is allowed to read this file + file.assertPrivilege(PrivilegeDescriptor.READ); + + String mimetype = file.getContentType(); + if (mimetype == null) { + mimetype = File.DEFAULT_MIME_TYPE; + } + + + resp.setContentType(mimetype); + + InputStream is; + final String transaction = req.getParameter("trans_id"); + if (transaction == null || transaction.equals("current")) { + is = file.getInputStream(); + } else { + is = getFileRevision(transaction); + } + + sendToOutput(is, resp.getOutputStream()); + + } + } else { + s_log.debug("dispatching"); + super.dispatch(req, resp, ctx); + } + + } + + private static void sendToOutput(InputStream is, OutputStream os) { + byte[] buf = new byte[8192]; // 8k buffer + + try { + int sz = 0; + while ((sz = is.read(buf, 0 , 8192)) != -1) { + os.write(buf, 0, sz); + } + } catch (IOException iox) { + iox.printStackTrace(); + throw new UncheckedWrapperException("IO Error streaming file", iox); + } finally { + try { + is.close(); + os.close(); + } catch(IOException iox2) { } + } + + } + + private static InputStream getFileRevision(String transaction) { + BigDecimal transactionID = new BigDecimal(transaction); + + Session session = SessionManager.getSession(); + DataQuery query = session.retrieveQuery + ("com.arsdigita.docrepo.getFileRevisionBlob"); + query.setParameter("transactionID", transactionID); + InputStream is = null; + if (query.next()) { + Object blob = query.get("content"); + is = new ByteArrayInputStream((byte[]) blob); + } + + return is; + } + +} Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRServlet.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRServlet.java (rev 0) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRServlet.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2011 Peter boy (pb...@ba... + * + * 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.docrepo.ui; + +import com.arsdigita.bebop.ActionLink; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +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.dispatcher.DispatcherHelper; +import com.arsdigita.dispatcher.ObjectNotFoundException; +import com.arsdigita.docrepo.File; +// import com.arsdigita.docrepo.ui.BrowsePane; +// import com.arsdigita.docrepo.ui.DocrepoBasePage; +// import com.arsdigita.docrepo.ui.DRConstants; +// import com.arsdigita.docrepo.ui.DRUtils; +// import com.arsdigita.docrepo.ui.FileInfoHistoryPane; +// import com.arsdigita.docrepo.ui.FileInfoPropertiesPane; +// import com.arsdigita.docrepo.ui.RepositoryPane; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.kernel.permissions.PrivilegeDescriptor; +import com.arsdigita.persistence.DataQuery; +import com.arsdigita.persistence.Session; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.templating.Templating; +import com.arsdigita.util.Assert; +import com.arsdigita.util.UncheckedWrapperException; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; +import com.arsdigita.xml.Document; + +import com.arsdigita.web.Web; +import java.io.*; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import javax.servlet.ServletException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * Application servlet for the ccm-docrepo application, serves all request made + * for the application's UI. + * + * URLs of the available services are stored in a XML file which is processed + * into a cache of services on a request by request basis (lazy loading). + * + * ServiceServlet is called by BaseApplicationServlet which has determined that + * ServiceServlet is associated with a request URL. + * + * The CMS Service determines whether a <tt>Page</tt> has been registered to + * the URL and if so passes the request to that page. + * + * If no <tt>Page</tt> is registered to the URL, then the CMS Service hands + * the request to the TemplateResolver to find an appropriate JSP file. + * + * @author <mailto href="Ste...@co...">Stefan Deusch</a> + * @author Peter Boy <pb...@ba...> + * @version $Id: DRServlet.java 2161 2012-02-26 00:16:13Z pboy $ + */ +public class DRServlet extends BaseApplicationServlet + implements DRConstants { + + /** Private logger instance to faciliate debugging procedures */ + private static final Logger s_log = Logger.getLogger(DRServlet.class); + + /** URL (pathinfo) -> Page object mapping. Based on it (and the http + * request url) the doService method selects a page to display */ + private final Map m_pages = new HashMap(); + + + /** + * Use parent's class initialization extension point to perform additional + * initialisation tasks. Here: build the UI pages. + */ + @Override + public void doInit() { + if (s_log.isDebugEnabled()) { + s_log.info("starting RepositoryServlet doInit method ..."); + } + + addPage("/", buildDMIndexPage()); + addPage("/file", buildFileInfoPage()); + + } + /** + * Implements the (abstract) doService method of BaseApplicationServlet to + * perform the services. + * @see com.arsdigita.web.BaseApplicationServlet#doService + * (HttpServletRequest, HttpServletResponse, Application) + */ + protected void doService( HttpServletRequest sreq, + HttpServletResponse sresp, + Application app) + throws ServletException, IOException { + if (s_log.isDebugEnabled()) { + s_log.info("starting doService method"); + } + + String url = sreq.getRequestURI(); + int index = url.lastIndexOf("/download/"); + + if (index > 0) { + /* Download requested, handle the download */ + s_log.debug("Downloading"); + String str = sreq.getParameter(FILE_ID_PARAM.getName()); + if (str != null) { + BigDecimal id = new BigDecimal(str); + + File file = null; + try { + file = new File(id); + } catch(DataObjectNotFoundException nfe) { + throw new ObjectNotFoundException( + "The requested file no longer exists."); + } + + //Check to see if current user is allowed to read this file + file.assertPrivilege(PrivilegeDescriptor.READ); + + String mimetype = file.getContentType(); + if (mimetype == null) { + mimetype = File.DEFAULT_MIME_TYPE; + } + + + sresp.setContentType(mimetype); + + InputStream is; + final String transaction = sreq.getParameter("trans_id"); + if (transaction == null || transaction.equals("current")) { + is = file.getInputStream(); + } else { + is = getFileRevision(transaction); + } + + sendToOutput(is, sresp.getOutputStream()); + + } + } else { + /* Show the repository page */ + s_log.debug("show repository page"); + // super.dispatch(req, resp, ctx); + + String pathInfo = sreq.getPathInfo(); + Assert.exists(pathInfo, "String pathInfo"); + if (pathInfo.length() > 1 && pathInfo.endsWith("/")) { + /* NOTE: ServletAPI specifies, pathInfo may be empty or will + * start with a '/' character. It currently carries a + * trailing '/' if a "virtual" page, i.e. not a real jsp, but + * result of a servlet mapping. But Application requires url + * NOT to end with a trailing '/' for legacy free applications. */ + pathInfo = pathInfo.substring(0, pathInfo.length()-1); + } + + final Page page = (Page) m_pages.get(pathInfo); + + if (page != null) { + + final Document doc = page.buildDocument(sreq, sresp); + + PresentationManager pm = Templating.getPresentationManager(); + pm.servePage(doc, sreq, sresp); + + } else { + + sresp.sendError(404, "No such page for path " + pathInfo); + + } + + } + + } + + /** + * Adds one Url-Page mapping to the internal mapping table. + * + * @param pathInfo url stub for a page to display + * @param page Page object to display + */ + private void addPage(final String pathInfo, final Page page) { + + Assert.exists(pathInfo, String.class); + Assert.exists(page, Page.class); + // Current Implementation requires pathInfo to start with a leading '/' + // SUN Servlet API specifies: "PathInfo *may be empty* or will start + // with a '/' character." + Assert.isTrue(pathInfo.startsWith("/"), "path starts not with '/'"); + + m_pages.put(pathInfo, page); + } + /** + * Build index page for the document repository, + */ + + private Page buildDMIndexPage() { + + Page page = new DocrepoBasePage(); + + /** + * Create main administration tab. + */ + TabbedPane tabbedPane = new TabbedPane(); + tabbedPane.setIdAttr("page-body"); + tabbedPane.addTab(WS_BROWSE_TITLE, new BrowsePane()); + + /* + * Disable Repositories tab because + * Still need to decide what to do with mounting + * repository, since repository are now application.*/ + // tabbedPane.addTab(WS_REPOSITORIES_TITLE, new RepositoryPane()); + + //p.add(new BrowsePane()); + page.add(tabbedPane); + page.lock(); + + return page; + } + + /** + * Build page for the administration of one file. + * (Implementation according to wireframes at) + */ + private Page buildFileInfoPage() { + + DocrepoBasePage p = new DocrepoBasePage() { + // need to override this to show the File name + @Override + protected void buildTitle() { + Label title = new Label(); + title.addPrintListener(new com.arsdigita.bebop.event.PrintListener() { + public void prepare(PrintEvent e) { + PageState state = e.getPageState(); + Label t = (Label) e.getTarget(); + BigDecimal fid = + (BigDecimal) state.getValue(FILE_ID_PARAM); + if (fid!=null) { + t.setLabel + (DRUtils.getFile(fid).getName()); + } + } + }); + setTitle(title); + } + }; + + /* Temporary fix to sdm #204233, NavBar of Application allows only + one URL per application, so here we add a Link back to the parent folder + */ + Label backLinkLabel = GO_BACK_LABEL; + backLinkLabel.addPrintListener(new PrintListener() { + public void prepare(PrintEvent e) { + PageState state = e.getPageState(); + + Label t= (Label) e.getTarget(); + String fixed = t.getLabel(e.getPageState()); + String url = Web.getContext().getApplication().getTitle(); + + t.setLabel(fixed + " " + url); + }}); + ActionLink backLink = new ActionLink(backLinkLabel); + backLink.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + PageState state = e.getPageState(); + String url = Web.getContext().getApplication().getPath(); + BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); + + if (fid != null) { + url = url + "?d_id="+fid; + } + /* + BigDecimal pid = null; + BigDecimal fid = (BigDecimal) state.getValue(FILE_ID_PARAM); + if (fid!=null) { + pid = DRUtils.getFile(fid).getParentResource().getID(); + } + */ + try { + DispatcherHelper.sendRedirect(state.getRequest(), + state.getResponse(), + url); + } catch (IOException iox) { + throw new RuntimeException("Redirect to Application failed" + +iox); + } + }}); + backLink.setClassAttr("actionLink"); + p.add(backLink); + + // create main File-Info tabs + TabbedPane tb = new TabbedPane(); + tb.setIdAttr("page-body"); + + tb.addTab(FILE_INFO_PROPERTIES_TITLE, new FileInfoPropertiesPane(p)); + tb.addTab(FILE_INFO_HISTORY_TITLE, new FileInfoHistoryPane()); + + /* + * Disable Links tab because we have not + * decided how to link other KnItems to a document. + * 01/04/02 Stefan Deusch + * + tb.addTab(FILE_INFO_LINKS_TITLE, new FileInfoLinksPane()); + */ + p.add(tb); + p.lock(); + + return p; + } + + + /** + * + * @param is + * @param os + */ + private static void sendToOutput(InputStream is, OutputStream os) { + byte[] buf = new byte[8192]; // 8k buffer + + try { + int sz = 0; + while ((sz = is.read(buf, 0 , 8192)) != -1) { + os.write(buf, 0, sz); + } + } catch (IOException iox) { + iox.printStackTrace(); + throw new UncheckedWrapperException("IO Error streaming file", iox); + } finally { + try { + is.close(); + os.close(); + } catch(IOException iox2) { } + } + + } + + /** + * + * @param transaction + * @return + */ + private static InputStream getFileRevision(String transaction) { + BigDecimal transactionID = new BigDecimal(transaction); + + Session session = SessionManager.getSession(); + DataQuery query = session.retrieveQuery + ("com.arsdigita.docrepo.getFileRevisionBlob"); + query.setParameter("transactionID", transactionID); + InputStream is = null; + if (query.next()) { + Object blob = query.get("content"); + is = new ByteArrayInputStream((byte[]) blob); + } + + return is; + } + +} Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRUtils.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRUtils.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DRUtils.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -48,7 +48,7 @@ * @author <mailto href="Ste...@co...">Stefan Deusch</a> * @version $Id: DRUtils.java pboy $ */ -public class DRUtils implements DRConstants { +class DRUtils implements DRConstants { private static final Logger s_log = Logger.getLogger(DRUtils.class); Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DocrepoBasePage.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DocrepoBasePage.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DocrepoBasePage.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -48,7 +48,7 @@ * @author <a href="mailto:jpa...@ar...">Jim Parsons</a> */ -public class DocrepoBasePage extends Page { +class DocrepoBasePage extends Page { private final Container m_global; private final Container m_header; @@ -131,7 +131,11 @@ // <em>override</em> this method. protected final void buildPage() { buildTitle(); - buildContextBar(); + // Context Byr temporarily deactivated until the functionality to + // to create multiple repositories (table docs_mounted) is restored. + // Because currently there is only one repository mounted there is + // no relevant context + /* buildContextBar(); */ buildGlobal(getGlobal()); buildHeader(getHeader()); buildBody(getBody()); Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/RepositoriesTable.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/RepositoriesTable.java 2012-03-11 01:37:17 UTC (rev 2284) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/RepositoriesTable.java 2012-03-11 09:12:45 UTC (rev 2285) @@ -56,10 +56,9 @@ class RepositoriesTable implements DRConstants { - private static String REPOSITORIES_IDS - = "repositories-ids"; + private static String REPOSITORIES_IDS = "repositories-ids"; private static String REPOSITORIES_SUBSCRIBED_IDS = - "repositories-subscribed-ids"; + "repositories-subscribed-ids"; static String[] s_tableHeaders = { "", @@ -87,6 +86,7 @@ // store query result once m_query = new RequestLocal() { + @Override protected Object initialValue(PageState s) { User viewer = DRUtils.getUser(s); Session session = SessionManager.getSession(); Added: trunk/ccm-docrepo/web/WEB-INF/web.ccm-docrepo.xml =================================================================== --- trunk/ccm-docrepo/web/WEB-INF/web.ccm-docrepo.xml (rev 0) +++ trunk/ccm-docrepo/web/WEB-INF/web.ccm-docrepo.xml 2012-03-11 09:12:45 UTC (rev 2285) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <!-- Servlets for the docrepo applications --> + <servlet> + <servlet-name>docrepo</servlet-name> + <servlet-class>com.arsdigita.docrepo.ui.DRServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>docrepo</servlet-name> + <url-pattern>/docrepo/*</url-pattern> + </servlet-mapping> + +</web-app> \ No newline at end of file |
From: <pb...@fe...> - 2012-03-11 00:13:25
|
Author: pboy Date: 2012-03-11 00:13:09 +0000 (Sun, 11 Mar 2012) New Revision: 2283 Added: trunk/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/ trunk/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/oracle-se-6.6.1-6.6.2.sql trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.1-6.6.2.sql Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java trunk/ccm-ldn-terms/application.xml trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-ldn-terms/src/ccm-ldn-terms.upgrade trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Loader.java Log: ccm-ldn-terms now a legacy free type of application, various minor code improvements. Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 00:08:40 UTC (rev 2282) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 00:13:09 UTC (rev 2283) @@ -155,7 +155,8 @@ personsRs.getInt(1))); stmt.addBatch(String.format( "UPDATE acs_objects " - + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericPersonBundle' " + + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericPersonBundle'," + + "object_type = 'com.arsdigita.cms.contenttypes.GenericPersonBundle' " + "WHERE object_id = %d", personsRs.getInt(1))); } @@ -172,7 +173,8 @@ contactsRs.getInt(1))); stmt.addBatch(String.format( "UPDATE acs_objects " - + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericContactBundle' " + + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericContactBundle', " + + "object_type = 'com.arsdigita.cms.contenttypes.GenericContactBundle' " + "WHERE object_id = %d", contactsRs.getInt(1))); } Modified: trunk/ccm-ldn-terms/application.xml =================================================================== --- trunk/ccm-ldn-terms/application.xml 2012-03-11 00:08:40 UTC (rev 2282) +++ trunk/ccm-ldn-terms/application.xml 2012-03-11 00:13:09 UTC (rev 2283) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-ldn-terms" prettyName="Terms" - version="6.6.0" + version="6.6.2" release="1" webapp="ROOT"> <ccm:dependencies> @@ -15,7 +15,10 @@ <ccm:contact uri="mailto:rh...@re..." type="support"/> </ccm:contacts> <ccm:description> - The Red Hat Web Application Framework is a platform for writing - database-backed web applications in Java. + Package ccm-ldn-terms creates and maintains domain based categories. One + domain is specifically used by ccm-navigation to create a navigation menue + for the site. + + It replaces the "purpose" based categorization of ccm-core. </ccm:description> </ccm:application> Added: trunk/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql =================================================================== --- trunk/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql (rev 0) +++ trunk/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql 2012-03-11 00:13:09 UTC (rev 2283) @@ -0,0 +1,131 @@ +-- +-- Copyright (C) 2011 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 +-- +-- $Id: remove_legacy_entries.sql $ + +-- ccm-ldn-terms is now initialized as a legacy free type of +-- application so entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%terms.Terms%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%terms.Terms%') + ) + ); + +-- delete all entries in site_nodes referring to a Terms instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%terms.Terms%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%terms.Terms%') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%terms.Terms%') + ); + +-- delete all entries for Terms instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like '%terms.Terms%') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like '%terms.Terms%') ; + + +-- set package_id to null for all entries referring to a ContentSection instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like '%terms.Terms%') ; + +-- set package_id to null for all entries referring to a Terms instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like '%terms.Terms%' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Added: trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/oracle-se-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/oracle-se-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/oracle-se-6.6.1-6.6.2.sql 2012-03-11 00:13:09 UTC (rev 2283) @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2008 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 +-- +-- $Id: oracle-se-6.6.1-6.6.2.sql 293 2012-02-07 15:10:39Z pboy $ + +PROMPT Red Hat Enterprise TERMS 6.6.1 -> 6.6.2 Upgrade Script (Oracle) + +-- Terms now initialized legacy free +@@ ../default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql Modified: trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.0-6.6.1.sql 2012-03-11 00:08:40 UTC (rev 2282) +++ trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.0-6.6.1.sql 2012-03-11 00:13:09 UTC (rev 2283) @@ -21,6 +21,9 @@ begin; +-- Under unknown circumstances a constraint may get lost during updating. +-- Only needed under special conditions or when a missing constraint causes +-- errors. \i ../default/upgrade/6.6.0-6.6.1/upd_constraints.sql commit; Added: trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-ldn-terms/sql/ccm-ldn-terms/upgrade/postgres-6.6.1-6.6.2.sql 2012-03-11 00:13:09 UTC (rev 2283) @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2008 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 +-- +-- $DateTime: 2012/02/10 23:15:09 $ + +\echo Red Hat Enterprise TERMS 6.6.1 -> 6.6.2 Upgrade Script (PostgreSQL) + +begin; + +-- Terms now initialized legacy free +\i ../default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql + +commit; Modified: trunk/ccm-ldn-terms/src/ccm-ldn-terms.upgrade =================================================================== --- trunk/ccm-ldn-terms/src/ccm-ldn-terms.upgrade 2012-03-11 00:08:40 UTC (rev 2282) +++ trunk/ccm-ldn-terms/src/ccm-ldn-terms.upgrade 2012-03-11 00:13:09 UTC (rev 2283) @@ -18,4 +18,7 @@ <version from="6.6.0" to="6.6.1"> <script sql="ccm-ldn-terms/upgrade/::database::-6.6.0-6.6.1.sql"/> </version> + <version from="6.6.1" to="6.6.2"> + <script sql="ccm-ldn-terms/upgrade/::database::-6.6.1-6.6.2.sql"/> + </version> </upgrade> Modified: trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Loader.java =================================================================== --- trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Loader.java 2012-03-11 00:08:40 UTC (rev 2282) +++ trunk/ccm-ldn-terms/src/com/arsdigita/london/terms/Loader.java 2012-03-11 00:13:09 UTC (rev 2283) @@ -25,7 +25,8 @@ import com.arsdigita.web.ApplicationType; /** - * Loader. + * Terms Loader executes nonrecurring at install time and loads (installs and + * initializes) the ccm-ldn-terms module into database. * * @author Justin Ross <jr...@re...> * @version $Id$ @@ -40,11 +41,18 @@ }.run(); } + /** + * Creates a legacy free application type and a admin application instance. + */ public static void setupApplication() { - ApplicationType type = ApplicationType - .createApplicationType("terms", - "CCM Terms Admin", - Terms.BASE_DATA_OBJECT_TYPE); + + // NOTE: The title "Navigation" is used to retrieve the application's + // name to determine the location of xsl files (by url-izing it). So + // DON'T modify it without synchronizing web directory tree accordingly! + ApplicationType type = + new ApplicationType( "Terms", + Terms.BASE_DATA_OBJECT_TYPE ); + type.setDescription("CCM Terms administration"); Application admin = Application.retrieveApplicationForPath("/admin/"); |
Author: pboy Date: 2012-03-11 00:08:40 +0000 (Sun, 11 Mar 2012) New Revision: 2282 Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/ trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-bar.png trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected-end.png trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected.png trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected-end.png trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected.png trunk/ccm-core/web/themes/heirloom/packages/categorization/ trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/ trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/categorization.xsl trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java.nolongerInUse trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java trunk/ccm-faq/web/themes/ trunk/ccm-faq/web/themes/heirloom/ trunk/ccm-faq/web/themes/heirloom/apps/ trunk/ccm-faq/web/themes/heirloom/apps/faq/ trunk/ccm-faq/web/themes/heirloom/apps/faq/xsl/ trunk/ccm-faq/web/themes/heirloom/apps/faq/xsl/index.xsl trunk/ccm-faq/web/themes/heirloom/css/ trunk/ccm-faq/web/themes/heirloom/css/faq.css trunk/ccm-faq/web/themes/heirloom/images/ trunk/ccm-faq/web/themes/heirloom/images/faq-32.gif trunk/ccm-faq/web/themes/heirloom/packages/ trunk/ccm-faq/web/themes/heirloom/packages/faq/ trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/ trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/comments.xsl trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl Removed: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java trunk/ccm-faq/web/__ccm__/ trunk/ccm-faq/web/assets/ trunk/ccm-faq/web/packages/ Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/File.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/Folder.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/Initializer.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ResourceImpl.java trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DestinationFolderForm.java trunk/ccm-faq/src/com/arsdigita/faq/Faq.java trunk/ccm-faq/src/com/arsdigita/faq/FaqServlet.java trunk/ccm-forum/src/com/arsdigita/forum/Forum.java trunk/ccm-forum/src/com/arsdigita/forum/Loader.java trunk/ccm-portalserver/web/themes/heirloom/css/portalserver/portalserver.css Log: ccm-faq now a legacy free type of application, various minor code improvements. Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -11,17 +11,17 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.cli.CommandLine; -import org.apache.log4j.Logger; /** * Upgrade for association between GenericContact and GenericPerson (6.6.4 to * 6.6.5) * * @author Jens Pelzetter - * @version $Id$ + * @version $Id: GenericContactPersonAssocUpgrade.java 1501 2012-02-10 16:49:14Z + * jensp $ */ public class GenericContactPersonAssocUpgrade extends Program { - + public GenericContactPersonAssocUpgrade() { super("GenericContactPersonAssocUpgrade", "1.0.0", ""); } @@ -45,7 +45,7 @@ printStackTrace(ex); close(conn); return; - } + } System.out.println("Retrieving old data..."); try { @@ -81,7 +81,7 @@ try { System.out.println("Creating new tables..."); final Statement stmt = conn.createStatement(); - + stmt.addBatch("CREATE TABLE cms_person_bundles ( " + "bundle_id integer NOT NULL)"); @@ -153,6 +153,11 @@ stmt.addBatch(String.format("INSERT INTO cms_person_bundles (bundle_id) " + "VALUES (%d)", personsRs.getInt(1))); + stmt.addBatch(String.format( + "UPDATE acs_objects " + + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericPersonBundle' " + + "WHERE object_id = %d", + personsRs.getInt(1))); } final ResultSet contactsRs = queryContactsStmt.executeQuery( @@ -165,10 +170,15 @@ stmt.addBatch(String.format("INSERT INTO cms_contact_bundles (bundle_id) " + "VALUES (%s)", contactsRs.getInt(1))); + stmt.addBatch(String.format( + "UPDATE acs_objects " + + "SET default_domain_class = 'com.arsdigita.cms.contenttypes.GenericContactBundle' " + + "WHERE object_id = %d", + contactsRs.getInt(1))); } final List<String> processedEntries = - new ArrayList<String>(); + new ArrayList<String>(); for (OldAssocEntry entry : oldData) { BigDecimal personBundleId; BigDecimal contactBundleId; @@ -289,11 +299,11 @@ printStackTrace(ex); } } - + private void printStackTrace(final SQLException ex) { ex.printStackTrace(System.err); if (ex.getNextException() != null) { printStackTrace(ex.getNextException()); - } + } } } Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-bar.png =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-bar.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected-end.png =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected-end.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected.png =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-selected.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected-end.png =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected-end.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected.png =================================================================== (Binary files differ) Property changes on: trunk/ccm-core/web/themes/heirloom/images/tabbed-pane/tab-unselected.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/categorization.xsl =================================================================== --- trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/categorization.xsl (rev 0) +++ trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/categorization.xsl 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:categorization="http://www.arsdigita.com/categorization/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + version="1.0"> + +<xsl:template match="categorization:objectCategories"> + <b><xsl:value-of select="bebop:name"/></b> + <blockquote> + <xsl:apply-templates select="categorization:qualifiedCategoryName" /> + </blockquote> +</xsl:template> + +<xsl:template match="categorization:qualifiedCategoryName"> + <xsl:value-of select="@qualifiedName"/><br /> +</xsl:template> + +</xsl:stylesheet> \ No newline at end of file Property changes on: trunk/ccm-core/web/themes/heirloom/packages/categorization/xsl/categorization.xsl ___________________________________________________________________ Added: svn:executable + Deleted: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -1,54 +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.docrepo; - - -/** - * Constants used throughout the document manager application. - * - * @version $Id: Constants.java pboy $ - */ - -public interface Constants { - - // PDL constants - String ACTION = "action"; - String CONTENT = "content"; - String DESCRIPTION = "description"; - String DURATION = "duration"; - String FOLDER_ID = "folderID"; - String IS_FOLDER = "isFolder"; - String LAST_MODIFIED_DATE = "lastModifiedDate"; - String MIME_TYPE_LABEL = "mimeTypeDescription"; - String NAME = "name"; - String OBJECT_ID = "objectID"; - String PARENT = "parent"; - String PARTY_ID = "partyID"; - String PATH = "path"; - String SIZE = "size"; - String TYPE = "mimeType"; - String USER_ID = "userID"; - - String REPOSITORIES_MOUNTED = "subscribedRepositories"; - - // MIME type constants - - String TEXT_PLAIN = com.arsdigita.mail.Mail.TEXT_PLAIN; - String TEXT_HTML = com.arsdigita.mail.Mail.TEXT_HTML; -} Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java.nolongerInUse =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java.nolongerInUse (rev 0) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Constants.java.nolongerInUse 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,54 @@ +/* + * 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.docrepo; + + +/** + * Constants used throughout the document manager application. + * + * @version $Id: Constants.java pboy $ + */ + +public interface Constants { + + // PDL constants + String ACTION = "action"; + String CONTENT = "content"; + String DESCRIPTION = "description"; + String DURATION = "duration"; + String FOLDER_ID = "folderID"; + String IS_FOLDER = "isFolder"; + String LAST_MODIFIED_DATE = "lastModifiedDate"; + String MIME_TYPE_LABEL = "mimeTypeDescription"; + String NAME = "name"; + String OBJECT_ID = "objectID"; + String PARENT = "parent"; + String PARTY_ID = "partyID"; + String PATH = "path"; + String SIZE = "size"; + String TYPE = "mimeType"; + String USER_ID = "userID"; + + String REPOSITORIES_MOUNTED = "subscribedRepositories"; + + // MIME type constants + + String TEXT_PLAIN = com.arsdigita.mail.Mail.TEXT_PLAIN; + String TEXT_HTML = com.arsdigita.mail.Mail.TEXT_HTML; +} Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/File.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/File.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/File.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -18,7 +18,6 @@ */ package com.arsdigita.docrepo; - import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.mimetypes.MimeType; @@ -26,7 +25,6 @@ import com.arsdigita.persistence.OID; import com.arsdigita.persistence.metadata.Property; import com.arsdigita.util.Assert; -import org.apache.oro.text.perl.Perl5Util; import javax.activation.DataHandler; import javax.activation.FileDataSource; @@ -39,6 +37,9 @@ import java.util.Iterator; import java.util.Vector; +import org.apache.log4j.Logger; +import org.apache.oro.text.perl.Perl5Util; + /** * Represents a File in the document manager application. * @@ -46,11 +47,10 @@ * @author Ron Henderson (ro...@ar...) * @version $Id: File.java pboy $ */ -public class File extends ResourceImpl implements Constants { +public class File extends ResourceImpl { /** Logger instance for debugging support. */ - protected static org.apache.log4j.Logger s_log = - org.apache.log4j.Logger.getLogger(File.class); + protected static Logger s_log = Logger.getLogger(File.class); public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.docrepo.File"; @@ -152,7 +152,7 @@ */ @Override protected void beforeSave() { - set(IS_FOLDER, Boolean.FALSE); + set(Repository.IS_FOLDER, Boolean.FALSE); super.beforeSave(); } @@ -169,7 +169,7 @@ * content type cannot be determined. */ public String getContentType() { - return (String) get(TYPE); + return (String) get(Repository.TYPE); } /** @@ -198,7 +198,7 @@ */ private void setContentType(String type) { if (isNew()) { - set(TYPE, type); + set(Repository.TYPE, type); } else { if (!type.equals(getContentType())) { throw new TypeChangeException(getContentType(), type); @@ -258,9 +258,9 @@ final byte[] content = text.getBytes(); DocBlobject dblob = new DocBlobject(); dblob.setContent(content); - set(CONTENT, dblob); - set(SIZE, BigDecimal.valueOf(content.length)); - setContentType(TEXT_PLAIN); + set(Repository.CONTENT, dblob); + set(Repository.SIZE, BigDecimal.valueOf(content.length)); + setContentType(Repository.TEXT_PLAIN); } /** @@ -318,8 +318,8 @@ byte[] content = os.toByteArray(); DocBlobject dblob = new DocBlobject(); dblob.setContent(content); - set(CONTENT, dblob); - set(SIZE, BigDecimal.valueOf(content.length)); + set(Repository.CONTENT, dblob); + set(Repository.SIZE, BigDecimal.valueOf(content.length)); } catch (IOException e) { throw new ResourceException("error reading content: " + e.getMessage()); @@ -333,7 +333,7 @@ * cannot be computed. */ public BigDecimal getSize() { - BigDecimal size = (BigDecimal) get(SIZE); + BigDecimal size = (BigDecimal) get(Repository.SIZE); if (size != null) { return size; } else { @@ -358,8 +358,8 @@ byte[] content = getRawContent(); DocBlobject dblob = new DocBlobject(); dblob.setContent(content); - dest.set(CONTENT,dblob); - dest.set(SIZE, BigDecimal.valueOf(content.length)); + dest.set(Repository.CONTENT,dblob); + dest.set(Repository.SIZE, BigDecimal.valueOf(content.length)); dest.save(); return dest; } Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Folder.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Folder.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Folder.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -40,7 +40,7 @@ * @author Ron Henderson (ro...@ar...) * @version $Id: Folder.java pboy $ */ -public class Folder extends ResourceImpl implements Constants { +public class Folder extends ResourceImpl { public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.docrepo.Folder"; @@ -135,7 +135,7 @@ if (s_log.isDebugEnabled()) { s_log.debug("folder before save"); } - set(IS_FOLDER, Boolean.TRUE); + set(Repository.IS_FOLDER, Boolean.TRUE); super.beforeSave(); } @@ -200,7 +200,7 @@ public boolean hasResource(String name) { DataAssociation da = (DataAssociation) get("immediateChildren"); DomainCollection resources = new DomainCollection(da); - resources.addEqualsFilter(NAME, name); + resources.addEqualsFilter(Repository.NAME, name); try { return resources.next(); } finally { @@ -247,7 +247,7 @@ String subPath[] = new String[pathElementCount]; for (int i = 0; i < pathElementCount; i++) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int j = 0; j <= i; j++) { buf.append(SEPARATOR); buf.append(name[j]); @@ -314,6 +314,7 @@ * Returns the display name for a folder, which is equivalent to * calling getName(). */ + @Override public String getDisplayName() { return getName(); } Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Initializer.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Initializer.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Initializer.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -72,7 +72,7 @@ new ACSObjectInstantiator() { @Override public DomainObject doNewInstance(DataObject obj) { - Boolean isFolder = (Boolean) obj.get(Constants.IS_FOLDER); + Boolean isFolder = (Boolean) obj.get(Repository.IS_FOLDER); if (isFolder != null && isFolder.booleanValue()) { return new Folder(obj); } else { Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/Repository.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -57,7 +57,7 @@ * @author Ron Henderson (ro...@ar...) */ -public class Repository extends Application implements Constants { +public class Repository extends Application { /** Logger instance for debugging purpose. */ private static Logger s_log = Logger.getLogger(Repository.class); @@ -65,20 +65,44 @@ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.docrepo.Repository"; + // pdl constants + private static final String ACTION = "action"; + public static final String CONTENT = "content"; + public static final String DESCRIPTION = "description"; + private static final String DURATION = "duration"; + private static final String FOLDER_ID = "folderID"; + public static final String IS_FOLDER = "isFolder"; + private static final String LAST_MODIFIED_DATE = "lastModifiedDate"; + private static final String MIME_TYPE_LABEL = "mimeTypeDescription"; + public static final String NAME = "name"; + private static final String OBJECT_ID = "objectID"; + public static final String PARENT = "parent"; + private static final String PARTY_ID = "partyID"; + public static final String PATH = "path"; + public static final String SIZE = "size"; + public static final String TYPE = "mimeType"; + private static final String USER_ID = "userID"; + private static final String OWNER = "ownerID"; + private static final String ROOT = "rootID"; + + String REPOSITORIES_MOUNTED = "subscribedRepositories"; + + // MIME type constants + + public static final String TEXT_PLAIN = com.arsdigita.mail.Mail.TEXT_PLAIN; + public static final String TEXT_HTML = com.arsdigita.mail.Mail.TEXT_HTML; + + private Folder m_root = null; + /** * * @return */ + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } - // pdl constants - private static final String OWNER = "ownerID"; - private static final String ROOT = "rootID"; - - private Folder m_root = null; - /** * Retreives a repository from the database usings its OID. * @@ -137,6 +161,7 @@ /** * Grant write permission to the Portal participants. */ + @Override protected void afterSave() { super.afterSave(); Added: trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java (rev 0) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/RepositoryServlet.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 Peter boy (pb...@ba... + * + * 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.docrepo; + +import com.arsdigita.bebop.page.BebopApplicationServlet; + +import org.apache.log4j.Logger; + +/** + * + * @author pb + */ +public class RepositoryServlet extends BebopApplicationServlet { + + /** Private logger instance to faciliate debugging procedures */ + private static final Logger s_log = Logger.getLogger(RepositoryServlet.class); + +} Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ResourceImpl.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ResourceImpl.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ResourceImpl.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -69,7 +69,7 @@ * @version $Id: ResourceImpl.java pboy $ */ public abstract class ResourceImpl extends VersionedACSObject - implements Resource, Constants { + implements Resource { /** Logger instance for debugging support. */ protected static Logger s_log = Logger.getLogger(ResourceImpl.class); @@ -200,8 +200,8 @@ * sufficient to update the path only when the name changes, but * the current implementation is conservative about path updates. */ - final boolean pathChanged = - isPropertyModified(PARENT) || isPropertyModified(NAME); + final boolean pathChanged = isPropertyModified(Repository.PARENT) + || isPropertyModified(Repository.NAME); if (pathChanged) { String oldPath = null; @@ -332,19 +332,19 @@ public String getName() { - return (String) get(NAME); + return (String) get(Repository.NAME); } public void setName(String name) { - set(NAME, name); + set(Repository.NAME, name); } public String getDescription() { - return (String) get(DESCRIPTION); + return (String) get(Repository.DESCRIPTION); } public void setDescription(String description) { - set(DESCRIPTION, description); + set(Repository.DESCRIPTION, description); } public Resource getParent() { @@ -380,12 +380,12 @@ } public String getPath() { - String path = (String) get(PATH); + String path = (String) get(Repository.PATH); return path; } private void setPath(String path) { - set(PATH, path); + set(Repository.PATH, path); } public abstract boolean isFolder(); @@ -406,7 +406,7 @@ String ids = null; if (collection.next()) { - ids = (String)collection.get(PATH); + ids = (String)collection.get(Repository.PATH); collection.close(); } else { // this means that the id is not valid so there is no path @@ -421,16 +421,16 @@ collection = SessionManager.getSession().retrieve (BASE_DATA_OBJECT_TYPE); - Filter filter = collection.addFilter(PATH + " <= :ancestors"); + Filter filter = collection.addFilter(Repository.PATH + " <= :ancestors"); filter.set("ancestors", ids); filter = collection.addFilter - (PATH + " = substr(:path, 1, length(" + PATH +"))"); + (Repository.PATH + " = substr(:path, 1, length(" + Repository.PATH +"))"); filter.set("path", ids); - collection.addOrder(PATH); + collection.addOrder(Repository.PATH); while (collection.next()) { - ancestors.append(SEPARATOR + collection.get(NAME)); + ancestors.append(SEPARATOR + collection.get(Repository.NAME)); } return ancestors.toString(); @@ -604,12 +604,13 @@ */ protected Vector getPropertyNames() { Vector names = new Vector(); - names.addElement(NAME); - names.addElement(DESCRIPTION); - names.addElement(IS_FOLDER); + names.addElement(Repository.NAME); + names.addElement(Repository.DESCRIPTION); + names.addElement(Repository.IS_FOLDER); return names; } + @Override public java.util.Date getLastModifiedDate() { java.util.Date date = (java.util.Date)get("lastModifiedDate"); return date; @@ -619,6 +620,7 @@ set("lastModifiedDate",date); } + @Override public java.util.Date getCreationDate() { java.util.Date date = (java.util.Date)get("creationDate"); return date; @@ -628,6 +630,7 @@ set("creationDate",date); } + @Override public User getCreationUser() { DataObject dobj = (DataObject)get("creationUser"); if(dobj == null) { @@ -641,6 +644,7 @@ set("creationUser", user); } + @Override public User getLastModifiedUser() { DataObject dobj = (DataObject)get("lastModifiedUser"); if(dobj == null) { @@ -654,6 +658,7 @@ set("lastModifiedUser", user); } + @Override public String getCreationIP() { String ip = (String)get("creationIP"); return ip; @@ -669,6 +674,7 @@ set("creationIP",ip); } + @Override public String getLastModifiedIP() { String ip = (String)get("lastModifiedIP"); return ip; Modified: trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DestinationFolderForm.java =================================================================== --- trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DestinationFolderForm.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-docrepo/src/com/arsdigita/docrepo/ui/DestinationFolderForm.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -269,16 +269,16 @@ int item = 0; while (collection.next()) { Filter filter = query.addFilter - (" not " + ResourceImpl.PATH + " like " + + (" not " + Repository.PATH + " like " + ":item" + item); filter.set("item" + item, - collection.get(ResourceImpl.PATH)); + collection.get(Repository.PATH)); } } } - query.addOrder(ResourceImpl.PATH); - query.addOrder(ResourceImpl.NAME); + query.addOrder(Repository.PATH); + query.addOrder(Repository.NAME); while (query.next()) { BigDecimal parentID = (BigDecimal) query.get("parentID"); Modified: trunk/ccm-faq/src/com/arsdigita/faq/Faq.java =================================================================== --- trunk/ccm-faq/src/com/arsdigita/faq/Faq.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-faq/src/com/arsdigita/faq/Faq.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -26,38 +26,59 @@ import com.arsdigita.persistence.OID; import com.arsdigita.persistence.SessionManager; import com.arsdigita.util.TypedText; - import com.arsdigita.web.Application; import java.math.BigDecimal; +import org.apache.log4j.Logger; + /** * Faq class. * + * @version $Id: com/arsdigita/faq/Faq.java#5 $ */ public class Faq extends Application { - public static final String versionId = "$Id: //apps/faq/dev/src/com/arsdigita/faq/Faq.java#5 $ by $Author: dennis $, $DateTime: 2004/08/17 23:26:27 $"; + /** Private logger instance for debugging purpose */ + private static final Logger log = Logger.getLogger(Faq.class); + // PDL stuff + public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.faq.Faq"; + "com.arsdigita.faq.Faq"; - private static final org.apache.log4j.Logger log = - org.apache.log4j.Logger.getLogger(Faq.class); - + /** + * + * @param oid + * @throws DataObjectNotFoundException + */ public Faq(OID oid) throws DataObjectNotFoundException { super(oid); } + /** + * + * @param key + * @throws DataObjectNotFoundException + */ public Faq(BigDecimal key) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, key)); } + /** + * + * @param dataObject + */ public Faq(DataObject dataObject) { super(dataObject); } + /** + * + * @return + */ + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } @@ -66,10 +87,13 @@ /** * Use this instead of the constructor to create new Faq objects */ - public static Faq create(String urlName, String title, + public static Faq create(String urlName, + String title, Application parent) { - return (Faq) Application.createApplication - (BASE_DATA_OBJECT_TYPE, urlName, title, parent); + return (Faq) Application.createApplication(BASE_DATA_OBJECT_TYPE, + urlName, + title, + parent); } /** @@ -83,13 +107,13 @@ new TypedText(answer, TypedText.TEXT_HTML)); } - /** - * @deprecated use createQuestion(String, TypedText) instead - */ - public QAPair createQuestion(String question, String answer, - String answerFormat) { - return createQuestion(question, new TypedText(answer, answerFormat)); - } +// /** +// * @deprecated use createQuestion(String, TypedText) instead +// */ +// public QAPair createQuestion(String question, String answer, +// String answerFormat) { +// return createQuestion(question, new TypedText(answer, answerFormat)); +// } public QAPair createQuestion(String question, TypedText answer) { @@ -159,4 +183,9 @@ } + @Override + public String getServletPath() { + return "/faq"; + } + } Modified: trunk/ccm-faq/src/com/arsdigita/faq/FaqServlet.java =================================================================== --- trunk/ccm-faq/src/com/arsdigita/faq/FaqServlet.java 2012-03-11 00:03:02 UTC (rev 2281) +++ trunk/ccm-faq/src/com/arsdigita/faq/FaqServlet.java 2012-03-11 00:08:40 UTC (rev 2282) @@ -38,8 +38,10 @@ private static final Logger s_log = Logger.getLogger(FaqServlet.class); + @Override public void init() throws ServletException { super.init(); + s_log.debug("creating FAQ page"); Page index = buildIndexPage(); Page admin = buildAdminIndexPage(); @@ -48,8 +50,8 @@ put("/index.jsp", index); put("/one.jsp", index); - put("admin/", admin); - put("admin/index.jsp", admin); + // put("admin", admin); + // put("admin/index.jsp", admin); } Added: trunk/ccm-faq/web/themes/heirloom/apps/faq/xsl/index.xsl =================================================================== --- trunk/ccm-faq/web/themes/heirloom/apps/faq/xsl/index.xsl (rev 0) +++ trunk/ccm-faq/web/themes/heirloom/apps/faq/xsl/index.xsl 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:include href="../../../packages/faq/xsl/faq.xsl"/> +</xsl:stylesheet> \ No newline at end of file Added: trunk/ccm-faq/web/themes/heirloom/css/faq.css =================================================================== --- trunk/ccm-faq/web/themes/heirloom/css/faq.css (rev 0) +++ trunk/ccm-faq/web/themes/heirloom/css/faq.css 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,735 @@ +/* + * Fundamental Styles + * Copied from portalserver + */ + +body { + background-color: white; + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; + margin: 0; +} + +table { + border-spacing: 0; + empty-cells: show; +} + +td { + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; + vertical-align: top; +} + +.main { /* background-color: #ffffff; */ } +.dark { /* background-color: #666666; */ } +.medium { /* background-color: #999999; */ } +.light { /* background-color: #cccccc; */ } + +.activeTabColor { + background: #A2E1E1; +} + +.inactiveTabColor { + background: #E1E1E1; +} + +.dialogTitle { + font-weight: bold; + font-size: 12pt; +} + +.messageOfTheDay { + padding-left: 0.4em; + padding-right: 0.4em; + margin-top: 0.4em; + margin-bottom: 0.4em; + border-style: solid; + border-bottom-width: 1px; + border-top-width: 1px; + border-right-width: 1px; + border-left-width: 1px; + border-color: #cccccc; +} + +/* We would use a div here, but it triggers a rendering bug. */ + +table.setInside { + width: 100%; + border-spacing: 0; +} + +table.setInside td.setInside { + padding: 6px; + padding-bottom: 0; +} + +/* + * Global Header + * + * This is currently a gray stripe at the top of each portal and + * application page. The left side, a context bar, uses the class + * attribute "globalNavigation" and the right uses "globalControl". + */ + +table.globalHeader { + background-color: rgb(225,225,225); + font-size: 10pt; + width: 100%; +} + +table.globalHeader td { + padding: 6px; + padding-bottom: 7px; + vertical-align: middle; +} + +table.globalHeader td.globalLogo { + width: 25px; + height: 25px; + background-image: url(../logo.png); + background-repeat: no-repeat; +} + +td.globalNavigation { + color: #3F3F3F; +} + +td.globalNavigation a { + color: #3F3F3F; +} + +td.global-links { + float: right; +} + +td.global-link-icon { + padding: 0 4px 0 10px; +} + +td.global-link-icon img { + border: 0; +} + +td.global-link a { + color: blue; + text-decoration: none; +} + +td.globalNavigation span.contextBarSeparator { + color: #3F3F3F; + font-weight: bold; +} + +td.globalNavigation span.immediateContext { + color: #3F3F3F; + font-weight: bold; +} + +form.globalSearch { + margin: 0; + border: 0; + padding: 0; +} + +td.globalControl { + color: #3F3F3F; + margin: 0; + padding: 0; + padding-right: 6px; + text-align: right; + vertical-align: middle; + font-weight: bold; +} + +td.globalControl a, +td.globalControl img { + margin: 0; + padding: 0; + color: #3F3F3F; + vertical-align: middle; + border: 0 none; + text-decoration: none; +} + +/* + * Local Header + * + * The header elements right under the blue stripe. These are + * elements logically connected to the current application, not to the + * system in general. + */ + +table.localHeader { + width: 100%; +} + +table.localHeader td.localTitle { + text-align: left; + font-weight: bold; + font-size: 12pt; +} + +table.localHeader td.localControl, +table.localHeader td.localControl a { + text-align: right; +} + +/* + * Split Panel + */ + +table.splitPanel { + width: 100%; +} + +table.splitPanelHeader { + /* Nothing here yet. */ +} + +td.splitPanelLeft { + width: 25%; +} + +td.splitPanelRight { + width: 75%; +} + +/* + * Tabs and Header/Body/Footer Separators + */ + +table.topRuleNoTabs { + background-color: rgb(162,30,30); + width: 100%; + margin: 0; + margin-bottom: 6px; + border-top: 1px solid black; + padding: 0; +} + +table.topRuleUnderTabs { + background-color: rgb(162,30,30); + width: 100%; + margin: 0; + margin-bottom: 6px; + padding: 0; +} + +table.bottomRule { + background-color: rgb(162,30,30); + width: 100%; + margin: 0; + margin-top: 6px; + border-bottom: 1px solid black; + padding: 0; +} + +table.tabs { + margin: 0; + border-spacing: 0; +} + +table.tabs a { + color: black; + text-decoration: none; + white-space: nowrap; +} + +table.tabs td { + margin: 0; + border: 0; + padding: 0; + font-weight: bold; + font-size: 10pt; + color: black; + text-decoration: none; + white-space: nowrap; +} + +table.tabs td.activeTab { + vertical-align: middle; + background-color: rgb(162,30,30); + border-top: 1px solid black; + color: #FFFFFF; + padding-top: 1px; +} + +table.tabs td.inactiveTab { + vertical-align: middle; + background-color: rgb(225,225,225); + border-top: 1px solid black; + border-bottom: 1px solid black; + color: #DDDDDD; + padding-top: 2px; +} + +table.tabs td.trimSpace { + border-bottom: 1px solid black; +} + +table.tabs td.tabBeginning { + border-left: 1px solid black; + border-top: 1px solid black; + background-color: rgb(162,30,30); + width: 6px; +} + +table.tabs td.tabBeginningOff { + border-top: 1px solid black; + border-left: 1px solid black; + border-bottom: 1px solid black; + background-color: rgb(225,225,225); + width: 6px; +} + +table.tabs td.tabEnd { + border-top: 1px solid black; + border-right: 1px solid black; + background-color: rgb(162,30,30); + width: 6px; +} + +table.tabs td.tabEndOff { + border-right: 1px solid black; + border-top: 1px solid black; + border-bottom: 1px solid black; + background-color: rgb(225,225,225); + width: 6px; +} + +/* + * Portals and Portlets + * + * "NW" denotes Narrow and Wide columns, in that order. Other layouts + * will require other CSS rules. + */ + +table.portalLayoutNW { + width: 100%; + margin: 0; + padding: 0; +} + +table.portalLayoutNW td.narrowColumn { + width: 25%; +} + +table.portalLayoutNW td.columnSeparator { + border: 0; + padding: 0; +} + +table.portalLayoutNW td.wideColumn { + width: 75%; +} + +table.portalLayoutW { + width: 100%; + margin: 0; + padding: 0; +} + +table.portalLayoutW td.VeryWideColumn { + width:100%; +} + +table.portalLayoutWN { + width: 100%; + margin: 0; + padding: 0; +} + +table.portalLayoutWN td.narrowColumn { + width: 25%; +} + +table.portalLayoutWN td.columnSeparator { + border: 0; + padding: 0; +} + +table.portalLayoutWN td.wideColumn { + width: 75%; +} + +table.portalLayoutNWN { + width: 100%; + margin: 0; + padding: 0; +} + +table.portalLayoutNWN td.narrowColumnLeft { + width: 25%; +} + +table.portalLayoutNWN td.narrowColumnRight { + width: 25%; +} + +table.portalLayoutNWN td.columnSeparator { + border: 0; + padding: 0; +} + +table.portalLayoutNWN td.wideColumn { + width: 50%; +} + +table.portalLayoutNNN { + width: 100%; + margin: 0; + padding: 0; +} + +table.portalLayoutNNN td.narrowColumnLeft { + width: 33%; +} + +table.portalLayoutNNN td.narrowColumnRight { + width: 33%; +} + +table.portalLayoutNNN td.columnSeparator { + border: 0; + padding: 0; +} + +table.portalLayoutNNN td.narrowColumnCenter { + width: 33%; +} + +table.portlet { + width: 100%; + margin: 0; + margin-bottom: 6px; + padding: 0; +} + +table.portlet td.portletHeader { + font-weight: bold; + background: #dddddd; + color: #666666; + padding: 4px; + padding-left: 6px; + vertical-align: middle; +} + +table.portlet td.portletIcon { + background: #dddddd; + padding: 4px; + text-align: right; +} + +table.portlet td.portletBody { + padding: 6px; +} + +/* + * Fancy Tables (for tabular data) + */ + +table.fancy { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 1px solid black; +} + +table.fancy th { + padding: 4px; + border:0 none; + font-size: 9pt; + text-align: left; +} + +table.fancy td { + padding: 4px; + border: 0 none; + font-size: 9pt; +} + +table.fancy thead tr { + background-color: #eeeeee; +} + +table.fancy thead tr.subheading { + background-color: #93bee2; +} + +table.fancy thead tr.subheading td { + text-align: right; +} + +table.fancy tbody td.subDivider { + padding: 0; + background-color: #93bee2; +} + +table.fancy thead th { + font-weight: bold; + text-align: left; + white-space: nowrap; +} + +table.fancy thead th.numeric { + text-align: right; +} + +table.fancy thead th.date { + text-align: center; +} + +table.fancy thead th.icon { + text-align: center; +} + +table.fancy tbody td { + border-top: 1px solid black; +} + +table.fancy tbody td.noborder { + border-top: none; +} + +table.fancy tbody td.numeric { + text-align: right; +} + +table.fancy tbody td.date { + text-align: right; + white-space: nowrap; +} + +table.fancy tbody td.icon { + text-align: center; +} + +/* + * With is for tables that want to look standard (no lines on the inside) but + * also want to have the really thin line around the outside + */ +table.plainWithBorder { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 1px solid black; +} + + +/* + * Miscellaneous + */ + +select { + font-family: Arial, Helvetica, sans-serif; + font-size: 9pt; +} + +tr.rowEven { background-color: #eeeeff; } + +th { + font-family: Arial, Helvetica, sans-serif; + font-size: 10pt; + font-weight: bold; + text-align: left; + vertical-align: bottom; +} + +td.panelHeader { + padding-left: 0.4em; + padding-right: 0.4em; + padding-top: 0.1em; + padding-bottom: 0.1em; + vertical-align: middle; + text-align: left; + font-weight: bold; +} + +/* styles for section headers */ + +table.sectionHeader { + border:0 none; +} + +table.sectionHeader td { + font-weight:bold; + font-size:12pt; + border:0 none; + white-space:nowrap; +} + +table.sectionHeader td.add { + text-align:right; +} + +table.sectionHeader td.path { + text-align:right; + font-family:monospace; + font-weight:normal; + font-size:10pt; +} + +/* styles for colorpicker */ +table.colorband { + border:1px solid black; +} +table.colorband td { + width:20px; + height:20px; + border:1px solid black; +} + +/* styles for controlBar */ + +table.controlBar { + width:100%; + font-size:8pt; + border:0 none; + border-collapse:collapse; + border-spacing:0; + border:1px solid black; +} + +table.controlBar td { + font-size:8pt; + border:0 none; + white-space:nowrap; +} + +table.controlBar span { + font-size:8pt; + font-weight:bold; + border:0 none; + white-space:nowrap; +} + +table.controlBar select { + font-size:8pt; + vertical-align: middle; +} + +table.controlBar input { + font-size:8pt; + vertical-align: middle; +} + +table.controlBar img { + vertical-align: middle; +} + +tbody.controlBar td { + border-top:1px solid black; +} + +tbody.controlBar td.numeric { + text-align:right; + padding-right:20px; +} + +tbody.controlBar td.date { + text-align:right; + white-space:nowrap; +} + +tbody.controlBar td.icon { + text-align:center; +} + +/**************Admin style*****************/ + +body { + margin: 0; +} +div.tabs div, div.tabs table { + position: relative; +} + +div.tabs { + margin: 0px 0 4px 0; +} + +div.tabs table { + margin-left: 6px; +} + +div.tabs table.tab-set { + top: 1px; + border-collapse: collapse; + float: left; + margin-left: 6px; + margin: 0 0 0 4px; + border: 0; + padding: 0; + border-spacing: 0; + font-size: x-small; +} + +div.tabs table td { + margin: 0; + border: 0; + padding: 0; +} +div.tabs table td.end { + width: 10px; +} + +div.tabs table td.label { + padding: 5px 0 3px 10px; +} + +div.tabs table td.current-tab-end { + width: 10px; +} + +div.tabs table td.current-tab-label { + padding: 5px 0 3px 10px; +} + +/* When selected */ + +div.tabs table.selected { + z-index: 20; + background: rgb(162,30,30) url(../images/tabbed-pane/tab-selected.png) no-repeat; +} + +div.tabs table.tab-set td.current-tab-label { + color: white; + background: rgb(162,30,30) url(../images/tabbed-pane/tab-selected.png) no-repeat; +} +div.tabs table.tab-set td.current-tab-end { + background: url(../images/tabbed-pane/tab-selected-end.png) no-repeat; +} + +/* When not selected */ + +div.tabs table.unselected { + background: rgb(225,225,225) url(../images/tabbed-pane/tab-unselected.png) no-repeat; +} + +div.tabs table.tab-set td.label { + color: rgb(63,63,63); + background: rgb(225,225,225) url(../images/tabbed-pane/tab-unselected.png) no-repeat; +} + +div.tabs table.tab-set td.end { + background: url(../images/tabbed-pane/tab-unselected-end.png) no-repeat; +} + +div.tabs table.tab-set td.tab-spacer { + width: 4px; +} + +div.tabs a { + text-decoration: none; +} + +div.tabs table.rule { + width: 100%; + clear: left; + background: rgb(162,30,30) url(../images/tabbed-pane/tab-bar.png) repeat-x; + height: 11px; + margin: 0px; + padding: 0px; +} + Added: trunk/ccm-faq/web/themes/heirloom/images/faq-32.gif =================================================================== (Binary files differ) Property changes on: trunk/ccm-faq/web/themes/heirloom/images/faq-32.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/comments.xsl =================================================================== --- trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/comments.xsl (rev 0) +++ trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/comments.xsl 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,235 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:comments="http://www.arsdigita.com/comments/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + + <xsl:template match="comments:comment-detail-view" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + <table width="90%" cellpadding="10"> + <tr> + <td align="left"> + <b>Title :</b><xsl:text> </xsl:text> + </td> + <td align="left"> + <xsl:value-of select="comments:one-comment-view/@title"/> + </td> + </tr> + <tr> + <td valign="top"> + <b>Comment:</b> <xsl:text> </xsl:text> + </td> + <td valign="top"> + <xsl:value-of disable-output-escaping="yes" select="comments:one-comment-view/@comment"/> + </td> + </tr> + <tr> + <td align="left"> + <b>By :</b><xsl:text> </xsl:text> + </td> + <td align="left"> + <xsl:value-of select="comments:one-comment-view/@name"/> + </td> + </tr> + <tr> + <td align="left"> + <b>Format :</b><xsl:text> </xsl:text> + </td> + <td align="left"> + <xsl:value-of select="comments:one-comment-view/@format"/> + </td> + </tr> + + <xsl:if test="comments:one-comment-view/@checkAdmin = 1"> + <tr> + <td align="left"> + <b>Status:</b><xsl:text> </xsl:text> + </td> + <td align="left"> + <a href="comment-setstatus.jsp?{@query-string}&message={comments:one-comment-view/@message}"><xsl:value-of select="comments:one-comment-view/@status"/></a> + </td> + </tr> + <tr> + <td> + <a href="comment-delete.jsp?{@query-string}" onClick='return confirm("The comment will be deleted permanently. Do you want to continue?");'>Delete this Comment</a> + </td> + <td align="right"> + <a href="index.jsp?{@query-string}">Return to all Comments</a> + </td> + </tr> + </xsl:if> + <xsl:if test="@checkAdmin = 0"> + <tr> + <td align="left"> + <b>Status:</b><xsl:text> </xsl:text> + </td> + <td align="left"> + <xsl:value-of select="comments:one-comment-view/@status"/> + </td> + </tr> + <tr> + <td align="right"> + <a href="index.jsp?{@query-string}">Return to all Comments</a> + </td> + </tr> + </xsl:if> + + </table> + </xsl:template> + + + <xsl:template match="comments:comments-view" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + + <hr /> + <center> + <h3>Comments</h3> + </center> + + <table width="90%" cellpadding="20"> + <xsl:if test="count(comments:comments-list/comments:comment/@commentID)=0"> + No comments have been made. + </xsl:if> + + <xsl:for-each select="comments:comments-list/comments:comment" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + <tr> + <td> + <xsl:if test="@checkAdmin = 1"> + <h3><i><xsl:value-of disable-output-escaping="yes" select="@title"/></i></h3>(<a href="comments/edit.jsp?commentID={@commentID}&{ancestor::comments:comments-view/@query-string}&return-url={ancestor::comments:comments-view/@return-url}">edit</a>) + </xsl:if> + <xsl:if test="@checkAdmin = 0"> + <h3><i><xsl:value-of disable-output-escaping="yes" select="@title"/></i></h3> + </xsl:if> + <blockquote> + <xsl:value-of disable-output-escaping="yes" select="@comment"/> + <p/> + -- <i>by <xsl:value-of select="@name"/> on DATE </i><xsl:value-of select="@date"/> + </blockquote> + </td> + </tr> + </xsl:for-each> + </table> + + <center> + <a href="comments/add.jsp?{@query-string}&return-url={@return-url}">Add a Comment</a> + </center> + </xsl:template> + + + + <xsl:template match="comments:commentsTab" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + + <table width="90%" cellpadding="20"> + + <xsl:if test="count(comments:singlecomment/@commentID)= 0"> + <b>There is no comment available under this section.</b> + </xsl:if> + <xsl:if test="count(comments:singlecomment/@commentID)> 0"> + + <tr> + <th width="5%"><a href="?{@query-string}&order-by=id">ID</a></th> + <th width="20%"><a href="?{@query-string}&order-by=subject">Title</a></th> + <th width="30%">Last Modified</th> + <th width="40%">By</th> + + </tr> + </xsl:if> + <xsl:for-each select="comments:singlecomment" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + <tr> + <td align="center" width="5%"> + <xsl:value-of select="@commentID"/>aaaaaaa + </td> + <td align="center" width="20%"> + <a href="one-object.jsp?commentID={@commentID}&{ancestor::comments:commentsTab/@query-string}"><xsl:value-of select="@title"/></a> + </td> + <td align="center" width="30%"> + <xsl:value-of select="@lastModifiedDate"/> + </td> + <td align="center" width="40%"> + <xsl:value-of select="@lastModifiedUser"/> + </td> + + </tr> + </xsl:for-each> + </table> + + + </xsl:template> + + + <xsl:template match="comments:comment" xmlns:comments="http://www.arsdigita.com/comments/1.0"> + <xsl:apply-templates /> + </xsl:template> + + + + <xsl:template match="comments:section"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <xsl:apply-templates select="comments:section_top"/> + <xsl:apply-templates select="comments:section_bottom"/> + </table> + </xsl:template> + + <xsl:template match="comments:section_top" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + <tr> + <td> + <table width="100%" cellspacing="0" cellpadding="2" border="0"> + <tr> + <th class="section_header" align="left"> + <xsl:value-of select="@section_title"/> + </th> + <td class="section_header" align="right"> + <xsl:apply-templates/> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td bgcolor="#ffffff"> + <table border="0" cellspacing="0" cellpadding="0"> + <tr> + <td height="1"></td> + </tr> + </table> + </td> + </tr> + </xsl:template> + + + <xsl:template match="comments:confirm-element" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + <p/> + <blockquote> + <font color="red"><xsl:apply-templates/></font> + </blockquote> + <p/> + </xsl:template> + + <xsl:template match="comments:section_bottom" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + <tr> + <td class="section_body"> + <br/> + <xsl:apply-templates/> + <br/> + </td> + </tr> + </xsl:template> + + <xsl:template match="comments:comment-information-added" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + The Comment has been added. + </xsl:template> + + <xsl:template match="comments:comment-information-changed" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + The Comment information has been changed and should be reflected below. + </xsl:template> + + <xsl:template match="comments:comment-active" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + This Comment is now approved. + </xsl:template> + + <xsl:template match="comments:comment-inactive" xmlns:gc="http://www.arsdigita.com/comments/1.0"> + This Comment is now unapproved. + </xsl:template> + + +</xsl:stylesheet> + + Added: trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl =================================================================== --- trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl (rev 0) +++ trunk/ccm-faq/web/themes/heirloom/packages/faq/xsl/faq.xsl 2012-03-11 00:08:40 UTC (rev 2282) @@ -0,0 +1,396 @@ +<?xml version="1.0"?> + +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:faq="http://www.redhat.com/faq/1.0" + xmlns:admin="http://www.arsdigita.com/admin-ui/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0"> + +<!-- The order of imports below is important. Please don't change + them without appropriate testing. --> + +<xsl:import href="../../acs-admin/xsl/admin_en.xsl"/> +<xsl:import href="../../categorization/xsl/categorization.xsl"/> +<xsl:import href="../../bebop/xsl/DimensionalNavbar.xsl"/> +<xsl:import href="../../toolbox/xsl/ControlBar.xsl"/> +<!-- <xsl:import href="../../faq/xsl/comments.xsl"/> --> + + +<xsl:output method="html" indent="yes"/> + +<xsl:param name="internal-theme"/> + + +<xsl:template match="bebop:page[@class='faq']"> + <html> + <head> + <title><xsl:value-of select="bebop:title"/></title> + <link href="{$internal-theme}/css/faq.css" rel="stylesheet" type="text/css"/> + <style type="text/css"> + BODY { background: white; color: black} + .main {background-color: #ffffff;} + table.globalHeader { background-color: rgb(225,225,225);} + table.bottomRule { background: rgb(162,30,30);} + table.topRuleNoTabs { background: rgb(162,30,30);} + </style> + + <xsl:for-each select="bebop:stylesheet"> + <link href="{@href}" rel="stylesheet" type="{@type}"/> + </xsl:for-each> + +<xsl:value-of select="faq:styleblock" disable-output-escaping="yes"/> + + </head> + <body> + <xsl:apply-templates select="faq:header"/> + + <xsl:apply-templates select="faq:body"/> + + <xsl:apply-templates select="faq:footer"/> + + <xsl:apply-templates select="faq:styleblock"/> + + <!-- + This is here so the the bebop page structure is displayed under /debug/ + --> + <xsl:apply-templates select="*[position()>4]"/> + </body> + </html> +</xsl:template> + +<xsl:template match="bebop:link[@class='portalControlProfileLink']"> + <xsl:call-template name="bebop:link" /> + <br /> +</xsl:template> + +<xsl:template match="faq:header"> + + <table class="globalHeader"> + <tr> + <td class="globalNavigation"> + <xsl:if test="bebop:dimensionalNavbar[@class = 'portalNavbar']"> + <xsl:apply-templates select="bebop:dimensionalNavbar[@class = 'portalNavbar']"/> + </xsl:if> + </td> + <td style="margin: 0; border: 0; padding: 0;"> + <table align="right" style="margin: 0; border: 0; padding: 0;"> + <tr> + <td style="margin: 0; border: 0; padding: 0; padding-right: 18px;"> + </td> +<!... [truncated message content] |
Author: pboy Date: 2012-03-11 00:03:02 +0000 (Sun, 11 Mar 2012) New Revision: 2281 Added: trunk/ccm-forum/sql/ccm-forum/upgrade/default/6.6.1-6.6.2/ trunk/ccm-forum/sql/ccm-forum/upgrade/default/6.6.1-6.6.2/remove_legacy_entries.sql trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.1-6.6.2.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.1-6.6.2.sql Modified: trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.css trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl trunk/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java trunk/ccm-core/src/log4j.properties trunk/ccm-forum/application.xml trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.0-6.6.1.sql trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.0-6.6.1.sql trunk/ccm-forum/src/ccm-forum.upgrade trunk/ccm-forum/src/com/arsdigita/forum/Forum.java trunk/ccm-forum/src/com/arsdigita/forum/ForumPageBuilder.java trunk/ccm-forum/src/com/arsdigita/forum/ForumPageFactory.java trunk/ccm-forum/src/com/arsdigita/forum/Loader.java trunk/ccm-forum/src/com/arsdigita/forum/ThreadPageBuilder.java trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumUserCompactView.java trunk/ccm-forum/src/com/arsdigita/forum/ui/ThreadsPanel.java trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.css trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.xsl Log: ccm-forum now a legacy free type of application, various minor code improvements. Modified: trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.css =================================================================== --- trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.css 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.css 2012-03-11 00:03:02 UTC (rev 2281) @@ -366,24 +366,24 @@ margin-left: 4px; padding: 5px 0 3px 10px; - background: rgb(225,225,225) url(/css/tabbed-pane/tab-unselected.png) no-repeat; + background: rgb(225,225,225) url(/themes/heirloom/css/tabbed-pane/tab-unselected.png) no-repeat; } div.tabbed-pane table.tab-set td.tab-end { width: 10px; - background: url(/css/tabbed-pane/tab-unselected-end.png) no-repeat; + background: url(/themes/heirloom/css/tabbed-pane/tab-unselected-end.png) no-repeat; } div.tabbed-pane table.tab-set td.current-tab-label { margin-left: 4px; padding: 5px 0 3px 10px; - background: rgb(162,30,30) url(/css/tabbed-pane/tab-selected.png) no-repeat; + background: rgb(162,30,30) url(/themes/heirloom/css/tabbed-pane/tab-selected.png) no-repeat; color: white; } div.tabbed-pane table.tab-set td.current-tab-end { width: 10px; - background: url(/css/tabbed-pane/tab-selected-end.png) no-repeat; + background: url(/themes/heirloom/css/tabbed-pane/tab-selected-end.png) no-repeat; } div.tabbed-pane table.tab-set td.tab-spacer { @@ -393,7 +393,7 @@ div.tabbed-pane table.rule { margin-left: 10px; width: 100%; - background: rgb(162,30,30) url(/css/tabbed-pane/tab-bar.png) repeat-x; + background: rgb(162,30,30) url(/themes/heirloom/css/tabbed-pane/tab-bar.png) repeat-x; height: 10px; } Modified: trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl =================================================================== --- trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl 2012-03-11 00:03:02 UTC (rev 2281) @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet xmlns:forum="http://www.arsdigita.com/forum/1.0" - xmlns:bebop="http://www.arsdigita.com/bebop/1.0" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:nav="http://ccm.redhat.com/navigation" - xmlns:search="http://rhea.redhat.com/search/1.0" - xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" - xmlns:cms="http://www.arsdigita.com/cms/1.0" - exclude-result-prefixes="xsl bebop nav search portal forum cms" - version="1.0"> +<xsl:stylesheet xmlns:forum="http://www.arsdigita.com/forum/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:nav="http://ccm.redhat.com/navigation" + xmlns:search="http://rhea.redhat.com/search/1.0" + xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + exclude-result-prefixes="xsl bebop nav search portal forum cms" + version="1.0"> <!-- IMPORT DEFINITIONS ccm-forum installed as separate web application <xsl:import href="../../../../ROOT/themes/heirloom/packages/bebop/xsl/bebop.xsl" /> @@ -16,9 +16,9 @@ --> <!-- IMPORT DEFINITIONS ccm-forum installed into the main CCM webapp --> - <xsl:import href="../../../packages/bebop/xsl/bebop.xsl" /> - <xsl:import href="../../../packages/ui/xsl/ui.xsl" /> - <xsl:import href="../../../packages/bebop/xsl/bebop.xsl" /> + <xsl:import href="../../heirloom/packages/bebop/xsl/bebop.xsl" /> + <xsl:import href="../../heirloom/packages/ui/xsl/ui.xsl" /> +<!-- <xsl:import href="../../heirloom/packages/bebop/xsl/bebop.xsl" /> --> <xsl:import href="lib/header.xsl" /> <xsl:import href="lib/lib.xsl" /> @@ -28,7 +28,7 @@ --> <!-- IMPORT DEFINITIONS ccm-forum installed into the main CCM webapp --> - <xsl:import href="../../../packages/bebop/xsl/dcp.xsl"/> + <xsl:import href="../../heirloom/packages/bebop/xsl/dcp.xsl"/> Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentAssetInitializer.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -22,13 +22,13 @@ import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.DomainInitEvent; -// import com.arsdigita.runtime.LegacyInitEvent; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.db.DbHelper; import com.arsdigita.persistence.pdl.ManifestSource; import com.arsdigita.persistence.pdl.NameFilter; import com.arsdigita.xml.XML; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; + import org.apache.log4j.Logger; @@ -71,7 +71,8 @@ */ @Override public void init(DomainInitEvent evt) { - System.err.println("ContentAssetInitializer init running..."); + s_log.info("ContentAssetInitializer init running..."); + // System.err.println("ContentAssetInitializer init running..."); super.init(evt); @@ -89,30 +90,6 @@ ); } - // Up to version 6.5 ContentAssetInitilizer used init(LegacyInitEvent) for - // initialization, even though it actually initializes the domain coupling - // machinery which is the domain of init(DomainInitEvent). It even didn't - // use any of the legacy initialization features (enterprise.init file). - // Switched to domain init because legacy init is deprecated and we will get - // rid of it. Retained here commented out for documentation purpose during - // transition of contributed content types. -/* public void init(LegacyInitEvent evt) { - super.init(evt); - - final String traversal = getTraversalXML(); - XML.parseResource - (traversal, - new ContentAssetTraversalHandler(getProperty())); - - AuthoringKitWizard.registerAssetStep( - getBaseType(), - getAuthoringStep(), - getAuthoringStepLabel(), - getAuthoringStepDescription(), - getAuthoringStepSortKey() - ); - } */ - /** * The base type against which the asset is defined, Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContactPersonAssocUpgrade.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -156,7 +156,7 @@ } final ResultSet contactsRs = queryContactsStmt.executeQuery( - "SELECT parent_id " + "SELECT DISTINCT parent_id " + "FROM cms_items " + "JOIN cms_contacts " + "ON cms_items.item_id = cms_contacts.contact_id"); Modified: trunk/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java =================================================================== --- trunk/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-cms-assets-imagestep/src/com/arsdigita/cms/contentassets/ItemImageAttachmentInitializer.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -18,23 +18,14 @@ package com.arsdigita.cms.contentassets; -import com.arsdigita.cms.AuthoringKit; -import com.arsdigita.cms.AuthoringKitStepAssociation; -import com.arsdigita.cms.AuthoringStep; import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.contenttypes.GenericArticle; import com.arsdigita.cms.contenttypes.ContentAssetInitializer; -// import com.arsdigita.cms.contentassets.ItemImageAttachment; import com.arsdigita.cms.contentassets.ui.ImageStep; import com.arsdigita.domain.DomainObject; import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectInstantiator; import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.PersistenceException; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.metadata.ObjectType; import com.arsdigita.runtime.DomainInitEvent; /** Modified: trunk/ccm-core/src/log4j.properties =================================================================== --- trunk/ccm-core/src/log4j.properties 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-core/src/log4j.properties 2012-03-11 00:03:02 UTC (rev 2281) @@ -44,6 +44,7 @@ # log4j.logger.com.arsdigita.core.Initializer=INFO # log4j.logger.com.arsdigita.cms.Loader=INFO # log4j.logger.com.arsdigita.cms.Initializer=INFO + log4j.logger.com.arsdigita.forum.Loader=INFO # For seeing progress of legacy initialization process #log4j.logger.com.arsdigita.initializer.Script=INFO Modified: trunk/ccm-forum/application.xml =================================================================== --- trunk/ccm-forum/application.xml 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/application.xml 2012-03-11 00:03:02 UTC (rev 2281) @@ -2,7 +2,7 @@ <ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project" name="ccm-forum" prettyName="Forum" - version="6.6.1" + version="6.6.2" release="1" webapp="ROOT"> Added: trunk/ccm-forum/sql/ccm-forum/upgrade/default/6.6.1-6.6.2/remove_legacy_entries.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/default/6.6.1-6.6.2/remove_legacy_entries.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/default/6.6.1-6.6.2/remove_legacy_entries.sql 2012-03-11 00:03:02 UTC (rev 2281) @@ -0,0 +1,131 @@ +-- +-- 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 +-- +-- $Id: remove_legacy_entries.sql $ + +-- ccm-forum is now initialized as a legacy free type of +-- application so entries in tables apm_package_types are no longer needed. + + +-- in case there may be several application instances! + +-- delete from object_context all entries referring to node_id in site_nodes +delete from object_context + where object_id in + (select node_id from site_nodes object_id where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%forum.Forum%') + ) + ); + +-- delete from acs_objects all entries referring to node_id in site_nodes +alter table site_nodes drop constraint site_nodes_node_id_f_n1m2y ; +delete from acs_objects + where object_id in + (select node_id from site_nodes where object_id in + ( select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%forum.Forum%') + ) + ); + +-- delete all entries in site_nodes referring to a Forum instance +delete from site_nodes + where object_id in + (select package_id from applications where application_type_id = + (select application_type_id from application_types + where object_type + like '%forum.Forum%') + ); +alter table site_nodes add constraint site_nodes_node_id_f_n1m2y + FOREIGN KEY (node_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; + + + +-- delete from object_context all entries referring to package_id in apm_packages +delete from object_context + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%forum.Forum%') + ); + +-- delete from acs_objects all entries referring to package_id in apm_packages +alter table apm_packages drop constraint apm_package_package_id_f_46may ; +alter table applications drop constraint application_package_id_f_cdaho ; +delete from acs_objects + where object_id in + (select package_id from apm_packages where package_type_id = + (select package_type_id from application_types + where object_type + like '%forum.Forum%') + ); + +-- delete all entries for Forum instances in apm_packages +-- identified by package_type_id in application_types +delete from apm_packages + where package_type_id = + (select package_type_id from application_types + where object_type + like '%forum.Forum%') ; + +-- there seem to be no intries for a apm_packages_types entry (row) in +-- acs_objects or object_context! + +-- delete all entries for subsite in apm_package_types identified by +-- package_type_id in application_types +alter table application_types drop constraint applica_typ_pac_typ_id_f_v80ma ; +delete from apm_package_types + where package_type_id = + (select package_type_id from application_types + where object_type + like '%forum.Forum%') ; + + +-- set package_id to null for all entries referring to a Forum instance +-- (indicating a new legacy free application) +update applications + set package_id = null + where application_type_id = + (select application_type_id from application_types + where object_type + like '%forum.Forum%') ; + +-- set package_id to null for all entries referring to a Forum instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like '%forum.Forum%' ; + +alter table application_types add constraint applica_typ_pac_typ_id_f_v80ma + FOREIGN KEY (package_type_id) + REFERENCES apm_package_types (package_type_id) + MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table applications add constraint application_package_id_f_cdaho + FOREIGN KEY (package_id) + REFERENCES apm_packages (package_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table apm_packages add constraint apm_package_package_id_f_46may + FOREIGN KEY (package_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.0-6.6.1.sql 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.0-6.6.1.sql 2012-03-11 00:03:02 UTC (rev 2281) @@ -17,7 +17,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -PROMPT APLAWS ccm-forum 6.5.0 -> 6.5.1 Upgrade Script (Oracle) +PROMPT OpenCCM ccm-forum 6.6.0 -> 6.6.1 Upgrade Script (Oracle) @@ default/6.6.0-6.6.1/add_ispublic.sql Added: trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.6.1-6.6.2.sql 2012-03-11 00:03:02 UTC (rev 2281) @@ -0,0 +1,24 @@ +-- +-- Copyright (C) chr...@we... All Rights Reserved. +-- Copyright (C) pb...@ze... 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 +-- + +-- Update: Forum now loaded as legacy free application +PROMPT OpenCCM ccm-forum 6.6.1 -> 6.6.2 Upgrade Script (Oracle) + + +@@ default/6.6.1-6.6.2/remove_legacy_entries.sql Modified: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.0-6.6.1.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.0-6.6.1.sql 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.0-6.6.1.sql 2012-03-11 00:03:02 UTC (rev 2281) @@ -17,7 +17,7 @@ -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -\echo APLAWS ccm-forum 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) +\echo APLAWS ccm-forum 6.6.0 -> 6.6.1 Upgrade Script (PostgreSQL) begin; Added: trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.1-6.6.2.sql =================================================================== --- trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.1-6.6.2.sql (rev 0) +++ trunk/ccm-forum/sql/ccm-forum/upgrade/postgres-6.6.1-6.6.2.sql 2012-03-11 00:03:02 UTC (rev 2281) @@ -0,0 +1,30 @@ +-- +-- Copyright (C) chr...@we... All Rights Reserved. +-- Copyright (C) pb...@ze... 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 +-- + +-- Update: Forum now loaded as legacy free application +\echo OpenCCM ccm-forum 6.6.1 -> 6.6.2 Upgrade Script (PostgreSQL) + +begin; + +\i default/6.6.1-6.6.2/remove_legacy_entries.sql + +commit; + + + Modified: trunk/ccm-forum/src/ccm-forum.upgrade =================================================================== --- trunk/ccm-forum/src/ccm-forum.upgrade 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/ccm-forum.upgrade 2012-03-11 00:03:02 UTC (rev 2281) @@ -15,4 +15,8 @@ <version from="6.6.0" to="6.6.1"> <script sql="ccm-forum/upgrade/::database::-6.6.0-6.6.1.sql"/> </version> + <version from="6.6.1" to="6.6.2"> + <!-- Forum now initialized as a legacy free application --> + <script sql="ccm-forum/upgrade/::database::-6.6.1-6.6.2.sql"/> + </version> </upgrade> Modified: trunk/ccm-forum/src/com/arsdigita/forum/Forum.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/Forum.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/Forum.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -361,10 +361,10 @@ PrivilegeDescriptor.ADMIN, this, getAdminGroup())); - s_log.debug("Current user : " - + Kernel.getContext().getParty().getPrimaryEmail() - + " class is " - + Kernel.getContext().getParty().getClass()); + // s_log.debug("Current user : " + // + Kernel.getContext().getParty().getPrimaryEmail() + // + " class is " + // + Kernel.getContext().getParty().getClass()); // // chr...@we... Original plan was that Modified: trunk/ccm-forum/src/com/arsdigita/forum/ForumPageBuilder.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ForumPageBuilder.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/ForumPageBuilder.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -57,6 +57,7 @@ //Output the title in an easy to find place page.add(new SimpleComponent(){ + @Override public void generateXML(PageState state, Element parent) { Element nameElement = parent.newChildElement( Constants.FORUM_XML_PREFIX + Modified: trunk/ccm-forum/src/com/arsdigita/forum/ForumPageFactory.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ForumPageFactory.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/ForumPageFactory.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -37,16 +37,23 @@ public class ForumPageFactory { private static final Logger logger = Logger.getLogger(ForumPageFactory.class); + public static final String THREAD_PAGE = "thread"; public static final String FORUM_PAGE = "forum"; + private static Map pageBuilders = new HashMap(); - static { - logger.debug("Static initalizer starting..."); + /** + * Constructor + */ + public ForumPageFactory() { + logger.debug("Constructor starting..."); + // default pageBuilders are those provided with this project pageBuilders.put(THREAD_PAGE, new ThreadPageBuilder()); pageBuilders.put(FORUM_PAGE, new ForumPageBuilder()); - logger.debug("Static initalizer finished."); + + logger.debug("Constructor finished."); } public static Page getPage(String pageType) { Modified: trunk/ccm-forum/src/com/arsdigita/forum/Loader.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/Loader.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/Loader.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -18,13 +18,12 @@ */ package com.arsdigita.forum; +import com.arsdigita.cms.util.Util; import com.arsdigita.forum.portlet.MyForumsPortlet; import com.arsdigita.forum.portlet.RecentPostingsPortlet; import com.arsdigita.kernel.EmailAddress; import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.KernelExcursion; -// unused? -// import com.arsdigita.kernel.Party; import com.arsdigita.kernel.User; import com.arsdigita.kernel.UserCollection; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; @@ -33,6 +32,8 @@ import com.arsdigita.portal.PortletType; import com.arsdigita.portal.apportlet.AppPortletType; import com.arsdigita.runtime.ScriptContext; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.web.ApplicationType; import org.apache.log4j.Logger; @@ -50,9 +51,54 @@ */ public class Loader extends PackageLoader { + // /////////////////////////////////////////////////////////////////// + // Configurable parameters during load step. + // /////////////////////////////////////////////////////////////////// + + /** + * Intentionally we don't create forum instance(s) by default during load + * step. Forum instances are created on demand using the admin ui. + * + * By specifying forum urls during load step you may install one or more + * forum instances, which are installed as root applications (i.e. without + * a parent application). + * + * Example: + * com.arsdigita.forum.forum_names=general-discussions,specific-discussion + * will create 2 forum instances accessible at + * [host]:/ccm/general-discussions + * [host]:/ccm/specific-discussions + * + * Additional forum instances can be created using the sitmap.jsp ui + * choosing either /navigation (i.e. an Navigation instance), /content (i. + * e. a ContentSection instance) or one of the created instances as + * parent applicaation. + */ + private final Parameter m_forumInstances = new StringArrayParameter( + "com.arsdigita.forum.forum_names", + Parameter.OPTIONAL, + new String[] { } + ); + /** Private logger instance for debugging purpose. */ private static final Logger s_log = Logger.getLogger(Loader.class); + + /** + * Standard constructor. + */ + public Loader() { + s_log.debug("forum.Loader (Constructor) invoked"); + + register(m_forumInstances); + + s_log.debug("forum.Loader (Constructor) completed"); + } + + /** + * + * @param ctx + */ public void run(final ScriptContext ctx) { new KernelExcursion() { @@ -60,11 +106,14 @@ setEffectiveParty(Kernel.getSystemParty()); setupPrivileges(); - setupForumAppType(); + setupDigestUser(); + + setupForumAppType( (String[]) get(m_forumInstances) ); //setupInboxAppType(); //TODO: why it is commented out? setupRecentPostingsPortletType(); setupMyForumsPortletType(); - setupDigestUser(); + // moved upwards + // setupDigestUser(); SessionManager.getSession().flushAll(); } @@ -72,16 +121,39 @@ } /** - * Creates Forum as a legacy-compatible application type. + * Creates Forum as a legacy-free application type. + * + * We just create the application type, intentionally not an application + * instance (see above). + * * @return */ - private static ApplicationType setupForumAppType() { - ApplicationType type = ApplicationType - .createApplicationType(Forum.PACKAGE_TYPE, - "Discussion Forum Application", - Forum.BASE_DATA_OBJECT_TYPE); - type.setDescription("An electronic bulletin board system."); - return type; + private static void setupForumAppType(String[] forumNames) { + + /* Create legacy-free application type + * NOTE: The wording in the title parameter of ApplicationType + * determines the name of the subdirectory for the XSL stylesheets. + * It gets "urlized", i.e. trimming leading and trailing blanks and + * replacing blanks between words and illegal characters with an + * hyphen and converted to lower case. + * "Forum" will become "forum". */ + ApplicationType type = new ApplicationType("Forum", + Forum.BASE_DATA_OBJECT_TYPE ); + + type.setDescription("An electronic bulletin board system (disussion forum)."); + type.save(); + + for (int i = 0 ; i < forumNames.length ; i++) { + + final String forumName = forumNames[i]; + Util.validateURLParameter("name", forumName); + s_log.info("Creating forum instance on /" + forumName); + + Forum.create(forumName,forumName,null); + + } + s_log.info("Forum setup completed"); + return ; } /** @@ -90,10 +162,10 @@ * @return */ private static ApplicationType setupInboxAppType() { - ApplicationType type = - ApplicationType.createApplicationType(Forum.PACKAGE_TYPE, - "Inbox", - "com.arsdigita.forum.Inbox"); + ApplicationType type = ApplicationType + .createApplicationType(Forum.PACKAGE_TYPE, + "Inbox", + "com.arsdigita.forum.Inbox"); type.setDescription("Inbox"); return type; } @@ -105,9 +177,9 @@ public static AppPortletType setupRecentPostingsPortletType() { AppPortletType type = AppPortletType.createAppPortletType( - "Recent Forum Postings", - PortletType.WIDE_PROFILE, - RecentPostingsPortlet.BASE_DATA_OBJECT_TYPE); + "Recent Forum Postings", + PortletType.WIDE_PROFILE, + RecentPostingsPortlet.BASE_DATA_OBJECT_TYPE); type.setProviderApplicationType(Forum.BASE_DATA_OBJECT_TYPE); type.setPortalApplication(true); type.setDescription("Displays the most recent postings " @@ -158,18 +230,26 @@ */ public static void setupPrivileges() { - PrivilegeDescriptor.createPrivilege(Forum.FORUM_READ_PRIVILEGE); - PrivilegeDescriptor.createPrivilege(Forum.FORUM_MODERATION_PRIVILEGE); - PrivilegeDescriptor.createPrivilege(Forum.CREATE_THREAD_PRIVILEGE); - PrivilegeDescriptor.createPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE); + PrivilegeDescriptor.createPrivilege( + Forum.FORUM_READ_PRIVILEGE); + PrivilegeDescriptor.createPrivilege( + Forum.FORUM_MODERATION_PRIVILEGE); + PrivilegeDescriptor.createPrivilege( + Forum.CREATE_THREAD_PRIVILEGE); + PrivilegeDescriptor.createPrivilege( + Forum.RESPOND_TO_THREAD_PRIVILEGE); // Establich privilege hierarchie, eg. moderation includes createThread - PrivilegeDescriptor.addChildPrivilege(Forum.FORUM_MODERATION_PRIVILEGE, - Forum.CREATE_THREAD_PRIVILEGE); - PrivilegeDescriptor.addChildPrivilege(Forum.CREATE_THREAD_PRIVILEGE, - Forum.RESPOND_TO_THREAD_PRIVILEGE); - PrivilegeDescriptor.addChildPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE, - PrivilegeDescriptor.READ.getName()); // general read privilege - PrivilegeDescriptor.addChildPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE, - Forum.FORUM_READ_PRIVILEGE); + PrivilegeDescriptor.addChildPrivilege( + Forum.FORUM_MODERATION_PRIVILEGE, + Forum.CREATE_THREAD_PRIVILEGE); + PrivilegeDescriptor.addChildPrivilege( + Forum.CREATE_THREAD_PRIVILEGE, + Forum.RESPOND_TO_THREAD_PRIVILEGE); + PrivilegeDescriptor.addChildPrivilege( + Forum.RESPOND_TO_THREAD_PRIVILEGE, + PrivilegeDescriptor.READ.getName()); // general read privilege + PrivilegeDescriptor.addChildPrivilege( + Forum.RESPOND_TO_THREAD_PRIVILEGE, + Forum.FORUM_READ_PRIVILEGE); } } Modified: trunk/ccm-forum/src/com/arsdigita/forum/ThreadPageBuilder.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ThreadPageBuilder.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/ThreadPageBuilder.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -57,21 +57,22 @@ //Output the title in an easy to find place threadPage.add(new SimpleComponent(){ - public void generateXML(PageState state, Element parent) { - Element nameElement = parent.newChildElement( - Constants.FORUM_XML_PREFIX + ":name", - Constants.FORUM_XML_NS); - nameElement.setText(ForumContext.getContext(state) - .getForum().getTitle()); + @Override + public void generateXML(PageState state, Element parent) { + Element nameElement = parent.newChildElement( + Constants.FORUM_XML_PREFIX + ":name", + Constants.FORUM_XML_NS); + nameElement.setText(ForumContext.getContext(state) + .getForum().getTitle()); - Element introductionElement = parent.newChildElement( - Constants.FORUM_XML_PREFIX + - ":introduction", - Constants.FORUM_XML_NS); - introductionElement.setText(ForumContext.getContext(state). + Element introductionElement = parent.newChildElement( + Constants.FORUM_XML_PREFIX + + ":introduction", + Constants.FORUM_XML_NS); + introductionElement.setText(ForumContext.getContext(state). getForum(). getIntroduction()); - } + } }); // threadPage.add(new DiscussionThreadSimpleView()); Modified: trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumUserCompactView.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumUserCompactView.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/ui/ForumUserCompactView.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -126,6 +126,7 @@ * * @param p */ + @Override public void register(Page p) { super.register(p); @@ -137,6 +138,7 @@ * @param state * @throws ServletException */ + @Override public void respond(PageState state) throws ServletException { super.respond(state); @@ -281,13 +283,18 @@ // admin section if (PermissionService.checkPermission(adminPermission)) { - generateModeXML(state, content, MODE_MODERATION, - Text.gz("forum.ui.modeAlerts")); +// generateModeXML(state, content, MODE_MODERATION, +// Text.gz("forum.ui.modeAlerts")); if (Forum.getConfig().showNewTabs()) { generateModeXML(state, content, MODE_SETUP, Text.gz("forum.ui.modeSetup")); generateModeXML(state, content, MODE_PERMISSIONS, Text.gz("forum.ui.modePermissions")); + } else { + // Generate old moderation panel instead of setup + generateModeXML(state, content, MODE_MODERATION, + Text.gz("forum.ui.modeAlerts")); + } // In case topic creation is bound to admin (and therefore not // created above) we must create xml here. Modified: trunk/ccm-forum/src/com/arsdigita/forum/ui/ThreadsPanel.java =================================================================== --- trunk/ccm-forum/src/com/arsdigita/forum/ui/ThreadsPanel.java 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-forum/src/com/arsdigita/forum/ui/ThreadsPanel.java 2012-03-11 00:03:02 UTC (rev 2281) @@ -56,7 +56,7 @@ * * @author Kevin Scaldeferri (ke...@ar...) * @version $Revision: 1.8 $ $Author: chrisg23 $ $DateTime: 2004/08/17 23:26:27 $ - * @version $Id: + * @version $Id: $ */ public class ThreadsPanel extends SimpleContainer implements Constants { @@ -104,6 +104,7 @@ * * @param p */ + @Override public void register(Page p) { super.register(p); Modified: trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.css =================================================================== --- trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.css 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.css 2012-03-11 00:03:02 UTC (rev 2281) @@ -366,24 +366,24 @@ margin-left: 4px; padding: 5px 0 3px 10px; - background: rgb(225,225,225) url(/css/tabbed-pane/tab-unselected.png) no-repeat; + background: rgb(225,225,225) url(/themes/heirloom/css/tabbed-pane/tab-unselected.png) no-repeat; } div.tabbed-pane table.tab-set td.tab-end { width: 10px; - background: url(/css/tabbed-pane/tab-unselected-end.png) no-repeat; + background: url(/themes/heirloom/css/tabbed-pane/tab-unselected-end.png) no-repeat; } div.tabbed-pane table.tab-set td.current-tab-label { margin-left: 4px; padding: 5px 0 3px 10px; - background: rgb(162,30,30) url(/css/tabbed-pane/tab-selected.png) no-repeat; + background: rgb(162,30,30) url(/themes/heirloom/css/tabbed-pane/tab-selected.png) no-repeat; color: white; } div.tabbed-pane table.tab-set td.current-tab-end { width: 10px; - background: url(/css/tabbed-pane/tab-selected-end.png) no-repeat; + background: url(/themes/heirloom/css/tabbed-pane/tab-selected-end.png) no-repeat; } div.tabbed-pane table.tab-set td.tab-spacer { @@ -393,7 +393,7 @@ div.tabbed-pane table.rule { margin-left: 10px; width: 100%; - background: rgb(162,30,30) url(/css/tabbed-pane/tab-bar.png) repeat-x; + background: rgb(162,30,30) url(/themes/heirloom/css/tabbed-pane/tab-bar.png) repeat-x; height: 10px; } Modified: trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.xsl =================================================================== --- trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.xsl 2012-03-10 23:55:04 UTC (rev 2280) +++ trunk/ccm-ldn-aplaws/web/themes/static/aplaws/forum-index.xsl 2012-03-11 00:03:02 UTC (rev 2281) @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet xmlns:forum="http://www.arsdigita.com/forum/1.0" - xmlns:bebop="http://www.arsdigita.com/bebop/1.0" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:nav="http://ccm.redhat.com/navigation" - xmlns:search="http://rhea.redhat.com/search/1.0" - xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" - xmlns:cms="http://www.arsdigita.com/cms/1.0" - exclude-result-prefixes="xsl bebop nav search portal forum cms" - version="1.0"> +<xsl:stylesheet xmlns:forum="http://www.arsdigita.com/forum/1.0" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:nav="http://ccm.redhat.com/navigation" + xmlns:search="http://rhea.redhat.com/search/1.0" + xmlns:portal="http://www.uk.arsdigita.com/portal/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + exclude-result-prefixes="xsl bebop nav search portal forum cms" + version="1.0"> <!-- IMPORT DEFINITIONS ccm-forum installed as separate web application <xsl:import href="../../../../ROOT/themes/heirloom/packages/bebop/xsl/bebop.xsl" /> @@ -16,9 +16,9 @@ --> <!-- IMPORT DEFINITIONS ccm-forum installed into the main CCM webapp --> - <xsl:import href="../../../packages/bebop/xsl/bebop.xsl" /> - <xsl:import href="../../../packages/ui/xsl/ui.xsl" /> - <xsl:import href="../../../packages/bebop/xsl/bebop.xsl" /> + <xsl:import href="../../heirloom/packages/bebop/xsl/bebop.xsl" /> + <xsl:import href="../../heirloom/packages/ui/xsl/ui.xsl" /> +<!-- <xsl:import href="../../heirloom/packages/bebop/xsl/bebop.xsl" /> --> <xsl:import href="lib/header.xsl" /> <xsl:import href="lib/lib.xsl" /> @@ -28,7 +28,7 @@ --> <!-- IMPORT DEFINITIONS ccm-forum installed into the main CCM webapp --> - <xsl:import href="../../../packages/bebop/xsl/dcp.xsl"/> + <xsl:import href="../../heirloom/packages/bebop/xsl/dcp.xsl"/> |