Updated GreyLiteratureImExporter to implement updated interface

master
Jens Pelzetter 2023-01-22 10:41:28 +01:00
parent 3f5422375f
commit d90ad517c3
1 changed files with 20 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import org.librecms.assets.Organization;
import java.util.Set; import java.util.Set;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
/** /**
@ -23,9 +22,28 @@ public class GreyLiteratureImExporter
} }
@Override @Override
@PostConstruct
protected void initUnPublishedImExporter() { protected void initUnPublishedImExporter() {
addRequiredEntities(Set.of(Organization.class)); addRequiredEntities(Set.of(Organization.class));
} }
@Override
protected void updateExistingUnPublished(
final GreyLiterature existingPublication,
final GreyLiterature withImportedPublication
) {
if (existingPublication.getStartPage() != withImportedPublication
.getStartPage()) {
existingPublication.setStartPage(
withImportedPublication.getStartPage()
);
}
if (existingPublication.getEndPage() != withImportedPublication
.getEndPage()) {
existingPublication.setEndPage(
withImportedPublication.getEndPage()
);
}
}
} }