From 0dd6e8ff5598727cc115b58060c3887f8929b50a Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 4 Jun 2014 19:29:19 +0000 Subject: [PATCH] A bugfix for ccm-sci-assets-publicationsperson git-svn-id: https://svn.libreccm.org/ccm/trunk@2668 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/contentassets/SciPublicationsPersons.pdl | 8 ++++---- .../SciPublicationsPersonsPersonsPublications.java | 6 ++++-- .../SciPublicationsPersonsPublicationsPersons.java | 6 ++++-- .../cms/contentassets/SciPublicationsPersonsService.java | 9 +++++---- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ccm-sci-assets-publicationspersons/pdl/com/arsdigita/cms/contentassets/SciPublicationsPersons.pdl b/ccm-sci-assets-publicationspersons/pdl/com/arsdigita/cms/contentassets/SciPublicationsPersons.pdl index 99f9c1d18..8183f8db9 100644 --- a/ccm-sci-assets-publicationspersons/pdl/com/arsdigita/cms/contentassets/SciPublicationsPersons.pdl +++ b/ccm-sci-assets-publicationspersons/pdl/com/arsdigita/cms/contentassets/SciPublicationsPersons.pdl @@ -51,8 +51,8 @@ object type SciPublicationsPersonsPublicationsPersons extends ACSObject { association { - composite ContentItem[1..1] owner = join ca_publications_persons_publications_persons_asset.owner_id - to cms_items.item_id; + composite ContentItem[1..1] owningPublication = join ca_publications_persons_publications_persons_asset.owner_id + to cms_items.item_id; component SciPublicationsPersonsPublicationsPersons[0..1] publicationsPersons = join cms_items.item_id to ca_publications_persons_publications_persons_asset.owner_id; @@ -67,8 +67,8 @@ object type SciPublicationsPersonsPersonsPublications extends ACSObject { association { - composite ContentItem[1..1] owner = join ca_publications_persons_persons_publications_asset.owner_id - to cms_items.item_id; + composite ContentItem[1..1] owningPerson = join ca_publications_persons_persons_publications_asset.owner_id + to cms_items.item_id; component SciPublicationsPersonsPersonsPublications[0..1] personsPublications = join cms_items.item_id to ca_publications_persons_persons_publications_asset.owner_id; diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPersonsPublications.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPersonsPublications.java index b7bb63899..141ae4241 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPersonsPublications.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPersonsPublications.java @@ -37,10 +37,10 @@ public class SciPublicationsPersonsPersonsPublications extends ACSObject { public static final String PUBLICATIONS = "publications"; public static final String PERSONS_PUBLICATIONS = "personsPublications"; - public static final String OWNER = "owner"; + public static final String OWNER = "owningPerson"; public SciPublicationsPersonsPersonsPublications() { - super(BASE_DATA_OBJECT_TYPE); + this(BASE_DATA_OBJECT_TYPE); } public SciPublicationsPersonsPersonsPublications(final String type) { @@ -70,9 +70,11 @@ public class SciPublicationsPersonsPersonsPublications extends ACSObject { final SciPublicationsPersonsPersonsPublications publications = new SciPublicationsPersonsPersonsPublications(); publications.set(OWNER, instance); + instance.set(PERSONS_PUBLICATIONS, publications); publications.update(); publications.save(); + instance.save(); } public String getPublications() { diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPublicationsPersons.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPublicationsPersons.java index 68e6c01e0..6ca1556ed 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPublicationsPersons.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsPublicationsPersons.java @@ -38,10 +38,10 @@ public class SciPublicationsPersonsPublicationsPersons extends ACSObject { public static final String PUBLICATIONS_PERSONS = "publicationsPersons"; public static final String PERSONS = "persons"; - public static final String OWNER = "owner"; + public static final String OWNER = "owningPublication"; public SciPublicationsPersonsPublicationsPersons() { - super(BASE_DATA_OBJECT_TYPE); + this(BASE_DATA_OBJECT_TYPE); } public SciPublicationsPersonsPublicationsPersons(final String type) { @@ -70,9 +70,11 @@ public class SciPublicationsPersonsPublicationsPersons extends ACSObject { final SciPublicationsPersonsPublicationsPersons persons = new SciPublicationsPersonsPublicationsPersons(); persons.set(OWNER, instance); + instance.set(PUBLICATIONS_PERSONS, persons); persons.update(); persons.save(); + instance.save(); } public String getPersons() { diff --git a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java index e98471bfb..3bdf78486 100644 --- a/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java +++ b/ccm-sci-assets-publicationspersons/src/com/arsdigita/cms/contentassets/SciPublicationsPersonsService.java @@ -83,12 +83,13 @@ public class SciPublicationsPersonsService { final PublicationBundle publicationBundle = publication.getPublicationBundle(); personBundle.remove(PUBLICATIONS, publicationBundle); - final DataObject personsAsset = (DataObject) person.get(PUBLICATIONS_PERSONS); - final SciPublicationsPersonsPublicationsPersons persons = new SciPublicationsPersonsPublicationsPersons(personsAsset); - persons.update(); - final DataObject publicationsAsset = (DataObject) publication.get(PERSONS_PUBLICATIONS); + final DataObject publicationsAsset = (DataObject) person.get(PERSONS_PUBLICATIONS); final SciPublicationsPersonsPersonsPublications publications = new SciPublicationsPersonsPersonsPublications(publicationsAsset); publications.update(); + final DataObject personsAsset = (DataObject) publication.get(PUBLICATIONS_PERSONS); + final SciPublicationsPersonsPublicationsPersons persons = new SciPublicationsPersonsPublicationsPersons(personsAsset); + persons.update(); + }