Class AnnotationRestService
java.lang.Object
org.opencastproject.annotation.impl.AnnotationRestService
The REST endpoint for the annotation service.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) The method that is called, when the service is activatedjavax.ws.rs.core.Responseadd(String mediapackageId, int inpoint, int outpoint, String type, String value, boolean isPrivate, javax.servlet.http.HttpServletRequest request) javax.ws.rs.core.ResponsegetAnnotationAsJson(String idAsString) getAnnotationAsXml(String idAsString) javax.ws.rs.core.ResponsegetAnnotationsAsJson(String id, String type, String day, int limit, int offset) javax.ws.rs.core.ResponsegetAnnotationsAsXml(String id, String type, String day, int limit, int offset) javax.ws.rs.core.ResponseremoveAnnotation(String idAsString) voidsetService(AnnotationService service) Method to set the service this REST endpoint uses
-
Field Details
-
serverUrl
This server's base URL -
serviceUrl
The REST endpoint's base URL
-
-
Constructor Details
-
AnnotationRestService
public AnnotationRestService()
-
-
Method Details
-
setService
Method to set the service this REST endpoint uses- Parameters:
service- the annotation service implementation
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) The method that is called, when the service is activated- Parameters:
cc- The ComponentContext of this service
-
getAnnotationsAsXml
@GET @Produces("text/xml") @Path("annotations.xml") public javax.ws.rs.core.Response getAnnotationsAsXml(@QueryParam("episode") String id, @QueryParam("type") String type, @QueryParam("day") String day, @QueryParam("limit") int limit, @QueryParam("offset") int offset) - Returns:
- XML with all footprints
-
getAnnotationsAsJson
@GET @Produces("application/json") @Path("annotations.json") public javax.ws.rs.core.Response getAnnotationsAsJson(@QueryParam("episode") String id, @QueryParam("type") String type, @QueryParam("day") String day, @QueryParam("limit") int limit, @QueryParam("offset") int offset) - Returns:
- JSON with all footprints
-
add
@PUT @Path("") @Produces("text/xml") public javax.ws.rs.core.Response add(@FormParam("episode") String mediapackageId, @FormParam("in") int inpoint, @FormParam("out") int outpoint, @FormParam("type") String type, @FormParam("value") String value, @FormParam("isPrivate") boolean isPrivate, @Context javax.servlet.http.HttpServletRequest request) -
change
@PUT @Path("{id}") @Produces("text/xml") public javax.ws.rs.core.Response change(@PathParam("id") String idAsString, @FormParam("value") String value, @Context javax.servlet.http.HttpServletRequest request) throws NotFoundException - Throws:
NotFoundException
-
getAnnotationAsXml
@GET @Produces("text/xml") @Path("{id}.xml") public AnnotationImpl getAnnotationAsXml(@PathParam("id") String idAsString) throws NotFoundException - Throws:
NotFoundException
-
getAnnotationAsJson
@GET @Produces("application/json") @Path("{id}.json") public AnnotationImpl getAnnotationAsJson(@PathParam("id") String idAsString) throws NotFoundException - Throws:
NotFoundException
-
removeAnnotation
@DELETE @Path("{id}") public javax.ws.rs.core.Response removeAnnotation(@PathParam("id") String idAsString) throws NotFoundException - Throws:
NotFoundException
-