Class AbstractWeblinkService

java.lang.Object
com.saperion.rs.RestService
com.saperion.rs.AbstractWeblinkService
Direct Known Subclasses:
WeblinkService, WeblinkZipService

public abstract class AbstractWeblinkService extends RestService
The Class AbstractWeblinkService. Extends the RestService basis class with helper methods for the weblink services.
  • Constructor Details

    • AbstractWeblinkService

      public AbstractWeblinkService()
  • Method Details

    • getHDoc

      protected static String getHDoc(com.saperion.connector.SaClassicConnector connector, String archive, String field, String id, int element, boolean released, boolean currentRevision)
      Gets the hdoc.
      Parameters:
      connector - the classic connector
      archive - the archive/DDC to query
      field - the field
      id - the id
      element - the element
      released - the released
      currentRevision - the current revision
      Returns:
      the hdoc
    • logAndThrowWebException

      protected static void logAndThrowWebException(String field, int element, String id, Exception e, jakarta.ws.rs.core.Response.Status status)
      Logs a error message (generated by the given values) and throws a.
      Parameters:
      field - the field
      element - the element
      id - the id
      e - the e
      status - the status
      Throws:
      jakarta.ws.rs.WebApplicationException - the web application exception WebApplicationException with the error message and given status.
    • sendBadRequestMessage

      protected static void sendBadRequestMessage()
    • getTypedId

      protected static Object getTypedId(com.saperion.connector.SaClassicConnector connector, String archive, String field, String id)
      Gets the typed id. Finds out the type of the archive field and converts the id to this type.
      Parameters:
      connector - the connector to get DB Definitions of the archive
      archive - the archive / DDC to find out type of given field
      field - the field to convert id
      id - the id to convert
      Returns:
      the typed id
    • getFilenameFromDocElement

      protected String getFilenameFromDocElement(String xhdoc, com.saperion.connector.SaClassicConnector connector, boolean currentRevision, int element, String field, String id)
      Gets the filename from doc element.
      Parameters:
      xhdoc - the xhdoc of document
      connector - the classic connector
      currentRevision - true, of current revision of document is needed
      element - the element number of document
      field - the field
      id - the id
      Returns:
      the filename from the document element
    • appendToFilename

      public static String appendToFilename(String filename, String appendix)
      Appends the given appendix to the given filename. The result will look like: - <filename w/o ending>_. if an ending is existing in the given filename, or - _ if no ending was detected.
      Parameters:
      filename - The filename to be appended.
      appendix - The appendix to append the given filename with.
      Returns:
      the appended filename.
    • getContent

      protected static InputStream getContent(com.saperion.connector.SaClassicConnector connector, String xhdoc, String field, String id, int element)
      Gets the content stream of a document from the backend.
      Parameters:
      connector - the classic connector
      xhdoc - the xhdoc of document to get content
      field - the field to identify document
      id - the id to identify value of document field
      element - the element number of document
      Returns:
      the content stream