Package com.saperion.ngc.model.document
Interface DocumentService
-
- All Superinterfaces:
Service
- All Known Implementing Classes:
DocClassicConnectorService
public interface DocumentService extends Service
Interface for document services.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DocumentService.AuditEvent
Audit events.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COMP_ID
Name for SapCompId.static java.lang.String
COMP_TYPE
Name for SapCompType.static java.lang.String
IXOS_ANNO
Element name of IXOS annotations.static java.lang.String
NEEDED_COMP_ID
Value for SapCompId.static java.lang.String
NEEDED_COMP_TYPE
Value for SapCompType.static java.lang.String
NOTES_NAME
Filename for SAP notes.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DocumentId
addDocument(java.util.List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls)
Adds a new document to the archive.DocumentId
addDocument(java.util.List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls, java.util.Map<java.lang.String,DocumentVariable> variables)
Adds a new document to the archive.DocumentId
addDocument(java.util.Map<java.lang.String,java.lang.Object> properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls, java.util.Map<java.lang.String,DocumentVariable> variables)
Adds a new document to the archive.DocumentId
addDocument(java.util.Properties properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls)
Deprecated.void
checkoutDocument(DocumentId id)
Checkout a document.void
checkoutDocument(DocumentId id, boolean withShareBase, int[] shareBaseDocIds)
Checkout a document.DocumentId
createLookupItem(java.util.List<FieldResultBean> properties, java.lang.String ddcName)
Create a new lookup entry.boolean
deleteDocument(DocumentId id)
Delete a document.boolean
deleteDocument(DocumentId id, boolean finalDelete)
Delete a document.void
discardCheckout(DocumentId id)
Discards checkout of a document.ResultAccessData
getAccessData(DocumentId id)
Retrieves the access data for the specified document.ResultAccessData
getAccessData(java.lang.String revisionId)
Retrieves the access data fot the specified document.java.lang.String
getAcl(DocumentId id)
Deprecated.usegetAclNames(DocumentId)
instead.java.util.List<java.lang.String>
getAclNames(DocumentId id)
Retrieves the ACLs for the specified document or lookup entry.org.zkoss.image.Image
getActualImage(DocumentId id)
Reads the actual document image from backend.java.lang.String
getAnnotations(java.lang.String hDoc, int element)
Deprecated.usegetAnnotations(String, int, boolean)
insteadjava.lang.String
getAnnotations(java.lang.String hDoc, int element, boolean currentRevision)
Retrieves the annotations of a document.DocumentArchiveMetaInfo
getArchiveMetaInfo(DocumentId documentId, boolean currentRevision)
Retrieves the meta information of a document that is stored on the archive.DocumentArchiveMetaInfo
getArchiveMetaInfo(DocumentId documentId, boolean currentRevision, boolean previewMode)
Retrieves the meta information of a document that is stored on the archive.ResultProperties
getDocumentInfo(DocumentId id)
Reads the document properties.ResultProperties
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.DocumentVersionInfo
getDocumentVersion(java.lang.String versionId)
Returns the metadata of the specified version.java.util.List<java.lang.String>
getDocumentVersionIds(DocumentId id)
Returns a list of all version IDs for the specified document.java.util.List<DocumentVersionInfo>
getDocumentVersions(DocumentId id)
Retrieves information about a document's versions.java.util.List<DocumentVersionInfo>
getDocumentVersions(java.lang.String ddcName, java.lang.String objectId)
Retrieves information about a document's versions.long
getElementSize(java.lang.String hDoc, int element)
Retrieves the size of the specified element (in bytes).java.util.Map<java.lang.Integer,java.lang.Long>
getElementSizes(java.lang.String hDoc, java.util.List<java.lang.Integer> elementsWithoutSize)
Retrieves a map with the sizes (in bytes) of elements for a given hDoc.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getFullTextFields(java.lang.String ddcName, java.util.List<java.lang.String> fullTextFields, java.lang.String hdoc)
Fetches values of Full text columnsDocumentImageInfo
getImageInfo(DocumentId id)
Reads the document image informations from backend.java.lang.String
getIXOSAnnotation(java.lang.String hdoc)
Reads the IXOS annotation for this document.ResultLockData
getLockData(DocumentId id)
Returns the lock data for the specified document.ResultLockData
getLockData(DocumentId id, boolean isDeleted)
Returns the lock data for the specified document.ResultAccessData
getLookupEntryAccessData(DocumentId id)
Retrieves the access data for the specified lookup table entry.int
getNextCounterValue(java.lang.String ddcName, java.lang.String fieldName, java.lang.String dbFieldName)
Deprecated.Counter fields cannot be set by API any more.java.lang.String
getNotesContent(java.lang.String hDoc)
Reads notes element.PageList
getPageList(java.lang.String hDoc, int element, boolean currentRevision)
java.io.InputStream
getPageListStream(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements)
java.io.InputStream
getReleasedStream(java.lang.String hDoc, int element, boolean currentRevision)
Retrieves the content of a document.java.lang.String
getReleaseHdoc(java.lang.String hDoc)
Gets the last released hdoc.java.util.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.ResultProperties
getRevisionInfo(DocumentId id)
Reads the properties of the specified revision.java.util.Set<DocumentId>
getSessionLocks()
Returns a set of document IDs that are locked by this session.java.io.InputStream
getStream(java.lang.String hDoc, int element)
Retrieves the content of a document.java.io.InputStream
getStream(java.lang.String hDoc, int element, boolean currentRevision)
Retrieves the content of a document.java.io.InputStream
getStream(java.lang.String hDoc, int element, boolean currentRevision, boolean withAnnotations)
Retrieves the content of a document.java.io.InputStream
getStream(java.lang.String hDoc, int element, boolean currentRevision, long start, long size)
Retrieves the content of a document.java.awt.image.BufferedImage
getThumbnail(DocumentId id, int height, int width, boolean color)
Retrieves a thumbnail for the specified document or null if no thumbnail is available.java.lang.String
getVariable(java.util.Properties variables, java.lang.String key)
Reads the variable with the given case insensitive name.boolean
hasBlackmarkers(DocumentId docId)
Checks for blackmarkers.boolean
hasVariable(java.util.Properties variables, java.lang.String key)
Checks, if the variable with the given case insensitive name exists.boolean
lockDocument(DocumentId id, DocumentService.AuditEvent event)
Lock document.void
releaseDocument(DocumentId id, java.lang.String comment)
Release a document.void
removeIXOSAnno(DocumentId docId)
Remove the IXOS annotation from content list.java.lang.String
resolveLatestHdoc(java.lang.String oldHdoc)
Deprecated.useresolveLatestRevision(String)
instead.java.lang.String
resolveLatestRevision(java.lang.String oldHdoc)
Resolve latest revision for the given hdoc.com.saperion.bean.SapDocInfo
resolveSapURL(java.lang.String url)
Resolves the given SAP URL and returns the SapDocInfo.void
setAcl(DocumentId id, java.lang.String acl, java.lang.String comment)
Deprecated.usesetAclNames(DocumentId, List, String)
instead.void
setAclNames(DocumentId id, java.util.List<java.lang.String> acls, java.lang.String comment)
Sets the ACL for the specified document or lookup table entry.void
setAnnotations(java.lang.String hDoc, int element, java.lang.String annotations)
Sets the annotations of a document.void
setDocumentRead(DocumentId id)
Sets the specified document's state to 'read' without creating a new revision.void
setDocumentUnread(DocumentId id)
Sets the specified document's state to 'unread' without creating a new revision.void
setNotesContent(java.lang.String hDoc, java.lang.String ddc, java.lang.String content)
Writes the notes element.boolean
unlockDocument(DocumentId id)
Unlock document.DocumentId
updateDocument(DocumentId docId, DataToUpdate data, UpdateSettings settings)
Updates the document identfied by docId using the specified data and settings.com.saperion.intf.SaSaveInfo
updateDocument(java.util.List<FieldResultBean> properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage)
Deprecated.com.saperion.intf.SaSaveInfo
updateDocument(java.util.Properties properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage)
Deprecated.void
updateLookupItem(java.lang.String sysRowId, java.util.List<FieldResultBean> properties, java.lang.String ddcName)
Update a lookup entry.void
updateLookupItem(java.lang.String sysRowId, java.util.List<FieldResultBean> properties, java.lang.String ddcName, boolean isDeleted)
Update a lookup entry.void
writeAuditEvent(java.lang.String hdoc, DocumentService.AuditEvent event, java.lang.String remark)
Write audit event.
-
-
-
Field Detail
-
COMP_ID
static final java.lang.String COMP_ID
Name for SapCompId.- See Also:
- Constant Field Values
-
NEEDED_COMP_ID
static final java.lang.String NEEDED_COMP_ID
Value for SapCompId.- See Also:
- Constant Field Values
-
COMP_TYPE
static final java.lang.String COMP_TYPE
Name for SapCompType.- See Also:
- Constant Field Values
-
NEEDED_COMP_TYPE
static final java.lang.String NEEDED_COMP_TYPE
Value for SapCompType.- See Also:
- Constant Field Values
-
NOTES_NAME
static final java.lang.String NOTES_NAME
Filename for SAP notes.- See Also:
- Constant Field Values
-
IXOS_ANNO
static final java.lang.String IXOS_ANNO
Element name of IXOS annotations.- See Also:
- Constant Field Values
-
-
Method Detail
-
getReleasedStream
java.io.InputStream getReleasedStream(java.lang.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.
- 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
-
getStream
java.io.InputStream getStream(java.lang.String hDoc, int element) throws BinaryUnavailableException, AuthenticationException
Retrieves the content of a document. For use in servlets.- 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
-
getStream
java.io.InputStream getStream(java.lang.String hDoc, int element, boolean currentRevision) throws BinaryUnavailableException, AuthenticationException
Retrieves the content of a document. For use in servlets.- 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
-
getStream
java.io.InputStream getStream(java.lang.String hDoc, int element, boolean currentRevision, boolean withAnnotations) throws BinaryUnavailableException, AuthenticationException
Retrieves the content of a document. For use in servlets.- 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
-
getStream
java.io.InputStream getStream(java.lang.String hDoc, int element, boolean currentRevision, long start, long size) throws BinaryUnavailableException, AuthenticationException
Retrieves the content of a document. For use in servlets.- 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
-
getPageList
PageList getPageList(java.lang.String hDoc, int element, boolean currentRevision) throws BinaryUnavailableException, AuthenticationException
- 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
-
getAnnotations
java.lang.String getAnnotations(java.lang.String hDoc, int element, boolean currentRevision) throws AuthenticationException, SystemException
Retrieves the annotations of a document.- Parameters:
hDoc
- document hDocelement
- document elementcurrentRevision
- currentRevision- Returns:
- annotations string
- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error
-
getAnnotations
@Deprecated java.lang.String getAnnotations(java.lang.String hDoc, int element) throws AuthenticationException, SystemException
Deprecated.usegetAnnotations(String, int, boolean)
insteadRetrieves the annotations of a document.- Parameters:
hDoc
- document hDocelement
- document element- Returns:
- annotations string
- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error
-
setAnnotations
void setAnnotations(java.lang.String hDoc, int element, java.lang.String annotations) throws AuthenticationException, SystemException
Sets the annotations of a document.- Parameters:
hDoc
- document hDocelement
- document elementannotations
- annotations string- Throws:
AuthenticationException
- if user identification failsSystemException
- in case of common system error
-
getAccessData
ResultAccessData getAccessData(DocumentId id) throws SystemException, AuthenticationException
Retrieves the access data for the specified document.- Parameters:
id
- document id- Returns:
- access data
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getLookupEntryAccessData
ResultAccessData getLookupEntryAccessData(DocumentId id) throws SystemException, AuthenticationException
Retrieves the access data for the specified lookup table entry.- 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
-
getAccessData
ResultAccessData getAccessData(java.lang.String revisionId) throws SystemException, AuthenticationException
Retrieves the access data fot the specified document. For use in servlets.- Parameters:
revisionId
- document's revision id- Returns:
- access data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getAcl
@Deprecated java.lang.String getAcl(DocumentId id) throws SystemException, AuthenticationException
Deprecated.usegetAclNames(DocumentId)
instead. Will be removed in 8.1.Retrieves the ACLs for the specified document.- Parameters:
id
- document id- Returns:
- ACL string (separated by
SaConstants.ACL_DELIMITER
to get multiple ACLs) - Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
setAcl
@Deprecated void setAcl(DocumentId id, java.lang.String acl, java.lang.String comment) throws SystemException, AuthenticationException
Deprecated.usesetAclNames(DocumentId, List, String)
instead. Will be removed in 8.1.Sets the ACLs for the specified document.- Parameters:
id
- document idacl
- ACL string (separated bySaConstants.ACL_DELIMITER
to set multiple ACLs)comment
- revision comment- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getAclNames
java.util.List<java.lang.String> getAclNames(DocumentId id) throws SystemException, AuthenticationException
Retrieves the ACLs for the specified document or lookup entry.- Parameters:
id
- document id- Returns:
- a list of ACL names that are set on the specified document
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
setAclNames
void setAclNames(DocumentId id, java.util.List<java.lang.String> acls, java.lang.String comment) throws SystemException, AuthenticationException
Sets the ACL for the specified document or lookup table entry.- Parameters:
id
- document idacls
- a list of ACL names to set on the specified documentcomment
- revision comment- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
lockDocument
boolean lockDocument(DocumentId id, DocumentService.AuditEvent event) throws SystemException, AuthenticationException, DocumentLockException
Lock document.- Parameters:
id
- Document ID- Returns:
- True, if done
- Throws:
DocumentLockException
- lock exceptionAuthenticationException
- authentication exceptionSystemException
- system exception
-
unlockDocument
boolean unlockDocument(DocumentId id) throws SystemException, AuthenticationException, DocumentLockException
Unlock document.- Parameters:
id
- Document ID- Returns:
- True, if done
- Throws:
DocumentLockException
- lock exceptionAuthenticationException
- authentication exceptionSystemException
- system exception
-
deleteDocument
boolean deleteDocument(DocumentId id) throws SystemException, AuthenticationException, DocumentAccessException
Delete a document.- Parameters:
id
- Document id- Returns:
- True, if done
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentAccessException
- document access exception
-
deleteDocument
boolean deleteDocument(DocumentId id, boolean finalDelete) throws SystemException, AuthenticationException, DocumentAccessException
Delete a document.- 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
-
updateDocument
@Deprecated com.saperion.intf.SaSaveInfo updateDocument(java.util.List<FieldResultBean> properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) throws SystemException, AuthenticationException, DocumentAccessException
Deprecated.Update a document.- Parameters:
properties
- PropertiesdocId
- Document IDcontent
- Document contentcomment
- revision commentcheckin
- True for checkinlookup
- True for lookup tableselectedImage
- Selected image- Returns:
- true if success
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentAccessException
- document access exception
-
updateDocument
@Deprecated com.saperion.intf.SaSaveInfo updateDocument(java.util.Properties properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, DocumentId docId, boolean checkin, boolean lookup, int selectedImage) throws SystemException, AuthenticationException, DocumentAccessException
Deprecated.Update a document.- Parameters:
properties
- PropertiesdocId
- Document IDcontent
- Document contentcomment
- revision commentcheckin
- True for checkinlookup
- True for lookup tableselectedImage
- Selected image- Returns:
- true if success
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentAccessException
- document access exception
-
updateDocument
DocumentId updateDocument(DocumentId docId, DataToUpdate data, UpdateSettings settings) throws SystemException, AuthenticationException, DocumentAccessException
Updates the document identfied by docId using the specified data and settings.- 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)
-
getIXOSAnnotation
java.lang.String getIXOSAnnotation(java.lang.String hdoc) throws AuthenticationException, SystemException
Reads the IXOS annotation for this document.- Parameters:
hdoc
- Document ID- Returns:
- ISOS Annotation as string
- Throws:
AuthenticationException
- AuthenticationExceptionSystemException
- SystemException
-
removeIXOSAnno
void removeIXOSAnno(DocumentId docId) throws DocumentAccessException, SystemException, AuthenticationException
Remove the IXOS annotation from content list.- Parameters:
docId
- Document ID- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDocumentAccessException
- document access exception
-
getLockData
ResultLockData getLockData(DocumentId id) throws SystemException, AuthenticationException
Returns the lock data for the specified document.- Parameters:
id
- document id- Returns:
- lock data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getLockData
ResultLockData getLockData(DocumentId id, boolean isDeleted) throws SystemException, AuthenticationException
Returns the lock data for the specified document.- Parameters:
id
- document idisDeleted
- pass true if the document is deleted (sysIndexState = 65002)- Returns:
- lock data
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
checkoutDocument
void checkoutDocument(DocumentId id) throws SystemException, AuthenticationException, DocumentAccessException, CheckoutFailedException
Checkout a document.- Parameters:
id
- Document id- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exceptionDocumentAccessException
- access exceptionCheckoutFailedException
- thrown when the checkout-operation did not cause an exception but did not actually checkout the document. Happens on image-files.
-
checkoutDocument
void checkoutDocument(DocumentId id, boolean withShareBase, int[] shareBaseDocIds) throws SystemException, AuthenticationException, DocumentAccessException, CheckoutFailedException
Checkout a document.- 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:
SystemException
- System exceptionAuthenticationException
- Authentication exceptionDocumentAccessException
- access exceptionCheckoutFailedException
- thrown when the checkout-operation did not cause an exception but did not actually checkout the document. Happens on image-files.
-
releaseDocument
void releaseDocument(DocumentId id, java.lang.String comment) throws SystemException, AuthenticationException, DocumentAccessException
Release a document.- Parameters:
id
- Document idcomment
- the revision comment- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exceptionDocumentAccessException
- access exception
-
getReleaseHdoc
java.lang.String getReleaseHdoc(java.lang.String hDoc) throws AuthenticationException, SystemException
Gets the last released hdoc.- Parameters:
hDoc
- the h doc- Returns:
- the release hdoc
- Throws:
AuthenticationException
- the authentication exceptionSystemException
- the system exception
-
discardCheckout
void discardCheckout(DocumentId id) throws SystemException, AuthenticationException, DocumentAccessException
Discards checkout of a document.- Parameters:
id
- Document id- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exceptionDocumentAccessException
- access exception
-
getDocumentInfo
ResultProperties getDocumentInfo(DocumentId id) throws SystemException, AuthenticationException
Reads the document properties.- Parameters:
id
- Document id- Returns:
- Document properties
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getDocumentInfo
ResultProperties getDocumentInfo(DocumentId id, boolean isDeleted) throws SystemException, AuthenticationException
Reads the document properties.- Parameters:
id
- Document idisDeleted
- pass true if the document is deleted (sysIndexState = 65002)- Returns:
- Document properties
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getRevisionInfo
ResultProperties getRevisionInfo(DocumentId id) throws SystemException, AuthenticationException, DatabaseException, DocumentIdentificationException
Reads the properties of the specified revision.- Parameters:
id
- id identifying the revision (revision-id must be set!)- Returns:
- revision properties
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exceptionDatabaseException
- database exceptionDocumentIdentificationException
- if the id does not contain the revision id
-
getDocumentVersions
java.util.List<DocumentVersionInfo> getDocumentVersions(DocumentId id) throws SystemException, AuthenticationException
Retrieves information about a document's versions.- Parameters:
id
- document id- Returns:
- list with DocumentVersionInfo objects
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getDocumentVersionIds
java.util.List<java.lang.String> getDocumentVersionIds(DocumentId id) throws SystemException, AuthenticationException
Returns a list of all version IDs for the specified document.- Parameters:
id
- document ID- Returns:
- list of version IDs
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getDocumentVersion
DocumentVersionInfo getDocumentVersion(java.lang.String versionId) throws DatabaseException, AuthenticationException, SystemException
Returns the metadata of the specified version.- Parameters:
versionId
- ID of the version- Returns:
- version information
- Throws:
DatabaseException
- database exceptionAuthenticationException
- authentication exceptionSystemException
- system exception
-
getDocumentVersions
java.util.List<DocumentVersionInfo> getDocumentVersions(java.lang.String ddcName, java.lang.String objectId) throws SystemException, AuthenticationException
Retrieves information about a document's versions. For use in servlets.- Parameters:
ddcName
- ddc nameobjectId
- object id of the document (SysRowId)- Returns:
- list with DocumentVersionInfo objects
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
resolveLatestHdoc
@Deprecated java.lang.String resolveLatestHdoc(java.lang.String oldHdoc) throws com.saperion.exception.SaSystemException, com.saperion.exception.SaAuthenticationException
Deprecated.useresolveLatestRevision(String)
instead.Resolve latest hdoc(revision) for the given hdoc.- 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
-
resolveLatestRevision
java.lang.String resolveLatestRevision(java.lang.String oldHdoc) throws SystemException, AuthenticationException
Resolve latest revision for the given hdoc.- Parameters:
oldHdoc
- the old hdoc to lookup- Returns:
- the latest hdoc (revision) of the given hdoc
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getThumbnail
java.awt.image.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.- Parameters:
id
- document idheight
- thumbnail heightwidth
- thumbnail widthcolor
- color option- Returns:
- thumbnail as BufferedImage in PNG format
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
writeAuditEvent
void writeAuditEvent(java.lang.String hdoc, DocumentService.AuditEvent event, java.lang.String remark) throws SystemException, AuthenticationException
Write audit event.- Parameters:
hdoc
- Document HDOCevent
- Event typeremark
- Remark- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getSessionLocks
java.util.Set<DocumentId> getSessionLocks()
Returns a set of document IDs that are locked by this session.- Returns:
- set of document IDs
-
addDocument
DocumentId addDocument(java.util.List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls) throws SystemException, AuthenticationException
Adds a new document to the archive.- 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
-
addDocument
DocumentId addDocument(java.util.List<FieldResultBean> properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls, java.util.Map<java.lang.String,DocumentVariable> variables) throws SystemException, AuthenticationException
Adds a new document to the archive.- 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
-
addDocument
@Deprecated DocumentId addDocument(java.util.Properties properties, com.saperion.rmi.SaContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls) throws SystemException, AuthenticationException
Deprecated.Adds a new document to the archive.- 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
-
addDocument
DocumentId addDocument(java.util.Map<java.lang.String,java.lang.Object> properties, com.saperion.bean.ContentStream[] content, java.lang.String comment, java.lang.String ddcName, java.lang.String acls, java.util.Map<java.lang.String,DocumentVariable> variables) throws SystemException, AuthenticationException
Adds a new document to the archive.- 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
-
createLookupItem
DocumentId createLookupItem(java.util.List<FieldResultBean> properties, java.lang.String ddcName) throws SystemException, AuthenticationException
Create a new lookup entry.- Parameters:
properties
- meta dataddcName
- name of the ddc- Returns:
- id of the new document
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
updateLookupItem
void updateLookupItem(java.lang.String sysRowId, java.util.List<FieldResultBean> properties, java.lang.String ddcName) throws SystemException, AuthenticationException
Update a lookup entry.- Parameters:
sysRowId
- SysRowId of the lookup entryproperties
- meta dataddcName
- name of the ddc- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
updateLookupItem
void updateLookupItem(java.lang.String sysRowId, java.util.List<FieldResultBean> properties, java.lang.String ddcName, boolean isDeleted) throws SystemException, AuthenticationException
Update a lookup entry.- 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
-
getNextCounterValue
@Deprecated int getNextCounterValue(java.lang.String ddcName, java.lang.String fieldName, java.lang.String dbFieldName) throws SystemException, AuthenticationException
Deprecated.Counter fields cannot be set by API any more. This method is contained for backwards-compatibility only 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.- 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
-
getImageInfo
DocumentImageInfo getImageInfo(DocumentId id) throws SystemException, AuthenticationException
Reads the document image informations from backend.- Parameters:
id
- Document Id- Returns:
- Image info
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getActualImage
org.zkoss.image.Image getActualImage(DocumentId id) throws SystemException, AuthenticationException
Reads the actual document image from backend.- Parameters:
id
- Document Id- Returns:
- Image
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception
-
getPageListStream
java.io.InputStream getPageListStream(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements)
- Parameters:
documentId
- ID of the documentdocumentElements
- list of the document's elements- Returns:
- stream containing the page-list
-
getNotesContent
java.lang.String getNotesContent(java.lang.String hDoc) throws SystemException, AuthenticationException
Reads notes element.- Parameters:
hDoc
- Document id- Returns:
- Element content
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
setNotesContent
void setNotesContent(java.lang.String hDoc, java.lang.String ddc, java.lang.String content) throws SystemException, AuthenticationException
Writes the notes element.- Parameters:
hDoc
- Document idddc
- DDC namecontent
- element content- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
resolveSapURL
com.saperion.bean.SapDocInfo resolveSapURL(java.lang.String url) throws SystemException, SapViewerUrlException, AuthenticationException
Resolves the given SAP URL and returns the SapDocInfo.- Parameters:
url
- URL- Returns:
- SAP Document info
- Throws:
SystemException
- System exceptionSapViewerUrlException
- resolving the url failedAuthenticationException
- Authentication exception
-
hasVariable
boolean hasVariable(java.util.Properties variables, java.lang.String key)
Checks, if the variable with the given case insensitive name exists.- Parameters:
variables
- Variableskey
- Key name- Returns:
- True, if exists
-
getVariable
java.lang.String getVariable(java.util.Properties variables, java.lang.String key)
Reads the variable with the given case insensitive name.- Parameters:
variables
- Variableskey
- Key name- Returns:
- Variable value or null, if variable don't exists
-
getElementSizes
java.util.Map<java.lang.Integer,java.lang.Long> getElementSizes(java.lang.String hDoc, java.util.List<java.lang.Integer> elementsWithoutSize) throws SystemException, AuthenticationException
Retrieves a map with the sizes (in bytes) of elements for a given hDoc.- 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
-
getElementSize
long getElementSize(java.lang.String hDoc, int element) throws SystemException, AuthenticationException
Retrieves the size of the specified element (in bytes).- Parameters:
hDoc
- hDoc of the documentelement
- number of the element- Returns:
- size in bytes
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception
-
getArchiveMetaInfo
DocumentArchiveMetaInfo getArchiveMetaInfo(DocumentId documentId, boolean currentRevision) throws AuthenticationException, SystemException
Retrieves the meta information of a document that is stored on the archive.- 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
- Authentication exceptionSystemException
- System exception
-
getArchiveMetaInfo
DocumentArchiveMetaInfo getArchiveMetaInfo(DocumentId documentId, boolean currentRevision, boolean previewMode) throws AuthenticationException, SystemException
Retrieves the meta information of a document that is stored on the archive.- 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
- Authentication exceptionSystemException
- System exception
-
hasBlackmarkers
boolean hasBlackmarkers(DocumentId docId) throws AuthenticationException, SystemException
Checks for blackmarkers.- Parameters:
docId
- The id of the document in question- Returns:
- Whether the document has blackmarker annotations
- Throws:
AuthenticationException
- Authentication exceptionSystemException
- System exception
-
getRenderedDocument
java.util.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.- 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
-
getDocumentMetadataFromArchive
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.- 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
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.- Parameters:
id
- document's ID- Throws:
DocumentIdentificationException
- missing information in IDSystemException
- system error when setting stateAuthenticationException
- authentication error when setting state
-
setDocumentUnread
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.- Parameters:
id
- document's ID- Throws:
DocumentIdentificationException
- missing information in IDSystemException
- system error when setting stateAuthenticationException
- authentication error when setting state
-
getFullTextFields
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getFullTextFields(java.lang.String ddcName, java.util.List<java.lang.String> fullTextFields, java.lang.String hdoc) throws SystemException, AuthenticationException
Fetches values of Full text columns- 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
AuthenticationException
-
-