diff --git a/ccm-subsite/application.xml b/ccm-subsite/application.xml index be172277f..d8c6a449a 100755 --- a/ccm-subsite/application.xml +++ b/ccm-subsite/application.xml @@ -2,14 +2,14 @@ - + diff --git a/ccm-subsite/doc/subsite-standalone/README b/ccm-subsite/doc/subsite-standalone/README index 437eee35a..2150850b2 100644 --- a/ccm-subsite/doc/subsite-standalone/README +++ b/ccm-subsite/doc/subsite-standalone/README @@ -4,11 +4,13 @@ application context: [webapps]/ccm-ldn-subsite. Now it is installed inside the main APLAWS application context along with all other applications. +Also, ccm-ldn-subsite is renamed to ccm-subsite. + If shortcuts should be installed as its own web context again following 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/subsite/Subsite.java +3. change src/com/ad/subsite/Subsite.java method getServletContext() as back to "/files" 4. edit __ccm__/.../xsl/index.xsl according the comment 5. edit in ccm-ldn-aplaws /web/__ccm__/themes/aplaws/subsite.xml diff --git a/ccm-subsite/pdl/com/arsdigita/subsite/Site.pdl b/ccm-subsite/pdl/com/arsdigita/subsite/Site.pdl index c1181454d..312ce94ac 100755 --- a/ccm-subsite/pdl/com/arsdigita/subsite/Site.pdl +++ b/ccm-subsite/pdl/com/arsdigita/subsite/Site.pdl @@ -24,16 +24,16 @@ import com.arsdigita.cms.TemplateContext; object type Site extends ACSObject { - String[1..1] title = subsite_site.title VARCHAR(100); - String[0..1] description = subsite_site.description VARCHAR(4000); - unique String[1..1] hostname = subsite_site.hostname VARCHAR(250); - String[0..1] styleDirectory = subsite_site.style_dir VARCHAR(50); + String[1..1] title = subsite_sites.title VARCHAR(100); + String[0..1] description = subsite_sites.description VARCHAR(4000); + unique String[1..1] hostname = subsite_sites.hostname VARCHAR(250); + String[0..1] styleDirectory = subsite_sites.style_dir VARCHAR(50); - Application[1..1] frontPage = join subsite_site.front_page_id + Application[1..1] frontPage = join subsite_sites.front_page_id to applications.application_id; - component TemplateContext[1..1] templateContext = join subsite_site.template_context + component TemplateContext[1..1] templateContext = join subsite_sites.template_context to cms_template_use_contexts.use_context; - reference key (subsite_site.site_id); + reference key (subsite_sites.site_id); } diff --git a/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl b/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl index fa4b5a59f..f99e081ff 100755 --- a/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl +++ b/ccm-subsite/pdl/com/arsdigita/subsite/Subsite.pdl @@ -14,11 +14,14 @@ // 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: Subsite.pdl pboy $ model com.arsdigita.subsite; import com.arsdigita.web.Application; object type Subsite extends Application { - reference key (subsite_app.application_id); + // nothing to persist + // reference key (subsite_app.application_id); } diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/drop_app_table.sql b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/drop_app_table.sql new file mode 100644 index 000000000..c39c8bf62 --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/drop_app_table.sql @@ -0,0 +1,23 @@ +-- +-- 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: drop_app_table.sql pboy $ + +-- drops table subsite_app which just contained application type id and is +-- never used for any action. + +drop table subsite_app ; diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql new file mode 100644 index 000000000..bfe418b63 --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql @@ -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 $ + +-- Subsite 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 '%subsite.Subsite%') + ) + ); + +-- 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 '%subsite.Subsite%') + ) + ); + +-- delete all entries in site_nodes referring to a subsite 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 '%subsite.Subsite%') + ); +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.subsite.Subsite') + ); + +-- 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.subsite.Subsite') + ); + +-- delete all entries for subsite 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.subsite.Subsite') ; + +-- 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 'com.arsdigita.subsite.Subsite') ; + + +-- set package_id to null for all entries referring to a subsite 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.subsite.Subsite') ; + +-- set package_id to null for all entries referring to a subsite instance +-- (indicating a new legacy free application) +update application_types + set package_type_id = null + where object_type like 'com.arsdigita.subsite.Subsite' ; + +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 ; diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/ren_sites_table.sql b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/ren_sites_table.sql new file mode 100644 index 000000000..15d6d4f2c --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/ren_sites_table.sql @@ -0,0 +1,49 @@ +-- +-- 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_sites_table.sql pboy $ + +-- rename table subsite_site to subsite_sites following ccm naming conventions +-- to make maintenance tasks easier + + +alter table subsite_site drop constraint subsite_site_site_id_p_rz022 ; +alter table subsite_site drop constraint subs_sit_templ_context_f_6wdu3 ; +alter table subsite_site drop constraint subsit_sit_fron_pag_id_f_4agqx ; +alter table subsite_site drop constraint subsite_site_site_id_f_rntkc ; +alter table subsite_site drop constraint subsite_site_hostname_u_uy5xf ; + +alter table subsite_site RENAME TO subsite_sites ; + +alter table subsite_sites + add constraint subsite_sites_site_id_p_wl5ul PRIMARY KEY (site_id) ; +alter table subsite_sites + add constraint subs_sit_templ_context_f_mpg0d FOREIGN KEY (template_context) + REFERENCES cms_template_use_contexts (use_context) + MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table subsite_sites + add constraint subsi_site_fron_pag_id_f_p5cc6 FOREIGN KEY (front_page_id) + REFERENCES applications (application_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table subsite_sites + add constraint subsite_sites_site_id_f_nrcet FOREIGN KEY (site_id) + REFERENCES acs_objects (object_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ; +alter table subsite_sites + add constraint subsite_sites_hostname_u_hrgra UNIQUE (hostname) ; + diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql new file mode 100644 index 000000000..37da270bb --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/default/6.6.0-6.6.1/upd_system_tables.sql @@ -0,0 +1,66 @@ +-- +-- 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: upd_system_tables.sql pboy $ + +-- adjust various system tables to the new name of application subsite + +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=replace(class_name,'london.subsite', 'subsite') + where class_name like '%london.subsite%' ; + +update init_requirements + set init=replace(init,'london.subsite', 'subsite') + where init like '%london.subsite%' ; + +update init_requirements + set required_init=replace(required_init,'london.subsite', 'subsie') + where required_init like '%london.subsite%' ; + +ALTER TABLE ONLY 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.subsite', 'subsite') + where object_type like '%london.subsite%' ; + +-- table applications doesn't require an update + +-- 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,default_domain_class) = + (replace(object_type,'london.subsite', 'subsite') , + replace(default_domain_class,'london.subsite', 'subsite') ) + where object_type like '%london.subsite%' ; diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-6.6.0-6.6.1.sql new file mode 100644 index 000000000..4e916a1b4 --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -0,0 +1,22 @@ +-- +-- 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 +-- +-- $DateTime: 2011/03/27 23:15:09 $ +-- $Id: oracle-se-6.6.0-6.6.1 pboy $ + +@@ default/6.6.0-6.6.1/upd_theme_app_table.sql +@@ default/6.6.0-6.6.1/upd_system_tables.sql diff --git a/ccm-subsite/sql/ccm-subsite/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-subsite/sql/ccm-subsite/upgrade/postgres-6.6.0-6.6.1.sql new file mode 100644 index 000000000..715c6ad58 --- /dev/null +++ b/ccm-subsite/sql/ccm-subsite/upgrade/postgres-6.6.0-6.6.1.sql @@ -0,0 +1,36 @@ +-- +-- 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 +-- +-- $DateTime: 2010/11/10 23:15:09 $ + +\echo Red Hat Enterprise ccm-subsite 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 + +-- rename table containing defined subsites following ccm naming conventions +\i default/6.6.0-6.6.1/ren_sites_table.sql + +-- rename application from london.subsite to subsite +\i default/6.6.0-6.6.1/upd_system_tables.sql + +-- remove legacy compatible bits +\i default/6.6.0-6.6.1/remove_legacy_entries.sql + +commit; diff --git a/ccm-subsite/src/ccm-subsite.upgrade b/ccm-subsite/src/ccm-subsite.upgrade new file mode 100755 index 000000000..accaec9a7 --- /dev/null +++ b/ccm-subsite/src/ccm-subsite.upgrade @@ -0,0 +1,5 @@ + + +