Package com.saperion.ws
Class SaWsArchiveService
java.lang.Object
com.saperion.ws.AbstractService
com.saperion.ws.SaWsArchiveService
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.
-
Field Summary
Fields inherited from class com.saperion.ws.AbstractService
configured
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(String token, String definition, List<SaWsProperty> metadatas, SaWsContentContainer container, String versionComment, String acls) Creates a new document on the backend system with the given metadata and content.void
delete
(String token, String xhdoc, SaWsDeleteType deleteType) Deletes a document from the backend system with the given strategy.getAccessData
(String token, String xhdoc) Reads the access rights of the given document.getContent
(String token, String xhdoc, int elementNumber) Deprecated.This method is deprecated.getContentFilename
(String token, String xhdoc, int elementNumber) Deprecated.This method is deprecated.getLockInfo
(String token, String sysRowId) Returns the locking informations for a given document.boolean
Locks a document.query
(String token, SaWsQueryInfo queryInfo) protected SaWsPropertyValue[][]
This method performs the search for the given SaQueryInfo.Performs a search with the given hql query (hibernate query language).searchWithPaging
(String token, 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
Unlocks a document.update
(String token, String definition, String xhdoc, List<SaWsProperty> metadatas, SaWsContentContainer container, String versionComment, String acls) Updates a document in the backend system with the given metadata and content.Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
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 definitionxhdoc
- The ID of the documentmetadatas
- A properties object containing the metadatacontainer
- Multiple content dataversionComment
- The comment for the versionacls
- 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 documentelementNumber
- 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 documentelementNumber
- 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
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 definitionmetadatas
- A properties object containing the metadatacontainer
- Multiple content dataversionComment
- 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
Locks a document.- Parameters:
token
- to identify the sessionsysRowId
- SysRowIddefinition
- 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
Unlocks a document.- Parameters:
token
- to identify the sessionsysRowId
- SysRowIddefinition
- 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
Reads the access rights of the given document.- Parameters:
token
- to identify the right sessionxhdoc
- 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
public SaWsLockInfo getLockInfo(String token, String sysRowId) throws SaWsAuthenticationException, SaWsLockException, SaWsRepositoryException, SaWsException Returns the locking informations for a given document.- Parameters:
token
- to identify the right sessionsysRowId
- 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
- Throws:
SaWsException
-
search
Performs a search with the given hql query (hibernate query language).- Parameters:
token
- needed to get the right sessionhql
- 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 sessionhql
- 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.
-