From a9e6b82350d6727ffef78fa6140cc39b66664a19 Mon Sep 17 00:00:00 2001 From: pb Date: Thu, 25 Dec 2008 23:39:20 +0000 Subject: [PATCH] Patch to make APLAWS/CCM work with PostgreSQL 8.3, does not affect Oracle. PostgreSQL 8.3 does no longer accept a mixture of integer and numeric fields in references/constrains. The modification eliminates a long standing performance complain by the analyze utility as well. Update script provided, the Oracle version doesn't do anything at all. Postgres 8.x required for the update script to work. If you use a 7.x version the upgrade isn't requirred and can savely be omitted. git-svn-id: https://svn.libreccm.org/ccm/trunk@66 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms/application.xml | 2 +- ...olderMap.pdl => UserHomeFolderMap.ora.pdl} | 0 .../content-section/UserHomeFolderMap.pg.pdl | 38 ++++++ .../6.5.3-6.5.4/cms_user_home_folder_map.sql | 7 ++ .../6.5.3-6.5.4/cms_user_home_folder_map.sql | 30 +++++ .../ccm-cms/upgrade/oracle-se-6.5.3-6.5.4.sql | 25 ++++ .../ccm-cms/upgrade/postgres-6.5.3-6.5.4.sql | 26 ++++ ccm-cms/src/com/arsdigita/cms/enterprise.init | 115 +++++++++--------- 8 files changed, 184 insertions(+), 59 deletions(-) rename ccm-cms/pdl/com/arsdigita/content-section/{UserHomeFolderMap.pdl => UserHomeFolderMap.ora.pdl} (100%) mode change 100755 => 100644 create mode 100755 ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pg.pdl create mode 100644 ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql create mode 100644 ccm-cms/sql/ccm-cms/postgres/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql create mode 100644 ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.5.3-6.5.4.sql create mode 100644 ccm-cms/sql/ccm-cms/upgrade/postgres-6.5.3-6.5.4.sql diff --git a/ccm-cms/application.xml b/ccm-cms/application.xml index 69b3bb78b..56005f928 100755 --- a/ccm-cms/application.xml +++ b/ccm-cms/application.xml @@ -2,7 +2,7 @@ diff --git a/ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pdl b/ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.ora.pdl old mode 100755 new mode 100644 similarity index 100% rename from ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pdl rename to ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.ora.pdl diff --git a/ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pg.pdl b/ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pg.pdl new file mode 100755 index 000000000..7f9748285 --- /dev/null +++ b/ccm-cms/pdl/com/arsdigita/content-section/UserHomeFolderMap.pg.pdl @@ -0,0 +1,38 @@ +// +// Copyright (C) 2003-2004 Red Hat Inc. 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: UserHomeFolderMap.pg.pdl 287 2008-12-24 00:29:02Z pboy $ +// $DateTime: 2004/08/17 23:15:09 $ +model com.arsdigita.cms; + +import com.arsdigita.kernel.*; + +// PostgreSQL 8.3 requires that user_id and section_id are INTEGER as in +// the referenced tables "content_sections" and "users". Without specification +// they are created as numeric here. Oracle doesn't seem to care about. + +object type UserHomeFolderMap extends ACSObject { + + BigDecimal userID = cms_user_home_folder_map.user_id INTEGER; + BigDecimal sectionID = cms_user_home_folder_map.section_id INTEGER; + + Folder[1..1] homeFolder = join cms_user_home_folder_map.folder_id to cms_folders.folder_id; + ContentSection[1..1] homeSection = join cms_user_home_folder_map.section_id to content_sections.section_id; + User[1..1] homeFolderUser = join cms_user_home_folder_map.user_id to users.user_id; + + reference key(cms_user_home_folder_map.map_id); +} \ No newline at end of file diff --git a/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql b/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql new file mode 100644 index 000000000..660f5a1eb --- /dev/null +++ b/ccm-cms/sql/ccm-cms/oracle-se/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql @@ -0,0 +1,7 @@ +-- +-- Peter Boy + +-- nothing to do here (Oracle) + + + diff --git a/ccm-cms/sql/ccm-cms/postgres/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql new file mode 100644 index 000000000..4cd811b6d --- /dev/null +++ b/ccm-cms/sql/ccm-cms/postgres/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql @@ -0,0 +1,30 @@ +-- +-- Copyright (C) 2008 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: cms_user_home_folder_map.sql, 2008/12/25 12:09:59 pboy Exp $ +-- $DateTime: 2004/08/17 23:15:09 $ + +-- in postgresql 8.3 a mixture of numeric and integer for reference keys +-- is no longer accepted- + +ALTER TABLE cms_user_home_folder_map + ALTER COLUMN user_id TYPE INTEGER , + ALTER COLUMN section_id TYPE INTEGER; + + + + diff --git a/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.5.3-6.5.4.sql b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.5.3-6.5.4.sql new file mode 100644 index 000000000..72697f83a --- /dev/null +++ b/ccm-cms/sql/ccm-cms/upgrade/oracle-se-6.5.3-6.5.4.sql @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2007 Chris Gilbert. 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.5.2-6.5.3.sql 293 2005-02-22 15:10:39Z cgilbert $ +-- $DateTime: 2004/08/16 18:10:38 $ + +PROMPT Red Hat Enterprise CMS 6.5.3 -> 6.5.4 Upgrade Script (Oracle) + +-- do nothing - postgresql update only + + diff --git a/ccm-cms/sql/ccm-cms/upgrade/postgres-6.5.3-6.5.4.sql b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.5.3-6.5.4.sql new file mode 100644 index 000000000..3b34e8fc4 --- /dev/null +++ b/ccm-cms/sql/ccm-cms/upgrade/postgres-6.5.3-6.5.4.sql @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2008 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: 2004/08/17 23:15:09 $ + +\echo Red Hat Enterprise CMS 6.5.3 -> 6.5.4 Upgrade Script (PostgreSQL) + +begin; + +\i ../postgres/upgrade/6.5.3-6.5.4/cms_user_home_folder_map.sql + +commit; diff --git a/ccm-cms/src/com/arsdigita/cms/enterprise.init b/ccm-cms/src/com/arsdigita/cms/enterprise.init index 365b94b76..f19712f7a 100755 --- a/ccm-cms/src/com/arsdigita/cms/enterprise.init +++ b/ccm-cms/src/com/arsdigita/cms/enterprise.init @@ -15,64 +15,63 @@ init com.arsdigita.cms.installer.xml.ContentTypeInitializer { }; } -// Test: temporarly deactivate publishToFile -// init com.arsdigita.cms.publishToFile.Initializer { -// // List of publish destinations for content types -// // Each element is a four-element list in the format -// // '{ "content type", "root directory", "shared storage", -// // "url stub" }'. -// // "Content type" is the object type of the content type. -// // "Root directory" must be a path to a writable directory, relative -// // to the file-system root. "Shared storage" must be _true_ if the root -// // directory is shared NFS storage, _false_ otherwise. "URL stub" -// // must be the path component of the URL from which the live server -// // will serve from this directory. -// destination = { -// { "com.arsdigita.cms.ContentItem", -// "data/p2fs", -// false, -// "/p2fs" }, -// { "com.arsdigita.cms.Template", -// "webapps/ROOT/packages/content-section/templates", -// false, -// "/templates" } -// }; -// -// // Class which implements PublishToFileListener used to perform -// // additional actions when publishing or unpublishing to the file system. -// publishListener = "com.arsdigita.cms.publishToFile.PublishToFile"; -// -// // Queue management parameters. -// -// // Set startupDelay to 0 to disable the processing of the queue -// // Time (seconds) before starting to monitor the -// // queue after a server start -// startupDelay = 30; -// -// // Time (in seconds) between checking if there are entries in the -// // publishToFile queue. -// // A value <= 0 disables processing the queue on this server. -// pollDelay = 5; -// -// // Time to wait (seconds) before retrying -// // to process a failed entry -// retryDelay = 120; -// -// // Number of queue entries to process at once. -// blockSize = 40; -// // Number of times a failed queue entry will be -// // reprocessed. If processing has failed more than -// // that number of times, the entry will be -// // ignored. -// maximumFailCount = 10; -// -// // Method used to select entries for processing. -// // 'QueuedOrder'-in queued order. -// // 'GroupByParent'-group entries according to parent when selecting items -// // (allows optimizations if a listener task required for all elements in a folder -// // can be done only once for the folder). -// blockSelectMethod = "GroupByParent"; -// } +init com.arsdigita.cms.publishToFile.Initializer { + // List of publish destinations for content types + // Each element is a four-element list in the format + // '{ "content type", "root directory", "shared storage", + // "url stub" }'. + // "Content type" is the object type of the content type. + // "Root directory" must be a path to a writable directory, relative + // to the file-system root. "Shared storage" must be _true_ if the root + // directory is shared NFS storage, _false_ otherwise. "URL stub" + // must be the path component of the URL from which the live server + // will serve from this directory. + destination = { + { "com.arsdigita.cms.ContentItem", + "data/p2fs", + false, + "/p2fs" }, + { "com.arsdigita.cms.Template", + "webapps/ROOT/packages/content-section/templates", + false, + "/templates" } + }; + + // Class which implements PublishToFileListener used to perform + // additional actions when publishing or unpublishing to the file system. + publishListener = "com.arsdigita.cms.publishToFile.PublishToFile"; + + // Queue management parameters. + + // Set startupDelay to 0 to disable the processing of the queue + // Time (seconds) before starting to monitor the + // queue after a server start + startupDelay = 30; + + // Time (in seconds) between checking if there are entries in the + // publishToFile queue. + // A value <= 0 disables processing the queue on this server. + pollDelay = 5; + + // Time to wait (seconds) before retrying + // to process a failed entry + retryDelay = 120; + + // Number of queue entries to process at once. + blockSize = 40; + // Number of times a failed queue entry will be + // reprocessed. If processing has failed more than + // that number of times, the entry will be + // ignored. + maximumFailCount = 10; + + // Method used to select entries for processing. + // 'QueuedOrder'-in queued order. + // 'GroupByParent'-group entries according to parent when selecting items + // (allows optimizations if a listener task required for all elements in a folder + // can be done only once for the folder). + blockSelectMethod = "GroupByParent"; +} init com.arsdigita.cms.installer.SectionInitializer {