From 78057f06a3f787c5bcc8904edafa84045844f2f3 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 27 Mar 2012 00:46:55 +0000 Subject: [PATCH] SimpleSurvey umgestellt auf legacy free application. Ebenfalls theme umgestellt. git-svn-id: https://svn.libreccm.org/ccm/trunk@1554 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/simplesurvey/SimpleSurvey.pdl | 3 +- .../default/6.6.0-6.6.1/drop_app_table.sql | 23 +++ .../remove_simplesurvey_legacy_entries.sql | 131 ++++++++++++++++++ ....0-5.2.1.sql => oracle-se-5.2.0-5.2.1.sql} | 0 .../upgrade/oracle-se-6.6.0-6.6.1.sql | 27 ++++ .../upgrade/postgres-6.6.0-6.6.1.sql | 30 ++++ ccm-simplesurvey/src/ccm-simplesurvey.upgrade | 5 + .../arsdigita/simplesurvey/Initializer.java | 32 ++++- .../com/arsdigita/simplesurvey/Loader.java | 40 +++--- .../apps/simple-survey}/xsl/index.xsl | 4 +- .../simple-survey}/css/simplesurvey.css | 0 .../simple-survey}/xsl/simplesurvey.xsl | 8 +- .../xsl/survey-response-data.xsl | 0 .../packages/simple-survey}/xsl/view.xsl | 0 14 files changed, 273 insertions(+), 30 deletions(-) create mode 100644 ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql create mode 100644 ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql rename ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/{oracle-se-upgrade-5.2.0-5.2.1.sql => oracle-se-5.2.0-5.2.1.sql} (100%) create mode 100644 ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql create mode 100644 ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql create mode 100755 ccm-simplesurvey/src/ccm-simplesurvey.upgrade rename ccm-simplesurvey/web/{__ccm__/apps/simplesurvey => themes/heirloom/apps/simple-survey}/xsl/index.xsl (51%) rename ccm-simplesurvey/web/{packages/simplesurvey => themes/heirloom/packages/simple-survey}/css/simplesurvey.css (100%) rename ccm-simplesurvey/web/{packages/simplesurvey => themes/heirloom/packages/simple-survey}/xsl/simplesurvey.xsl (75%) rename ccm-simplesurvey/web/{packages/simplesurvey => themes/heirloom/packages/simple-survey}/xsl/survey-response-data.xsl (100%) rename ccm-simplesurvey/web/{packages/simplesurvey => themes/heirloom/packages/simple-survey}/xsl/view.xsl (100%) diff --git a/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl b/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl index 2a01ec325..f6012f896 100755 --- a/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl +++ b/ccm-simplesurvey/pdl/com/arsdigita/simplesurvey/SimpleSurvey.pdl @@ -22,5 +22,6 @@ model com.arsdigita.simplesurvey; 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); } diff --git a/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql new file mode 100644 index 000000000..93d2bde62 --- /dev/null +++ b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/drop_app_table.sql @@ -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 ; diff --git a/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql new file mode 100644 index 000000000..2a0f9e5b2 --- /dev/null +++ b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/default/6.6.0-6.6.1/remove_simplesurvey_legacy_entries.sql @@ -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 ; diff --git a/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql similarity index 100% rename from ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-upgrade-5.2.0-5.2.1.sql rename to ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-5.2.0-5.2.1.sql diff --git a/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql new file mode 100644 index 000000000..c37a11f66 --- /dev/null +++ b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/oracle-se-6.6.0-6.6.1.sql @@ -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 diff --git a/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql new file mode 100644 index 000000000..647593ab9 --- /dev/null +++ b/ccm-simplesurvey/sql/ccm-simplesurvey/upgrade/postgres-6.6.0-6.6.1.sql @@ -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; diff --git a/ccm-simplesurvey/src/ccm-simplesurvey.upgrade b/ccm-simplesurvey/src/ccm-simplesurvey.upgrade new file mode 100755 index 000000000..cdacdbd3d --- /dev/null +++ b/ccm-simplesurvey/src/ccm-simplesurvey.upgrade @@ -0,0 +1,5 @@ + + +