Package com.logicaldoc.core.document
Class AbstractDocument
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.metadata.ExtensibleObject
com.logicaldoc.core.document.AbstractDocument
- All Implemented Interfaces:
- Extensible,- TransactionalObject,- Serializable
@MappedSuperclass
public abstract class AbstractDocument
extends ExtensibleObject
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 SummaryFieldsModifier and TypeFieldDescriptionstatic final intDocument's export status unlocked: 0static final intDocument's export status unlocked: 0static final intDocument's nature regular document: 0Fields inherited from class com.logicaldoc.core.PersistentObjectDELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id
- 
Method SummaryModifier and TypeMethodDescriptionvoidcopyAttributes(AbstractDocument docVO) Copies in the current instance the attributes of the passed values object, but NOT the IDbooleanintgetColor()longEach document can be identified with a custom identifiergetDate()The document's last publication date.The document's digestintThe last archive in which the document was exportedThe last archive name in which the document was exportedintThe document export statusThe last exported versionThe original file namelongThe document's file size expressed in bytesThe working file version.abstract longgetIcon()The icon for this document, it may be kept from file name extensionintDefines if the document is immutableThe document's language.intgetLinks()The id of the user that locked this document and that currently locks itintintgetOcrd()intgetPages()intintThe username that published this documentlongThe user id of the user that published this documentintReturn 1 if the document was signedintgetTgs()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)inthashCode()booleanChecks if the document is accessible with the given passwordbooleanbooleanbooleanbooleanvoidsetBarcoded(int barcoded) voidsetBarcodeTemplateId(Long barcodeTemplateId) voidvoidsetComment(String comment) voidsetCreator(String creator) voidsetCreatorId(long creatorId) voidsetCustomId(String customId) voidvoidsetDecodedPassword(String pwd) Sets the password and encode itvoidsetDeleteUserId(Long deleteUserId) voidvoidsetDocAttrs(int docAttrs) voidsetExportId(Long exportId) voidsetExportName(String exportName) voidsetExportStatus(int exportStatus) voidsetExportVersion(String exportVersion) voidsetExtResId(String extResId) voidsetFileName(String fileName) voidsetFileSize(long fileSize) voidsetFileVersion(String fileVersion) voidvoidsetImmutable(int immutable) voidsetIndexingStatus(int indexingStatus) voidsetIndexingStatus(IndexingStatus indexingStatus) voidsetLanguage(String language) voidsetLastNote(String lastNote) voidsetLinks(int links) voidvoidsetLockUser(String lockUser) voidsetLockUserId(Long lockUserId) voidsetModified(boolean modified) voidsetNature(int nature) voidsetOcrd(int ocrd) voidsetOcrTemplateId(Long ocrTemplateId) voidsetPages(int pages) voidsetPassword(String password) voidsetPreviewPages(int previewPages) voidsetPublished(int published) voidsetPublisher(String publisher) voidsetPublisherId(long publisherId) voidsetRevision(String revision) voidsetSigned(int signed) voidsetStamped(int stamped) voidsetStartPublishing(Date startPublishing) voidsetStatus(int status) voidsetStatus(DocumentStatus status) voidsetStopPublishing(Date stopPublishing) voidsetTagsFromWords(Set<String> tgs) voidsetTemplateId(Long templateId) voidsetTemplateName(String templateName) voidvoidsetTransactionId(String transactionId) Sets the transaction's identifiervoidvoidsetVersion(String version) Iterates over the versions searching for the specified idvoidsetWorkflowStatus(String workflowStatus) voidsetWorkflowStatusDisplay(String workflowStatusDisplay) toString()Methods inherited from class com.logicaldoc.core.metadata.ExtensibleObjectgetAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, setValue, setValuesMethods inherited from class com.logicaldoc.core.PersistentObjectgetCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantIdMethods inherited from interface com.logicaldoc.core.metadata.ExtensiblegetAttributes, getTemplate, setAttributes, setTemplate
- 
Field Details- 
EXPORT_UNLOCKEDpublic static final int EXPORT_UNLOCKEDDocument's export status unlocked: 0- See Also:
 
- 
EXPORT_LOCKEDpublic static final int EXPORT_LOCKEDDocument's export status unlocked: 0- See Also:
 
- 
NATURE_DOCpublic static final int NATURE_DOCDocument's nature regular document: 0- See Also:
 
 
- 
- 
Method Details- 
getFolderIdpublic abstract long getFolderId()
- 
getVersionThe working version (the most recent version)- Returns:
- the version
 
- 
setVersionIterates over the versions searching for the specified id- Parameters:
- version- The version id
 
- 
getStatus
- 
setStatus
- 
setStatuspublic void setStatus(int status) 
- 
getIndexed
- 
setIndexingStatus
- 
setIndexingStatuspublic void setIndexingStatus(int indexingStatus) 
- 
getDateThe document's last publication date. This date is altered by checkin operations.- Returns:
- the publication date
 
- 
setDate
- 
getPublisherIdpublic long getPublisherId()The user id of the user that published this document- Returns:
- identifier of the user that published the file
 
- 
setPublisherIdpublic void setPublisherId(long publisherId) 
- 
isModifiedpublic boolean isModified()
- 
setModifiedpublic void setModified(boolean modified) 
- 
getDeleteUserId
- 
setDeleteUserId
- 
getPublisherThe username that published this document- Returns:
- the username that published the document
 
- 
setPublisher
- 
getTypeThe document type, that is the file extension- Returns:
- the right part of the file name
 
- 
setType
- 
getLockUserIdThe id of the user that locked this document and that currently locks it- Returns:
- identifier of the user that owns the lock
 
- 
setLockUserId
- 
getLanguageThe 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:
 
- 
getTitleComputes the title that is the file name without the extension- Returns:
- the left part of the file name
 
- 
getFileNameThe original file name- Returns:
- the file name
 
- 
setFileName
- 
getIconThe icon for this document, it may be kept from file name extension- Returns:
- name of the icon file
 
- 
getFileSizepublic long getFileSize()The document's file size expressed in bytes- Returns:
- the file size in bytes
 
- 
setFileSizepublic void setFileSize(long fileSize) 
- 
getFileExtension
- 
getCustomIdEach document can be identified with a custom identifier- Returns:
- the unique custom identifier
 
- 
setCustomId
- 
getImmutablepublic int getImmutable()Defines if the document is immutable- Returns:
- 1 = immutable, 0 = regular
 
- 
setImmutablepublic void setImmutable(int immutable) 
- 
getDigestThe document's digest- Returns:
- the digest
 
- 
setDigest
- 
getSignedpublic int getSigned()Return 1 if the document was signed- Returns:
- 1 = signed, 0 = not signed
 
- 
setSignedpublic void setSigned(int signed) 
- 
getFileVersionThe 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
- 
getCreatorIdpublic long getCreatorId()
- 
setCreatorIdpublic void setCreatorId(long creatorId) 
- 
getCreator
- 
setCreator
- 
getLocale
- 
setLocale
- 
getExportStatuspublic int getExportStatus()The document export status- Returns:
- the export satus
- See Also:
 
- 
setExportStatuspublic void setExportStatus(int exportStatus) 
- 
getExportVersionThe last exported version- Returns:
- the last exported version
 
- 
setExportVersion
- 
getExportNameThe last archive name in which the document was exported- Returns:
- name of the export archive
 
- 
setExportName
- 
getExportIdThe last archive in which the document was exported- Returns:
- identifier of the export archive
 
- 
setExportId
- 
isToIndexpublic boolean isToIndex()
- 
getBarcodedpublic int getBarcoded()
- 
setBarcodedpublic void setBarcoded(int barcoded) 
- 
getComment
- 
setComment
- 
getWorkflowStatus
- 
setWorkflowStatus
- 
getWorkflowStatusDisplay
- 
setWorkflowStatusDisplay
- 
getPublishedpublic int getPublished()
- 
setPublishedpublic void setPublished(int published) 
- 
getStartPublishing
- 
setStartPublishing
- 
getStopPublishing
- 
setStopPublishing
- 
isPublishingpublic boolean isPublishing()
- 
getTransactionIdDescription copied from interface:TransactionalObjectGets the unique ID of the transaction- Specified by:
- getTransactionIdin interface- TransactionalObject
- Returns:
- the identifier of the transaction
 
- 
setTransactionIdDescription copied from interface:TransactionalObjectSets the transaction's identifier- Specified by:
- setTransactionIdin interface- TransactionalObject
- Parameters:
- transactionId- the identifier of the transacrion
 
- 
getTgs
- 
setTgs
- 
getExtResId
- 
setExtResId
- 
getPagespublic int getPages()
- 
setPagespublic void setPages(int pages) 
- 
getStampedpublic int getStamped()
- 
setStampedpublic void setStamped(int stamped) 
- 
getFormId
- 
setFormId
- 
getNaturepublic int getNature()
- 
setNaturepublic void setNature(int nature) 
- 
getLockUser
- 
setLockUser
- 
toString- Overrides:
- toStringin class- PersistentObject
 
- 
getPassword
- 
setPassword
- 
setDecodedPasswordSets the password and encode it- Parameters:
- pwd- The password in readable format
- Throws:
- NoSuchAlgorithmException- Cripting error
 
- 
getDecodedPassword
- 
isGrantedChecks if the document is accessible with the given password- Parameters:
- myPassword- the password to check
- Returns:
- true id the password is correct
 
- 
isPasswordProtectedpublic boolean isPasswordProtected()
- 
getLinkspublic int getLinks()
- 
setLinkspublic void setLinks(int links) 
- 
getOcrTemplateId
- 
setOcrTemplateId
- 
getOcrdpublic int getOcrd()
- 
setOcrdpublic void setOcrd(int ocrd) 
- 
getBarcodeTemplateId
- 
setBarcodeTemplateId
- 
getPreviewPagespublic int getPreviewPages()
- 
setPreviewPagespublic void setPreviewPages(int previewPages) 
- 
getColor
- 
setColor
- 
getTemplateName- Specified by:
- getTemplateNamein interface- Extensible
 
- 
setTemplateName- Specified by:
- setTemplateNamein interface- Extensible
 
- 
getTemplateId- Specified by:
- getTemplateIdin interface- Extensible
 
- 
setTemplateId- Specified by:
- setTemplateIdin interface- Extensible
 
- 
getRevision
- 
setRevision
- 
copyAttributesCopies in the current instance the attributes of the passed values object, but NOT the ID- Parameters:
- docVO- the document to get the attributes from
 
- 
setTagsFromWords
- 
getDocAttrspublic int getDocAttrs()
- 
setDocAttrspublic void setDocAttrs(int docAttrs) 
- 
getLastNote
- 
setLastNote
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- PersistentObject
 
- 
equals- Overrides:
- equalsin class- PersistentObject
 
 
-