Class SaWsArchiveService

java.lang.Object
com.saperion.ws.AbstractService
com.saperion.ws.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.

  • Constructor Details

    • SaWsArchiveService

      public SaWsArchiveService()
      Constructor.
  • Method Details

    • update

      public SaWsSaveInfo update(String token, String definition, String xhdoc, List<SaWsProperty> metadatas, SaWsContentContainer container, String versionComment, 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(String token, 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 String getContentFilename(String token, 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(String token, 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(String token, String definition, List<SaWsProperty> metadatas, SaWsContentContainer container, String versionComment, 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(String token, String sysRowId, 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(String token, String sysRowId, 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(String token, 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)
    • getLockInfo

      Returns the locking informations for a given document.
      Parameters:
      token - to identify the right session
      sysRowId - Document SysRowId
      Returns:
      Lockin informations
      Throws:
      SaWsAuthenticationException - if an authentication error occurs.
      SaWsLockException - if a lock error occurs.
      SaWsRepositoryException - if a repository error occurs.
      SaWsException
      See Also:
      • SaClassicConnector.getLockInfo(java.lang.String)
    • query

      public List<SaWsDocumentInfo> query(String token, SaWsQueryInfo queryInfo) throws SaWsException
      Throws:
      SaWsException
    • search

      public SaWsPropertyValue[][] search(String token, 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 SaWsPropertyValue[][] searchWithPaging(String token, 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 SaWsPropertyValue[][] search(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.