Completed upgrade scripts for ccm-cms-types-decision from version 1.0.3 to 6.6.0

git-svn-id: https://svn.libreccm.org/ccm/trunk@2396 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-10-29 14:00:40 +00:00
parent 32dfe9106d
commit 442c3fdf4a
9 changed files with 130 additions and 225 deletions

View File

@ -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%';

View File

@ -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;

View File

@ -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

View File

@ -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' ;
UPDATE init_requirements
SET init='com.arsdigita.cms.contenttypes.DecisionTreeInitializer'
WHERE init='com.arsdigita.camden.cms.contenttypes.DecisionTreeInitializer' ;

View File

@ -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

View File

@ -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;

View File

@ -1,44 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
<ctd:content-type label="DecisionTree"
description="A content type for Camden Decision Trees."
objectType="com.arsdigita.cms.contenttypes.DecisionTree"
classname="com.arsdigita.cms.contenttypes.DecisionTree">
description="A content type for Camden Decision Trees."
objectType="com.arsdigita.cms.contenttypes.DecisionTree"
classname="com.arsdigita.cms.contenttypes.DecisionTree">
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
<ctd:authoring-step
labelKey="cms.contenttypes.shared.basic_properties.title"
labelBundle="com.arsdigita.cms.CMSResources"
descriptionKey="cms.contenttypes.shared.basic_properties.description"
descriptionBundle="com.arsdigita.cms.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreePropertiesStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.shared.basic_properties.title"
labelBundle="com.arsdigita.cms.CMSResources"
descriptionKey="cms.contenttypes.shared.basic_properties.description"
descriptionBundle="com.arsdigita.cms.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreePropertiesStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.tree_sections.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.tree_sections.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeSectionStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.tree_sections.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.tree_sections.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeSectionStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.section_options.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.section_options.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeOptionStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.section_options.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.section_options.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeOptionStep"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.option_targets.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.option_targets.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeTargetStep" />
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
<ctd:authoring-step
labelKey="cms.contenttypes.ui.authoring.decisiontree.option_targets.title"
labelBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
descriptionKey="cms.contenttypes.ui.authoring.decisiontree.option_targets.description"
descriptionBundle="com.arsdigita.cms.contenttypes.DecisionTreeResources"
component="com.arsdigita.cms.contenttypes.ui.DecisionTreeTargetStep" />
</ctd:authoring-kit>
</ctd:content-type>
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
</ctd:authoring-kit>
</ctd:content-type>
</ctd:content-types>

View File

@ -29,13 +29,12 @@ import com.arsdigita.runtime.DomainInitEvent;
import com.arsdigita.search.MetadataProviderRegistry;
/**
* Executes at each system startup and initializes the Decision Tree
* content type.
* 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).
* 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$
@ -51,23 +50,25 @@ public class DecisionTreeInitializer extends ContentTypeInitializer {
@Override
public void init(DomainInitEvent evt) {
super.init(evt);
super.init(evt);
DomainObjectFactory f = evt.getFactory();
DomainObjectFactory f = evt.getFactory();
f.registerInstantiator(DecisionTreeSectionOption.BASE_DATA_OBJECT_TYPE
, new DomainObjectInstantiator() {
protected DomainObject doNewInstance(DataObject dataObject) {
return new DecisionTreeSectionOption(dataObject);
}
});
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);
}
});
});
f.registerInstantiator(DecisionTreeOptionTarget.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() {
protected DomainObject doNewInstance(DataObject dataObject) {
return new DecisionTreeOptionTarget(dataObject);
}
});
}
@Override
@ -75,13 +76,13 @@ 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
*/
@Override
@ -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.
* 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.
* 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.
* 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"};
}
}