Updated ArticleInCollectedVolumeImExporter to implement updated

interface
master
Jens Pelzetter 2023-01-22 10:24:22 +01:00
parent 0818ad1481
commit 643b89099f
1 changed files with 35 additions and 3 deletions

View File

@ -2,9 +2,9 @@ package org.scientificcms.publications;
import org.libreccm.imexport.Processes; import org.libreccm.imexport.Processes;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
/** /**
@ -22,9 +22,41 @@ public class ArticleInCollectedVolumeImExporter
} }
@Override @Override
@PostConstruct protected void initPublicationImExporter() {
protected void init() {
addRequiredEntities(Set.of(CollectedVolume.class)); addRequiredEntities(Set.of(CollectedVolume.class));
} }
@Override
protected void updateExistingPublication(
final ArticleInCollectedVolume existingPublication,
final ArticleInCollectedVolume withImportedPublication
) {
if (!Objects.equals(
existingPublication.getStartPage(),
withImportedPublication.getStartPage()
)) {
existingPublication.setStartPage(
withImportedPublication.getStartPage()
);
}
if (!Objects.equals(
existingPublication.getEndPage(),
withImportedPublication.getEndPage()
)) {
existingPublication.setEndPage(
withImportedPublication.getEndPage()
);
}
if (!Objects.equals(
existingPublication.getChapter(),
withImportedPublication.getChapter()
)) {
existingPublication.setChapter(
withImportedPublication.getChapter()
);
}
}
} }