Package com.logicaldoc.core.document

# Class Document

java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.metadata.ExtensibleObject
com.logicaldoc.core.filler.Fillable
com.logicaldoc.core.document.AbstractDocument
com.logicaldoc.core.document.Document

All Implemented Interfaces:
  `Extensible`, `Secure<DocumentAccessControlEntry>`, `TransactionalObject`, `Serializable`

Direct Known Subclasses:
  `Hit`

@Entity public class Document extends AbstractDocument implements Secure<DocumentAccessControlEntry>
Basic concrete implementation of `AbstractDocument`

Since:
  1.0
Author:
  Marco Meschieri - LogicalDOC
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class com.logicaldoc.core.document.AbstractDocument

`EXPORT_LOCKED, EXPORT_UNLOCKED, NATURE_DOC`

### Fields inherited from class com.logicaldoc.core.PersistentObject

`DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id`

## Constructor Summary

Constructors
Constructor
Description
`Document()`
`Document(AbstractDocument source)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addAccessControlEntry(DocumentAccessControlEntry ace)`
Adds a new entry, replacing a previous one with the same groupId.
`void`
`addTag(String word)`
`void`
`clearTags()`
`void`
`copyAttributes(AbstractDocument docVO)`
Copies in the current instance the attributes of the passed values object, but NOT the ID
`boolean`
`equals(Object obj)`
`Set<DocumentAccessControlEntry>`
`getAccessControlEntries(Set<Long> groupIds)`
Retrieves the set of entries related to whatever group within the specified set.
`DocumentAccessControlEntry`
`getAccessControlEntry(long groupId)`
`Set<DocumentAccessControlEntry>`
`getAccessControlList()`
`Map<String,Attribute>`
`getAttributes()`
`String`
`getDeleteUser()`
`Long`
`getDocRef()`
If the document is an alias, it is the id of the referenced document
`String`
`getDocRefType()`
`Folder`
`getFolder()`
Retrieve the folder owning this document
`long`
`getFolderId()`
`String`
`getIcon()`
The icon for this document, it may be kept from file name extension
`Integer`
`getRating()`
`Set<Tag>`
`getTags()`
The set of tags for this document.
`Set<String>`
`getTagsAsWords()`
`String`
`getTagsString()`
`Template`
`getTemplate()`
`int`
`hashCode()`
`void`
`removeAccessControlEntries(long groupId)`
Removes all the ACEs related to the given group.
`void`
`setAccessControlList(Set<DocumentAccessControlEntry> accessControlList)`
`void`
`setAttributes(Map<String,Attribute> attributes)`
`void`
`setDeleteUser(String deleteUser)`
`void`
`setDocRef(Long docRef)`
`void`
`setDocRefType(String docRefType)`
`void`
`setFolder(Folder folder)`
`void`
`setRating(Integer rating)`
`void`
`setTags(Set<Tag> tags)`
`void`
`setTagsFromWords(Set<String> tgs)`
`void`
`setTemplate(Template template)`

### Methods inherited from class com.logicaldoc.core.document.AbstractDocument

`getBarcodeTemplateId, getColor, getComment, getCreator, getCreatorId, getCustomId, getDate, getDecodedPassword, getDeleteUserId, getDigest, getDocAttrs, getEmbeddingStatus, getExportId, getExportName, getExportStatus, getExportVersion, getExtResId, getFileExtension, getFileName, getFileSize, getFileVersion, getFormId, getIndexed, getIndexingStatus, getLanguage, getLastNote, getLinks, getLocale, getLockUser, getLockUserId, getNature, getOcrTemplateId, getPages, getPassword, getPreviewPages, getPublisher, getPublisherId, getRevision, getStartPublishing, getStatus, getStopPublishing, getTemplateId, getTemplateName, getTgs, getTitle, getTransactionId, getType, getVersion, getWorkflowStatus, getWorkflowStatusDisplay, isBarcoded, isGranted, isImmutable, isModified, isOcrd, isPasswordProtected, isPublished, isPublishing, isSigned, isStamped, isToIndex, setBarcoded, setBarcodeTemplateId, setColor, setComment, setCreator, setCreatorId, setCustomId, setDate, setDecodedPassword, setDeleteUserId, setDigest, setDocAttrs, setEmbeddingStatus, setExportId, setExportName, setExportStatus, setExportVersion, setExtResId, setFileName, setFileSize, setFileVersion, setFormId, setImmutable, setIndexingStatus, setIndexingStatus, setLanguage, setLastNote, setLinks, setLocale, setLockUser, setLockUserId, setModified, setNature, setOcrd, setOcrTemplateId, setPages, setPassword, setPreviewPages, setPublished, setPublisher, setPublisherId, setRevision, setSigned, setStamped, setStartPublishing, setStatus, setStatus, setStopPublishing, setTemplateId, setTemplateName, setTgs, setTransactionId, setType, setVersion, setWorkflowStatus, setWorkflowStatusDisplay, toString`

