Class AbstractWeblinkService

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String appendToFilename​(java.lang.String filename, java.lang.String appendix)
      Appends the given appendix to the given filename.
      protected static java.io.InputStream getContent​(com.saperion.connector.SaClassicConnector connector, java.lang.String xhdoc, java.lang.String field, java.lang.String id, int element)
      Gets the content stream of a document from the backend.
      protected java.lang.String getFilenameFromDocElement​(java.lang.String xhdoc, com.saperion.connector.SaClassicConnector connector, boolean currentRevision, int element, java.lang.String field, java.lang.String id)
      Gets the filename from doc element.
      protected static java.lang.String getHDoc​(com.saperion.connector.SaClassicConnector connector, java.lang.String archive, java.lang.String field, java.lang.String id, int element, boolean released, boolean currentRevision)
      Gets the hdoc.
      protected static java.lang.Object getTypedId​(com.saperion.connector.SaClassicConnector connector, java.lang.String archive, java.lang.String field, java.lang.String id)
      Gets the typed id.
      protected static void logAndThrowWebException​(java.lang.String field, int element, java.lang.String id, java.lang.Exception e, javax.ws.rs.core.Response.Status status)
      Logs a error message (generated by the given values) and throws a.
      protected static void sendBadRequestMessage()  
      • Methods inherited from class java.lang.Object

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

      • AbstractWeblinkService

        public AbstractWeblinkService()
    • Method Detail

      • getHDoc

        protected static java.lang.String getHDoc​(com.saperion.connector.SaClassicConnector connector,
                                                  java.lang.String archive,
                                                  java.lang.String field,
                                                  java.lang.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​(java.lang.String field,
                                                      int element,
                                                      java.lang.String id,
                                                      java.lang.Exception e,
                                                      javax.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:
        javax.ws.rs.WebApplicationException - the web application exception WebApplicationException with the error message and given status.
      • sendBadRequestMessage

        protected static void sendBadRequestMessage()
      • getTypedId

        protected static java.lang.Object getTypedId​(com.saperion.connector.SaClassicConnector connector,
                                                     java.lang.String archive,
                                                     java.lang.String field,
                                                     java.lang.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 java.lang.String getFilenameFromDocElement​(java.lang.String xhdoc,
                                                             com.saperion.connector.SaClassicConnector connector,
                                                             boolean currentRevision,
                                                             int element,
                                                             java.lang.String field,
                                                             java.lang.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 java.lang.String appendToFilename​(java.lang.String filename,
                                                        java.lang.String appendix)
        Appends the given appendix to the given filename. The result will look like: - _. 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 java.io.InputStream getContent​(com.saperion.connector.SaClassicConnector connector,
                                                        java.lang.String xhdoc,
                                                        java.lang.String field,
                                                        java.lang.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