Nachtrag Update scripts zu CMS Workspace / Service als legacy free apps.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1553 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2012-03-26 21:48:42 +00:00
parent 8b4b7cb929
commit f371065415
9 changed files with 328 additions and 72 deletions

View File

@ -118,7 +118,7 @@ public class Loader extends PackageLoader {
*/
private void setupAdministrator() {
s_log.warn("Administrator eMail is retrieved as: " + getAdminEmail());
s_log.info("Administrator eMail is retrieved as: " + getAdminEmail());
DataCollection coll = SessionManager.getSession()
.retrieve(User.BASE_DATA_OBJECT_TYPE);
@ -133,7 +133,7 @@ public class Loader extends PackageLoader {
User admin = User.retrieve( coll.getDataObject() );
coll.close();
s_log.warn("Administrator is retrieved as: " + admin);
s_log.info("Administrator is retrieved as: " + admin);
UserLogin login = UserLogin.findByUser(admin);
if (login == null) {

View File

@ -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_service_legacy_entries.sql $
-- ccm-cms Service 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 '%cms.Service%')
)
);
-- 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 '%cms.Service%')
)
);
-- delete all entries in site_nodes referring to a Service 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 '%cms.Service%')
);
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 '%cms.Service%')
);
-- 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 '%cms.Service%')
);
-- delete all entries for Service 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 '%cms.Service%') ;
-- 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 '%cms.Service%') ;
-- set package_id to null for all entries referring to a Service 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 '%cms.Service%') ;
-- set package_id to null for all entries referring to a Service instance
-- (indicating a new legacy free application)
update application_types
set package_type_id = null
where object_type like '%cms.Service%' ;
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 ;

View File

@ -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_workspace_legacy_entries.sql $
-- ccm-cms Workspace (content-center) 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 '%cms.Workspace%')
)
);
-- 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 '%cms.Workspace%')
)
);
-- delete all entries in site_nodes referring to a Workspace 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 '%cms.Workspace%')
);
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 '%cms.Workspace%')
);
-- 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 '%cms.Workspace%')
);
-- delete all entries for Workspace 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 '%cms.Workspace%') ;
-- 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 '%cms.Workspace%') ;
-- set package_id to null for all entries referring to a Workspace 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 '%cms.Workspace%') ;
-- set package_id to null for all entries referring to a Workspace instance
-- (indicating a new legacy free application)
update application_types
set package_type_id = null
where object_type like '%cms.Workspace%' ;
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 ;

View File

@ -0,0 +1,25 @@
--
-- 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: oracle-se-6.6.6-6.6.7.sql 2012-03-26 15:10:39Z pboy $
-- Update: content-center (Workspace) & CMS Service now loaded as
-- legacy free application
PROMPT Red Hat Enterprise CMS 6.6.6 -> 6.6.7 Upgrade Script (Oracle)
@@ ../default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql
@@ ../default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql

View File

@ -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: 2011/09/06 23:15:09 $
-- $Id: postgres-6.6.6-6.6.7.sql 2012-03-26 15:10:39Z pboy $
-- Update: content-center (Workspace) & CMS Service now loaded as
-- legacy free application
\echo Red Hat Enterprise CMS 6.6.6 -> 6.6.7 Upgrade Script (PostgreSQL)
begin;
\i ../default/upgrade/6.6.6-6.6.7/remove_workspace_legacy_entries.sql
\i ../default/upgrade/6.6.6-6.6.7/remove_service_legacy_entries.sql
commit;

View File

@ -40,6 +40,7 @@
<script class="com.arsdigita.cms.upgrade.CreateGenericContentTypes"/>
</version>
<version from="6.6.1" to="6.6.2">
<!-- CMS Workspace & Service now new style legacy compatible apps -->
<script class="com.arsdigita.cms.upgrade.AddNewStyleApplicationEntries"/>
<script sql="ccm-cms/upgrade/::database::-6.6.1-6.6.2.sql"/>
</version>
@ -58,4 +59,8 @@
<!-- ContentSection now loaded as legacy free application -->
<script sql="ccm-cms/upgrade/::database::-6.6.5-6.6.6.sql"/>
</version>
<version from="6.6.6" to="6.6.7">
<!-- CMS Workspace&Service now loaded as legacy free application -->
<script sql="ccm-cms/upgrade/::database::-6.6.6-6.6.7.sql"/>
</version>
</upgrade>

View File