### Methods inherited from class com.logicaldoc.core.filler.Fillable

`getFillerId, setFillerId`

### Methods inherited from class com.logicaldoc.core.metadata.ExtensibleObject

`getAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, setValue, setValues`

### Methods inherited from class com.logicaldoc.core.PersistentObject

`getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Document

public Document()

### Document

public Document(AbstractDocument source)

## Method Details

### getAttributes

public Map<String,Attribute> getAttributes()

Specified by:
  `getAttributes` in interface `Extensible`

### setAttributes

public void setAttributes(Map<String,Attribute> attributes)

Specified by:
  `setAttributes` in interface `Extensible`

### getRating

public Integer getRating()

### setRating

public void setRating(Integer rating)

### getDocRefType

public String getDocRefType()

### setDocRefType

public void setDocRefType(String docRefType)

### getDocRef

public Long getDocRef()
If the document is an alias, it is the id of the referenced document

Returns:
  identifier of the referenced document

### setDocRef

public void setDocRef(Long docRef)

### getDeleteUser

public String getDeleteUser()

### setDeleteUser

public void setDeleteUser(String deleteUser)

### getFolder

public Folder getFolder()
Retrieve the folder owning this document

Returns:
  the parent folder

### getFolderId

public long getFolderId()

Specified by:
  `getFolderId` in class `AbstractDocument`

### setFolder

public void setFolder(Folder folder)

### getTags

public Set<Tag> getTags()
The set of tags for this document.

Returns:
  the set of tags

### setTags

public void setTags(Set<Tag> tags)

### setTagsFromWords

public void setTagsFromWords(Set<String> tgs)

Overrides:
  `setTagsFromWords` in class `AbstractDocument`

### getTagsAsWords

public Set<String> getTagsAsWords()

### getTagsString

public String getTagsString()

### addTag

public void addTag(String word)

### clearTags

public void clearTags()

### getIcon

public String getIcon()
Description copied from class: `AbstractDocument`
The icon for this document, it may be kept from file name extension

Overrides:
  `getIcon` in class `AbstractDocument`
Returns:
  name of the icon file

### copyAttributes

public void copyAttributes(AbstractDocument docVO)
Copies in the current instance the attributes of the passed values object, but NOT the ID

Overrides:
  `copyAttributes` in class `AbstractDocument`
Parameters:
  `docVO` - the document to get the attributes from

### getTemplate

public Template getTemplate()

Specified by:
  `getTemplate` in interface `Extensible`

### setTemplate

public void setTemplate(Template template)

Specified by:
  `setTemplate` in interface `Extensible`

### getAccessControlList

public Set<DocumentAccessControlEntry> getAccessControlList()

Specified by:
  `getAccessControlList` in interface `Secure<DocumentAccessControlEntry>`

### setAccessControlList

public void setAccessControlList(Set<DocumentAccessControlEntry> accessControlList)

Specified by:
  `setAccessControlList` in interface `Secure<DocumentAccessControlEntry>`

### getAccessControlEntry

public DocumentAccessControlEntry getAccessControlEntry(long groupId)

Specified by:
  `getAccessControlEntry` in interface `Secure<DocumentAccessControlEntry>`

### getAccessControlEntries

public Set<DocumentAccessControlEntry> getAccessControlEntries(Set<Long> groupIds)
Description copied from interface: `Secure`
Retrieves the set of entries related to whatever group within the specified set.

Specified by:
  `getAccessControlEntries` in interface `Secure<DocumentAccessControlEntry>`
Parameters:
  `groupIds` - identifiers of groups
Returns:
  The set of matching entries

### addAccessControlEntry

public void addAccessControlEntry(DocumentAccessControlEntry ace)
Description copied from interface: `Secure`
Adds a new entry, replacing a previous one with the same groupId.

Specified by:
  `addAccessControlEntry` in interface `Secure<DocumentAccessControlEntry>`
Parameters:
  `ace` - the access control entry to add

### removeAccessControlEntries

public void removeAccessControlEntries(long groupId)
Description copied from interface: `Secure`
Removes all the ACEs related to the given group.

Specified by:
  `removeAccessControlEntries` in interface `Secure<DocumentAccessControlEntry>`
Parameters:
  `groupId` - Identifier of the group

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `AbstractDocument`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `AbstractDocument`