From 00da3505ae3b3042c12b0ded80b9933ee164e34e Mon Sep 17 00:00:00 2001 From: pb Date: Fri, 15 Feb 2008 18:53:06 +0000 Subject: [PATCH] incorporating APLAWS patch: r1663 | chrisg23 | 2007-09-19 10:23:54 +0200 (Mi, 19 Sep 2007) Add association between image and link. Changes have no effect by themselves, but if the ccm-wsx-image-link-step module in contrib is loaded then the default image step is replaced with an asset step UI for associating the article image with one of the related links defined for the article. This change requires upgrade script to be run: ccm upgrade ccm-ldn-image-step --from-version 6.5.0 --to-version 6.5.1 git-svn-id: https://svn.libreccm.org/ccm/trunk@27 8810af33-2d31-482b-a856-94f89814c4df --- ccm-ldn-image-step/application.xml | 2 +- .../cms/contenttypes/ItemImageAttachment.pdl | 1 + .../upgrade/6.5.0-6.5.1/add_link_column.sql | 25 +++++++++++++++ .../upgrade/oracle-se-6.5.0-6.5.1.sql | 4 +++ .../upgrade/postgres-6.5.0-6.5.1.sql | 7 ++++ .../src/ccm-ldn-image-step.upgrade | 3 ++ .../cms/contenttypes/ItemImageAttachment.java | 32 +++++++++++++++++++ 7 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 ccm-ldn-image-step/sql/ccm-ldn-image-step/default/upgrade/6.5.0-6.5.1/add_link_column.sql create mode 100644 ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql create mode 100644 ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql diff --git a/ccm-ldn-image-step/application.xml b/ccm-ldn-image-step/application.xml index 3f247c420..23a7cca5a 100755 --- a/ccm-ldn-image-step/application.xml +++ b/ccm-ldn-image-step/application.xml @@ -2,7 +2,7 @@ diff --git a/ccm-ldn-image-step/pdl/com/arsdigita/cms/contenttypes/ItemImageAttachment.pdl b/ccm-ldn-image-step/pdl/com/arsdigita/cms/contenttypes/ItemImageAttachment.pdl index 778a097fd..aad1f6bfd 100755 --- a/ccm-ldn-image-step/pdl/com/arsdigita/cms/contenttypes/ItemImageAttachment.pdl +++ b/ccm-ldn-image-step/pdl/com/arsdigita/cms/contenttypes/ItemImageAttachment.pdl @@ -9,6 +9,7 @@ object type ItemImageAttachment extends ACSObject { String[0..1] caption = cms_item_image_attachment.caption VARCHAR( 100 ); String[0..1] title = cms_item_image_attachment.title VARCHAR( 200 ); String[0..1] description = cms_item_image_attachment.description VARCHAR( 4000 ); + component Link[0..1] imageLink = join cms_item_image_attachment.link_id to cms_links.link_id; composite ReusableImageAsset[0..1] image = join cms_item_image_attachment.image_id to cms_images.image_id; diff --git a/ccm-ldn-image-step/sql/ccm-ldn-image-step/default/upgrade/6.5.0-6.5.1/add_link_column.sql b/ccm-ldn-image-step/sql/ccm-ldn-image-step/default/upgrade/6.5.0-6.5.1/add_link_column.sql new file mode 100644 index 000000000..89328429b --- /dev/null +++ b/ccm-ldn-image-step/sql/ccm-ldn-image-step/default/upgrade/6.5.0-6.5.1/add_link_column.sql @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 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 +-- + +alter table cms_item_image_attachment add (link_id NUMBER); + +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_lin_id_f_eeymm foreign key (link_id) + references cms_links(link_id); + + diff --git a/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql b/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql new file mode 100644 index 000000000..ae0414a6c --- /dev/null +++ b/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/oracle-se-6.5.0-6.5.1.sql @@ -0,0 +1,4 @@ + +PROMPT ImageStep 6.5.0 -> 6.5.1 Upgrade Script (Oracle) + +@@ ../default/upgrade/6.5.0-6.5.1/add_link_column.sql diff --git a/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql b/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql new file mode 100644 index 000000000..71553c545 --- /dev/null +++ b/ccm-ldn-image-step/sql/ccm-ldn-image-step/upgrade/postgres-6.5.0-6.5.1.sql @@ -0,0 +1,7 @@ +\echo ImageStep 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../default/upgrade/6.5.0-6.5.1/add_link_column.sql + +commit; diff --git a/ccm-ldn-image-step/src/ccm-ldn-image-step.upgrade b/ccm-ldn-image-step/src/ccm-ldn-image-step.upgrade index 4b873bb8d..c2272b611 100755 --- a/ccm-ldn-image-step/src/ccm-ldn-image-step.upgrade +++ b/ccm-ldn-image-step/src/ccm-ldn-image-step.upgrade @@ -5,4 +5,7 @@