3137 Anpassade SciPro till den nya xsd:n för Daisys API.
This commit is contained in:
parent
779c6922c9
commit
e861c0dce4
core/src/main/xsd
daisy-integration/src/main/java/se/su/dsv/scipro
@ -833,9 +833,9 @@
|
||||
|
||||
<xs:enumeration value="OPPONENT"/>
|
||||
|
||||
<xs:enumeration value="EXAMINER"/>
|
||||
<xs:enumeration value="REVIEWER"/>
|
||||
|
||||
<xs:enumeration value="ACTIVE_PARTICIPATION"/>
|
||||
<xs:enumeration value="ACTIVE_PARTICIPANT"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
|
@ -135,7 +135,7 @@ public class ProjectExporter extends AbstractWorker {
|
||||
}
|
||||
|
||||
private void updateParticipants(final Integer projectId, final Stream<User> participants) {
|
||||
updateParticipations(projectId, participants, Role.ACTIVE_PARTICIPATION);
|
||||
updateParticipations(projectId, participants, Role.ACTIVE_PARTICIPANT);
|
||||
}
|
||||
|
||||
private void updateParticipations(final Integer projectId, final Stream<User> users, final Role role) {
|
||||
@ -259,14 +259,14 @@ public class ProjectExporter extends AbstractWorker {
|
||||
private void updateReviewers(Project project) throws ExternalExportException {
|
||||
Set<ProjectParticipant> contributors = daisyAPI.getContributors(project.getIdentifier());
|
||||
for (ProjectParticipant contributor : contributors) {
|
||||
if (contributor.getRole() == Role.EXAMINER &&
|
||||
if (contributor.getRole() == Role.REVIEWER &&
|
||||
reviewerIsRemoved(contributor.getPerson().getId(), project.getReviewers())) {
|
||||
daisyAPI.deleteThesisPerson(project.getIdentifier(), contributor.getPerson().getId());
|
||||
}
|
||||
}
|
||||
for (User reviewer : project.getReviewers()) {
|
||||
if (reviewerIsMissing(reviewer, contributors)) {
|
||||
externalExporter.addContributorToProject(project, reviewer, Role.EXAMINER);
|
||||
externalExporter.addContributorToProject(project, reviewer, Role.REVIEWER);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -282,7 +282,7 @@ public class ProjectExporter extends AbstractWorker {
|
||||
|
||||
private boolean reviewerIsMissing(User reviewer, Iterable<ProjectParticipant> contributors) {
|
||||
for (ProjectParticipant contributor : contributors) {
|
||||
if (contributor.getRole() == Role.EXAMINER && contributor.getPerson().getId().equals(reviewer.getIdentifier())) {
|
||||
if (contributor.getRole() == Role.REVIEWER && contributor.getPerson().getId().equals(reviewer.getIdentifier())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ExporterFacade {
|
||||
exporter.addContributorToProject(project, project.getHeadSupervisor(), Role.SUPERVISOR);
|
||||
|
||||
for (User user : project.getReviewers()) {
|
||||
exporter.addContributorToProject(project, user, Role.EXAMINER);
|
||||
exporter.addContributorToProject(project, user, Role.REVIEWER);
|
||||
}
|
||||
} catch (ExternalExportException eee) {
|
||||
exporter.deleteProject(project);
|
||||
|
Loading…
x
Reference in New Issue
Block a user