Some fixes for ImExporters
parent
4d9704f8ac
commit
bc1d774d96
|
|
@ -2,6 +2,8 @@ package org.scientificcms.publications;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -11,6 +13,7 @@ import java.util.Set;
|
|||
public abstract class AbstractPublicationWithPublisherImExporter<T extends PublicationWithPublisher>
|
||||
extends AbstractPublicationImExporter<T> {
|
||||
|
||||
@PostConstruct
|
||||
@Override
|
||||
protected final void init() {
|
||||
addRequiredEntities(
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import org.librecms.assets.Organization;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -12,6 +14,7 @@ import java.util.Set;
|
|||
public abstract class AbstractUnPublishedImExporter<T extends UnPublished>
|
||||
extends AbstractPublicationImExporter<T> {
|
||||
|
||||
@PostConstruct
|
||||
@Override
|
||||
protected final void init() {
|
||||
addRequiredEntities(
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = ArticleInCollectedVolumeIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = ArticleInCollectedVolume.class
|
||||
)
|
||||
public class ArticleInCollectedVolume extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = ArticleInCollectedVolumeIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = ArticleInJournal.class
|
||||
)
|
||||
public class ArticleInJournal extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@Audited
|
||||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Authorship.class
|
||||
)
|
||||
public class Authorship
|
||||
implements Exportable, Serializable, Comparable<Authorship> {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = CollectedVolumeIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = CollectedVolume.class
|
||||
)
|
||||
public class CollectedVolume extends PublicationWithPublisher {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = ExpertiseIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Expertise.class
|
||||
)
|
||||
public class Expertise extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = GreyLiteratureIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = GreyLiterature.class
|
||||
)
|
||||
public class GreyLiterature extends UnPublished {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = InProceedingsIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = InProceedings.class
|
||||
)
|
||||
public class InProceedings extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = InternetArticleIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = InternetArticle.class
|
||||
)
|
||||
public class InternetArticle extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = JournalIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Journal.class
|
||||
)
|
||||
public class Journal implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = MonographIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Monograph.class
|
||||
)
|
||||
public class Monograph extends PublicationWithPublisher {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = ProceedingsIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Proceedings.class
|
||||
)
|
||||
public class Proceedings extends PublicationWithPublisher {
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = PublicationIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Publication.class
|
||||
)
|
||||
public class Publication implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class PublicationIdResolver implements Serializable, ObjectIdResolver {
|
|||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No Publiation with UUID %s found in database.",
|
||||
"No Publication with UUID %s found in database.",
|
||||
id.key.toString()
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = PublicationWithPublisherIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = PublicationWithPublisher.class
|
||||
)
|
||||
public class PublicationWithPublisher extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = PublisherIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Publisher.class
|
||||
)
|
||||
public class Publisher implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class PublisherIdResolver implements Serializable, ObjectIdResolver {
|
|||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No Pubisher with UUID %s found in the database.",
|
||||
"No Publisher with UUID %s found in the database.",
|
||||
id.key.toString()
|
||||
)
|
||||
)
|
||||
|
|
@ -43,12 +43,12 @@ public class PublisherIdResolver implements Serializable, ObjectIdResolver {
|
|||
|
||||
@Override
|
||||
public ObjectIdResolver newForDeserialization(final Object context) {
|
||||
return new PublicationIdResolver();
|
||||
return new PublisherIdResolver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseFor(final ObjectIdResolver resolverType) {
|
||||
return resolverType instanceof PublicationIdResolver;
|
||||
return resolverType instanceof PublisherIdResolver;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = SeriesIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Series.class
|
||||
)
|
||||
public class Series implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = TalkIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Talk.class
|
||||
)
|
||||
public class Talk extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = UnPublishedIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = UnPublished.class
|
||||
)
|
||||
public class UnPublished extends Publication {
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@Audited
|
||||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = VolumeInSeries.class
|
||||
)
|
||||
public class VolumeInSeries implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = WorkingPaperIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = WorkingPaper.class
|
||||
)
|
||||
public class WorkingPaper extends UnPublished {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package org.scientificcms.publications.assets;
|
|||
import org.libreccm.imexport.AbstractEntityImExporter;
|
||||
import org.libreccm.imexport.Processes;
|
||||
import org.librecms.contentsection.AssetRepository;
|
||||
import org.scientificcms.publications.Publisher;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
|
@ -26,7 +28,7 @@ public class PublisherAssetImExporter
|
|||
@PostConstruct
|
||||
@Override
|
||||
protected void init() {
|
||||
// Nothing
|
||||
addRequiredEntities(Set.of(Publisher.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ import static org.scientificcms.contenttypes.scidepartment.SciDepartmentConstant
|
|||
@Table(name = "DEPARTMENT_MEMBERSHIPS", schema = DB_SCHEMA)
|
||||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Membership.class
|
||||
)
|
||||
public class Membership implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ import static org.scientificcms.contenttypes.scidepartment.SciDepartmentConstant
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = SciDepartmentIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = SciDepartment.class
|
||||
)
|
||||
public class SciDepartment extends ContentItem implements Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import static org.scientificcms.contenttypes.sciproject.SciProjectConstants.*;
|
|||
@Table(name = "PROJECT_MEMBERSHIPS", schema = DB_SCHEMA)
|
||||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = Membership.class
|
||||
)
|
||||
public class Membership implements Exportable, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ import static org.scientificcms.contenttypes.sciproject.SciProjectConstants.*;
|
|||
@JsonIdentityInfo(
|
||||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
resolver = SciProjectIdResolver.class,
|
||||
property = "uuid"
|
||||
property = "uuid",
|
||||
scope = SciProject.class
|
||||
)
|
||||
public class SciProject extends ContentItem implements Serializable {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue