Class ContentService

java.lang.Object
com.saperion.rs.RestService
com.saperion.rs.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
     
  • Method Summary

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

    Methods inherited from class com.saperion.rs.RestService

    checkConnection, getConnection

    Methods inherited from class java.lang.Object

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

    • ContentService

      public ContentService()
  • Method Details

    • getContent

      @GET @Path("/{xhdoc}/{element}/{filename}") @Produces("application/octet-stream") public jakarta.ws.rs.core.Response getContent(@PathParam("xhdoc") String xhdoc, @PathParam("element") int element, @PathParam("filename") String filename, @Context jakarta.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 jakarta.ws.rs.core.Response getStructure(@PathParam("xhdoc") String xhdoc, @Context jakarta.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 jakarta.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 jakarta.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.