Package com.saperion.ws
Class SaWsVersionService
- java.lang.Object
-
- com.saperion.ws.AbstractService
-
- com.saperion.ws.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)
-
-
Field Summary
-
Fields inherited from class com.saperion.ws.AbstractService
configured
-
-
Constructor Summary
Constructors Constructor Description SaWsVersionService()
Constructor.
-
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 com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
-
-
-
Method Detail
-
restore
public SaWsSaveInfo restore(java.lang.String token, java.lang.String xhdoc) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException
Restores the version with the given HDOC.- Parameters:
token
- to identify the session.xhdoc
- Version HDOC- Returns:
- SaWsSaveInfo object describing the new document
- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- See Also:
SaClassicConnector.restoreVersion(java.lang.String)
-
getMetadata
public SaWsVersionData getMetadata(java.lang.String token, java.lang.String xhdoc) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException
Reads the version metadata of the document with the given ID.- Parameters:
token
- to identify the session.xhdoc
- Version ID- Returns:
- Metadata of the document
- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- See Also:
SaClassicConnector.readVersionMetadata(java.lang.String)
-
getContent
public SaWsContent getContent(java.lang.String token, java.lang.String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException
Loads a document version from the backend system.- Parameters:
token
- to identify the session.xhdoc
- Version IDelementNumber
- Element number- Returns:
- Input stream with the document content
- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- See Also:
SaClassicConnector.readVersionDocument(java.lang.String, int)
-
getContentFilename
public java.lang.String getContentFilename(java.lang.String token, java.lang.String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException
Loads the filename for a document from the backend system.- Parameters:
token
- Token for the open sessionxhdoc
- ID for the document which contains the contentelementNumber
- number element which should be read- Returns:
- Filename of the content
- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- See Also:
SaClassicConnector.readVersionDocumentFilename(java.lang.String, int)
-
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 documentsysrowid
- 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 namexhdoc
- 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
-
-