@ -46,18 +46,6 @@ import java.util.List;
import org.apache.log4j.Logger;
// Migration status
//
// The module in its complete version (i.e. all method invocations in run()
// method commented IN(!) does load all packages into database and
// ccm/admin/sitemap lists them appropriately.
//
// Next Try
// Refactor using legacy compatible web/Application and ApplicationSetup *DONE*
// Refactor content-section als legacy free application *DONE*
// Refactor workspace (content-center) as a legacy free application *DONE*
// Refactor cms-service as a legacy free application *DONE*
/**
* <p>Executes nonrecurring at install time and loads (installs and initializes)
* the Content Management System module,including the Content Center, CMS Service
@ -184,13 +172,6 @@ public class Loader extends PackageLoader {
public static ApplicationType loadWorkspaceApplicationType() {
s_log.debug("Creating CMS Workspace...");
/* Create new type legacy compatible application type */
// ApplicationType type = ApplicationType
// .createApplicationType(Workspace.PACKAGE_KEY,
// Workspace.INSTANCE_NAME,
// Workspace.BASE_DATA_OBJECT_TYPE);
// type.setDispatcherClass(Workspace.DISPATCHER_CLASS);
/* Create new type legacy free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.
@ -249,40 +230,6 @@ public class Loader extends PackageLoader {
public static ApplicationType loadServiceApplicationType() {
s_log.debug("Loading CMS Servce Package...");
// Creating Service package using new style c.ad.web.Application
// in legacy compatible mode. Needs refactoring of the Service package.
// In a first step these instructions replace c.ad.installer.ServiceInstaller
// create application type
// ApplicationSetup appsetup = new ApplicationSetup(s_log);
// // new style properties
// appsetup.setApplicationObjectType(Service.BASE_DATA_OBJECT_TYPE);
// appsetup.setTitle(Service.INSTANCE_NAME); // same as for instance
// there is only one
// appsetup.setDescription("Services to store global resources and assets.");
// old style / legacy compatible properties
// appsetup.setKey(Service.PRIMARY_URL_STUB);
// appsetup.setDispatcherClass(Service.DISPATCHER_CLASS);
// appsetup.setSingleton(true);
// appsetup.setPortalApplication(false);
// appsetup.setInstantiator(new ACSObjectInstantiator() {
// @Override
// protected DomainObject doNewInstance(DataObject dataObject) {
// return new Service(dataObject);
// }
// });
// ApplicationType serviceType = appsetup.run();
// serviceType.save();
// ////////////// Current style to create app type ///////////////
/* Create new type legacy compatible application type */
// ApplicationType type = ApplicationType
// .createApplicationType(Service.PRIMARY_URL_STUB,
// Service.INSTANCE_NAME,
// Service.BASE_DATA_OBJECT_TYPE);
// type.setDispatcherClass(Service.DISPATCHER_CLASS);
/* Create new type legacy free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.
@ -292,7 +239,6 @@ public class Loader extends PackageLoader {
* "CMS Service" will become "cms-service". */
ApplicationType type = new ApplicationType("CMS Service",
Service.BASE_DATA_OBJECT_TYPE );
type.setDescription("Services to store global resources and assets.");
type.save();
@ -340,13 +286,6 @@ public class Loader extends PackageLoader {
// Step 1: Create content section application type
// prerequisite for concrete content-section instance creation.
/* Create new type legacy compatible application type */
// ApplicationType type = ApplicationType
// .createApplicationType(ContentSection.PACKAGE_TYPE,
// "CMS Content Section",
// ContentSection.BASE_DATA_OBJECT_TYPE);
/* Create legacy-free application type
* NOTE: The wording in the title parameter of ApplicationType
* determines the name of the subdirectory for the XSL stylesheets.

View File

@ -136,7 +136,7 @@ public class Initializer extends CompoundInitializer {
* Called on startup.
*/
public void startup() {
s_log.warn("Document Manager is initializing.");
s_log.info("Document Manager is initializing.");
// setupDomainFactory();

View File

@ -109,7 +109,7 @@ public class Loader extends PackageLoader {
}
}.run();
s_log.warn("Done");
s_log.info("Done");
}
@ -492,7 +492,7 @@ public class Loader extends PackageLoader {
return;
}
s_log.warn("There is no Portal Site Map application instance " +
s_log.info("There is no Portal Site Map application instance " +
"on /portal-admin/. Installing now.");
Application app = Application.createApplication
@ -503,7 +503,7 @@ public class Loader extends PackageLoader {
app.save();
s_log.warn("Done installing Portal Site Map on " +
s_log.info("Done installing Portal Site Map on " +
"/portal-admin/portal-sitemap/.");
}
}
@ -724,11 +724,6 @@ public class Loader extends PackageLoader {
("Package Type with key \"" + packageKey + "\" was not found.\n");
}
// Create default stylesheet.
// stylesheetName = "/packages/login/xsl/login_ps_en.xsl";
// s_log.warn("Adding stylesheet: " + stylesheetName);
// subsite.addStylesheet(Stylesheet.createStylesheet(stylesheetName));
// Set subsite dispatcher class.
subsite.setDispatcherClass(