use of org.opencastproject.job.api.JaxbJobList in project opencast by opencast.
the class VideoEditorServiceEndpoint method processSmil.
@POST
@Path("/process-smil")
@Produces({ MediaType.APPLICATION_XML })
@RestQuery(name = "processsmil", description = "Create smil processing jobs.", returnDescription = "Smil processing jobs.", restParameters = { @RestParameter(name = "smil", type = RestParameter.Type.TEXT, description = "Smil document to process.", isRequired = true) }, reponses = { @RestResponse(description = "Smil processing jobs created successfully.", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Internal server error.", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) })
public Response processSmil(@FormParam("smil") String smilStr) {
Smil smil;
try {
smil = smilService.fromXml(smilStr).getSmil();
List<Job> jobs = videoEditorService.processSmil(smil);
return Response.ok(new JaxbJobList(jobs)).build();
} catch (Exception ex) {
return Response.serverError().entity(ex.getMessage()).build();
}
}