Updated ArticleInJournalImExporter to implement updated interface
parent
643b89099f
commit
92299fb9b0
|
|
@ -2,9 +2,9 @@ package org.scientificcms.publications;
|
|||
|
||||
import org.libreccm.imexport.Processes;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -22,9 +22,55 @@ public class ArticleInJournalImExporter
|
|||
}
|
||||
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
protected void initPublicationImExporter() {
|
||||
addRequiredEntities(Set.of(Journal.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateExistingPublication(
|
||||
final ArticleInJournal existingPublication,
|
||||
final ArticleInJournal withImportedPublication
|
||||
) {
|
||||
if (!Objects.equals(
|
||||
existingPublication.getVolume(),
|
||||
withImportedPublication.getVolume()
|
||||
)) {
|
||||
existingPublication.setVolume(withImportedPublication.getVolume());
|
||||
}
|
||||
|
||||
if (!Objects.equals(
|
||||
existingPublication.getIssue(),
|
||||
withImportedPublication.getIssue()
|
||||
)) {
|
||||
existingPublication.setIssue(withImportedPublication.getIssue());
|
||||
}
|
||||
|
||||
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.getPublicationDate(),
|
||||
withImportedPublication.getPublicationDate()
|
||||
)) {
|
||||
existingPublication.setPublicationDate(
|
||||
withImportedPublication.getPublicationDate()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue