Class SaWsArchiveService


  • public class SaWsArchiveService
    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.

    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      SaWsSaveInfo create​(java.lang.String token, java.lang.String definition, java.util.List<SaWsProperty> metadatas, SaWsContentContainer container, java.lang.String versionComment, java.lang.String acls)
      Creates a new document on the backend system with the given metadata and content.
      void delete​(java.lang.String token, java.lang.String xhdoc, SaWsDeleteType deleteType)
      Deletes a document from the backend system with the given strategy.
      SaWsAccessData getAccessData​(java.lang.String token, java.lang.String xhdoc)
      Reads the access rights of the given document.
      SaWsContent getContent​(java.lang.String token, java.lang.String xhdoc, int elementNumber)
      Deprecated.
      This method is deprecated.
      java.lang.String getContentFilename​(java.lang.String token, java.lang.String xhdoc, int elementNumber)
      Deprecated.
      This method is deprecated.
      SaWsLockInfo getLockInfo​(java.lang.String token, java.lang.String sysRowId)
      Returns the locking informations for a given document.
      boolean lock​(java.lang.String token, java.lang.String sysRowId, java.lang.String definition)
      Locks a document.
      java.util.List<SaWsDocumentInfo> query​(java.lang.String token, SaWsQueryInfo queryInfo)  
      protected java.util.List<SaWsPropertyValue[]> search​(java.lang.String token, com.saperion.rmi.SaQueryInfo query)
      This method performs the search for the given SaQueryInfo.
      java.util.List<SaWsPropertyValue[]> search​(java.lang.String token, java.lang.String hql)
      Performs a search with the given hql query (hibernate query language).
      java.util.List<SaWsPropertyValue[]> searchWithPaging​(java.lang.String token, java.lang.String hql, int offset, int maxNumber)
      Performs a search with the given hql query (hibernate query language) with the support for paging by the given offset and max number parameters.
      boolean unlock​(java.lang.String token, java.lang.String sysRowId, java.lang.String definition)
      Unlocks a document.
      SaWsSaveInfo update​(java.lang.String token, java.lang.String definition, java.lang.String xhdoc, java.util.List<SaWsProperty> metadatas, SaWsContentContainer container, java.lang.String versionComment, java.lang.String acls)
      Updates a document in the backend system with the given metadata and content.
      • Methods inherited from class java.lang.Object

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

      • SaWsArchiveService

        public SaWsArchiveService()
        Constructor.
    • Method Detail

      • update

        public SaWsSaveInfo update​(java.lang.String token,
                                   java.lang.String definition,
                                   java.lang.String xhdoc,
                                   java.util.List<SaWsProperty> metadatas,
                                   SaWsContentContainer container,
                                   java.lang.String versionComment,
                                   java.lang.String acls)
                            throws SaWsException
        Updates a document in the backend system with the given metadata and content. Only the attached metadata are changed. The If the document was checked out, it will be automatically checked in.
        Parameters:
        token - to identify the session.
        definition - The name of the database definition
        xhdoc - The ID of the document
        metadatas - A properties object containing the metadata
        container - Multiple content data
        versionComment - The comment for the version
        acls - Document ACL
        Returns:
        SaSaveInfo SaSaveInfo object describing the document
        Throws:
        SaWsRepositoryException - if a repository error occurs.
        SaWsDBException - if a database error occurs.
        SaWsException
        See Also:
        SaClassicConnector.updateDocument(java.lang.String, java.lang.String, java.util.Properties, java.io.InputStream[], java.lang.String)
      • getContent

        @Deprecated
        public SaWsContent getContent​(java.lang.String token,
                                      java.lang.String xhdoc,
                                      int elementNumber)
                               throws SaWsException
        Deprecated.
        This method is deprecated. Use SaWsContentService.getContent instead.
        Loads a document from the back end system.
        Parameters:
        token - to identify the session.
        xhdoc - The ID of the document
        elementNumber - Element number
        Returns:
        Input stream with the document content
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if an repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.readDocument(java.lang.String, boolean, int)
      • getContentFilename

        @Deprecated
        public java.lang.String getContentFilename​(java.lang.String token,
                                                   java.lang.String xhdoc,
                                                   int elementNumber)
                                            throws SaWsException
        Deprecated.
        This method is deprecated. Use SaWsContentService.getContentFilename instead.
        Loads the filename for a document from the backend system.
        Parameters:
        token - to identify the session.
        xhdoc - The ID of the document
        elementNumber - Element number
        Returns:
        Document filename
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if an repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.readDocumentFilename(java.lang.String, boolean, int)
      • delete

        public void delete​(java.lang.String token,
                           java.lang.String xhdoc,
                           SaWsDeleteType deleteType)
                    throws SaWsException
        Deletes a document from the backend system with the given strategy.
        Parameters:
        token - to identify the session.
        xhdoc - The HDoc of the document.
        deleteType - Deletion strategy
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.deleteDocument(java.lang.String, int)
      • create

        public SaWsSaveInfo create​(java.lang.String token,
                                   java.lang.String definition,
                                   java.util.List<SaWsProperty> metadatas,
                                   SaWsContentContainer container,
                                   java.lang.String versionComment,
                                   java.lang.String acls)
                            throws SaWsException
        Creates a new document on the backend system with the given metadata and content.
        Parameters:
        token - to identify the session.
        definition - The name of the database definition
        metadatas - A properties object containing the metadata
        container - Multiple content data
        versionComment - The comment for the version (mandatory)
        acls - ACL name string (optional - multiple ACLs with semicolon separated)
        Returns:
        SaSaveInfo SaSaveInfo object describing the document
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.createDocument(java.lang.String, java.util.Properties, java.io.InputStream[], java.lang.String, java.lang.String)
      • lock

        public boolean lock​(java.lang.String token,
                            java.lang.String sysRowId,
                            java.lang.String definition)
                     throws SaWsException
        Locks a document.
        Parameters:
        token - to identify the session
        sysRowId - SysRowId
        definition - DDC name
        Returns:
        True, if ok
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsLockException - if a lock error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.lockDocument(java.lang.String, java.lang.String)
      • unlock

        public boolean unlock​(java.lang.String token,
                              java.lang.String sysRowId,
                              java.lang.String definition)
                       throws SaWsException
        Unlocks a document.
        Parameters:
        token - to identify the session
        sysRowId - SysRowId
        definition - DDC name
        Returns:
        True, if ok
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsLockException - if a lock error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.unlockDocument(java.lang.String, java.lang.String)
      • getAccessData

        public SaWsAccessData getAccessData​(java.lang.String token,
                                            java.lang.String xhdoc)
                                     throws SaWsException
        Reads the access rights of the given document.
        Parameters:
        token - to identify the right session
        xhdoc - The ID of the document (XHDOC)
        Returns:
        Access rights of this document
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.getDocumentAccessData(java.lang.String)
      • search

        public java.util.List<SaWsPropertyValue[]> search​(java.lang.String token,
                                                          java.lang.String hql)
                                                   throws SaWsException
        Performs a search with the given hql query (hibernate query language).
        Parameters:
        token - needed to get the right session
        hql - the Hibernate query - hql.
        Returns:
        a result list of values which are returned by the Hibernate. Each returned value represented as SaWsPropertyValue object.
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.searchHQL(SaQueryInfo)
      • searchWithPaging

        public java.util.List<SaWsPropertyValue[]> searchWithPaging​(java.lang.String token,
                                                                    java.lang.String hql,
                                                                    int offset,
                                                                    int maxNumber)
                                                             throws SaWsException
        Performs a search with the given hql query (hibernate query language) with the support for paging by the given offset and max number parameters.
        Parameters:
        token - needed to get the right session
        hql - the Hibernate query - hql.
        offset - The index to start the results from.
        maxNumber - The maximum number of results to be in the response.
        Returns:
        a result list of values which are returned by the Hibernate. Each returned value represented as SaWsPropertyValue object.
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException
        See Also:
        SaClassicConnector.searchHQL(SaQueryInfo)
      • search

        protected java.util.List<SaWsPropertyValue[]> search​(java.lang.String token,
                                                             com.saperion.rmi.SaQueryInfo query)
                                                      throws SaWsException
        This method performs the search for the given SaQueryInfo.
        Parameters:
        token - The authentication token.
        query - The SaQueryInfo.
        Returns:
        a result list of SaWsPropertyValue arrays.
        Throws:
        SaWsAuthenticationException - if an authentication error occurs.
        SaWsDBException - if a database error occurs.
        SaWsRepositoryException - if a repository error occurs.
        SaWsException - if an exception occurs.