Class AbstractDocument

All Implemented Interfaces:
Securable, TransactionalObject, Serializable
Direct Known Subclasses:
Document, Version

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 Details Link icon

    • DOC_UNLOCKED Link icon

      public static final int DOC_UNLOCKED
      Document's status unlocked: 0
      See Also:
    • DOC_CHECKED_OUT Link icon

      public static final int DOC_CHECKED_OUT
      Document's status checked out: 1
      See Also:
    • DOC_LOCKED Link icon

      public static final int DOC_LOCKED
      Document's status locked: 2
      See Also:
    • DOC_ARCHIVED Link icon

      public static final int DOC_ARCHIVED
      Document's status archived: 3
      See Also:
    • EXPORT_UNLOCKED Link icon

      public static final int EXPORT_UNLOCKED
      Document's export status unlocked: 0
      See Also:
    • EXPORT_LOCKED Link icon

      public static final int EXPORT_LOCKED
      Document's export status unlocked: 0
      See Also:
    • INDEX_TO_INDEX Link icon

      public static final int INDEX_TO_INDEX
      Document's indexed status to index: 0
      See Also:
    • INDEX_INDEXED Link icon

      public static final int INDEX_INDEXED
      Document's indexed status indexed: 1
      See Also:
    • INDEX_SKIP Link icon

      public static final int INDEX_SKIP
      Document's indexed status skip: 2
      See Also:
    • INDEX_TO_INDEX_METADATA Link icon

      public static final int INDEX_TO_INDEX_METADATA
      Document's indexed status index just metadata: 3
      See Also:
    • NATURE_DOC Link icon

      public static final int NATURE_DOC
      Document's nature regular document: 0
      See Also:
  • Method Details Link icon

    • getStatus Link icon

      public int getStatus()
      The document status
      Returns:
      the document's status
      See Also:
    • setStatus Link icon

      public void setStatus(int status)
    • getVersion Link icon

      public String getVersion()
      The working version (the most recent version)
      Returns:
      the version
    • setVersion Link icon

      public void setVersion(String version)
      Iterates over the versions searching for the specified id
      Parameters:
      version - The version id
    • getDate Link icon

      public Date getDate()
      The document's last publication date. This date is altered by checkin operations.
      Returns:
      the publication date
    • setDate Link icon

      public void setDate(Date date)
    • getPublisherId Link icon

      public long getPublisherId()
      The user id of the user that published this document
      Returns:
      identifier of the user that published the file
    • setPublisherId Link icon

      public void setPublisherId(long publisherId)
    • isModified Link icon

      public boolean isModified()
    • setModified Link icon

      public void setModified(boolean modified)
    • getDeleteUserId Link icon

      public Long getDeleteUserId()
    • setDeleteUserId Link icon

      public void setDeleteUserId(Long deleteUserId)
    • getPublisher Link icon

      public String getPublisher()
      The username that published this document
      Returns:
      the username that published the document
    • setPublisher Link icon

      public void setPublisher(String publisher)
    • getType Link icon

      public String getType()
      The document type, that is the file extension
      Returns:
      the right part of the file name
    • setType Link icon

      public void setType(String type)
    • getLockUserId Link icon

      public Long 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 Link icon

      public void setLockUserId(Long lockUserId)
    • getLanguage Link icon

      public String 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 Link icon

      public void setLanguage(String language)
      Parameters:
      language - the language
      See Also:
    • getTags Link icon

      public Set<Tag> getTags()
      The set of tags for this document.
      Returns:
      the set of tags
    • setTags Link icon

      public void setTags(Set<Tag> tags)
    • setTagsFromWords Link icon

      public void setTagsFromWords(Set<String> tgs)
    • getTagsAsWords Link icon

      public Set<String> getTagsAsWords()
    • getIndexed Link icon

      public int getIndexed()
    • setIndexed Link icon

      public void setIndexed(int indexed)
    • getTagsString Link icon

      public String getTagsString()
    • getTitle Link icon

      public String getTitle()
      Computes the title that is the file name without the extension
      Returns:
      the left part of the file name
    • getFileName Link icon

      public String getFileName()
      The original file name
      Returns:
      the file name
    • setFileName Link icon

      public void setFileName(String fileName)
    • getIcon Link icon

      public String getIcon()
      The icon for this document, it may be kept from file name extension
      Returns:
      name of the icon file
    • getFileSize Link icon

      public long getFileSize()
      The document's file size expressed in bytes
      Returns:
      the file size in bytes
    • setFileSize Link icon

      public void setFileSize(long fileSize)
    • getFolder Link icon

      public Folder getFolder()
      Retrieve the folder owning this document
      Returns:
      the parent folder
    • setFolder Link icon

      public void setFolder(Folder folder)
    • addTag Link icon

      public void addTag(String word)
    • clearTags Link icon

      public void clearTags()
    • getFileExtension Link icon

      public String getFileExtension()
    • getCustomId Link icon

      public String getCustomId()
      Each document can be identified with a custom identifier
      Returns:
      the unique custom identifier
    • setCustomId Link icon

      public void setCustomId(String customId)
    • getImmutable Link icon

      public int getImmutable()
      Defines if the document is immutable
      Returns:
      1 = immutable, 0 = regular
    • setImmutable Link icon

      public void setImmutable(int immutable)
    • getDigest Link icon

      public String getDigest()
      The document's digest
      Returns:
      the digest
    • setDigest Link icon

      public void setDigest(String digest)
    • getSigned Link icon

      public int getSigned()
      Return 1 if the document was signed
      Returns:
      1 = signed, 0 = not signed
    • setSigned Link icon

      public void setSigned(int signed)
    • getFileVersion Link icon

      public String 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 Link icon

      public void setFileVersion(String fileVersion)
    • getCreatorId Link icon

      public long getCreatorId()
    • setCreatorId Link icon

      public void setCreatorId(long creatorId)
    • getCreator Link icon

      public String getCreator()
    • setCreator Link icon

      public void setCreator(String creator)
    • getLocale Link icon

      public Locale getLocale()
    • setLocale Link icon

      public void setLocale(Locale locale)
    • getExportStatus Link icon

      public int getExportStatus()
      The document export status
      Returns:
      the export satus
      See Also:
    • setExportStatus Link icon

      public void setExportStatus(int exportStatus)
    • getExportVersion Link icon

      public String getExportVersion()
      The last exported version
      Returns:
      the last exported version
    • setExportVersion Link icon

      public void setExportVersion(String exportVersion)
    • getExportName Link icon

      public String getExportName()
      The last archive name in which the document was exported
      Returns:
      name of the export archive
    • setExportName Link icon

      public void setExportName(String exportName)
    • getExportId Link icon

      public Long getExportId()
      The last archive in which the document was exported
      Returns:
      identifier of the export archive
    • setExportId Link icon

      public void setExportId(Long exportId)
    • getDocRef Link icon

      public Long getDocRef()
      If the document is an alias, it is the id of the referenced document
      Returns:
      identifier of the referenced document
    • setDocRef Link icon

      public void setDocRef(Long docRef)
    • isToIndex Link icon

      public boolean isToIndex()
    • getBarcoded Link icon

      public int getBarcoded()
    • setBarcoded Link icon

      public void setBarcoded(int barcoded)
    • getRating Link icon

      public Integer getRating()
    • setRating Link icon

      public void setRating(Integer rating)
    • getComment Link icon

      public String getComment()
    • setComment Link icon

      public void setComment(String comment)
    • getWorkflowStatus Link icon

      public String getWorkflowStatus()
    • setWorkflowStatus Link icon

      public void setWorkflowStatus(String workflowStatus)
    • getWorkflowStatusDisplay Link icon

      public String getWorkflowStatusDisplay()
    • setWorkflowStatusDisplay Link icon

      public void setWorkflowStatusDisplay(String workflowStatusDisplay)
    • getPublished Link icon

      public int getPublished()
    • setPublished Link icon

      public void setPublished(int published)
    • getStartPublishing Link icon

      public Date getStartPublishing()
    • setStartPublishing Link icon

      public void setStartPublishing(Date startPublishing)
    • getStopPublishing Link icon

      public Date getStopPublishing()
    • setStopPublishing Link icon

      public void setStopPublishing(Date stopPublishing)
    • isPublishing Link icon

      public boolean isPublishing()
    • getTransactionId Link icon

      public String getTransactionId()
      Description copied from interface: TransactionalObject
      Gets the unique ID of the transaction
      Specified by:
      getTransactionId in interface TransactionalObject
      Returns:
      the identifier of the transaction
    • setTransactionId Link icon

      public void setTransactionId(String transactionId)
      Description copied from interface: TransactionalObject
      Sets the transaction's identifier
      Specified by:
      setTransactionId in interface TransactionalObject
      Parameters:
      transactionId - the identifier of the transacrion
    • getTgs Link icon

      public String getTgs()
    • setTgs Link icon

      public void setTgs(String tgs)
    • getExtResId Link icon

      public String getExtResId()
    • setExtResId Link icon

      public void setExtResId(String extResId)
    • getDocRefType Link icon

      public String getDocRefType()
    • setDocRefType Link icon

      public void setDocRefType(String docRefType)
    • getPages Link icon

      public int getPages()
    • setPages Link icon

      public void setPages(int pages)
    • getStamped Link icon

      public int getStamped()
    • setStamped Link icon

      public void setStamped(int stamped)
    • getFormId Link icon

      public Long getFormId()
    • setFormId Link icon

      public void setFormId(Long formId)
    • getNature Link icon

      public int getNature()
    • setNature Link icon

      public void setNature(int nature)
    • getLockUser Link icon

      public String getLockUser()
    • setLockUser Link icon

      public void setLockUser(String lockUser)
    • toString Link icon

      public String toString()
      Overrides:
      toString in class PersistentObject
    • getPassword Link icon

      public String getPassword()
    • setPassword Link icon

      public void setPassword(String password)
    • setDecodedPassword Link icon

      public void setDecodedPassword(String pwd) throws NoSuchAlgorithmException
      Sets the password and encode it
      Parameters:
      pwd - The password in readable format
      Throws:
      NoSuchAlgorithmException - Cripting error
    • getDecodedPassword Link icon

      public String getDecodedPassword()
    • getDeleteUser Link icon

      public String getDeleteUser()
    • setDeleteUser Link icon

      public void setDeleteUser(String deleteUser)
    • isGranted Link icon

      public boolean isGranted(String myPassword)
      Checks if the document is accessible with the given password
      Parameters:
      myPassword - the password to check
      Returns:
      true id the password is correct
    • isPasswordProtected Link icon

      public boolean isPasswordProtected()
    • getLinks Link icon

      public int getLinks()
    • setLinks Link icon

      public void setLinks(int links)
    • getOcrTemplateId Link icon

      public Long getOcrTemplateId()
    • setOcrTemplateId Link icon

      public void setOcrTemplateId(Long ocrTemplateId)
    • getOcrd Link icon

      public int getOcrd()
    • setOcrd Link icon

      public void setOcrd(int ocrd)
    • getBarcodeTemplateId Link icon

      public Long getBarcodeTemplateId()
    • setBarcodeTemplateId Link icon

      public void setBarcodeTemplateId(Long barcodeTemplateId)
    • getPreviewPages Link icon

      public int getPreviewPages()
    • setPreviewPages Link icon

      public void setPreviewPages(int previewPages)
    • getColor Link icon

      public String getColor()
    • setColor Link icon

      public void setColor(String color)
    • copyAttributes Link icon

      public void copyAttributes(AbstractDocument docVO)
      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 Link icon

      public int getDocAttrs()
    • setDocAttrs Link icon

      public void setDocAttrs(int docAttrs)
    • getLastNote Link icon

      public String getLastNote()
    • setLastNote Link icon

      public void setLastNote(String lastNote)
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class ExtensibleObject
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class ExtensibleObject