Package com.saperion.ws
Class SaWsContentService
- java.lang.Object
-
- com.saperion.ws.AbstractService
-
- com.saperion.ws.SaWsContentService
-
public class SaWsContentService extends AbstractService
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 Constructor Description SaWsContentService()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Annotations
getAnnotations(java.lang.String token, java.lang.String xhdoc, int elementNumber)
Returns the annotations by the specified document in its current revision.SaWsContent
getContent(java.lang.String token, java.lang.String xhdoc, int elementNumber)
Loads a document in its current revision from the backend system.java.lang.String
getFilename(java.lang.String token, java.lang.String xhdoc, int elementNumber)
Loads the filename for a document from the backend system.long
getSize(java.lang.String token, java.lang.String xhdoc, int elementNumber)
Returns the total document size in archive.SaWsContentStructure
getStructure(java.lang.String token, java.lang.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(java.lang.String token, Annotations annotations, java.lang.String xhdoc, int elementNumber)
Sets the annotations of a document.-
Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
-
-
-
Method Detail
-
getContent
public SaWsContent getContent(java.lang.String token, java.lang.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 java.lang.String getFilename(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
- 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(java.lang.String token, java.lang.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(java.lang.String token, Annotations annotations, java.lang.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(java.lang.String token, java.lang.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(java.lang.String token, java.lang.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
-
-