Package com.saperion.ngc.model.document
Class DocClassicConnectorService
java.lang.Object
com.saperion.ngc.model.ClassicConnectorService
com.saperion.ngc.model.document.DocClassicConnectorService
- All Implemented Interfaces:
DocumentService
,Service
Service presenting document access methods provided by the classic connector.
- Author:
- mak
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.saperion.ngc.model.document.DocumentService
DocumentService.AuditEvent
-
Field Summary
Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
Fields inherited from interface com.saperion.ngc.model.document.DocumentService
COMP_ID, COMP_TYPE, IXOS_ANNO, NEEDED_COMP_ID, NEEDED_COMP_TYPE, NOTES_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DocClassicConnectorService
(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider) Creates a newDocClassicConnectorService
.DocClassicConnectorService
(jakarta.servlet.http.HttpSession session) Creates a new DocClassicConnectorService. -
Method Summary
Modifier and TypeMethodDescriptionfinal DocumentId
addDocument
(List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls) Adds a new document to the archive.addDocument
(List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls, Map<String, DocumentVariable> variables) Adds a new document to the archive.addDocument
(Map<String, Object> properties, com.saperion.bean.ContentStream[] content, String comment, String ddcName, String acls, Map<String, DocumentVariable> variables) Adds a new document to the archive.final DocumentId
addDocument
(Properties properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls) Deprecated.void
Checkout a document.void
checkoutDocument
(DocumentId id, boolean withShareBase, int[] shareBaseDocIds) Checkout a document.com.saperion.connector.service.RmiClientExtendedLookupEntryService
createLookupEntryService
(com.saperion.connector.SaClassicConnector connector) final DocumentId
createLookupItem
(List<FieldResultBean> properties, String ddcName) Create a new lookup entry.final boolean
Delete a document.boolean
deleteDocument
(DocumentId id, boolean finalDelete) Delete a document.void
Discards checkout of a document.Retrieves the access data for the specified document.getAccessData
(String revisionId) Retrieves the access data fot the specified document.getAcl
(DocumentId docId) Deprecated.usegetAclNames(DocumentId)
instead.Retrieves the ACLs for the specified document or lookup entry.org.zkoss.image.Image
Reads the actual document image from backend.Gets all ACL names.final String
getAnnotations
(String hDoc, int element) Deprecated.usegetAnnotations(String, int, boolean)
insteadfinal String
getAnnotations
(String hDoc, int element, boolean currentRevision) Retrieves the annotations of a document.getArchiveMetaInfo
(DocumentId documentId, boolean currentRevision) Retrieves the meta information of a document that is stored on the archive.getArchiveMetaInfo
(DocumentId documentId, boolean currentRevision, boolean previewMode) Retrieves the meta information of a document that is stored on the archive.Reads the document properties.getDocumentInfo
(DocumentId id, boolean isDeleted) Reads the document properties.com.saperion.intf.SaPropertyValue[]
getDocumentMetadataFromArchive
(DocumentId id, boolean currentRevision) Returns the metadata of the document as read from the archive.getDocumentVersion
(String versionId) Returns the metadata of the specified version.Returns a list of all version IDs for the specified document.Retrieves information about a document's versions.getDocumentVersions
(String ddcName, String objectId) Retrieves information about a document's versions.long
getElementSize
(String hDoc, int element) Retrieves the size of the specified element (in bytes).getElementSizes
(String hDoc, List<Integer> elementsWithoutSize) Retrieves a map with the sizes (in bytes) of elements for a given hDoc.getFullTextFields
(String ddcName, List<String> fullTextFields, String hdoc) Reads the document image informations from backend.getIXOSAnnotation
(String hdoc) Reads the IXOS annotation for this document.Returns the lock data for the specified document.getLockData
(DocumentId id, boolean isDeleted) Returns the lock data for the specified document.Retrieves the access data for the specified lookup table entry.int
getNextCounterValue
(String ddcName, String fieldName, String dbFieldName) Deprecated.Counter fields cannot be set by API any more.getNotesContent
(String hDoc) Reads notes element.getPageList
(String hDoc, int element, boolean currentRevision) final InputStream
getReleasedStream
(String hDoc, int element, boolean currentRevision) Retrieves the content of a document.getReleaseHdoc
(String hDoc) Gets the last released hdoc.List<com.saperion.connector.renditions.Rendition>
getRenderedDocument
(DocumentId documentId, com.saperion.connector.formats.TargetFormat format, boolean currentRevision) Renders the specified document to the target format.Reads the properties of the specified revision.Returns a set of document IDs that are locked by this session.final InputStream
Retrieves the content of a document.final InputStream
Retrieves the content of a document.final InputStream
Retrieves the content of a document.Retrieves the content of a document.getThumbnail
(DocumentId id, int height, int width, boolean color) Retrieves a thumbnail for the specified document or null if no thumbnail is available.getVariable
(Properties variables, String key) Reads the variable with the given case insensitive name.boolean
hasBlackmarkers
(DocumentId docId) Checks for blackmarkers.boolean
hasVariable
(Properties variables, String key) Checks, if the variable with the given case insensitive name exists.final boolean
lockDocument
(DocumentId id, DocumentService.AuditEvent event) Lock document.void
releaseDocument
(DocumentId id, String comment) Release a document.final void
removeIXOSAnno
(DocumentId docId) Remove the IXOS annotation from content list.resolveLatestHdoc
(String oldHdoc) Deprecated.useresolveLatestRevision(String)
insteadresolveLatestRevision
(String oldHdoc) Resolve latest revision for the given hdoc.com.saperion.bean.SapDocInfo
resolveSapURL
(String url) Resolves the given SAP URL and returns the SapDocInfo.void
setAcl
(DocumentId docId, String acl, String comment) Deprecated.usesetAclNames(DocumentId, List, String)
instead.void
setAclNames
(DocumentId id, List<String> acls, String comment) Sets the ACL for the specified document or lookup table entry.final void
setAnnotations
(String hDoc, int element, String annotations) Sets the annotations of a document.void
Sets the specified document's state to 'read' without creating a new revision.void
Sets the specified document's state to 'unread' without creating a new revision.void
setNotesContent
(String hDoc, String ddc, String content) Writes the notes element.final boolean
Unlock document.updateDocument
(DocumentId docId, DataToUpdate data, UpdateSettings settings) Updates the document identfied by docId using the specified data and settings.final com.saperion.intf.SaSaveInfo
updateDocument
(List<FieldResultBean> properties, com.saperion.bean.ContentStream[] content, String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) Deprecated.final com.saperion.intf.SaSaveInfo
updateDocument
(Properties properties, com.saperion.bean.ContentStream[] content, String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) Deprecated.void
updateLookupItem
(String sysRowId, List<FieldResultBean> properties, String ddcName) Update a lookup entry.void
updateLookupItem
(String sysRowId, List<FieldResultBean> properties, String ddcName, boolean isDeleted) Update a lookup entry.void
writeAuditEvent
(String hdoc, DocumentService.AuditEvent event, String remark) Write audit event.Methods inherited from class com.saperion.ngc.model.ClassicConnectorService
convertAuthenticationException, getCachedDDC, getConnectionProvider, getCurrentUserFromSession, getSession, getWfConnectionProvider, isActive
-
Constructor Details
-
DocClassicConnectorService
public DocClassicConnectorService()Constructor. -
DocClassicConnectorService
public DocClassicConnectorService(jakarta.servlet.http.HttpSession session) Creates a new DocClassicConnectorService.- Parameters:
session
- HTTP session
-
DocClassicConnectorService
public DocClassicConnectorService(ConnectionProvider<com.saperion.connector.SaClassicConnector> connectionProvider) Creates a newDocClassicConnectorService
.- Parameters:
connectionProvider
- connection provider
-
-
Method Details
-
getReleasedStream
public final InputStream getReleasedStream(String hDoc, int element, boolean currentRevision) throws BinaryUnavailableException, AuthenticationException Retrieves the content of a document. For use in servlets.If the release feature is configured, and the logged in user doesn't have write permissions on the Document the last released document is returned, otherwise the current revision content stream is returned.
- Specified by:
getReleasedStream
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub documentcurrentRevision
- the current revision- Returns:
- InputStream with content
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getStream
public final InputStream getStream(String hDoc, int element, boolean currentRevision) throws BinaryUnavailableException, AuthenticationException Retrieves the content of a document. For use in servlets.- Specified by:
getStream
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub documentcurrentRevision
- currentRevision- Returns:
- InputStream with content
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getStream
public final InputStream getStream(String hDoc, int element, boolean currentRevision, boolean withAnnotations) throws BinaryUnavailableException, AuthenticationException Retrieves the content of a document. For use in servlets.- Specified by:
getStream
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub documentcurrentRevision
- currentRevisionwithAnnotations
- * withAnnotations- Returns:
- InputStream with content
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getStream
public final InputStream getStream(String hDoc, int element) throws BinaryUnavailableException, AuthenticationException Retrieves the content of a document. For use in servlets.- Specified by:
getStream
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub document- Returns:
- InputStream with content
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getStream
public InputStream getStream(String hDoc, int element, boolean currentRevision, long start, long size) throws BinaryUnavailableException, AuthenticationException Retrieves the content of a document. For use in servlets.- Specified by:
getStream
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub documentcurrentRevision
- currentRevisionstart
- Startbytesize
- Streamsize- Returns:
- InputStream with content
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getPageList
public PageList getPageList(String hDoc, int element, boolean currentRevision) throws BinaryUnavailableException, AuthenticationException - Specified by:
getPageList
in interfaceDocumentService
- Parameters:
hDoc
- document HDOCelement
- sub documentcurrentRevision
- currentRevision- Returns:
- Pagelist
- Throws:
BinaryUnavailableException
- when the binary content could not be accessed.AuthenticationException
- when the user is not authenticated- See Also:
-
getAnnotations
@Deprecated public final String getAnnotations(String hDoc, int element) throws AuthenticationException, SystemException Deprecated.usegetAnnotations(String, int, boolean)
insteadRetrieves the annotations of a document.- Specified by:
getAnnotations
in interfaceDocumentService
- Parameters:
hDoc
- document hDocelement
- document element- Returns:
- annotations string
- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error- See Also:
-
getAnnotations
public final String getAnnotations(String hDoc, int element, boolean currentRevision) throws AuthenticationException, SystemException Retrieves the annotations of a document.- Specified by:
getAnnotations
in interfaceDocumentService
- Parameters:
hDoc
- document hDocelement
- document elementcurrentRevision
- currentRevision- Returns:
- annotations string
- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error- See Also:
-
setAnnotations
public final void setAnnotations(String hDoc, int element, String annotations) throws AuthenticationException, SystemException Sets the annotations of a document.- Specified by:
setAnnotations
in interfaceDocumentService
- Parameters:
hDoc
- document hDocelement
- document elementannotations
- annotations string- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error- See Also:
-
getAccessData
public ResultAccessData getAccessData(DocumentId id) throws SystemException, AuthenticationException Retrieves the access data for the specified document.- Specified by:
getAccessData
in interfaceDocumentService
- Parameters:
id
- document id- Returns:
- access data
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getAccessData
public ResultAccessData getAccessData(String revisionId) throws SystemException, AuthenticationException Retrieves the access data fot the specified document. For use in servlets.- Specified by:
getAccessData
in interfaceDocumentService
- Parameters:
revisionId
- document's revision id- Returns:
- access data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getLookupEntryAccessData
public ResultAccessData getLookupEntryAccessData(DocumentId id) throws SystemException, AuthenticationException Description copied from interface:DocumentService
Retrieves the access data for the specified lookup table entry.- Specified by:
getLookupEntryAccessData
in interfaceDocumentService
- Parameters:
id
- the id of the entry- Returns:
- the access data for the current user
- Throws:
SystemException
- system error when getting access dataAuthenticationException
- authentication error when getting access data
-
createLookupEntryService
public com.saperion.connector.service.RmiClientExtendedLookupEntryService createLookupEntryService(com.saperion.connector.SaClassicConnector connector) -
getAcl
Deprecated.usegetAclNames(DocumentId)
instead. Will be removed in 8.1.Retrieves the ACLs for the specified document.- Specified by:
getAcl
in interfaceDocumentService
- Parameters:
docId
- document id- Returns:
- ACL string (separated by
SaConstants.ACL_DELIMITER
to get multiple ACLs) - Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getAclNames
Description copied from interface:DocumentService
Retrieves the ACLs for the specified document or lookup entry.- Specified by:
getAclNames
in interfaceDocumentService
- Parameters:
id
- document id- Returns:
- a list of ACL names that are set on the specified document
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getAllAcls
Gets all ACL names.- Specified by:
getAllAcls
in interfaceDocumentService
- Returns:
- list of ACL names
- Throws:
AuthenticationException
SystemException
- See Also:
-
setAcl
@Deprecated public void setAcl(DocumentId docId, String acl, String comment) throws SystemException, AuthenticationException Deprecated.usesetAclNames(DocumentId, List, String)
instead. Will be removed in 8.1.Sets the ACLs for the specified document.- Specified by:
setAcl
in interfaceDocumentService
- Parameters:
docId
- document idacl
- ACL string (separated bySaConstants.ACL_DELIMITER
to set multiple ACLs)comment
- revision comment- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
setAclNames
public void setAclNames(DocumentId id, List<String> acls, String comment) throws SystemException, AuthenticationException Description copied from interface:DocumentService
Sets the ACL for the specified document or lookup table entry.- Specified by:
setAclNames
in interfaceDocumentService
- Parameters:
id
- document idacls
- a list of ACL names to set on the specified documentcomment
- revision comment- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
lockDocument
public final boolean lockDocument(DocumentId id, DocumentService.AuditEvent event) throws SystemException, AuthenticationException, DocumentLockException Lock document.- Specified by:
lockDocument
in interfaceDocumentService
- Parameters:
id
- Document ID- Returns:
- True, if done
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentLockException
- lock exception- See Also:
-
unlockDocument
public final boolean unlockDocument(DocumentId id) throws SystemException, AuthenticationException, DocumentLockException Unlock document.- Specified by:
unlockDocument
in interfaceDocumentService
- Parameters:
id
- Document ID- Returns:
- True, if done
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentLockException
- lock exception- See Also:
-
deleteDocument
public final boolean deleteDocument(DocumentId id) throws DocumentAccessException, SystemException, AuthenticationException Delete a document.- Specified by:
deleteDocument
in interfaceDocumentService
- Parameters:
id
- Document id- Returns:
- True, if done
- Throws:
DocumentAccessException
- document access exceptionSystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
deleteDocument
public boolean deleteDocument(DocumentId id, boolean finalDelete) throws SystemException, AuthenticationException, DocumentAccessException Delete a document.- Specified by:
deleteDocument
in interfaceDocumentService
- Parameters:
id
- Document idfinalDelete
- set to true if the document was already marked as deleted (sysindexstate = 65002) to avoid checking of document access, which will fail otherwise- Returns:
- True, if done
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentAccessException
- document access exception- See Also:
-
updateDocument
@Deprecated public final com.saperion.intf.SaSaveInfo updateDocument(Properties properties, com.saperion.bean.ContentStream[] content, String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) throws DocumentAccessException, SystemException, AuthenticationException Deprecated.Update a document.- Specified by:
updateDocument
in interfaceDocumentService
- Parameters:
properties
- Propertiescontent
- Document contentcomment
- revision commentdocId
- Document IDcheckin
- True for checkinlookup
- True for lookup tableselectedImage
- Selected image- Returns:
- true if success
- Throws:
DocumentAccessException
- document access exceptionSystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
updateDocument
public DocumentId updateDocument(DocumentId docId, DataToUpdate data, UpdateSettings settings) throws SystemException, AuthenticationException, DocumentAccessException Updates the document identfied by docId using the specified data and settings.- Specified by:
updateDocument
in interfaceDocumentService
- Parameters:
docId
- ID of the document to updatedata
- data to update (content and/or metadata)settings
- setting to use when updating- Returns:
- ID of the updated document
- Throws:
SystemException
- system error when updatingAuthenticationException
- insufficient rights or logged offDocumentAccessException
- insufficient rights (ACL-based)- See Also:
-
getIXOSAnnotation
Reads the IXOS annotation for this document.- Specified by:
getIXOSAnnotation
in interfaceDocumentService
- Parameters:
hdoc
- Document ID- Returns:
- ISOS Annotation as string
- Throws:
AuthenticationException
- AuthenticationExceptionSystemException
- SystemException- See Also:
-
removeIXOSAnno
public final void removeIXOSAnno(DocumentId docId) throws DocumentAccessException, SystemException, AuthenticationException Remove the IXOS annotation from content list.- Specified by:
removeIXOSAnno
in interfaceDocumentService
- Parameters:
docId
- Document ID- Throws:
DocumentAccessException
- document access exceptionSystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
updateDocument
@Deprecated public final com.saperion.intf.SaSaveInfo updateDocument(List<FieldResultBean> properties, com.saperion.bean.ContentStream[] content, String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) throws DocumentAccessException, SystemException, AuthenticationException Deprecated.Update a document.- Specified by:
updateDocument
in interfaceDocumentService
- Parameters:
properties
- Propertiescontent
- Document contentcomment
- revision commentdocId
- Document IDcheckin
- True for checkinlookup
- True for lookup tableselectedImage
- Selected image- Returns:
- true if success
- Throws:
DocumentAccessException
- document access exceptionSystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
addDocument
public final DocumentId addDocument(List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls) throws SystemException, AuthenticationException Adds a new document to the archive.- Specified by:
addDocument
in interfaceDocumentService
- Parameters:
properties
- meta datacontent
- contentcomment
- commentddcName
- name of the ddcacls
- semicolon separated string of ACL names- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
addDocument
@Deprecated public final DocumentId addDocument(Properties properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls) throws SystemException, AuthenticationException Deprecated.Adds a new document to the archive.- Specified by:
addDocument
in interfaceDocumentService
- Parameters:
properties
- meta datacontent
- contentcomment
- commentddcName
- name of the ddcacls
- semicolon separated string of ACL names- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
addDocument
public DocumentId addDocument(List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, String comment, String ddcName, String acls, Map<String, DocumentVariable> variables) throws SystemException, AuthenticationExceptionAdds a new document to the archive.- Specified by:
addDocument
in interfaceDocumentService
- Parameters:
properties
- meta datacontent
- contentcomment
- commentddcName
- name of the ddcacls
- semicolon separated string of ACL namesvariables
- variables to add to the document- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
addDocument
public DocumentId addDocument(Map<String, Object> properties, com.saperion.bean.ContentStream[] content, String comment, String ddcName, String acls, Map<String, throws SystemException, AuthenticationExceptionDocumentVariable> variables) Adds a new document to the archive.- Specified by:
addDocument
in interfaceDocumentService
- Parameters:
properties
- meta datacontent
- contentcomment
- commentddcName
- name of the ddcacls
- semicolon separated string of ACL namesvariables
- variables to add to the document- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
createLookupItem
public final DocumentId createLookupItem(List<FieldResultBean> properties, String ddcName) throws SystemException, AuthenticationException Create a new lookup entry.- Specified by:
createLookupItem
in interfaceDocumentService
- Parameters:
properties
- meta dataddcName
- name of the ddc- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
updateLookupItem
public void updateLookupItem(String sysRowId, List<FieldResultBean> properties, String ddcName) throws SystemException, AuthenticationException Update a lookup entry.- Specified by:
updateLookupItem
in interfaceDocumentService
- Parameters:
sysRowId
- SysRowId of the lookup entryproperties
- meta dataddcName
- name of the ddc- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
updateLookupItem
public void updateLookupItem(String sysRowId, List<FieldResultBean> properties, String ddcName, boolean isDeleted) throws SystemException, AuthenticationException Update a lookup entry.- Specified by:
updateLookupItem
in interfaceDocumentService
- Parameters:
sysRowId
- SysRowId of the lookup entryproperties
- meta dataddcName
- name of the ddcisDeleted
- indicates if the document is deleted or not- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getLockData
Returns the lock data for the specified document.- Specified by:
getLockData
in interfaceDocumentService
- Parameters:
id
- document id- Returns:
- lock data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getLockData
public ResultLockData getLockData(DocumentId id, boolean isDeleted) throws SystemException, AuthenticationException Returns the lock data for the specified document.- Specified by:
getLockData
in interfaceDocumentService
- Parameters:
id
- document idisDeleted
- pass true if the document is deleted (sysIndexState = 65002)- Returns:
- lock data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
checkoutDocument
public void checkoutDocument(DocumentId id) throws SystemException, AuthenticationException, DocumentAccessException, CheckoutFailedException Checkout a document.- Specified by:
checkoutDocument
in interfaceDocumentService
- Parameters:
id
- Document id- Throws:
DocumentAccessException
SystemException
- System exceptionAuthenticationException
- Authentication exceptionCheckoutFailedException
- thrown when the checkout-operation did not cause an exception but did not actually checkout the document. Happens on image-files.- See Also:
-
checkoutDocument
public void checkoutDocument(DocumentId id, boolean withShareBase, int[] shareBaseDocIds) throws SystemException, AuthenticationException, DocumentAccessException, CheckoutFailedException Checkout a document.- Specified by:
checkoutDocument
in interfaceDocumentService
- Parameters:
id
- Document idwithShareBase
- true if open document is checked out with ShareBase else falseshareBaseDocIds
- Array of sharebase doc ids for open checkout docs- Throws:
DocumentAccessException
SystemException
- System exceptionAuthenticationException
- Authentication exceptionCheckoutFailedException
- thrown when the checkout-operation did not cause an exception but did not actually checkout the document. Happens on image-files.- See Also:
-
releaseDocument
public void releaseDocument(DocumentId id, String comment) throws SystemException, AuthenticationException, DocumentAccessException Release a document.- Specified by:
releaseDocument
in interfaceDocumentService
- Parameters:
id
- Document idcomment
- the revision comment- Throws:
DocumentAccessException
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getReleaseHdoc
Gets the last released hdoc.- Specified by:
getReleaseHdoc
in interfaceDocumentService
- Parameters:
hDoc
- the h doc- Returns:
- the release hdoc
- Throws:
AuthenticationException
- the authentication exceptionSystemException
- the system exception- See Also:
-
discardCheckout
public void discardCheckout(DocumentId id) throws SystemException, AuthenticationException, DocumentAccessException Discards checkout of a document.- Specified by:
discardCheckout
in interfaceDocumentService
- Parameters:
id
- Document id- Throws:
DocumentAccessException
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getRevisionInfo
public ResultProperties getRevisionInfo(DocumentId id) throws DatabaseException, AuthenticationException, SystemException, DocumentIdentificationException Reads the properties of the specified revision.- Specified by:
getRevisionInfo
in interfaceDocumentService
- Parameters:
id
- id identifying the revision (revision-id must be set!)- Returns:
- revision properties
- Throws:
DatabaseException
- database exceptionAuthenticationException
- authentication exceptionSystemException
- system exceptionDocumentIdentificationException
- if the id does not contain the revision id- See Also:
-
getDocumentInfo
public ResultProperties getDocumentInfo(DocumentId id) throws SystemException, AuthenticationException Reads the document properties.- Specified by:
getDocumentInfo
in interfaceDocumentService
- Parameters:
id
- Document id- Returns:
- Document properties
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getDocumentInfo
public ResultProperties getDocumentInfo(DocumentId id, boolean isDeleted) throws SystemException, AuthenticationException Reads the document properties.- Specified by:
getDocumentInfo
in interfaceDocumentService
- Parameters:
id
- Document idisDeleted
- pass true if the document is deleted (sysIndexState = 65002)- Returns:
- Document properties
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getDocumentVersionIds
public List<String> getDocumentVersionIds(DocumentId id) throws SystemException, AuthenticationException Returns a list of all version IDs for the specified document.- Specified by:
getDocumentVersionIds
in interfaceDocumentService
- Parameters:
id
- document ID- Returns:
- list of version IDs
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getDocumentVersion
public DocumentVersionInfo getDocumentVersion(String versionId) throws DatabaseException, AuthenticationException, SystemException Returns the metadata of the specified version.- Specified by:
getDocumentVersion
in interfaceDocumentService
- Parameters:
versionId
- ID of the version- Returns:
- version information
- Throws:
DatabaseException
- database exceptionAuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getDocumentVersions
public List<DocumentVersionInfo> getDocumentVersions(DocumentId id) throws SystemException, AuthenticationException Retrieves information about a document's versions.- Specified by:
getDocumentVersions
in interfaceDocumentService
- Parameters:
id
- document id- Returns:
- list with DocumentVersionInfo objects
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getDocumentVersions
public List<DocumentVersionInfo> getDocumentVersions(String ddcName, String objectId) throws SystemException, AuthenticationException Retrieves information about a document's versions. For use in servlets.- Specified by:
getDocumentVersions
in interfaceDocumentService
- Parameters:
ddcName
- ddc nameobjectId
- object id of the document (SysRowId)- Returns:
- list with DocumentVersionInfo objects
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
resolveLatestHdoc
@Deprecated public String resolveLatestHdoc(String oldHdoc) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException Deprecated.useresolveLatestRevision(String)
insteadResolve latest hdoc(revision) for the given hdoc.- Specified by:
resolveLatestHdoc
in interfaceDocumentService
- Parameters:
oldHdoc
- the old hdoc to lookup- Returns:
- the latest hdoc (revision) of the given hdoc
- Throws:
com.saperion.exception.SaSystemException
- system exceptioncom.saperion.exception.SaAuthenticationException
- authentication exception- See Also:
-
resolveLatestRevision
Resolve latest revision for the given hdoc.- Specified by:
resolveLatestRevision
in interfaceDocumentService
- Parameters:
oldHdoc
- the old hdoc to lookup- Returns:
- the latest hdoc (revision) of the given hdoc
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getThumbnail
public BufferedImage getThumbnail(DocumentId id, int height, int width, boolean color) throws SystemException, AuthenticationException Retrieves a thumbnail for the specified document or null if no thumbnail is available.- Specified by:
getThumbnail
in interfaceDocumentService
- Parameters:
id
- document idheight
- thumbnail heightwidth
- thumbnail widthcolor
- color option- Returns:
- thumbnail as BufferedImage in PNG format
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
writeAuditEvent
public void writeAuditEvent(String hdoc, DocumentService.AuditEvent event, String remark) throws SystemException, AuthenticationException Write audit event.- Specified by:
writeAuditEvent
in interfaceDocumentService
- Parameters:
hdoc
- Document HDOCevent
- Event typeremark
- Remark- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getSessionLocks
Returns a set of document IDs that are locked by this session.- Specified by:
getSessionLocks
in interfaceDocumentService
- Returns:
- set of document IDs
- See Also:
-
getNextCounterValue
@Deprecated public int getNextCounterValue(String ddcName, String fieldName, String dbFieldName) throws SystemException, AuthenticationException Deprecated.Counter fields cannot be set by API any more. This method is contained for backwards-compatibility and will be removed in a future version.This method is only contained for compatibility reasons and always returns -1 because counter-fields cannot be set by API any more.- Specified by:
getNextCounterValue
in interfaceDocumentService
- Parameters:
ddcName
- name of the ddcfieldName
- name of the counter fielddbFieldName
- database name of the counter field- Returns:
- next possible value as int
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getImageInfo
public DocumentImageInfo getImageInfo(DocumentId id) throws SystemException, AuthenticationException Reads the document image informations from backend.- Specified by:
getImageInfo
in interfaceDocumentService
- Parameters:
id
- Document Id- Returns:
- Image info
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getActualImage
public org.zkoss.image.Image getActualImage(DocumentId id) throws SystemException, AuthenticationException Reads the actual document image from backend.- Specified by:
getActualImage
in interfaceDocumentService
- Parameters:
id
- Document Id- Returns:
- Image
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
hasVariable
Checks, if the variable with the given case insensitive name exists.- Specified by:
hasVariable
in interfaceDocumentService
- Parameters:
variables
- Variableskey
- Key name- Returns:
- True, if exists
- See Also:
-
getVariable
Reads the variable with the given case insensitive name.- Specified by:
getVariable
in interfaceDocumentService
- Parameters:
variables
- Variableskey
- Key name- Returns:
- Variable value or null, if variable don't exists
- See Also:
-
getNotesContent
Reads notes element.- Specified by:
getNotesContent
in interfaceDocumentService
- Parameters:
hDoc
- Document id- Returns:
- Element content
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
setNotesContent
public void setNotesContent(String hDoc, String ddc, String content) throws SystemException, AuthenticationException Writes the notes element.- Specified by:
setNotesContent
in interfaceDocumentService
- Parameters:
hDoc
- Document idddc
- DDC namecontent
- element content- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
resolveSapURL
public com.saperion.bean.SapDocInfo resolveSapURL(String url) throws SystemException, SapViewerUrlException, AuthenticationException Resolves the given SAP URL and returns the SapDocInfo.- Specified by:
resolveSapURL
in interfaceDocumentService
- Parameters:
url
- URL- Returns:
- SAP Document info
- Throws:
SystemException
- System exceptionSapViewerUrlException
- resolving the url failedAuthenticationException
- Authentication exception- See Also:
-
getElementSizes
public Map<Integer,Long> getElementSizes(String hDoc, List<Integer> elementsWithoutSize) throws SystemException, AuthenticationException Retrieves a map with the sizes (in bytes) of elements for a given hDoc.- Specified by:
getElementSizes
in interfaceDocumentService
- Parameters:
hDoc
- hDoc of the documentelementsWithoutSize
- List of elementNumbers for elements without a file size.- Returns:
- Map of Element Numbers and its sizes in bytes
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getElementSize
public long getElementSize(String hDoc, int element) throws SystemException, AuthenticationException Retrieves the size of the specified element (in bytes).- Specified by:
getElementSize
in interfaceDocumentService
- Parameters:
hDoc
- hDoc of the documentelement
- number of the element- Returns:
- size in bytes
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getArchiveMetaInfo
public DocumentArchiveMetaInfo getArchiveMetaInfo(DocumentId documentId, boolean currentRevision) throws AuthenticationException, SystemException Retrieves the meta information of a document that is stored on the archive.- Specified by:
getArchiveMetaInfo
in interfaceDocumentService
- Parameters:
documentId
- The id of the document the information is aboutcurrentRevision
- if true, the latest revision of the document will be retrieved- Returns:
- The meta information of a document that is stored on the archive.
- Throws:
AuthenticationException
SystemException
- See Also:
-
getArchiveMetaInfo
public DocumentArchiveMetaInfo getArchiveMetaInfo(DocumentId documentId, boolean currentRevision, boolean previewMode) throws AuthenticationException, SystemException Retrieves the meta information of a document that is stored on the archive.- Specified by:
getArchiveMetaInfo
in interfaceDocumentService
- Parameters:
documentId
- The id of the document the information is aboutcurrentRevision
- if true, the latest revision of the document will be retrievedpreviewMode
- used to notify the document service that a preview-viewer in a mask requests the archive meta info (currently not in use)- Returns:
- The meta information of a document that is stored on the archive.
- Throws:
AuthenticationException
SystemException
- See Also:
-
hasBlackmarkers
Checks for blackmarkers.- Specified by:
hasBlackmarkers
in interfaceDocumentService
- Parameters:
docId
- The id of the document in question- Returns:
- Whether the document has blackmarker annotations
- Throws:
AuthenticationException
SystemException
- See Also:
-
getRenderedDocument
public List<com.saperion.connector.renditions.Rendition> getRenderedDocument(DocumentId documentId, com.saperion.connector.formats.TargetFormat format, boolean currentRevision) throws SystemException, AuthenticationException, RenderingFailedException Renders the specified document to the target format.- Specified by:
getRenderedDocument
in interfaceDocumentService
- Parameters:
documentId
- the document idformat
- the target formatcurrentRevision
- if true, the current revision of the document will be rendered- Returns:
- the rendered document
- Throws:
SystemException
- System exception when renderingAuthenticationException
- authentication exception when renderingRenderingFailedException
- rendering the document failed- See Also:
-
getDocumentMetadataFromArchive
public com.saperion.intf.SaPropertyValue[] getDocumentMetadataFromArchive(DocumentId id, boolean currentRevision) throws DocumentIdentificationException, SystemException, AuthenticationException, DatabaseException Returns the metadata of the document as read from the archive. The database will not be used to load the data.- Specified by:
getDocumentMetadataFromArchive
in interfaceDocumentService
- Parameters:
id
- document idcurrentRevision
- resolve current revision or not- Returns:
- document's metadata
- Throws:
DocumentIdentificationException
- revision id not set in document idSystemException
- system exception when loading metadataAuthenticationException
- authentication exception when loading metadataDatabaseException
- ddc exception when loading metadata
-
setDocumentRead
public void setDocumentRead(DocumentId id) throws DocumentIdentificationException, SystemException, AuthenticationException Sets the specified document's state to 'read' without creating a new revision. If the specified DDC does not contain the SYSDOCSTATE field, this method has no effect.- Specified by:
setDocumentRead
in interfaceDocumentService
- Parameters:
id
- document's ID- Throws:
DocumentIdentificationException
- missing information in IDSystemException
- system error when setting stateAuthenticationException
- authentication error when setting state- See Also:
-
setDocumentUnread
public void setDocumentUnread(DocumentId id) throws DocumentIdentificationException, SystemException, AuthenticationException Sets the specified document's state to 'unread' without creating a new revision. If the specified DDC does not contain the SYSDOCSTATE field, this method has no effect.- Specified by:
setDocumentUnread
in interfaceDocumentService
- Parameters:
id
- document's ID- Throws:
DocumentIdentificationException
- missing information in IDSystemException
- system error when setting stateAuthenticationException
- authentication error when setting state- See Also:
-
getFullTextFields
public Set<Map.Entry<String,String>> getFullTextFields(String ddcName, List<String> fullTextFields, String hdoc) throws SystemException - Specified by:
getFullTextFields
in interfaceDocumentService
- Parameters:
ddcName
- name of the DDCfullTextFields
- List of Fields which are of Text retrieval type. Make sure to prefixSaConstants.FULL_TEXT_COLUMN_PREFIX
hdoc
- hdoc of the document- Returns:
- Set of entries containing full text coulmn and corresponding value
- Throws:
SystemException
-
addDocument(Map, ContentStream[], String, String, String, Map)
instead