Search in sources :

Example 1 with JaxbJobList

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();
    }
}
Also used : Smil(org.opencastproject.smil.entity.api.Smil) Job(org.opencastproject.job.api.Job) JaxbJobList(org.opencastproject.job.api.JaxbJobList) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces) RestQuery(org.opencastproject.util.doc.rest.RestQuery)

Aggregations

POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 JaxbJobList (org.opencastproject.job.api.JaxbJobList)1 Job (org.opencastproject.job.api.Job)1 Smil (org.opencastproject.smil.entity.api.Smil)1 RestQuery (org.opencastproject.util.doc.rest.RestQuery)1