Korrekturen an den optimierten Assoziationen (Ticket #1193).
git-svn-id: https://svn.libreccm.org/ccm/trunk@1575 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
23bfac769b
commit
9d5c4cd3f9
|
|
@ -30,3 +30,7 @@ object type InProceedings extends Publication {
|
|||
reference key (ct_inproceedings.inproceedings_id);
|
||||
|
||||
}
|
||||
|
||||
object type InProceedingsBundle extends PublicationBundle {
|
||||
reference key (ct_inproceedings_bundles.bundle_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,30 +32,34 @@ object type Proceedings extends PublicationWithPublisher {
|
|||
reference key (ct_proceedings.proceedings_id);
|
||||
}
|
||||
|
||||
object type ProceedingsBundle extends PublicationWithPublisherBundle {
|
||||
reference key (ct_proceedings_bundles.bundle_id);
|
||||
}
|
||||
|
||||
association {
|
||||
Proceedings[0..n] proceedingOfConference = join cms_organizationalunits.organizationalunit_id
|
||||
ProceedingsBundle[0..n] proceedingOfConference = join cms_orgaunit_bundles.bundle_id
|
||||
to ct_proceedings_organizer_map.organizer_id,
|
||||
join ct_proceedings_organizer_map.proceeding_id
|
||||
to ct_proceedings.proceedings_id;
|
||||
to ct_proceedings_bundles.bundle_id;
|
||||
|
||||
GenericOrganizationalUnit[0..n] organizerOfConference = join ct_proceedings.proceedings_id
|
||||
GenericOrganizationalUnitBundle[0..n] organizerOfConference = join ct_proceedings_bundles.bundle_id
|
||||
to ct_proceedings_organizer_map.proceeding_id,
|
||||
join ct_proceedings_organizer_map.organizer_id
|
||||
to cms_organizationalunits.organizationalunit_id;
|
||||
to cms_orgaunit_bundles.bundle_id;
|
||||
|
||||
Integer[0..1] organizerOrder = ct_proceedings_organizer_map.organizer_order INTEGER;
|
||||
}
|
||||
|
||||
association {
|
||||
|
||||
Proceedings[0..n] proceedings = join ct_inproceedings.inproceedings_id
|
||||
ProceedingsBundle[0..n] proceedings = join ct_inproceedings_bundles.bundle_id
|
||||
to ct_proceedings_papers_map.paper_id,
|
||||
join ct_proceedings_papers_map.proceedings_id
|
||||
to ct_proceedings.proceedings_id;
|
||||
InProceedings[0..n] papers = join ct_proceedings.proceedings_id
|
||||
to ct_proceedings_bundles.bundle_id;
|
||||
InProceedingsBundle[0..n] papers = join ct_proceedings_bundles.bundle_id
|
||||
to ct_proceedings_papers_map.proceedings_id,
|
||||
join ct_proceedings_papers_map.paper_id
|
||||
to ct_inproceedings.inproceedings_id;
|
||||
to ct_inproceedings_bundles.bundle_id;
|
||||
|
||||
Integer[0..1] paperOrder = ct_proceedings_papers_map.paper_order INTEGER;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ association {
|
|||
join cms_organizationalunits_publications_map.orgaunit_id
|
||||
to cms_orgaunit_bundles.bundle_id;
|
||||
|
||||
Publication[0..n] publications = join cms_orgaunit_bundles.bundle_id
|
||||
PublicationBundle[0..n] publications = join cms_orgaunit_bundles.bundle_id
|
||||
to cms_organizationalunits_publications_map.orgaunit_id,
|
||||
join cms_organizationalunits_publications_map.publication_id
|
||||
to ct_publication_bundles.bundle_id;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.InProceedings"
|
||||
classname="com.arsdigita.cms.contenttypes.InProceedings">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.PublicationCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.InProceedingsCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.inProceedings_properties.title"
|
||||
|
|
|
|||
|
|
@ -6,16 +6,16 @@
|
|||
|
||||
<ctd:content-type
|
||||
label="SciPublications/Journal"
|
||||
description="Base type for articleInJournals"
|
||||
description="Base type for journals"
|
||||
objectType="com.arsdigita.cms.contenttypes.Journal"
|
||||
classname="com.arsdigita.cms.contenttypes.Journal">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.JournalCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.articleInJournal_properties.title"
|
||||
labelKey="publications.ui.journal_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
|
||||
descriptionKey="publications.ui.articleInJournal.basic_properties.description"
|
||||
descriptionKey="publications.ui.journal.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.ui.PublicationResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.JournalPropertiesStep"
|
||||
ordering="1"/>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.Proceedings"
|
||||
classname="com.arsdigita.cms.contenttypes.Proceedings">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.PublicationWithPublisherCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.ProceedingsCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.proceedings_properties.title"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.Series"
|
||||
classname="com.arsdigita.cms.contenttypes.Series">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.SeriesCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SeriesCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.series_properties.title"
|
||||
|
|
|
|||
|
|
@ -20,11 +20,8 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
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.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
|
@ -116,13 +113,23 @@ public class ArticleInCollectedVolume extends Publication {
|
|||
// return (CollectedVolume)DomainObjectFactory.newInstance(dobj);
|
||||
// }
|
||||
|
||||
return (CollectedVolume) getArticleInCollectedVolumeBundle().
|
||||
getCollectedVolume().getPrimaryInstance();
|
||||
final CollectedVolumeBundle bundle = getArticleInCollectedVolumeBundle().getCollectedVolume();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (CollectedVolume) bundle.getPrimaryInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public CollectedVolume getCollectedVolume(final String language) {
|
||||
return (CollectedVolume) getArticleInCollectedVolumeBundle().
|
||||
getCollectedVolume().getInstance(language);
|
||||
final CollectedVolumeBundle bundle = getArticleInCollectedVolumeBundle().getCollectedVolume();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (CollectedVolume) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCollectedVolume(CollectedVolume collectedVolume) {
|
||||
|
|
|
|||
|
|
@ -133,13 +133,21 @@ public class ArticleInJournal extends Publication {
|
|||
// return (Journal) DomainObjectFactory.newInstance(dobj);
|
||||
// }
|
||||
|
||||
return (Journal) getArticleInJournalBundle().getJournal().
|
||||
getPrimaryInstance();
|
||||
final JournalBundle bundle = getArticleInJournalBundle().getJournal();
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Journal) bundle.getPrimaryInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public Journal getJournal(final String language) {
|
||||
return (Journal) getArticleInJournalBundle().getJournal().getInstance(
|
||||
language);
|
||||
final JournalBundle bundle = getArticleInJournalBundle().getJournal();
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Journal) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
||||
public void setJournal(final Journal journal) {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public class ArticleInJournalBundle extends PublicationBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contentttypes.ArticleInJournalBundle";
|
||||
public static final String JOURNAL = "JOURNAL";
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.ArticleInJournalBundle";
|
||||
public static final String JOURNAL = "journal";
|
||||
|
||||
public ArticleInJournalBundle(final ContentItem primary) {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
|
|||
|
|
@ -20,10 +20,8 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,7 +8,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;
|
||||
|
|
@ -21,8 +20,10 @@ import java.math.BigDecimal;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class CollectedVolumeBundle extends PublicationBundle {
|
||||
public class CollectedVolumeBundle extends PublicationWithPublisherBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.CollectedVolumeBundle";
|
||||
public static final String ARTICLES = "articles";
|
||||
public static final String ARTICLE_ORDER = "articleOrder";
|
||||
|
||||
|
|
@ -63,12 +64,14 @@ public class CollectedVolumeBundle extends PublicationBundle {
|
|||
final String attribute = property.getName();
|
||||
|
||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
||||
final CollectedVolumeBundle collVolBundle = (CollectedVolumeBundle) source;
|
||||
final CollectedVolumeBundle collVolBundle =
|
||||
(CollectedVolumeBundle) source;
|
||||
|
||||
if (ARTICLES.equals(attribute)) {
|
||||
final DataCollection articles = (DataCollection) collVolBundle.get(ARTICLES);
|
||||
final DataCollection articles = (DataCollection) collVolBundle.
|
||||
get(ARTICLES);
|
||||
|
||||
while(articles.next()) {
|
||||
while (articles.next()) {
|
||||
createArticleAssoc(articles);
|
||||
}
|
||||
|
||||
|
|
@ -82,8 +85,12 @@ public class CollectedVolumeBundle extends PublicationBundle {
|
|||
}
|
||||
|
||||
private void createArticleAssoc(final DataCollection articles) {
|
||||
final ArticleInCollectedVolumeBundle draftArticle = (ArticleInCollectedVolumeBundle) DomainObjectFactory.newInstance(articles.getDataObject());
|
||||
final ArticleInCollectedVolumeBundle liveArticle = (ArticleInCollectedVolumeBundle) draftArticle.getLiveVersion();
|
||||
final ArticleInCollectedVolumeBundle draftArticle =
|
||||
(ArticleInCollectedVolumeBundle) DomainObjectFactory.
|
||||
newInstance(articles.getDataObject());
|
||||
final ArticleInCollectedVolumeBundle liveArticle =
|
||||
(ArticleInCollectedVolumeBundle) draftArticle.
|
||||
getLiveVersion();
|
||||
|
||||
if (liveArticle != null) {
|
||||
final DataObject link = add(ARTICLES, liveArticle);
|
||||
|
|
@ -96,7 +103,8 @@ public class CollectedVolumeBundle extends PublicationBundle {
|
|||
}
|
||||
|
||||
public ArticleInCollectedVolumeCollection getArticles() {
|
||||
return new ArticleInCollectedVolumeCollection((DataCollection) get(ARTICLES));
|
||||
return new ArticleInCollectedVolumeCollection((DataCollection) get(
|
||||
ARTICLES));
|
||||
}
|
||||
|
||||
public void addArticle(final ArticleInCollectedVolume article) {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ public class InProceedings extends Publication {
|
|||
super(type);
|
||||
}
|
||||
|
||||
public InProceedingsBundle getInProceedingsBundle() {
|
||||
return (InProceedingsBundle) getContentBundle();
|
||||
}
|
||||
|
||||
public Integer getPagesFrom() {
|
||||
return (Integer) get(PAGES_FROM);
|
||||
}
|
||||
|
|
@ -76,7 +80,7 @@ public class InProceedings extends Publication {
|
|||
}
|
||||
|
||||
public Proceedings getProceedings() {
|
||||
DataCollection collection;
|
||||
/*DataCollection collection;
|
||||
|
||||
collection = (DataCollection) get(PROCEEDINGS);
|
||||
|
||||
|
|
@ -90,11 +94,29 @@ public class InProceedings extends Publication {
|
|||
collection.close();
|
||||
|
||||
return (Proceedings) DomainObjectFactory.newInstance(dobj);
|
||||
}*/
|
||||
|
||||
final ProceedingsBundle bundle = getInProceedingsBundle().getProceedings();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Proceedings) bundle.getPrimaryInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public void setProceedings(Proceedings proceedings) {
|
||||
Proceedings oldProceedings;
|
||||
public Proceedings getProceedings(final String language) {
|
||||
final ProceedingsBundle bundle = getInProceedingsBundle().getProceedings();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Proceedings) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
||||
public void setProceedings(final Proceedings proceedings) {
|
||||
/*Proceedings oldProceedings;
|
||||
|
||||
oldProceedings = getProceedings();
|
||||
if (oldProceedings != null) {
|
||||
|
|
@ -107,6 +129,9 @@ public class InProceedings extends Publication {
|
|||
link.set(Proceedings.PAPER_ORDER,
|
||||
Integer.valueOf((int) proceedings.getPapers().size()));
|
||||
link.save();
|
||||
}
|
||||
}*/
|
||||
|
||||
getInProceedingsBundle().setProceedings(proceedings);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,134 @@
|
|||
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 InProceedingsBundle extends PublicationBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.InProceedingsBundle";
|
||||
public static final String PROCEEDINGS = "proceedings";
|
||||
|
||||
public InProceedingsBundle(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 InProceedingsBundle(final OID oid)
|
||||
throws DataObjectNotFoundException {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public InProceedingsBundle(final BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public InProceedingsBundle(final DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public InProceedingsBundle(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 InProceedingsBundle inProceedingsBundle =
|
||||
(InProceedingsBundle) source;
|
||||
|
||||
if (PROCEEDINGS.equals(attribute)) {
|
||||
final DataCollection proceedings =
|
||||
(DataCollection) inProceedingsBundle.get(
|
||||
PROCEEDINGS);
|
||||
|
||||
while (proceedings.next()) {
|
||||
createProceedingsAssoc(proceedings);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
}
|
||||
|
||||
private void createProceedingsAssoc(final DataCollection proceedings) {
|
||||
final ProceedingsBundle draftProceedings =
|
||||
(ProceedingsBundle) DomainObjectFactory.
|
||||
newInstance(proceedings.getDataObject());
|
||||
final ProceedingsBundle liveProceedings =
|
||||
(ProceedingsBundle) draftProceedings.
|
||||
getLiveVersion();
|
||||
|
||||
if (liveProceedings != null) {
|
||||
final DataObject link = add(PROCEEDINGS, liveProceedings);
|
||||
|
||||
link.set(Proceedings.PAPER_ORDER,
|
||||
proceedings.get(InProceedingsCollection.LINKORDER));
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public ProceedingsBundle getProceedings() {
|
||||
final DataCollection collection = (DataCollection) get(PROCEEDINGS);
|
||||
|
||||
if (collection.size() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
final DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (ProceedingsBundle) DomainObjectFactory.newInstance(dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setProceedings(final Proceedings proceedings) {
|
||||
final ProceedingsBundle oldProceedings = getProceedings();
|
||||
|
||||
if (oldProceedings != null) {
|
||||
remove(PROCEEDINGS, oldProceedings);
|
||||
}
|
||||
|
||||
if (proceedings != null) {
|
||||
Assert.exists(proceedings, Proceedings.class);
|
||||
|
||||
final DataObject link = add(PROCEEDINGS, proceedings.getProceedingsBundle());
|
||||
link.set(ProceedingsBundle.PAPER_ORDER,
|
||||
Integer.valueOf((int) proceedings.getPapers().size()));
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.domain.DomainCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -148,6 +150,18 @@ public class InProceedingsCollection extends DomainCollection {
|
|||
}
|
||||
|
||||
public InProceedings getPaper() {
|
||||
return new InProceedings(m_dataCollection.getDataObject());
|
||||
//return new InProceedings(m_dataCollection.getDataObject());
|
||||
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (InProceedings) bundle.getPrimaryInstance();
|
||||
}
|
||||
|
||||
public InProceedings getPaper(final String language) {
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (InProceedings) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
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;
|
||||
|
|
@ -69,8 +68,12 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
super(type);
|
||||
}
|
||||
|
||||
public ProceedingsBundle getProceedingsBundle() {
|
||||
return (ProceedingsBundle) getContentBundle();
|
||||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganizerOfConference() {
|
||||
DataCollection collection;
|
||||
/*DataCollection collection;
|
||||
|
||||
collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
||||
|
||||
|
|
@ -85,11 +88,30 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}*/
|
||||
|
||||
final GenericOrganizationalUnitBundle bundle = getProceedingsBundle().getOrganizerOfConference();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (GenericOrganizationalUnit) bundle.getPrimaryInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganizerOfConference(
|
||||
final String language) {
|
||||
final GenericOrganizationalUnitBundle bundle = getProceedingsBundle().getOrganizerOfConference();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (GenericOrganizationalUnit) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganizerOfConference(GenericOrganizationalUnit organizer) {
|
||||
GenericOrganizationalUnit oldOrga;
|
||||
/*GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganizerOfConference();
|
||||
if (oldOrga != null) {
|
||||
|
|
@ -101,7 +123,9 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
DataObject link = add(ORGANIZER_OF_CONFERENCE, organizer);
|
||||
link.set("organizerOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
} */
|
||||
|
||||
getProceedingsBundle().setOrganizerOfConference(organizer);
|
||||
}
|
||||
|
||||
public String getNameOfConference() {
|
||||
|
|
@ -137,20 +161,26 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
}
|
||||
|
||||
public InProceedingsCollection getPapers() {
|
||||
return new InProceedingsCollection((DataCollection) get(PAPERS));
|
||||
//return new InProceedingsCollection((DataCollection) get(PAPERS));
|
||||
|
||||
return getProceedingsBundle().getPapers();
|
||||
}
|
||||
|
||||
public void addPaper(InProceedings paper) {
|
||||
Assert.exists(paper, InProceedings.class);
|
||||
/*Assert.exists(paper, InProceedings.class);
|
||||
|
||||
DataObject link = add(PAPERS, paper);
|
||||
|
||||
link.set(PAPER_ORDER, Integer.valueOf((int) getPapers().size()));
|
||||
link.set(PAPER_ORDER, Integer.valueOf((int) getPapers().size()));*/
|
||||
|
||||
getProceedingsBundle().addPaper(paper);
|
||||
}
|
||||
|
||||
public void removePaper(InProceedings paper) {
|
||||
Assert.exists(paper, InProceedings.class);
|
||||
remove(PAPERS, paper);
|
||||
/*Assert.exists(paper, InProceedings.class);
|
||||
remove(PAPERS, paper);*/
|
||||
|
||||
getProceedingsBundle().removePaper(paper);
|
||||
}
|
||||
|
||||
public boolean hasPapers() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,229 @@
|
|||
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 ProceedingsBundle extends PublicationWithPublisherBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.ProceedingsBundle";
|
||||
public static final String ORGANIZER_OF_CONFERENCE = "organizerOfConference";
|
||||
public static final String PAPERS = "papers";
|
||||
public static final String PAPER_ORDER = "paperOrder";
|
||||
|
||||
public ProceedingsBundle(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 ProceedingsBundle(final OID oid) throws DataObjectNotFoundException {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public ProceedingsBundle(final BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public ProceedingsBundle(final DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public ProceedingsBundle(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 ProceedingsBundle proceedingsBundle =
|
||||
(ProceedingsBundle) source;
|
||||
|
||||
if (PAPERS.equals(attribute)) {
|
||||
final DataCollection papers =
|
||||
(DataCollection) proceedingsBundle.get(
|
||||
PAPERS);
|
||||
|
||||
while (papers.next()) {
|
||||
createPaperAssoc(papers);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (ORGANIZER_OF_CONFERENCE.equals(attribute)) {
|
||||
final DataCollection organizers =
|
||||
(DataCollection) proceedingsBundle.get(
|
||||
ORGANIZER_OF_CONFERENCE);
|
||||
|
||||
while (organizers.next()) {
|
||||
createOrganizerAssoc(organizers);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
} else {
|
||||
return super.copyProperty(source, property, copier);
|
||||
}
|
||||
}
|
||||
|
||||
private void createPaperAssoc(final DataCollection papers) {
|
||||
final InProceedingsBundle draftPaper =
|
||||
(InProceedingsBundle) DomainObjectFactory.
|
||||
newInstance(papers.getDataObject());
|
||||
final InProceedingsBundle livePaper = (InProceedingsBundle) draftPaper.
|
||||
getLiveVersion();
|
||||
|
||||
if (livePaper != null) {
|
||||
final DataObject link = add(PAPERS, livePaper);
|
||||
|
||||
link.set(PAPER_ORDER, papers.get(InProceedingsCollection.LINKORDER));
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
private void createOrganizerAssoc(final DataCollection organizers) {
|
||||
final GenericOrganizationalUnitBundle draftOrganizer =
|
||||
(GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||
newInstance(organizers.getDataObject());
|
||||
final GenericOrganizationalUnitBundle liveOrganizer =
|
||||
(GenericOrganizationalUnitBundle) draftOrganizer.
|
||||
getLiveVersion();
|
||||
|
||||
if (liveOrganizer != null) {
|
||||
final DataObject link = add(ORGANIZER_OF_CONFERENCE, liveOrganizer);
|
||||
|
||||
link.set("organizerOrder", 1);
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyReverseProperty(final CustomCopy source,
|
||||
final ContentItem liveItem,
|
||||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
final String attribute = property.getName();
|
||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
||||
if (("proceedingsOfConference".equals(attribute))
|
||||
&& (source instanceof GenericOrganizationalUnitBundle)) {
|
||||
final GenericOrganizationalUnitBundle orgaunitBundle =
|
||||
(GenericOrganizationalUnitBundle) source;
|
||||
final DataCollection proceedings =
|
||||
(DataCollection) orgaunitBundle.get(
|
||||
"proceedingsOfConference");
|
||||
|
||||
while (proceedings.next()) {
|
||||
createProceedingsAssoc(proceedings,
|
||||
(GenericOrganizationalUnitBundle) liveItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return super.copyReverseProperty(source,
|
||||
liveItem,
|
||||
property,
|
||||
copier);
|
||||
}
|
||||
} else {
|
||||
return super.copyReverseProperty(source, liveItem, property, copier);
|
||||
}
|
||||
}
|
||||
|
||||
private void createProceedingsAssoc(
|
||||
final DataCollection proceedings,
|
||||
final GenericOrganizationalUnitBundle orgaunit) {
|
||||
final ProceedingsBundle draftProceedigns = (ProceedingsBundle) DomainObjectFactory.newInstance(proceedings.getDataObject());
|
||||
final ProceedingsBundle liveProceedings = (ProceedingsBundle) draftProceedigns.getLiveVersion();
|
||||
|
||||
if (liveProceedings != null) {
|
||||
final DataObject link = orgaunit.add("proceedingsOfConference", liveProceedings);
|
||||
|
||||
link.set("organizerOrder", 1);
|
||||
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
|
||||
public InProceedingsCollection getPapers() {
|
||||
return new InProceedingsCollection((DataCollection) get(PAPERS));
|
||||
}
|
||||
|
||||
public void addPaper(final InProceedings paper) {
|
||||
Assert.exists(paper, InProceedings.class);
|
||||
|
||||
final DataObject link = add(PAPERS, paper.getInProceedingsBundle());
|
||||
|
||||
link.set(PAPER_ORDER, Integer.valueOf((int) getPapers().size()));
|
||||
|
||||
link.save();
|
||||
}
|
||||
|
||||
public void removePaper(final InProceedings paper) {
|
||||
Assert.exists(paper, InProceedings.class);
|
||||
|
||||
remove(PAPERS, paper);
|
||||
}
|
||||
|
||||
public GenericOrganizationalUnitBundle getOrganizerOfConference() {
|
||||
DataCollection collection;
|
||||
|
||||
collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
||||
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnitBundle) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrganizerOfConference(GenericOrganizationalUnit organizer) {
|
||||
final GenericOrganizationalUnitBundle oldOrga = getOrganizerOfConference();
|
||||
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZER_OF_CONFERENCE, oldOrga);
|
||||
}
|
||||
|
||||
if (null != organizer) {
|
||||
Assert.exists(organizer, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZER_OF_CONFERENCE,
|
||||
organizer.getGenericOrganizationalUnitBundle());
|
||||
link.set("organizerOrder", 1);
|
||||
link.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -255,19 +255,23 @@ public class Publication extends ContentPage {
|
|||
}
|
||||
|
||||
public SeriesCollection getSeries() {
|
||||
return new SeriesCollection((DataCollection) get(SERIES));
|
||||
//return new SeriesCollection((DataCollection) get(SERIES));
|
||||
return getPublicationBundle().getSeries();
|
||||
}
|
||||
|
||||
public void addSeries(final Series series) {
|
||||
Assert.exists(series, Series.class);
|
||||
//Assert.exists(series, Series.class);
|
||||
|
||||
add(SERIES, series);
|
||||
//add(SERIES, series);
|
||||
getPublicationBundle().addSeries(series);
|
||||
}
|
||||
|
||||
public void removeSeries(final Series series) {
|
||||
Assert.exists(series, Series.class);
|
||||
//Assert.exists(series, Series.class);
|
||||
|
||||
remove(SERIES, series);
|
||||
//remove(SERIES, series);
|
||||
|
||||
getPublicationBundle().removeSeries(series);
|
||||
}
|
||||
|
||||
public boolean hasSeries() {
|
||||
|
|
|
|||
|
|
@ -23,13 +23,14 @@ import java.math.BigDecimal;
|
|||
public class PublicationBundle extends ContentBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentttypes.PublicationBundle";
|
||||
"com.arsdigita.cms.contenttypes.PublicationBundle";
|
||||
public static final String AUTHORS = "authors";
|
||||
public final static String AUTHOR_ORDER = "authorOrder";
|
||||
public final static String EDITOR = "editor";
|
||||
public final static String ORGAUNITS = "orgaunits";
|
||||
public final static String ORGAUNIT_ORDER = "publicationOrder";
|
||||
public final static String ORGAUNIT_PUBLICATIONS = "publications";
|
||||
public final static String SERIES = "series";
|
||||
|
||||
public PublicationBundle(final ContentItem primary) {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -318,4 +319,20 @@ public class PublicationBundle extends ContentBundle {
|
|||
|
||||
orgaunitBundle.remove(ORGAUNIT_PUBLICATIONS, publication);
|
||||
}
|
||||
|
||||
public SeriesCollection getSeries() {
|
||||
return new SeriesCollection((DataCollection) get(SERIES));
|
||||
}
|
||||
|
||||
public void addSeries(final Series series) {
|
||||
Assert.exists(series, Series.class);
|
||||
|
||||
add(SERIES, series.getSeriesBundle());
|
||||
}
|
||||
|
||||
public void removeSeries(final Series series) {
|
||||
Assert.exists(series, Series.class);
|
||||
|
||||
remove(SERIES, series.getSeriesBundle());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class PublicationGenericOrganizationalsUnitCollection
|
|||
final DataCollection dataCollection) {
|
||||
super(dataCollection);
|
||||
|
||||
addOrder("title");
|
||||
addOrder("name");
|
||||
}
|
||||
|
||||
public GenericOrganizationalUnit getOrganizationalUnit() {
|
||||
|
|
@ -44,10 +44,10 @@ public class PublicationGenericOrganizationalsUnitCollection
|
|||
return getOrganizationalUnit().getTitle();
|
||||
}
|
||||
|
||||
public String getAddendum() {
|
||||
/*public String getAddendum() {
|
||||
return (String) m_dataCollection.getDataObject().get(
|
||||
GenericOrganizationalUnit.ADDENDUM);
|
||||
}
|
||||
}*/
|
||||
|
||||
/*public GenericOrganizationalUnitContactCollection getContacts() {
|
||||
return new GenericOrganizationalUnitContactCollection(
|
||||
|
|
|
|||
|
|
@ -20,11 +20,8 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
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.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -160,13 +157,23 @@ public class PublicationWithPublisher extends Publication {
|
|||
// return (Publisher) DomainObjectFactory.newInstance(dobj);
|
||||
// }
|
||||
|
||||
return (Publisher) getPublicationWithPublisherBundle().getPublisher().
|
||||
getPrimaryInstance();
|
||||
final PublisherBundle bundle = getPublicationWithPublisherBundle().
|
||||
getPublisher();
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Publisher) bundle.getPrimaryInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public Publisher getPublisher(final String language) {
|
||||
return (Publisher) getPublicationWithPublisherBundle().getPublisher().
|
||||
getInstance(language);
|
||||
final PublisherBundle bundle = getPublicationWithPublisherBundle().
|
||||
getPublisher();
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Publisher) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.math.BigDecimal;
|
|||
public class PublicationWithPublisherBundle extends PublicationBundle {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentttypes.PublicationWithPublisherBundle";
|
||||
"com.arsdigita.cms.contenttypes.PublicationWithPublisherBundle";
|
||||
public static final String PUBLISHER = "publisher";
|
||||
public static final String PUBLISHER_ORDER = "publisherOrder";
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.domain.DomainCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
|
||||
/**
|
||||
|
|
@ -33,7 +35,16 @@ public class SeriesCollection extends DomainCollection {
|
|||
}
|
||||
|
||||
public Series getSeries() {
|
||||
return new Series(m_dataCollection.getDataObject());
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (Series) bundle.getPrimaryInstance();
|
||||
}
|
||||
|
||||
public Series getSeries(final String language) {
|
||||
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||
newInstance(m_dataCollection.getDataObject());
|
||||
|
||||
return (Series) bundle.getInstance(language);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,14 +200,12 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet
|
|||
ContentSection section =
|
||||
CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link = new Link(
|
||||
String.format("%s (%s)",
|
||||
value.toString(),
|
||||
collectedVolume.getLanguage()),
|
||||
Link link = new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
collectedVolume,
|
||||
section,
|
||||
collectedVolume.getVersion()));
|
||||
collectedVolume.
|
||||
getVersion()));
|
||||
return link;
|
||||
} else {
|
||||
CollectedVolume collectedVolume;
|
||||
|
|
@ -217,10 +215,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
collectedVolume.
|
||||
getLanguage()));
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,8 +167,7 @@ public class ArticleInJournalJournalSheet
|
|||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||
ArticleInJournal article = (ArticleInJournal) itemModel.
|
||||
getSelectedObject(state);
|
||||
|
||||
|
|
@ -187,9 +186,7 @@ public class ArticleInJournalJournalSheet
|
|||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link =
|
||||
new Link(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
journal.getLanguage()),
|
||||
new Link(journal.getTitle(),
|
||||
resolver.generateItemURL(state,
|
||||
journal,
|
||||
section,
|
||||
|
|
@ -204,9 +201,7 @@ public class ArticleInJournalJournalSheet
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
journal.getLanguage()));
|
||||
Label label = new Label(journal.getTitle());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,9 +216,7 @@ public class CollectedVolumeArticlesTable
|
|||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link =
|
||||
new Link(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
article.getLanguage()),
|
||||
new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
article,
|
||||
section,
|
||||
|
|
@ -236,9 +234,7 @@ public class CollectedVolumeArticlesTable
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
article.getLanguage()));
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.InProceedingsBundle;
|
||||
import com.arsdigita.cms.contenttypes.PublicationBundle;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class InProceedingsCreate extends PublicationCreate {
|
||||
|
||||
public InProceedingsCreate(final ItemSelectionModel itemModel,
|
||||
final CreationSelector parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationBundle createBundle(final ContentItem primary) {
|
||||
return new InProceedingsBundle(primary);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ public class JournalCreate extends PageCreate {
|
|||
final ContentPage item = createContentPage(state);
|
||||
item.setLanguage((String) data.get(LANGUAGE));
|
||||
item.setName((String) data.get(NAME));
|
||||
item.setTitle((String) data.get(TITLE));
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
item.setLaunchDate((Date) data.get(LAUNCH_DATE));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,43 +21,94 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SegmentedPanel;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Journal;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import java.text.DateFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class JournalPropertiesStep extends PublicationPropertiesStep {
|
||||
public class JournalPropertiesStep extends SimpleEditStep {
|
||||
|
||||
public static final String EDIT_SHEET_NAME = "editJournal";
|
||||
private SegmentedPanel segmentedPanel;
|
||||
|
||||
public JournalPropertiesStep(
|
||||
ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
segmentedPanel = new SegmentedPanel();
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
|
||||
addBasicProperties(itemModel, parent);
|
||||
addSteps(itemModel, parent);
|
||||
|
||||
setDisplayComponent(segmentedPanel);
|
||||
|
||||
}
|
||||
|
||||
public static Component getJournalPropertySheet(
|
||||
ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) PublicationPropertiesStep.
|
||||
getPublicationPropertySheet(itemModel);
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.name"),
|
||||
Publication.NAME);
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.title"),
|
||||
Publication.TITLE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.issn"),
|
||||
Journal.ISSN);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.firstYearOfPublication"),
|
||||
Journal.FIRST_YEAR);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.lastYearOfPublication"),
|
||||
Journal.LAST_YEAR);
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
ContentPage page = (ContentPage) item;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).
|
||||
format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addBasicProperties(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
|
|
@ -69,7 +120,7 @@ public class JournalPropertiesStep extends PublicationPropertiesStep {
|
|||
|
||||
basicProperties.add(EDIT_SHEET_NAME,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collected_volume.edit_basic_sheet").localize(),
|
||||
"publications.ui.journal.edit_basic_sheet").localize(),
|
||||
new WorkflowLockedComponentAccess(editBasicSheet,
|
||||
itemModel),
|
||||
editBasicSheet.getSaveCancelSection().
|
||||
|
|
@ -84,12 +135,20 @@ public class JournalPropertiesStep extends PublicationPropertiesStep {
|
|||
basicProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SegmentedPanel getSegmentedPanel() {
|
||||
return segmentedPanel;
|
||||
}
|
||||
|
||||
protected void addSteps(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super.addSteps(itemModel, parent);
|
||||
|
||||
addStep(new JournalArticlesStep(itemModel, parent),
|
||||
"publications.ui.journal.articles");
|
||||
}
|
||||
|
||||
protected void addStep(SimpleEditStep step, String labelKey) {
|
||||
segmentedPanel.addSegment(
|
||||
new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
labelKey).localize()),
|
||||
step);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.arsdigita.bebop.parameters.ParameterModel;
|
|||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Journal;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +43,7 @@ import org.apache.log4j.Logger;
|
|||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class JournalPropertyForm
|
||||
extends PublicationPropertyForm
|
||||
extends BasicPageForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
|
@ -58,7 +59,7 @@ public class JournalPropertyForm
|
|||
|
||||
public JournalPropertyForm(ItemSelectionModel itemModel,
|
||||
JournalPropertiesStep step) {
|
||||
super(itemModel, step);
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
|
@ -101,7 +102,14 @@ public class JournalPropertyForm
|
|||
});
|
||||
add(issn);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize("publications.ui.journal.lastYearOfPublication").localize()));
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.firstYearOfPublication").localize()));
|
||||
ParameterModel firstYearParam = new IntegerParameter(Journal.FIRST_YEAR);
|
||||
TextField firstYear = new TextField(firstYearParam);
|
||||
add(firstYear);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.lastYearOfPublication").localize()));
|
||||
ParameterModel lastYearParam = new IntegerParameter(Journal.LAST_YEAR);
|
||||
TextField lastYear = new TextField(lastYearParam);
|
||||
add(lastYear);
|
||||
|
|
@ -109,21 +117,18 @@ public class JournalPropertyForm
|
|||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
super.init(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Journal journal = (Journal) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(Journal.ISSN, journal.getISSN());
|
||||
data.put(Journal.FIRST_YEAR, journal.getFirstYear());
|
||||
data.put(Journal.LAST_YEAR, journal.getLastYear());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
super.process(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Journal journal = (Journal) super.initBasicWidgets(fse);
|
||||
Journal journal = (Journal) super.processBasicWidgets(fse);
|
||||
|
||||
if ((journal != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
|
|
@ -132,10 +137,21 @@ public class JournalPropertyForm
|
|||
issn = issn.replace("-", "");
|
||||
journal.setISSN(issn);
|
||||
|
||||
Integer firstYear = (Integer) data.get(Journal.FIRST_YEAR);
|
||||
journal.setFirstYear(firstYear);
|
||||
|
||||
Integer lastYear = (Integer) data.get(Journal.LAST_YEAR);
|
||||
journal.setLastYear(lastYear);
|
||||
|
||||
journal.save();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if ((m_step != null) && getSaveCancelSection().getCancelButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.ProceedingsBundle;
|
||||
import com.arsdigita.cms.contenttypes.PublicationBundle;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ProceedingsCreate extends PublicationWithPublisherCreate {
|
||||
|
||||
public ProceedingsCreate(final ItemSelectionModel itemModel,
|
||||
final CreationSelector parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationBundle createBundle(final ContentItem primary) {
|
||||
return new ProceedingsBundle(primary);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ public class ProceedingsOrganizerSheet
|
|||
int row,
|
||||
int column) {
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
CMS.getSecurityManager(state);
|
||||
Proceedings proceedings = (Proceedings) itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
|
|
@ -168,9 +168,7 @@ public class ProceedingsOrganizerSheet
|
|||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link =
|
||||
new Link(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
organizer.getLanguage()),
|
||||
new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
organizer,
|
||||
section,
|
||||
|
|
@ -186,10 +184,7 @@ public class ProceedingsOrganizerSheet
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(
|
||||
String.format("%s (%s)",
|
||||
value.toString(),
|
||||
organizer.getLanguage()));
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,9 +245,7 @@ public class PublicationAuthorsTable
|
|||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link =
|
||||
new Link(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
author.getLanguage()),
|
||||
new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
author,
|
||||
section,
|
||||
|
|
@ -265,9 +263,7 @@ public class PublicationAuthorsTable
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
author.getLanguage()));
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ import com.arsdigita.bebop.event.FormSubmissionListener;
|
|||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
|
|
|
|||
|
|
@ -385,3 +385,7 @@ genericorganizationalunit.ui.publication.select=Select publication to add
|
|||
publications.ui.orgaunits.columns.remove=Remove
|
||||
genericorganizationalunit.ui.publications.columns.name=Title of the publication
|
||||
genericorganizationalunit.ui.publications.columns.remove=Remove
|
||||
publication.ui.series.volumes.remove=Remove volume
|
||||
publications.ui.journal.firstYearOfPublication=First year of publication
|
||||
publications.ui.journal.edit_basic_sheet\ =Basic properties
|
||||
publications.ui.journal.edit_basic_sheet=Edit basic properties
|
||||
|
|
|
|||
|
|
@ -384,3 +384,7 @@ genericorganizationalunit.ui.publication.select=Publikation zum hinzuf\u00fcgen
|
|||
publications.ui.orgaunits.columns.remove=Entfernen
|
||||
genericorganizationalunit.ui.publications.columns.name=Titel der Publikation
|
||||
genericorganizationalunit.ui.publications.columns.remove=Entfernen
|
||||
publication.ui.series.volumes.remove=Band entfernen
|
||||
publications.ui.journal.firstYearOfPublication=Erstes Erscheinungsjahr
|
||||
publications.ui.journal.edit_basic_sheet\ =Basiseigenschaften
|
||||
publications.ui.journal.edit_basic_sheet=Basiseigenschaften bearbeiten
|
||||
|
|
|
|||
|
|
@ -174,9 +174,7 @@ public class PublicationWithPublisherSetPublisherSheet
|
|||
ContentSection section = CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
Link link =
|
||||
new Link(String.format("%s (%s)",
|
||||
value.toString(),
|
||||
publisher.getLanguage()),
|
||||
new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
publisher,
|
||||
section,
|
||||
|
|
@ -192,10 +190,7 @@ public class PublicationWithPublisherSetPublisherSheet
|
|||
return new Label(value.toString());
|
||||
}
|
||||
|
||||
Label label = new Label(
|
||||
String.format("%s (%s)",
|
||||
value.toString(),
|
||||
publisher.getLanguage()));
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue