Class ContentService


  • @Path("/content")
    @Singleton
    public class ContentService
    extends RestService
    This JAX-RS resource represents the content service. URL: /content.
    Author:
    sts
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response getContent​(int waitseconds)
      Test method for artificially creating a response delay.
      javax.ws.rs.core.Response getContent​(java.lang.String xhdoc, int element, java.lang.String filename, javax.servlet.http.HttpServletRequest request)
      Retrieves the requested document element in its current revision and returns it as a download attachment.
      javax.ws.rs.core.Response getStructure​(java.lang.String xhdoc, javax.servlet.http.HttpServletRequest request)
      Returns the structure of the document (in its current revision) with the given xhdoc.
      javax.ws.rs.core.Response info()
      Informational method to indicate the right usage of this JAX-RS resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContentService

        public ContentService()
    • Method Detail

      • getContent

        @GET
        @Path("/{xhdoc}/{element}/{filename}")
        @Produces("application/octet-stream")
        public javax.ws.rs.core.Response getContent​(@PathParam("xhdoc")
                                                    java.lang.String xhdoc,
                                                    @PathParam("element")
                                                    int element,
                                                    @PathParam("filename")
                                                    java.lang.String filename,
                                                    @Context
                                                    javax.servlet.http.HttpServletRequest request)
        Retrieves the requested document element in its current revision and returns it as a download attachment.
        Parameters:
        request - injected HttpServletRequest
        xhdoc - The hdoc id of the document whose element to load.
        element - The element number of the element to load.
        filename - The filename used in the 'Content-Disposition' header.
        Returns:
        processing dependent Response.
      • getStructure

        @GET
        @Path("/{xhdoc}/structure")
        @Produces({"application/json","application/xml","text/html"})
        public javax.ws.rs.core.Response getStructure​(@PathParam("xhdoc")
                                                      java.lang.String xhdoc,
                                                      @Context
                                                      javax.servlet.http.HttpServletRequest request)
        Returns the structure of the document (in its current revision) with the given xhdoc. The structure is returned in the requested format (JSON, XML or HTML).
        Parameters:
        xhdoc - The XHDOC of the document to get the structure from.
        request - The request object.
        Returns:
        the document structure in the requested format.
      • info

        @GET
        @Produces("text/plain")
        public javax.ws.rs.core.Response info()
        Informational method to indicate the right usage of this JAX-RS resource.
        Returns:
        An information how to use this JAX-RS resource.
      • getContent

        @GET
        @Path("/test/{waitseconds}")
        @Produces("text/plain")
        public javax.ws.rs.core.Response getContent​(@PathParam("waitseconds")
                                                    int waitseconds)
        Test method for artificially creating a response delay.
        Parameters:
        waitseconds - the number of seconds this method should wait until it returns
        Returns:
        processing dependent Response.