From bc166abc1f406b4fc5a70e78098732e7852e1b9f Mon Sep 17 00:00:00 2001 From: pb Date: Sun, 16 Jan 2011 09:24:58 +0000 Subject: [PATCH] =?UTF-8?q?Update=20script=20vervollst=C3=A4ndigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@682 8810af33-2d31-482b-a856-94f89814c4df --- .../6.6.0-6.6.1/upd_table_cms_articles.sql | 21 ++++++ .../ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql | 1 + .../ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql | 1 + .../src/com/arsdigita/cms/ContentSection.java | 10 +-- ccm-cms/src/com/arsdigita/cms/Loader.java | 22 +++--- .../src/com/arsdigita/cms/LoaderConfig.java | 71 +------------------ .../contentsection/ContentSectionConfig.java | 18 ++--- 7 files changed, 49 insertions(+), 95 deletions(-) create mode 100644 ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql new file mode 100644 index 000000000..adfb00589 --- /dev/null +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql @@ -0,0 +1,21 @@ +-- +-- 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_table_cms_articles.sql pboy $ + +alter table cms_articles add column text_id integer ; +update cms_articles set text_id = (select text_id from cms_text_pages + where cms_text_pages.item_id = cms_articles.article_id); +drop table cms_text_pages; \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql index 75fa3e6ee..05bea7711 100644 --- a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql +++ b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -28,3 +28,4 @@ PROMPT Red Hat Enterprise CMS 6.6.0 -> 6.6.1 Upgrade Script (Oracle) @@ ../default/upgrade/6.6.0-6.6.1/upd_table_cms_rel_links.sql @@ ../default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ ../default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql +@@ ../default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql diff --git a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql index 28126aea6..7555b2d2e 100644 --- a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql +++ b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.6.0-6.6.1.sql @@ -30,5 +30,6 @@ begin; \i ../default/upgrade/6.6.0-6.6.1/upd_table_cms_rel_links.sql \i ../default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql \i ../default/upgrade/6.6.0-6.6.1/drop_table_cms_article_image_map.sql +\i ../default/upgrade/6.6.0-6.6.1/upd_table_cms_articles.sql commit; diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSection.java b/ccm-cms/src/com/arsdigita/cms/ContentSection.java index 797273071..ccde1a60c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSection.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSection.java @@ -98,7 +98,7 @@ public class ContentSection extends Application { public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.ContentSection"; public static final String PACKAGE_TYPE = "content-section"; - public final static String STYLESHEET = "/packages/content-section/xsl/cms.xsl"; +// public final static String STYLESHEET = "/packages/content-section/xsl/cms.xsl"; protected static final String ID = "id"; protected static final String PACKAGE = "package"; protected static final String NAME = "label"; @@ -1305,8 +1305,8 @@ public class ContentSection extends Application { return URL.SERVLET_DIR + "/content-section"; } - @Override - public String getStylesheetPath() { - return STYLESHEET; - } +// @Override +// public String getStylesheetPath() { +// return STYLESHEET; +// } } diff --git a/ccm-cms/src/com/arsdigita/cms/Loader.java b/ccm-cms/src/com/arsdigita/cms/Loader.java index 2c360d19b..a3a845458 100755 --- a/ccm-cms/src/com/arsdigita/cms/Loader.java +++ b/ccm-cms/src/com/arsdigita/cms/Loader.java @@ -40,7 +40,7 @@ import com.arsdigita.kernel.KernelExcursion; import com.arsdigita.kernel.PackageInstance; import com.arsdigita.kernel.PackageType; import com.arsdigita.kernel.SiteNode; -import com.arsdigita.kernel.Stylesheet; +// import com.arsdigita.kernel.Stylesheet; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.loader.PackageLoader; import com.arsdigita.persistence.DataObject; @@ -132,8 +132,8 @@ public class Loader extends PackageLoader { * Stylesheet which has to be assigned as part of a legacy application * creation. */ - private final static String CMS_STYLESHEET = - "/packages/content-section/xsl/cms.xsl"; +// private final static String CMS_STYLESHEET = +// "/packages/content-section/xsl/cms.xsl"; // /** // * Constant string used as key for creating Workspace (content-center) as a // * legacy application. @@ -300,10 +300,16 @@ public class Loader extends PackageLoader { type.setDispatcherClass(WORKSPACE_DISPATCHER_CLASS); // Register a stylesheet to the Content Center package. - Stylesheet ss = - Stylesheet.createStylesheet(WORKSPACE_STYLESHEET); - ss.save(); - type.addStylesheet(ss); + // Registering a Stylesheet referrs to the old LegacyStylesheetResolver + // which uses a database entry to determine an appropriate stylesheet. + // New way is a pattern based search algorithm. Preserved here for easy + // reference during transition (removal of corresponding classes) + // see com.arsdigita.templating + // content center works without registering a style sheet here. + // Stylesheet ss = + // Stylesheet.createStylesheet(WORKSPACE_STYLESHEET); + // ss.save(); + // type.addStylesheet(ss); type.save(); @@ -356,7 +362,6 @@ public class Loader extends PackageLoader { appsetup.setKey(Workspace.PACKAGE_KEY); appsetup.setDispatcherClass(Workspace.DISPATCHER_CLASS); // should not be needed anymore, stypesheets handled by StylesheetResolver - appsetup.setStylesheet(Workspace.STYLESHEET); appsetup.setSingleton(true); appsetup.setPortalApplication(false); appsetup.setInstantiator(new ACSObjectInstantiator() { @@ -491,7 +496,6 @@ public class Loader extends PackageLoader { appType.setDescription("A CMS Content Section"); appType.setPortalApplication(false); //setup.setDispatcherClass(ContentItemDispatcher.class.getName()); - appType.setStylesheet(CMS_STYLESHEET); // by default: /pack./c-s/xml/cms.xml // contains the xsl to generate the page appType.setInstantiator(new ACSObjectInstantiator() { diff --git a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java index b92d24ca0..597cadab3 100644 --- a/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/LoaderConfig.java @@ -19,17 +19,12 @@ package com.arsdigita.cms; -//import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.BooleanParameter; -// import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -// import com.arsdigita.util.parameter.ResourceParameter; -// import com.arsdigita.util.parameter.URLParameter; -// import java.io.InputStream; import java.util.Arrays; import java.util.List; import java.util.ArrayList; @@ -113,7 +108,8 @@ public final class LoaderConfig extends AbstractConfig { * List of Paths to XML files that contain content type definition(s). * Example: * contentTypeDefinitions = { "/WEB-INF/content-types/Template.xml" }; - * List currently contains only one path/filename. + * An entry in this list is required by internal content types (see package + * ccm-cms/src/com/arsdigita/cms/contenttypes) */ private final Parameter m_ctDefFiles = new StringArrayParameter( @@ -561,67 +557,4 @@ public final class LoaderConfig extends AbstractConfig { return Arrays.asList(contentTypes); } - -// public final String[] getTaskAlerts() { -// return (String[]) get(m_taskAlerts); -// } - - // Parameters controlling Overdue Task alerts: - // Currently not a loader task, see above - - -// /** -// * getSendOverdueAlerts: Retrieve wether we should send alerts about -// * overdue tasks at all? -// */ -// public final boolean getSendOverdueAlerts() { -// return ((Boolean) get(m_sendOverdueAlerts)).booleanValue(); } - -// /** -// * getTaskDuration: Retrieve the time between when a task is enabled -// * (it is made available for completion) and when it is considered -// * overdue (in HOURS) -// */ -// public final Integer getTaskDuration() { -// return ((Integer) get(m_taskDuration)); } - -// /** -// * getAlertInterval: Retrieve the time to wait between sending successive -// * alerts on the same overdue task (in HOURS) -// */ -// public final Integer getOverdueAlertInterval() { -// return ((Integer) get(m_overdueAlertInterval)); } - -// /** -// * maxAlerts: Retrieve the maximum number of alerts to send about any one -// * overdue task -// */ -// public final Integer getMaxAlerts() { -// return ((Integer) get(m_maxAlerts)); } - - // End section task alerts - -// InputStream getTraversalAdapters() { -// return (InputStream) get(m_adapters); -// } - -// public String getDefaultLayout() { -// return (String) get(m_defaultLayout); -// } - -// public boolean getCreateUserWorkspaces() { -// return ((Boolean) get(m_createUserWorkspaces)).booleanValue(); -// } - -// public List getExcludedPortletTypes() { -// String[] excludedTypes = (String[]) get(m_excludedPortletTypes); -// return Arrays.asList(excludedTypes); -// } - -// public List getAdminPortletTypes() { -// String[] adminTypes = (String[]) get(m_adminPortletTypes); -// return Arrays.asList(adminTypes); -// } - - } diff --git a/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionConfig.java b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionConfig.java index de72f273b..aa01f9bb0 100644 --- a/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionConfig.java @@ -19,20 +19,14 @@ package com.arsdigita.cms.contentsection; -//import com.arsdigita.kernel.permissions.PrivilegeDescriptor; import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.util.parameter.BooleanParameter; -//import com.arsdigita.util.parameter.ErrorList; import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; //import com.arsdigita.util.parameter.ParameterError; import com.arsdigita.util.parameter.StringArrayParameter; import com.arsdigita.util.parameter.StringParameter; -// import com.arsdigita.util.parameter.ResourceParameter; -// import com.arsdigita.util.parameter.URLParameter; -//import com.arsdigita.util.StringUtils; -// import java.io.InputStream; import java.util.Arrays; import java.util.List; import java.util.ArrayList; @@ -64,10 +58,6 @@ public final class ContentSectionConfig extends AbstractConfig { public static final synchronized ContentSectionConfig getInstance() { if (s_config == null) { s_config = new ContentSectionConfig(); - // deprecated - // s_config.require("ccm-core/runtime.properties"); - // use instead: - // read values from the persistent storage s_config.load(); } @@ -112,8 +102,12 @@ public final class ContentSectionConfig extends AbstractConfig { * In the new Initializer system we use a specifically formatted String Array * because we have no List parameter. Format: * - A string for each task to handle, possible values: Authoring, Approval, - * Depploy - * - Each String: [taskName]:[alert_1]:...:[alert_n] + * Deploy + * - Each Task String: [taskName]:[alert_1]:...:[alert_n] + * The specially formatted string is not handled by StringArray parameter, + * but forwarded untouched to the initializer which has the duty to process + * it! + * * Currently there is no way to persist taskAlerts section specific. So all * sections have to treated equally. * Default values are provided here.