Package com.saperion.ws
Class SaWsContentService
java.lang.Object
com.saperion.ws.AbstractService
com.saperion.ws.SaWsContentService
This class wraps all methods of the SaClassicConnector. It parses the information, which is
fetched from the server to classes useable for webservices. 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 TypeMethodDescriptiongetAnnotations
(String token, String xhdoc, int elementNumber) Returns the annotations by the specified document in its current revision.getContent
(String token, String xhdoc, int elementNumber) Loads a document in its current revision from the backend system.getFilename
(String token, String xhdoc, int elementNumber) Loads the filename for a document from the backend system.long
Returns the total document size in archive.getStructure
(String token, String xhdoc) With the help of getStructure you are able to receive all informations about the documents content structure of the actual document version.void
setAnnotations
(String token, Annotations annotations, String xhdoc, int elementNumber) Sets the annotations of a document.Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
Constructor Details
-
SaWsContentService
public SaWsContentService()Constructor.
-
-
Method Details
-
getContent
public SaWsContent getContent(String token, String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException Loads a document in its current revision from the backend system.- Parameters:
token
- to identify the session.xhdoc
- The ID of the documentelementNumber
- The number of the structured element, starting with 1.- 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.readDocument(java.lang.String, boolean, int)
-
getFilename
public String getFilename(String token, String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException 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:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- See Also:
-
SaClassicConnector.readDocumentFilename(java.lang.String, boolean, int)
-
getAnnotations
public Annotations getAnnotations(String token, String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException Returns the annotations by the specified document in its current revision.- Parameters:
token
- to identify the session.xhdoc
- the ID of the document.elementNumber
- position of the element in the structured document.- Returns:
- a string representing the document annotations.
- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
setAnnotations
public void setAnnotations(String token, Annotations annotations, String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsDBException, SaWsRepositoryException, SaWsException Sets the annotations of a document.- Parameters:
token
- to identify the session.annotations
- the annotations to set.xhdoc
- the ID of the document.elementNumber
- position of the element in the structured document (starts by 1).- Throws:
SaWsDBException
- if a database error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getSize
public long getSize(String token, String xhdoc, int elementNumber) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Returns the total document size in archive.- Parameters:
token
- to identify the session.xhdoc
- the ID of the document.elementNumber
- position of the element in the structured document.- Returns:
- the total document size.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getStructure
public SaWsContentStructure getStructure(String token, String xhdoc) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException With the help of getStructure you are able to receive all informations about the documents content structure of the actual document version. It will return the file size, names, variables and so on.- Parameters:
token
- to identify the session.xhdoc
- the version id of the document (doesn't matter if the latest)- Returns:
- the document structure with file size, name, variables, ...
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
- if an unexpected error occurs
-