Class SaWsVersionService


  • public class SaWsVersionService
    extends AbstractService
    This class wraps all methods of the SaClassicConnector. It parses the information, which is fetched from the server to classes useable for web services. JAX-B requires classes to be JavaBeans, because it uses the set/get-Methods. You need a token for calling the methods to perform searches and modifications. For getting a token the logon method has to be called. If the thread is timed out on the backend or if you aren't logged in you will get an exception.
    Author:
    Daniel Manzke(dam)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SaWsContent getContent​(java.lang.String token, java.lang.String xhdoc, int elementNumber)
      Loads a document version from the backend system.
      java.lang.String getContentFilename​(java.lang.String token, java.lang.String xhdoc, int elementNumber)
      Loads the filename for a document from the backend system.
      SaWsVersionData getMetadata​(java.lang.String token, java.lang.String xhdoc)
      Reads the version metadata of the document with the given ID.
      SaWsContent getReleasedDocument​(java.lang.String token, java.lang.String xhdoc, int elementNumber)
      Gets the content stream of the last released document.
      java.util.List<java.lang.String> getVersionIDs​(java.lang.String token, java.lang.String definition, java.lang.String sysrowid)
      Reads the version IDs of the given document.
      void releaseDocument​(java.lang.String token, java.lang.String ddcName, java.lang.String xhdoc, java.lang.String comment)
      Release the document by given xhdoc.
      SaWsSaveInfo restore​(java.lang.String token, java.lang.String xhdoc)
      Restores the version with the given HDOC.
      • Methods inherited from class java.lang.Object

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

      • SaWsVersionService

        public SaWsVersionService()
        Constructor.
    • Method Detail

      • getVersionIDs

        public java.util.List<java.lang.String> getVersionIDs​(java.lang.String token,
                                                              java.lang.String definition,
                                                              java.lang.String sysrowid)
                                                       throws SaWsAuthenticationException,
                                                              SaWsRepositoryException,
                                                              SaWsException
        Reads the version IDs of the given document.
        Parameters:
        token - to identify the session.
        definition - definition which is used for finding the versions of the document
        sysrowid - The ID of the document
        Returns:
        Set of version IDs
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.getVersionIDs(java.lang.String, java.lang.String)
      • releaseDocument

        public void releaseDocument​(java.lang.String token,
                                    java.lang.String ddcName,
                                    java.lang.String xhdoc,
                                    java.lang.String comment)
                             throws SaWsException
        Release the document by given xhdoc.
        Parameters:
        token - the token to identify the session.
        ddcName - the ddc name
        xhdoc - the xhdoc the ID of the document.
        comment - The comment for the new reversion
        Throws:
        SaWsException - if an unexpected error occurs, e.g. when release feature is not configured
      • getReleasedDocument

        public SaWsContent getReleasedDocument​(java.lang.String token,
                                               java.lang.String xhdoc,
                                               int elementNumber)
                                        throws SaWsException
        Gets the content stream of the last released document.
        Parameters:
        token - the token to identify the session.
        xhdoc - the xhdoc the ID of the document.
        elementNumber - position of the element to return in the structured document.
        Returns:
        the last released document content stream of given element number if release feature is configured
        Throws:
        SaWsException - if an unexpected error occurs, e.g. when release feature is not configured