diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doAnotherThing.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doAnotherThing.sql deleted file mode 100644 index 650ab45c9..000000000 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doAnotherThing.sql +++ /dev/null @@ -1,94 +0,0 @@ --- --- 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 ccm-cms-types-contact to ccm-ldn-types-contact --- adjust various system tables to the new name of content type - --- -------------------------------------------- --- !!! REPLACE BY REQUIRED SQL COMMANDS !!! --- -------------------------------------------- - -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.london.contenttypes.ESDServiceInitializer' - where class_name='com.arsdigita.cms.contenttypes.ESDServiceInitializer' ; - -update init_requirements - set init='com.arsdigita.london.contenttypes.ESDServiceInitializer' - where init='com.arsdigita.cms.contenttypes.ESDServiceInitializer' ; - -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 content_types - set object_type='com.arsdigita.london.contenttypes.ESDService', - label='ESD Service', - description='An ESDService', - classname='com.arsdigita.london.contenttypes.ESDService' - where classname='com.arsdigita.cms.contenttypes.ESDService' ; - -update authoring_steps - set label_key='ESD Service Properties', - label_bundle='com.arsdigita.london.contenttypes.ESDServiceResources', - description_key='Edit the basic ESDService properties', - description_bundle='com.arsdigita.london.contenttypes.ESDServiceResources', - component='com.arsdigita.london.contenttypes.ui.ESDServicePropertiesStep' - where component='com.arsdigita.cms.contenttypes.ui.ESDServicePropertiesStep' ; - -update authoring_steps - set label_key='ESD Service Contact', - label_bundle='com.arsdigita.london.contenttypes.ESDServiceResources', - description_key='Edit/Choose the associated Contact object', - description_bundle='com.arsdigita.london.contenttypes.ESDServiceResources', - component='com.arsdigita.london.contenttypes.ui.ESDServiceChooseContactStep' - where component='com.arsdigita.cms.contenttypes.ui.ESDServiceChooseContactStep' ; - - - -update acs_objects - set (object_type,default_domain_class) = - ('com.arsdigita.london.contenttypes.ESDService' , - 'com.arsdigita.london.contenttypes.ESDService' ) - where default_domain_class like 'com.arsdigita.cms.contenttypes.ESDService' ; - -update lucene_docs - set type='com.arsdigita.london.contenttypes.ESDService' - where type='com.arsdigita.cms.contenttypes.ESDService' ; - -update vcx_generic_operations - set value=replace(value,'cms.contenttypes.ESDService', 'london.contenttypes.ESDService') - where value like '%cms.contenttypes.ESDService%'; - -update vcx_obj_changes - set obj_id=replace(obj_id,'cms.contenttypes.ESDService', 'london.contenttypes.ESDService') - where obj_id like '%cms.contenttypes.ESDService%'; - -update vcx_tags - set tagged_oid=replace(tagged_oid,'cms.contenttypes.ESDService', 'london.contenttypes.ESDService') - where tagged_oid like '%cms.contenttypes.ESDService%'; - diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doSomething.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doSomething.sql deleted file mode 100644 index 7875940af..000000000 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/doSomething.sql +++ /dev/null @@ -1,47 +0,0 @@ --- --- 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: ren_esdservice_table.sql pboy $ - --- rename ct_esdservice table to ct_ldn_esdservice table following --- ccm naming conventions to make maintenance tasks easier - - --- -------------------------------------------- --- !!! REPLACE BY REQUIRED SQL COMMANDS !!! --- -------------------------------------------- - - - --- if we could figure out the old names we could rename constraints too --- alter table ct_esdservice drop constraint ... ; --- alter table ct_esdservice drop constraint ... ; --- alter table ct_esdservice drop constraint ... ; - -alter table ct_esdservice RENAME TO ct_ldn_esdservice ; - --- alter table ct_ldn_esdservice --- add constraint ct_ldn_esdserv_serv_id_p_5dac0 PRIMARY KEY(service_id); --- alter table ct_ldn_esdservice --- add constraint ct_ldn_esdserv_cont_id_f_r4d1z FOREIGN KEY (contact_id) --- references ct_ldn_contacts (contact_id) MATCH SIMPLE --- ON UPDATE NO ACTION ON DELETE NO ACTION; --- alter table ct_ldn_esdservice --- add constraint ct_ldn_esdserv_serv_id_f_tfkqn FOREIGN KEY (service_id) --- references cms_articles (article_id) MATCH SIMPLE --- ON UPDATE NO ACTION ON DELETE NO ACTION; - diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/ren_decisiontree_tables.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/rename_decisiontree_tables.sql similarity index 64% rename from ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/ren_decisiontree_tables.sql rename to ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/rename_decisiontree_tables.sql index bff428656..23fcd0768 100644 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/ren_decisiontree_tables.sql +++ b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/rename_decisiontree_tables.sql @@ -1,5 +1,5 @@ -- --- Copyright (C) 2012 Peter Boy All Rights Reserved. +-- Copyright (C) 2013 Jens Pelzetter 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 @@ -15,7 +15,48 @@ -- 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 $ +-- $Id$ + +-- The content type decisiontree was orginally developed by/for the London Bourough of Camden. +-- Because this content type is not only useful the E-Government purposes, but also for example +-- for advice centres, for example in a university it has been decided to rename the content type +-- to ccm-cms-types-decisiontree and integrate the type into the main developement line. +-- This upgrade script renames the database tables and their constraints according to the +-- general naming conventions of CCM. + +-- Rename tables +ALTER TABLE cam_decision_trees RENAME TO ct_decisiontrees; +ALTER TABLE cam_tree_sections RENAME TO ct_decisiontree_sections; +ALTER TABLE cam_section_options RENAME TO ct_decisiontree_section_options;cam_tre_section_tre_id_f_m_sh9 +ALTER TABLE cam_option_targets RENAME TO ct_decisiontree_option_targets; + +-- Rename constraints. Because it is not possible to rename constraints we drop the old ones +-- and recreate them. +-- Difficult to figure names and order for droping and creating the constraint. Therefore we will +-- not rename the constraints. +-- ALTER TABLE ct_decisiontree_option_targets DROP CONSTRAINT cam_opt_tar_mat_option_f_fmueq RESTRICT; +-- ALTER TABLE ct_decisiontree_option_targets DROP CONSTRAINT cam_opt_tar_tar_sectio_f_fwfz3 RESTRICT; +-- ALTER TABLE ct_decisiontree_option_targets DROP CONSTRAINT cam_opti_targe_targ_id_f_jvtlm RESTRICT; + +-- ALTER TABLE ct_decisiontree_section_options DROP CONSTRAINT cam_sect_optio_opti_id_f_l2tm2 RESTRICT; +-- ALTER TABLE ct_decisiontree_section_options DROP CONSTRAINT cam_sect_opti_secti_id_f_e8da0 RESTRICT; + +-- ALTER TABLE ct_decisiontree_sections DROP CONSTRAINT cam_tre_sec_instructio_f_nce9c RESTRICT; +-- ALTER TABLE ct_decisiontree_sections DROP CONSTRAINT cam_tre_secti_secti_id_f_i2mrf RESTRICT; +-- ALTER TABLE ct_decisiontree_sections DROP CONSTRAINT cam_tre_section_tre_id_f_m_sh9 RESTRICT; + +-- ALTER TABLE ct_decisiontrees DROP CONSTRAINT cam_dec_tre_fir_sectio_f_9jr7j RESTRICT; +-- ALTER TABLE ct_decisiontrees DROP CONSTRAINT cam_decisi_tree_tre_id_f_g0r8e RESTRICT; + + + + + + + + + +-- rename cam_tree_sections to -- rename ct_contact_* tables to ct_ldn_contact_* tables following -- ccm naming conventions to make maintenance tasks easier diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/upd_inits.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/update_inits.sql similarity index 76% rename from ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/upd_inits.sql rename to ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/update_inits.sql index c30cce0dc..5829f2534 100644 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/upd_inits.sql +++ b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/update_inits.sql @@ -18,11 +18,11 @@ -- $Id: upd_inits.sql $ -- Adjust the class name of the Initializer -update inits - set class_name='com.arsdigita.cms.contenttypes.DecisionTreeInitializer' - where class_name='com.arsdigita.camden.cms.contenttypes.DecisionTreeInitializer' ; +UPDATE inits + SET class_name='com.arsdigita.cms.contenttypes.DecisionTreeInitializer' + WHERE class_name='com.arsdigita.camden.cms.contenttypes.DecisionTreeInitializer' ; -- Adjust the class name of the Initializer in init-requirements -update init_requirements - set init='com.arsdigita.cms.contenttypes.DecisionTreeInitializer' - where init='com.arsdigita.camden.cms.contenttypes.DecisionTreeInitializer' ; \ No newline at end of file +UPDATE init_requirements + SET init='com.arsdigita.cms.contenttypes.DecisionTreeInitializer' + WHERE init='com.arsdigita.camden.cms.contenttypes.DecisionTreeInitializer' ; \ No newline at end of file diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/upd_system_tables.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/update_system_tables.sql similarity index 100% rename from ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/upd_system_tables.sql rename to ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/default/1.0.3-6.6.0/update_system_tables.sql diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/oracle-se-1.0.3-6.6.0.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/oracle-se-1.0.3-6.6.0.sql index d9fd79b9b..3e789b63e 100644 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/oracle-se-1.0.3-6.6.0.sql +++ b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/oracle-se-1.0.3-6.6.0.sql @@ -1,5 +1,5 @@ -- --- Copyright (C) 2013 Peter Boy All Rights Reserved. +-- Copyright (C) 2013 Jens Pelzetter 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 @@ -19,5 +19,7 @@ PROMPT Red Hat Enterprise types-decisiontree 1.0.3 -> 6.6.0 Upgrade Script (Oracle) -@@ default/1.0.3-6.6.0/drop_constraints_ct_addresses.sql +@@ default/1.0.3-6.6.0/rename_decision_tree_tables.sql +@@ default/1.0.3-6.6.0/update_inits.sql +@@ default/1.0.3-6.6.0/update_system_tables.sql diff --git a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/postgres-1.0.3-6.6.0.sql b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/postgres-1.0.3-6.6.0.sql index 4f0aaf6aa..80a5f5dab 100644 --- a/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/postgres-1.0.3-6.6.0.sql +++ b/ccm-cms-types-decisiontree/sql/ccm-cms-types-decisiontree/upgrade/postgres-1.0.3-6.6.0.sql @@ -1,5 +1,5 @@ -- --- Copyright (C) 2011 Peter Boy All Rights Reserved. +-- Copyright (C) 2013 Jens Pelzetter 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 @@ -21,7 +21,8 @@ begin; -\i default/1.0.3-6.6.0/drop_constraints_ct_adresses.sql - +\i default/1.0.3-6.6.0/rename_decision_tree_tables.sql +\i default/1.0.3-6.6.0/update_inits.sql +\i default/1.0.3-6.6.0/update_system_tables.sql commit; diff --git a/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml b/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml index 10e75b181..b08c35cc9 100644 --- a/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml +++ b/ccm-cms-types-decisiontree/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/DecisionTree.xml @@ -1,44 +1,45 @@ + xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> + description="A content type for Camden Decision Trees." + objectType="com.arsdigita.cms.contenttypes.DecisionTree" + classname="com.arsdigita.cms.contenttypes.DecisionTree"> - + - + - + - + - - + + + - - + + diff --git a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeInitializer.java b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeInitializer.java index b6b5aded3..c6317c050 100644 --- a/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeInitializer.java +++ b/ccm-cms-types-decisiontree/src/com/arsdigita/cms/contenttypes/DecisionTreeInitializer.java @@ -29,19 +29,18 @@ import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.search.MetadataProviderRegistry; /** - * Executes at each system startup and initializes the Decision Tree - * 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). + * Executes at each system startup and initializes the Decision Tree 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). * * @author Carsten Clasohm * @version $Id$ */ public class DecisionTreeInitializer extends ContentTypeInitializer { - + /** * Constructor, sets the PDL manifest file and object type string. */ @@ -51,23 +50,25 @@ public class DecisionTreeInitializer extends ContentTypeInitializer { @Override public void init(DomainInitEvent evt) { - super.init(evt); - - DomainObjectFactory f = evt.getFactory(); - - f.registerInstantiator(DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE - , new DomainObjectInstantiator() { - protected DomainObject doNewInstance(DataObject dataObject) { - return new DecisionTreeSectionOption(dataObject); - } - }); - - f.registerInstantiator(DecisionTreeOptionTarget.BASE_DATA_OBJECT_TYPE - , new DomainObjectInstantiator() { - protected DomainObject doNewInstance(DataObject dataObject) { - return new DecisionTreeOptionTarget(dataObject); - } - }); + super.init(evt); + + DomainObjectFactory f = evt.getFactory(); + + f.registerInstantiator(DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE, + new DomainObjectInstantiator() { + protected DomainObject doNewInstance(DataObject dataObject) { + return new DecisionTreeSectionOption(dataObject); + } + + }); + + f.registerInstantiator(DecisionTreeOptionTarget.BASE_DATA_OBJECT_TYPE, + new DomainObjectInstantiator() { + protected DomainObject doNewInstance(DataObject dataObject) { + return new DecisionTreeOptionTarget(dataObject); + } + + }); } @Override @@ -75,14 +76,14 @@ public class DecisionTreeInitializer extends ContentTypeInitializer { super.init(evt); MetadataProviderRegistry.registerAdapter( - DecisionTree.BASE_DATA_OBJECT_TYPE, + DecisionTree.BASE_DATA_OBJECT_TYPE, new ContentPageMetadataProvider()); } - /** * Retrieves fully qualified traversal adapter file name. - * @return + * + * @return */ @Override public String getTraversalXML() { @@ -90,20 +91,20 @@ public class DecisionTreeInitializer extends ContentTypeInitializer { } /** - * Retrieve location of this content type's internal default theme - * stylesheet(s) which concomitantly serve as a fallback if a custom theme - * is engaged. - * - * Custom themes usually will provide their own stylesheet(s) and their own - * access method, but may not support every content type. - * - * Overwrites parent method with AgendaItem specific value for use by the - * parent class worker methods. - * + * Retrieve location of this content type's internal default theme stylesheet(s) which + * concomitantly serve as a fallback if a custom theme is engaged. + * + * Custom themes usually will provide their own stylesheet(s) and their own access method, but + * may not support every content type. + * + * Overwrites parent method with AgendaItem specific value for use by the parent class worker + * methods. + * * @return String array of XSL stylesheet files of the internal default theme */ @Override public String[] getStylesheets() { - return new String[] { INTERNAL_THEME_TYPES_DIR + "DecisionTree.xsl" }; + return new String[]{INTERNAL_THEME_TYPES_DIR + "DecisionTree.xsl"}; } + }