SimpleSurvey umgestellt auf legacy free application. Ebenfalls theme umgestellt.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1554 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f371065415
commit
78057f06a3
|
|
@ -22,5 +22,6 @@ model com.arsdigita.simplesurvey;
|
||||||
import com.arsdigita.web.Application;
|
import com.arsdigita.web.Application;
|
||||||
|
|
||||||
object type SimpleSurvey extends Application {
|
object type SimpleSurvey extends Application {
|
||||||
reference key (ss_simplesurvey.application_id);
|
// nothing to persist
|
||||||
|
// reference key (ss_simplesurvey.application_id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 ;
|
||||||
|
|
@ -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 ;
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<upgrade>
|
||||||
|
<version from="6.6.0" to="6.6.1">
|
||||||
|
<script sql="ccm-simplesurvey/upgrade/::database::-6.6.0-6.6.1.sql"/>
|
||||||
|
</version>
|
||||||
|
</upgrade>
|
||||||
|
|
@ -19,13 +19,18 @@
|
||||||
package com.arsdigita.simplesurvey;
|
package com.arsdigita.simplesurvey;
|
||||||
|
|
||||||
import com.arsdigita.db.DbHelper;
|
import com.arsdigita.db.DbHelper;
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.kernel.ACSObjectInstantiator;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.pdl.ManifestSource;
|
import com.arsdigita.persistence.pdl.ManifestSource;
|
||||||
import com.arsdigita.persistence.pdl.NameFilter;
|
import com.arsdigita.persistence.pdl.NameFilter;
|
||||||
import com.arsdigita.runtime.CompoundInitializer;
|
import com.arsdigita.runtime.CompoundInitializer;
|
||||||
// import com.arsdigita.runtime.LegacyInitializer;
|
import com.arsdigita.runtime.DomainInitEvent;
|
||||||
import com.arsdigita.runtime.PDLInitializer;
|
import com.arsdigita.runtime.PDLInitializer;
|
||||||
import com.arsdigita.runtime.RuntimeConfig;
|
import com.arsdigita.runtime.RuntimeConfig;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes ccm-simplesurvey at each system startup.
|
* Initializes ccm-simplesurvey at each system startup.
|
||||||
*
|
*
|
||||||
|
|
@ -34,6 +39,9 @@ import com.arsdigita.runtime.RuntimeConfig;
|
||||||
*/
|
*/
|
||||||
public class Initializer extends CompoundInitializer {
|
public class Initializer extends CompoundInitializer {
|
||||||
|
|
||||||
|
/** Creates a s_logging category with name = to the full name of class */
|
||||||
|
private static Logger s_log = Logger.getLogger(Initializer.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Delegates to the old initializer system.
|
* Constructor. Delegates to the old initializer system.
|
||||||
*/
|
*/
|
||||||
|
|
@ -46,6 +54,26 @@ public class Initializer extends CompoundInitializer {
|
||||||
("ccm-simplesurvey.pdl.mf",
|
("ccm-simplesurvey.pdl.mf",
|
||||||
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
|
||||||
|
|
||||||
// add(new LegacyInitializer("com/arsdigita/simplesurvey/enterprise.init"));
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes domain-coupling machinery, usually consisting of
|
||||||
|
* registering object instantiators and observers.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void init(DomainInitEvent e) {
|
||||||
|
s_log.debug("SimpleSurvey Initializer.init(DomainInitEvent) invoked");
|
||||||
|
super.init(e);
|
||||||
|
|
||||||
|
/* Register object instantiator for Workspace (Content Center) */
|
||||||
|
e.getFactory().registerInstantiator
|
||||||
|
(SimpleSurvey.BASE_DATA_OBJECT_TYPE,
|
||||||
|
new ACSObjectInstantiator() {
|
||||||
|
@Override
|
||||||
|
public DomainObject doNewInstance(DataObject dobj) {
|
||||||
|
return new SimpleSurvey(dobj);
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ public class Loader extends PackageLoader {
|
||||||
new KernelExcursion() {
|
new KernelExcursion() {
|
||||||
public void excurse() {
|
public void excurse() {
|
||||||
setEffectiveParty(Kernel.getSystemParty());
|
setEffectiveParty(Kernel.getSystemParty());
|
||||||
|
|
||||||
setupSimpleSurveyPackage();
|
setupSimpleSurveyPackage();
|
||||||
|
|
||||||
}
|
}
|
||||||
}.run();
|
}.run();
|
||||||
}
|
}
|
||||||
|
|
@ -97,35 +99,31 @@ public class Loader extends PackageLoader {
|
||||||
"com.arsdigita.simplesurvey.ui.widgets.RadioEditor" )
|
"com.arsdigita.simplesurvey.ui.widgets.RadioEditor" )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* Create new type legacy free application type
|
||||||
ApplicationSetup setup = new ApplicationSetup(s_log);
|
* NOTE: The wording in the title parameter of ApplicationType
|
||||||
|
* determines the name of the subdirectory for the XSL stylesheets.
|
||||||
setup.setApplicationObjectType(SimpleSurvey.BASE_DATA_OBJECT_TYPE);
|
* It gets "urlized", i.e. trimming leading and trailing blanks and
|
||||||
setup.setKey("simplesurvey");
|
* replacing blanks between words and illegal characters with an
|
||||||
setup.setTitle("Simple Survey");
|
* hyphen and converted to lower case.
|
||||||
// setup.setDescription("Simple Survey");
|
* "Content Center" will become "content-center". */
|
||||||
setup.setDescription("A simple survey application.");
|
ApplicationType type = new
|
||||||
setup.setInstantiator(new ACSObjectInstantiator() {
|
ApplicationType("Simple Survey",
|
||||||
@Override
|
SimpleSurvey.BASE_DATA_OBJECT_TYPE );
|
||||||
public DomainObject doNewInstance(DataObject dataObject) {
|
type.setDescription("An application to conduct a simple survey.");
|
||||||
return new SimpleSurvey(dataObject);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ApplicationType type = setup.run();
|
|
||||||
type.save();
|
type.save();
|
||||||
|
|
||||||
if (!Application.isInstalled(SimpleSurvey.BASE_DATA_OBJECT_TYPE,
|
if (!Application.isInstalled(SimpleSurvey.BASE_DATA_OBJECT_TYPE,
|
||||||
"/simplesurvey/")) {
|
"/simplesurvey/")) {
|
||||||
Application app =
|
Application app = Application.createApplication(type,
|
||||||
Application.createApplication(type,
|
"simplesurvey",
|
||||||
"simplesurvey",
|
"Simplesurvey",
|
||||||
"Simplesurvey",
|
null);
|
||||||
null);
|
app.setDescription("The default Survey application instance.");
|
||||||
app.save();
|
app.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the widgets types (i.e. description and class names to be
|
// Load the widgets types (i.e. description and class names to be
|
||||||
// instantiated ad runtime) used in survey forms into database.
|
// instantiated at runtime) used in survey forms into database.
|
||||||
FormbuilderSetup fbs = new FormbuilderSetup();
|
FormbuilderSetup fbs = new FormbuilderSetup();
|
||||||
fbs.setup(widgetTypes, null, null);
|
fbs.setup(widgetTypes, null, null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
version="1.0">
|
version="1.0">
|
||||||
|
|
||||||
<xsl:import href="../../../../packages/simplesurvey/xsl/simplesurvey.xsl"/>
|
<xsl:import href="../../packages/simple-survey/xsl/simplesurvey.xsl"/>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
||||||
xmlns:simplesurvey="http://www.arsdigita.com/simplesurvey/1.0"
|
xmlns:simplesurvey="http://www.arsdigita.com/simplesurvey/1.0"
|
||||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0">
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
|
version="1.0">
|
||||||
|
|
||||||
<!-- IMPORT DEFINITIONS ccm-simplesurvey installed as separate web application
|
<!-- IMPORT DEFINITIONS ccm-simplesurvey installed as separate web application
|
||||||
<xsl:import href="../../../../ROOT/packages/content-section/xsl/cms.xsl"/>
|
<xsl:import href="../../../../ROOT/packages/content-section/xsl/cms.xsl"/>
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<!-- IMPORT DEFINITIONS ccm-simplesurvey installed into the main CCM webapp
|
<!-- IMPORT DEFINITIONS ccm-simplesurvey installed into the main CCM webapp
|
||||||
-->
|
-->
|
||||||
<xsl:import href="../../../packages/content-section/xsl/cms.xsl"/>
|
<xsl:import href="../../packages/cms/xsl/cms.xsl"/>
|
||||||
|
|
||||||
<xsl:import href="view.xsl"/> <!-- Stylesheet for the page for submitting a survey -->
|
<xsl:import href="view.xsl"/> <!-- Stylesheet for the page for submitting a survey -->
|
||||||
<xsl:import href="survey-response-data.xsl"/> <!-- Stylesheet for the CSV file page -->
|
<xsl:import href="survey-response-data.xsl"/> <!-- Stylesheet for the CSV file page -->
|
||||||
Loading…
Reference in New Issue