Package com.logicaldoc.core.document
Class AbstractDocument
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.metadata.ExtensibleObject
com.logicaldoc.core.security.SecurableExtensibleObject
com.logicaldoc.core.document.AbstractDocument
- All Implemented Interfaces:
Securable
,TransactionalObject
,Serializable
public abstract class AbstractDocument
extends SecurableExtensibleObject
implements TransactionalObject
The Document is the central entity of LogicalDOC. A Document is a persistent
business object and represents metadata over a single file stored into the
DMS.
Each document has one or more Versions. The most recent version is the one used as default when we refer to a Document, but all previous versions are accessible from the history even if the are not indexed.
Each Version carries out two main informations, the version code itself that is called simply 'version', and the file version, called 'fileVersion'. The first identified the Version itself while the second refers to the file content. In general not all updates to a document involves the upload of a new file. A Document is written in a single language, this language defines the full-text index in which the document's content will be stored.
- Since:
- 4.5
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Document's status archived: 3static final int
Document's status checked out: 1static final int
Document's status locked: 2static final int
Document's status unlocked: 0static final int
Document's export status unlocked: 0static final int
Document's export status unlocked: 0static final int
Document's indexed status indexed: 1static final int
Document's indexed status skip: 2static final int
Document's indexed status to index: 0static final int
Document's indexed status index just metadata: 3static final int
Document's nature regular document: 0Fields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
copyAttributes
(AbstractDocument docVO) Copies in the current instance the attributes of the passed values object, but NOT the IDint
getColor()
long
Each document can be identified with a custom identifiergetDate()
The document's last publication date.The document's digestint
If the document is an alias, it is the id of the referenced documentThe last archive in which the document was exportedThe last archive name in which the document was exportedint
The document export statusThe last exported versionThe original file namelong
The document's file size expressed in bytesThe working file version.Retrieve the folder owning this documentgetIcon()
The icon for this document, it may be kept from file name extensionint
Defines if the document is immutableint
The document's language.int
getLinks()
The id of the user that locked this document and that currently locks itint
int
getOcrd()
int
getPages()
int
int
The username that published this documentlong
The user id of the user that published this documentint
Return 1 if the document was signedint
int
The document statusgetTags()
The set of tags for this document.getTgs()
getTitle()
Computes the title that is the file name without the extensionGets the unique ID of the transactiongetType()
The document type, that is the file extensionThe working version (the most recent version)boolean
Checks if the document is accessible with the given passwordboolean
boolean
boolean
boolean
void
setBarcoded
(int barcoded) void
setBarcodeTemplateId
(Long barcodeTemplateId) void
void
setComment
(String comment) void
setCreator
(String creator) void
setCreatorId
(long creatorId) void
setCustomId
(String customId) void
void
setDecodedPassword
(String pwd) Sets the password and encode itvoid
setDeleteUser
(String deleteUser) void
setDeleteUserId
(Long deleteUserId) void
void
setDocAttrs
(int docAttrs) void
void
setDocRefType
(String docRefType) void
setExportId
(Long exportId) void
setExportName
(String exportName) void
setExportStatus
(int exportStatus) void
setExportVersion
(String exportVersion) void
setExtResId
(String extResId) void
setFileName
(String fileName) void
setFileSize
(long fileSize) void
setFileVersion
(String fileVersion) void
void
void
setImmutable
(int immutable) void
setIndexed
(int indexed) void
setLanguage
(String language) void
setLinks
(int links) void
void
setLockUser
(String lockUser) void
setLockUserId
(Long lockUserId) void
setModified
(boolean modified) void
setNature
(int nature) void
setOcrd
(int ocrd) void
setOcrTemplateId
(Long ocrTemplateId) void
setPages
(int pages) void
setPassword
(String password) void
setPreviewPages
(int previewPages) void
setPublished
(int published) void
setPublisher
(String publisher) void
setPublisherId
(long publisherId) void
void
setSigned
(int signed) void
setStamped
(int stamped) void
setStartPublishing
(Date startPublishing) void
setStatus
(int status) void
setStopPublishing
(Date stopPublishing) void
void
setTagsFromWords
(Set<String> tgs) void
void
setTransactionId
(String transactionId) Sets the transaction's identifiervoid
void
setVersion
(String version) Iterates over the versions searching for the specified idvoid
setWorkflowStatus
(String workflowStatus) void
setWorkflowStatusDisplay
(String workflowStatusDisplay) toString()
Methods inherited from class com.logicaldoc.core.security.SecurableExtensibleObject
addAccessControlEntry, equals, getAccessControlEntry, getAccessControlList, hashCode, setAccessControlList
Methods inherited from class com.logicaldoc.core.metadata.ExtensibleObject
getAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getAttributes, getTemplate, getTemplateId, getTemplateName, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, setAttributes, setTemplate, setTemplateId, setTemplateName, setValue, setValues
Methods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Field Details
-
DOC_UNLOCKED
public static final int DOC_UNLOCKEDDocument's status unlocked: 0- See Also:
-
DOC_CHECKED_OUT
public static final int DOC_CHECKED_OUTDocument's status checked out: 1- See Also:
-
DOC_LOCKED
public static final int DOC_LOCKEDDocument's status locked: 2- See Also:
-
DOC_ARCHIVED
public static final int DOC_ARCHIVEDDocument's status archived: 3- See Also:
-
EXPORT_UNLOCKED
public static final int EXPORT_UNLOCKEDDocument's export status unlocked: 0- See Also:
-
EXPORT_LOCKED
public static final int EXPORT_LOCKEDDocument's export status unlocked: 0- See Also:
-
INDEX_TO_INDEX
public static final int INDEX_TO_INDEXDocument's indexed status to index: 0- See Also:
-
INDEX_INDEXED
public static final int INDEX_INDEXEDDocument's indexed status indexed: 1- See Also:
-
INDEX_SKIP
public static final int INDEX_SKIPDocument's indexed status skip: 2- See Also:
-
INDEX_TO_INDEX_METADATA
public static final int INDEX_TO_INDEX_METADATADocument's indexed status index just metadata: 3- See Also:
-
NATURE_DOC
public static final int NATURE_DOCDocument's nature regular document: 0- See Also:
-
-
Method Details
-
getStatus
public int getStatus()The document status- Returns:
- the document's status
- See Also:
-
setStatus
public void setStatus(int status) -
getVersion
The working version (the most recent version)- Returns:
- the version
-
setVersion
Iterates over the versions searching for the specified id- Parameters:
version
- The version id
-
getDate
The document's last publication date. This date is altered by checkin operations.- Returns:
- the publication date
-
setDate
-
getPublisherId
public long getPublisherId()The user id of the user that published this document- Returns:
- identifier of the user that published the file
-
setPublisherId
public void setPublisherId(long publisherId) -
isModified
public boolean isModified() -
setModified
public void setModified(boolean modified) -
getDeleteUserId
-
setDeleteUserId
-
getPublisher
The username that published this document- Returns:
- the username that published the document
-
setPublisher
-
getType
The document type, that is the file extension- Returns:
- the right part of the file name
-
setType
-
getLockUserId
The id of the user that locked this document and that currently locks it- Returns:
- identifier of the user that owns the lock
-
setLockUserId
-
getLanguage
The document's language. This attribute is very important because of it is used to select the right full-text index.- Returns:
- the language
-
setLanguage
- Parameters:
language
- the language- See Also:
-
getTags
The set of tags for this document.- Returns:
- the set of tags
-
setTags
-
setTagsFromWords
-
getTagsAsWords
-
getIndexed
public int getIndexed() -
setIndexed
public void setIndexed(int indexed) -
getTagsString
-
getTitle
Computes the title that is the file name without the extension- Returns:
- the left part of the file name
-
getFileName
The original file name- Returns:
- the file name
-
setFileName
-
getIcon
The icon for this document, it may be kept from file name extension- Returns:
- name of the icon file
-
getFileSize
public long getFileSize()The document's file size expressed in bytes- Returns:
- the file size in bytes
-
setFileSize
public void setFileSize(long fileSize) -
getFolder
Retrieve the folder owning this document- Returns:
- the parent folder
-
setFolder
-
addTag
-
clearTags
public void clearTags() -
getFileExtension
-
getCustomId
Each document can be identified with a custom identifier- Returns:
- the unique custom identifier
-
setCustomId
-
getImmutable
public int getImmutable()Defines if the document is immutable- Returns:
- 1 = immutable, 0 = regular
-
setImmutable
public void setImmutable(int immutable) -
getDigest
The document's digest- Returns:
- the digest
-
setDigest
-
getSigned
public int getSigned()Return 1 if the document was signed- Returns:
- 1 = signed, 0 = not signed
-
setSigned
public void setSigned(int signed) -
getFileVersion
The working file version. Sometimes the version of the document may differ from the file versions. In fact if a new version differs from metadata only, we it have to reference the old file.- Returns:
- the file version
-
setFileVersion
-
getCreatorId
public long getCreatorId() -
setCreatorId
public void setCreatorId(long creatorId) -
getCreator
-
setCreator
-
getLocale
-
setLocale
-
getExportStatus
public int getExportStatus()The document export status- Returns:
- the export satus
- See Also:
-
setExportStatus
public void setExportStatus(int exportStatus) -
getExportVersion
The last exported version- Returns:
- the last exported version
-
setExportVersion
-
getExportName
The last archive name in which the document was exported- Returns:
- name of the export archive
-
setExportName
-
getExportId
The last archive in which the document was exported- Returns:
- identifier of the export archive
-
setExportId
-
getDocRef
If the document is an alias, it is the id of the referenced document- Returns:
- identifier of the referenced document
-
setDocRef
-
isToIndex
public boolean isToIndex() -
getBarcoded
public int getBarcoded() -
setBarcoded
public void setBarcoded(int barcoded) -
getRating
-
setRating
-
getComment
-
setComment
-
getWorkflowStatus
-
setWorkflowStatus
-
getWorkflowStatusDisplay
-
setWorkflowStatusDisplay
-
getPublished
public int getPublished() -
setPublished
public void setPublished(int published) -
getStartPublishing
-
setStartPublishing
-
getStopPublishing
-
setStopPublishing
-
isPublishing
public boolean isPublishing() -
getTransactionId
Description copied from interface:TransactionalObject
Gets the unique ID of the transaction- Specified by:
getTransactionId
in interfaceTransactionalObject
- Returns:
- the identifier of the transaction
-
setTransactionId
Description copied from interface:TransactionalObject
Sets the transaction's identifier- Specified by:
setTransactionId
in interfaceTransactionalObject
- Parameters:
transactionId
- the identifier of the transacrion
-
getTgs
-
setTgs
-
getExtResId
-
setExtResId
-
getDocRefType
-
setDocRefType
-
getPages
public int getPages() -
setPages
public void setPages(int pages) -
getStamped
public int getStamped() -
setStamped
public void setStamped(int stamped) -
getFormId
-
setFormId
-
getNature
public int getNature() -
setNature
public void setNature(int nature) -
getLockUser
-
setLockUser
-
toString
- Overrides:
toString
in classPersistentObject
-
getPassword
-
setPassword
-
setDecodedPassword
Sets the password and encode it- Parameters:
pwd
- The password in readable format- Throws:
NoSuchAlgorithmException
- Cripting error
-
getDecodedPassword
-
getDeleteUser
-
setDeleteUser
-
isGranted
Checks if the document is accessible with the given password- Parameters:
myPassword
- the password to check- Returns:
- true id the password is correct
-
isPasswordProtected
public boolean isPasswordProtected() -
getLinks
public int getLinks() -
setLinks
public void setLinks(int links) -
getOcrTemplateId
-
setOcrTemplateId
-
getOcrd
public int getOcrd() -
setOcrd
public void setOcrd(int ocrd) -
getBarcodeTemplateId
-
setBarcodeTemplateId
-
getPreviewPages
public int getPreviewPages() -
setPreviewPages
public void setPreviewPages(int previewPages) -
getColor
-
setColor
-
copyAttributes
Copies in the current instance the attributes of the passed values object, but NOT the ID- Parameters:
docVO
- the document to get the attributes from
-
getDocAttrs
public int getDocAttrs() -
setDocAttrs
public void setDocAttrs(int docAttrs)
-