예제 #1
0
 private String buildLifecycleXml(List<Process> procs, String druid) {
   StringBuilder xml = new StringBuilder("<lifecycle objectId=\"" + druid + "\">\n");
   for (Process p : procs) {
     xml.append("  <milestone date=\"")
         .append(DateAdapter.STANDARD_DATE_FORMAT.format(p.getDatetime()))
         .append("\">")
         .append(p.getLifecycle())
         .append("</milestone>\n");
   }
   xml.append("</lifecycle>\n");
   return xml.toString();
 }
예제 #2
0
 @PUT
 @Path("{repo}/objects/{druid}/workflows/{workflow}/{procName}")
 @Consumes("application/xml")
 public Response addUpdateProcessStep(
     @PathParam("repo") String repo,
     @PathParam("druid") String druid,
     @PathParam("workflow") String workflow,
     @PathParam("procName") String procName,
     Process p) {
   if (!p.getName().equals(procName)) {
     return Response.status(400).entity("Process name does not match URI").build();
   }
   try {
     p.setDruid(druid);
     p.setDatastream(workflow);
     p.setRepository(repo);
     wfService.persist(p, repo);
   } catch (Exception e) {
     return ResourceUtilities.createErrorResponse(e, logger);
   }
   return Response.noContent().build();
 }