Assoziation zwischen CollectedVolume und ArticleInCollectedVolume optimiert (Ticket #1117)
git-svn-id: https://svn.libreccm.org/ccm/trunk@1572 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
cec7fb12a2
commit
d3749d6919
|
|
@ -5,7 +5,6 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
|
@ -19,8 +18,7 @@ import java.math.BigDecimal;
|
|||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class GenericPersonBundle
|
||||
extends ContentBundle {
|
||||
public class GenericPersonBundle extends ContentBundle {
|
||||
|
||||
public final static String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.GenericPersonBundle";
|
||||
|
|
@ -138,9 +136,11 @@ public class GenericPersonBundle
|
|||
}
|
||||
|
||||
private void createOrgaUnitAssoc(final DataCollection orgaunits) {
|
||||
final GenericOrganizationalUnitBundle draftOrga = (GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||
final GenericOrganizationalUnitBundle draftOrga =
|
||||
(GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||
newInstance(orgaunits.getDataObject());
|
||||
final GenericOrganizationalUnitBundle liveOrga = (GenericOrganizationalUnitBundle) draftOrga.
|
||||
final GenericOrganizationalUnitBundle liveOrga =
|
||||
(GenericOrganizationalUnitBundle) draftOrga.
|
||||
getLiveVersion();
|
||||
|
||||
if (liveOrga != null) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
|
||||
// PDL definition for a collected volume
|
||||
object type ArticleInCollectedVolume extends Publication {
|
||||
|
|
@ -33,6 +34,6 @@ object type ArticleInCollectedVolume extends Publication {
|
|||
reference key (ct_article_in_collected_volume.article_id);
|
||||
}
|
||||
|
||||
object type ArticleInJournalBundle extends PublicationBundle {
|
||||
reference key (ct_article_in_journal_bundles.bundle_id);
|
||||
object type ArticleInCollectedVolumeBundle extends PublicationBundle {
|
||||
reference key (ct_article_in_collected_volume_bundles.bundle_id);
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
|
||||
// PDL definition for an article in a journal
|
||||
object type ArticleInJournal extends Publication {
|
||||
|
|
@ -34,3 +35,7 @@ object type ArticleInJournal extends Publication {
|
|||
reference key (ct_article_in_journal.article_in_journal_id);
|
||||
|
||||
}
|
||||
|
||||
object type ArticleInJournalBundle extends PublicationBundle {
|
||||
reference key (ct_article_in_journal_bundles.bundle_id);
|
||||
}
|
||||
|
|
@ -29,17 +29,21 @@ object type CollectedVolume extends PublicationWithPublisher {
|
|||
//Moved to publication Boolean[0..1] reviewed = ct_collected_volume.reviewed BIT;
|
||||
}
|
||||
|
||||
object type CollectedVolumeBundle extends PublicationBundle {
|
||||
reference key (ct_collected_volume_bundles.bundle_id);
|
||||
}
|
||||
|
||||
|
||||
association {
|
||||
|
||||
CollectedVolume[0..n] collectedVolume = join ct_article_in_collected_volume.article_id
|
||||
CollectedVolumeBundle[0..n] collectedVolume = join ct_article_in_collected_volume_bundles.bundle_id
|
||||
to ct_collected_volume_article_map.article_id,
|
||||
join ct_collected_volume_article_map.collected_volume_id
|
||||
to ct_collected_volume.collected_volume_id;
|
||||
ArticleInCollectedVolume[0..n] articles = join ct_collected_volume.collected_volume_id
|
||||
to ct_collected_volume_bundles.bundle_id;
|
||||
ArticleInCollectedVolumeBundle[0..n] articles = join ct_collected_volume_bundles.bundle_id
|
||||
to ct_collected_volume_article_map.collected_volume_id,
|
||||
join ct_collected_volume_article_map.article_id
|
||||
to ct_article_in_collected_volume.article_id;
|
||||
to ct_article_in_collected_volume_bundles.bundle_id;
|
||||
|
||||
Integer[0..1] articleOrder = ct_collected_volume_article_map.article_order INTEGER;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.ArticleInCollectedVolume"
|
||||
classname="com.arsdigita.cms.contenttypes.ArticleInCollectedVolume">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.PublicationCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.ArticleInCollectedVolumeCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.articleInCollectedVolume_properties.title"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.CollectedVolume"
|
||||
classname="com.arsdigita.cms.contenttypes.CollectedVolume">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.PublicationCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.CollectedVolumeCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.collectedVolume_properties.title"
|
||||
|
|
|
|||
|
|
@ -88,6 +88,10 @@ public class ArticleInCollectedVolume extends Publication {
|
|||
set(CHAPTER, chapter);
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeBundle getArticleInCollectedVolumeBundle() {
|
||||
return (ArticleInCollectedVolumeBundle) getContentBundle();
|
||||
}
|
||||
|
||||
/*public Boolean getReviewed() {
|
||||
return (Boolean) get(REVIEWED);
|
||||
}
|
||||
|
|
@ -95,39 +99,48 @@ public class ArticleInCollectedVolume extends Publication {
|
|||
public void setReviewed(Boolean reviewed) {
|
||||
set(REVIEWED, reviewed);
|
||||
// }*/
|
||||
|
||||
public CollectedVolume getCollectedVolume() {
|
||||
DataCollection collection;
|
||||
// DataCollection collection;
|
||||
//
|
||||
// collection = (DataCollection) get(COLLECTED_VOLUME);
|
||||
//
|
||||
// if (collection.size() == 0) {
|
||||
// return null;
|
||||
// } else {
|
||||
// DataObject dobj;
|
||||
//
|
||||
// collection.next();
|
||||
// dobj = collection.getDataObject();
|
||||
// collection.close();
|
||||
//
|
||||
// return (CollectedVolume)DomainObjectFactory.newInstance(dobj);
|
||||
// }
|
||||
|
||||
collection = (DataCollection) get(COLLECTED_VOLUME);
|
||||
|
||||
if (collection.size() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (CollectedVolume)DomainObjectFactory.newInstance(dobj);
|
||||
return (CollectedVolume) getArticleInCollectedVolumeBundle().
|
||||
getCollectedVolume().getPrimaryInstance();
|
||||
}
|
||||
|
||||
public CollectedVolume getCollectedVolume(final String language) {
|
||||
return (CollectedVolume) getArticleInCollectedVolumeBundle().
|
||||
getCollectedVolume().getInstance(language);
|
||||
}
|
||||
|
||||
public void setCollectedVolume(CollectedVolume collectedVolume) {
|
||||
CollectedVolume oldCollectedVolume;
|
||||
// CollectedVolume oldCollectedVolume;
|
||||
//
|
||||
// oldCollectedVolume = getCollectedVolume();
|
||||
// if (oldCollectedVolume != null) {
|
||||
// remove(COLLECTED_VOLUME, oldCollectedVolume);
|
||||
// }
|
||||
//
|
||||
// if (collectedVolume != null) {
|
||||
// Assert.exists(collectedVolume, CollectedVolume.class);
|
||||
// DataObject link = add(COLLECTED_VOLUME, collectedVolume);
|
||||
// link.set(CollectedVolume.ARTICLE_ORDER,
|
||||
// Integer.valueOf((int) collectedVolume.getArticles().size()));
|
||||
// link.save();
|
||||
// }
|
||||
|
||||
oldCollectedVolume = getCollectedVolume();
|
||||
if (oldCollectedVolume != null) {
|
||||
remove(COLLECTED_VOLUME, oldCollectedVolume);
|
||||
}
|
||||
|
||||
if (collectedVolume != null) {
|
||||
Assert.exists(collectedVolume, CollectedVolume.class);
|
||||
DataObject link = add(COLLECTED_VOLUME, collectedVolume);
|
||||
link.set(CollectedVolume.ARTICLE_ORDER,
|
||||
Integer.valueOf((int) collectedVolume.getArticles().size()));
|
||||
link.save();
|
||||
}
|
||||
getArticleInCollectedVolumeBundle().setCollectedVolume(collectedVolume);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.metadata.Property;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ArticleInCollectedVolumeBundle extends PublicationBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.ArticleInCollectedVolumeBundle";
|
||||
public static final String COLLECTED_VOLUME = "collectedVolume";
|
||||
|
||||
public ArticleInCollectedVolumeBundle(final ContentItem primary) {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
Assert.exists(primary, ContentItem.class);
|
||||
|
||||
setDefaultLanguage(primary.getLanguage());
|
||||
setContentType(primary.getContentType());
|
||||
addInstance(primary);
|
||||
|
||||
setName(primary.getName());
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeBundle(final OID oid)
|
||||
throws DataObjectNotFoundException {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeBundle(final BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeBundle(final DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeBundle(final String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyProperty(final CustomCopy source,
|
||||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
final String attribute = property.getName();
|
||||
|
||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
||||
final ArticleInCollectedVolumeBundle articleBundle = (ArticleInCollectedVolumeBundle) source;
|
||||
|
||||
if (COLLECTED_VOLUME.equals(attribute)) {
|
||||
final DataCollection collectedVolumes = (DataCollection) articleBundle.get(COLLECTED_VOLUME);
|
||||
|
||||
while(collectedVolumes.next()) {
|
||||
createCollectedVolumeAssoc(collectedVolumes);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
}
|
||||
|
||||
private void createCollectedVolumeAssoc(final DataCollection collectedVolumes) {
|
||||
final CollectedVolumeBundle draftCollVol = (CollectedVolumeBundle) DomainObjectFactory.newInstance(collectedVolumes.getDataObject());
|
||||
final CollectedVolumeBundle liveCollVol = (CollectedVolumeBundle) draftCollVol.getLiveVersion();
|
||||
|
||||
if (liveCollVol != null) {
|
||||
final DataObject link = add(COLLECTED_VOLUME, liveCollVol);
|
||||
|
||||
link.set(CollectedVolumeBundle.ARTICLE_ORDER,
|
||||
collectedVolumes.get(ArticleInCollectedVolumeCollection.LINKORDER));
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public CollectedVolumeBundle getCollectedVolume() {
|
||||
final DataCollection collection = (DataCollection) get(COLLECTED_VOLUME);
|
||||
|
||||
if (collection.size() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
final DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (CollectedVolumeBundle) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCollectedVolume(final CollectedVolume collectedVolume) {
|
||||
final CollectedVolumeBundle oldCollectedVolume = getCollectedVolume();
|
||||
|
||||
if (oldCollectedVolume != null) {
|
||||
remove(COLLECTED_VOLUME, oldCollectedVolume);
|
||||
}
|
||||
|
||||
if (collectedVolume != null) {
|
||||
Assert.exists(collectedVolume, CollectedVolume.class);
|
||||
|
||||
final DataObject link = add(
|
||||
COLLECTED_VOLUME,
|
||||
collectedVolume.getCollectedVolumeBundle());
|
||||
link.set(CollectedVolumeBundle.ARTICLE_ORDER,
|
||||
Integer.valueOf((int) collectedVolume.getArticles().size()));
|
||||
link.save();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,10 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.domain.DomainCollection;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -149,6 +152,18 @@ public class ArticleInCollectedVolumeCollection extends DomainCollection {
|
|||
}
|
||||
|
||||
public ArticleInCollectedVolume getArticle() {
|
||||
return new ArticleInCollectedVolume(m_dataCollection.getDataObject());
|
||||
//return new ArticleInCollectedVolume(m_dataCollection.getDataObject());
|
||||
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (ArticleInCollectedVolume) bundle.getPrimaryInstance();
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolume getArticle(final String language) {
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (ArticleInCollectedVolume) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
|
|
|
|||
|
|
@ -68,22 +68,30 @@ public class CollectedVolume extends PublicationWithPublisher {
|
|||
set(REVIEWED, reviewed);
|
||||
}*/
|
||||
|
||||
public CollectedVolumeBundle getCollectedVolumeBundle() {
|
||||
return (CollectedVolumeBundle) getContentBundle();
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeCollection getArticles() {
|
||||
return new ArticleInCollectedVolumeCollection(
|
||||
(DataCollection) get(ARTICLES));
|
||||
//return new ArticleInCollectedVolumeCollection(
|
||||
// (DataCollection) get(ARTICLES));
|
||||
return getCollectedVolumeBundle().getArticles();
|
||||
}
|
||||
|
||||
public void addArticle(ArticleInCollectedVolume article) {
|
||||
Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
// Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
//
|
||||
// DataObject link = add(ARTICLES, article);
|
||||
//
|
||||
// link.set(ARTICLE_ORDER, Integer.valueOf((int) getArticles().size()));
|
||||
|
||||
DataObject link = add(ARTICLES, article);
|
||||
|
||||
link.set(ARTICLE_ORDER, Integer.valueOf((int) getArticles().size()));
|
||||
getCollectedVolumeBundle().addArticle(article);
|
||||
}
|
||||
|
||||
public void removeArticle(ArticleInCollectedVolume article) {
|
||||
Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
remove(ARTICLES, article);
|
||||
//Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
//remove(ARTICLES, article);
|
||||
getCollectedVolumeBundle().removeArticle(article);
|
||||
}
|
||||
|
||||
public boolean hasArticles() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.metadata.Property;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class CollectedVolumeBundle extends PublicationBundle {
|
||||
|
||||
public static final String ARTICLES = "articles";
|
||||
public static final String ARTICLE_ORDER = "articleOrder";
|
||||
|
||||
public CollectedVolumeBundle(final ContentItem primary) {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
Assert.exists(primary, ContentItem.class);
|
||||
|
||||
setDefaultLanguage(primary.getLanguage());
|
||||
setContentType(primary.getContentType());
|
||||
addInstance(primary);
|
||||
|
||||
setName(primary.getName());
|
||||
}
|
||||
|
||||
public CollectedVolumeBundle(final OID oid)
|
||||
throws DataObjectNotFoundException {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public CollectedVolumeBundle(final BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public CollectedVolumeBundle(final DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public CollectedVolumeBundle(final String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyProperty(final CustomCopy source,
|
||||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
final String attribute = property.getName();
|
||||
|
||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
||||
final CollectedVolumeBundle collVolBundle = (CollectedVolumeBundle) source;
|
||||
|
||||
if (ARTICLES.equals(attribute)) {
|
||||
final DataCollection articles = (DataCollection) collVolBundle.get(ARTICLES);
|
||||
|
||||
while(articles.next()) {
|
||||
createArticleAssoc(articles);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
}
|
||||
|
||||
private void createArticleAssoc(final DataCollection articles) {
|
||||
final ArticleInCollectedVolumeBundle draftArticle = (ArticleInCollectedVolumeBundle) DomainObjectFactory.newInstance(articles.getDataObject());
|
||||
final ArticleInCollectedVolumeBundle liveArticle = (ArticleInCollectedVolumeBundle) draftArticle.getLiveVersion();
|
||||
|
||||
if (liveArticle != null) {
|
||||
final DataObject link = add(ARTICLES, liveArticle);
|
||||
|
||||
link.set(ARTICLE_ORDER,
|
||||
articles.get(ArticleInCollectedVolumeCollection.LINKORDER));
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public ArticleInCollectedVolumeCollection getArticles() {
|
||||
return new ArticleInCollectedVolumeCollection((DataCollection) get(ARTICLES));
|
||||
}
|
||||
|
||||
public void addArticle(final ArticleInCollectedVolume article) {
|
||||
Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
|
||||
final DataObject link = add(ARTICLES,
|
||||
article.getArticleInCollectedVolumeBundle());
|
||||
|
||||
link.set(ARTICLE_ORDER, Integer.valueOf((int) getArticles().size()));
|
||||
}
|
||||
|
||||
public void removeArticle(final ArticleInCollectedVolume article) {
|
||||
Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
|
||||
remove(ARTICLES, article.getArticleInCollectedVolumeBundle());
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
|
@ -108,6 +107,8 @@ public class JournalBundle extends ContentBundle {
|
|||
final DataObject link = add(ARTICLES,
|
||||
article.getArticleInJournalBundle());
|
||||
link.set(ARTICLE_ORDER, Integer.valueOf((int) getArticles().size()));
|
||||
|
||||
link.save();
|
||||
}
|
||||
|
||||
public void removeArticle(final ArticleInJournal article) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInCollectedVolumeBundle;
|
||||
import com.arsdigita.cms.contenttypes.PublicationBundle;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ArticleInCollectedVolumeCreate extends PublicationCreate {
|
||||
|
||||
public ArticleInCollectedVolumeCreate(final ItemSelectionModel itemModel,
|
||||
final CreationSelector parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationBundle createBundle(final ContentItem primary) {
|
||||
return new ArticleInCollectedVolumeBundle(primary);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.CollectedVolumeBundle;
|
||||
import com.arsdigita.cms.contenttypes.PublicationBundle;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class CollectedVolumeCreate extends PublicationCreate {
|
||||
|
||||
public CollectedVolumeCreate(final ItemSelectionModel itemModel,
|
||||
final CreationSelector parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationBundle createBundle(final ContentItem primary) {
|
||||
return new CollectedVolumeBundle(primary);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue