From 98f27f244d33d15a22d1c82f8e7db9acedcd9b85 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 5 Apr 2012 11:56:08 +0000 Subject: [PATCH] =?UTF-8?q?Updateskript=20f=C3=BCr=20Publication=20<->=20G?= =?UTF-8?q?enericPerson?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@1568 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms/application.xml | 2 +- .../src/com/arsdigita/cms/ContentItem.java | 25 +- ccm-sci-publications/application.xml | 4 +- .../src/ccm-sci-publications.upgrade | 3 + .../PublicationAuthorAssocUpgrade.java | 411 ++++++++++++++++++ .../cms/contenttypes/PublicationBundle.java | 9 +- ccm-sci-types-department/application.xml | 4 +- 7 files changed, 440 insertions(+), 18 deletions(-) create mode 100644 ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationAuthorAssocUpgrade.java diff --git a/ccm-cms/application.xml b/ccm-cms/application.xml index 1fa16bbb5..fdc411d38 100755 --- a/ccm-cms/application.xml +++ b/ccm-cms/application.xml @@ -2,7 +2,7 @@ diff --git a/ccm-cms/src/com/arsdigita/cms/ContentItem.java b/ccm-cms/src/com/arsdigita/cms/ContentItem.java index eeeaa98f9..a5797b8f2 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentItem.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentItem.java @@ -1955,17 +1955,28 @@ public class ContentItem extends VersionedACSObject implements CustomCopy { return assocCopier.copyProperty(source, property, copier); }*/ - if (handlesReverseProperties()) { - return copyReverseProperty(source, this, property, copier); + if (source instanceof ContentItem) { + final ContentItem sourceItem = (ContentItem) source; + final Object value = sourceItem.get(property.getName()); + if (value instanceof DataCollection) { + final DataCollection collection = (DataCollection) value; + while(collection.next()) { + DomainObject obj = DomainObjectFactory.newInstance(collection.getDataObject()); + if (obj instanceof ContentItem) { + final ContentItem item = (ContentItem) obj; + return item.copyReverseProperty(source, + item, + property, + + copier); + } + } + } } return false; } - - public boolean handlesReverseProperties() { - return false; - } - + public boolean copyReverseProperty(final CustomCopy source, final ContentItem liveItem, final Property property, diff --git a/ccm-sci-publications/application.xml b/ccm-sci-publications/application.xml index 994b31ff5..f13453263 100644 --- a/ccm-sci-publications/application.xml +++ b/ccm-sci-publications/application.xml @@ -2,12 +2,12 @@ - + diff --git a/ccm-sci-publications/src/ccm-sci-publications.upgrade b/ccm-sci-publications/src/ccm-sci-publications.upgrade index 1d7981863..8b2b3aa2e 100644 --- a/ccm-sci-publications/src/ccm-sci-publications.upgrade +++ b/ccm-sci-publications/src/ccm-sci-publications.upgrade @@ -5,4 +5,7 @@