Skip to content

Commit

Permalink
Added JobUserDetails to createJob
Browse files Browse the repository at this point in the history
  • Loading branch information
João Gomes committed May 17, 2022
1 parent de04447 commit dffdce1
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.roda.core.data.v2.index.sublist.Sublist;
import org.roda.core.data.v2.jobs.IndexedReport;
import org.roda.core.data.v2.jobs.Job;
import org.roda.core.data.v2.jobs.JobUserDetails;
import org.roda.core.data.v2.jobs.PluginState;
import org.roda.core.data.v2.jobs.Reports;
import org.roda.core.data.v2.user.User;
Expand Down Expand Up @@ -71,6 +72,14 @@ protected static void validateAndSetJobInformation(User user, Job job) throws Re
job.setName(job.getId());
}
job.setUsername(user.getName());

// Set the JobUserDetails in Job creation
JobUserDetails jobUserDetails = new JobUserDetails();
jobUserDetails.setUsername(user.getName());
jobUserDetails.setEmail(user.getEmail());
jobUserDetails.setFullname(user.getFullName());
jobUserDetails.setRole(RodaConstants.PreservationAgentRole.EXECUTING_PROGRAM.toString());
job.getJobUsersDetails().add(jobUserDetails);
}

protected static void validateJobInformation(User user, Job job)
Expand Down

0 comments on commit dffdce1

Please sign in to comment.