## com.imcode.imcms.api
Class Document

    java.lang.Object
      com.imcode.imcms.api.Document

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  FileDocument, TextDocument, UrlDocument

    public class Document

extends java.lang.Object
implements java.io.Serializable

See Also:
  Serialized Form

Nested Class Summary
`static class` `Document.Comparator`
`static class` `Document.LifeCyclePhase`
`static class` `Document.PublicationStatus`

Field Summary
`static int` `STATUS_NEW` Deprecated. Use `Document.PublicationStatus.NEW` instead.
`static int` `STATUS_PUBLICATION_APPROVED` Deprecated. Use `Document.PublicationStatus.APPROVED` instead.
`static int` `STATUS_PUBLICATION_DISAPPROVED` Deprecated. Use `Document.PublicationStatus.DISAPPROVED` instead.

Constructor Summary
`protected` `Document(DocumentDomainObject document, ContentManagementSystem contentManagementSystem)`

Method Summary
`void` `addCategory(Category category)`
`void` `addSection(Section section)`
`boolean` `equals(java.lang.Object o)`
`java.lang.String` `getAlias()`
`java.util.Date` `getArchivedDatetime()`
`Category[]` `getCategories()`
`Category[]` `getCategoriesOfType(CategoryType categoryType)`
`java.util.Date` `getCreatedDatetime()`
`User` `getCreator()`
`DocumentPermissionSet` `getDocumentPermissionSetForUser()`
`java.lang.String` `getHeadline()`
`int` `getId()`
`java.util.Set` `getKeywords()`
`Language` `getLanguage()`
`java.lang.String` `getMenuImageURL()`
`java.lang.String` `getMenuText()`
`java.util.Date` `getModifiedDatetime()`
`java.lang.String` `getName()`
`int` `getPermissionSetIdForRole(Role role)` Deprecated. Use `getPermissionSetTypeForRole(Role)`
`DocumentPermissionSet` `getPermissionSetRestrictedOne()`
`DocumentPermissionSet` `getPermissionSetRestrictedTwo()`
`DocumentPermissionSetType` `getPermissionSetTypeForRole(Role role)`
`java.util.Date` `getPublicationEndDatetime()`
`java.util.Date` `getPublicationStartDatetime()`
`Document.PublicationStatus` `getPublicationStatus()`
`User` `getPublisher()`
`java.util.Map` `getRolesMappedToPermissions()`
`Section[]` `getSections()`
`int` `getStatus()` Deprecated. Use `getPublicationStatus()` instead.
`java.lang.String` `getTarget()`
`int` `hashCode()`
`boolean` `isActive()` Whether the document is published and not archived.
`boolean` `isArchived()` Whether the document is archived.
`boolean` `isLinkableByOtherUsers()`
`boolean` `isPublished()` Whether the document is published.
`boolean` `isSearchDisabled()`
`boolean` `isVisibleInMenusForUnauthorizedUsers()`
`void` `removeCategory(Category category)`
`void` `setAlias(java.lang.String alias)`
`void` `setArchivedDatetime(java.util.Date datetime)`
`void` `setCreator(User creator)`
`void` `setHeadline(I18nLanguage language, java.lang.String headline)`
`void` `setKeywords(I18nLanguage language, java.util.Set keywords)`
`void` `setLanguage(Language language)`
`void` `setLinkableByOtherUsers(boolean linkableByOtherUsers)`
`void` `setMenuImageURL(I18nLanguage language, java.lang.String imageUrl)`
`void` `setMenuText(I18nLanguage language, java.lang.String menuText)`
`void` `setModifiedDatetime(java.util.Date date)`
`void` `setPermissionSetIdForRole(Role role, int permissionSetId)` Deprecated. Use `setPermissionSetTypeForRole(Role, DocumentPermissionSetType)`
`void` `setPermissionSetTypeForRole(Role role, DocumentPermissionSetType documentPermissionSetType)`
`void` `setPublicationEndDatetime(java.util.Date datetime)`
`void` `setPublicationStartDatetime(java.util.Date datetime)`
`void` `setPublicationStatus(Document.PublicationStatus publicationStatus)`
`void` `setPublisher(User user)`
`void` `setSearchDisabled(boolean searchDisabled)`
`void` `setSections(Section[] sections)`
`void` `setStatus(int status)` Deprecated. Use `setPublicationStatus(com.imcode.imcms.api.Document.PublicationStatus)` instead.
`void` `setVisibleInMenusForUnauthorizedUsers(boolean visibleInMenusForUnauthorizedUsers)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### STATUS_NEW

    public static final int STATUS_NEW

  Deprecated. Use `Document.PublicationStatus.NEW` instead.
  See Also:
    Constant Field Values

### STATUS_PUBLICATION_DISAPPROVED

    public static final int STATUS_PUBLICATION_DISAPPROVED

  Deprecated. Use `Document.PublicationStatus.DISAPPROVED` instead.
  See Also:
    Constant Field Values

### STATUS_PUBLICATION_APPROVED

    public static final int STATUS_PUBLICATION_APPROVED

  Deprecated. Use `Document.PublicationStatus.APPROVED` instead.
  See Also:
    Constant Field Values

Constructor Detail

### Document

    protected Document(DocumentDomainObject document,
                       ContentManagementSystem contentManagementSystem)

Method Detail

### getId

    public int getId()

### getRolesMappedToPermissions

    public java.util.Map getRolesMappedToPermissions()

  Returns:
    map of roles Role -> DocumentPermissionSet instances.

### isArchived

    public boolean isArchived()

  Whether the document is archived.

### isActive

    public boolean isActive()

  Whether the document is published and not archived.

### isPublished

    public boolean isPublished()

  Whether the document is published.

### isSearchDisabled

    public boolean isSearchDisabled()

### setSearchDisabled

    public void setSearchDisabled(boolean searchDisabled)

### getDocumentPermissionSetForUser

    public DocumentPermissionSet getDocumentPermissionSetForUser()

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### getKeywords

    public java.util.Set getKeywords()

### setKeywords

    public void setKeywords(I18nLanguage language,
                            java.util.Set keywords)

### getPermissionSetRestrictedOne

    public DocumentPermissionSet getPermissionSetRestrictedOne()

### getPermissionSetRestrictedTwo

    public DocumentPermissionSet getPermissionSetRestrictedTwo()

### getHeadline

    public java.lang.String getHeadline()

### getMenuText

    public java.lang.String getMenuText()

### getAlias

    public java.lang.String getAlias()

### setAlias

    public void setAlias(java.lang.String alias)

### getName

    public java.lang.String getName()

### getMenuImageURL

    public java.lang.String getMenuImageURL()

### setHeadline

    public void setHeadline(I18nLanguage language,
                            java.lang.String headline)

### setMenuText

    public void setMenuText(I18nLanguage language,
                            java.lang.String menuText)

### setMenuImageURL

    public void setMenuImageURL(I18nLanguage language,
                                java.lang.String imageUrl)

### getCreator

    public User getCreator()

### setCreator

    public void setCreator(User creator)

### getLanguage

    public Language getLanguage()

### addCategory

    public void addCategory(Category category)

### removeCategory

    public void removeCategory(Category category)

### getCategories

    public Category[] getCategories()

  Returns:
    An array of Categories, an empty if no one found.

### setPermissionSetIdForRole

    public void setPermissionSetIdForRole(Role role,
                                          int permissionSetId)

  Deprecated. Use `setPermissionSetTypeForRole(Role, DocumentPermissionSetType)`

  Parameters:
    `permissionSetId` - One of the constants in `DocumentPermissionSet`.
  Since:
    2.0

### setPermissionSetTypeForRole

    public void setPermissionSetTypeForRole(Role role,
                                            DocumentPermissionSetType documentPermissionSetType)

  Since:
    3.0

### getPermissionSetIdForRole

    public int getPermissionSetIdForRole(Role role)

  Deprecated. Use `getPermissionSetTypeForRole(Role)`

  Since:
    2.0

### getPermissionSetTypeForRole

    public DocumentPermissionSetType getPermissionSetTypeForRole(Role role)

  Since:
    3.0

### getCategoriesOfType

    public Category[] getCategoriesOfType(CategoryType categoryType)

  Parameters:
    `categoryType` -
  Returns:
    an array of Categories, empty array if no one found.

### getPublisher

    public User getPublisher()

### getTarget

    public java.lang.String getTarget()

### getPublicationStartDatetime

    public java.util.Date getPublicationStartDatetime()

### setPublicationStartDatetime

    public void setPublicationStartDatetime(java.util.Date datetime)

### getArchivedDatetime

    public java.util.Date getArchivedDatetime()

### setArchivedDatetime

    public void setArchivedDatetime(java.util.Date datetime)

### setPublisher

    public void setPublisher(User user)

### getSections

    public Section[] getSections()

  Returns:
    An array of Sections, an empty array if none found.

### setSections

    public void setSections(Section[] sections)

### getModifiedDatetime

    public java.util.Date getModifiedDatetime()

### setModifiedDatetime

    public void setModifiedDatetime(java.util.Date date)

### getCreatedDatetime

    public java.util.Date getCreatedDatetime()

### addSection

    public void addSection(Section section)

### setStatus

    public void setStatus(int status)

  Deprecated. Use `setPublicationStatus(com.imcode.imcms.api.Document.PublicationStatus)` instead.

### setLanguage

    public void setLanguage(Language language)

### setPublicationEndDatetime

    public void setPublicationEndDatetime(java.util.Date datetime)

### getPublicationEndDatetime

    public java.util.Date getPublicationEndDatetime()

### getStatus

    public int getStatus()

  Deprecated. Use `getPublicationStatus()` instead.

### setVisibleInMenusForUnauthorizedUsers

    public void setVisibleInMenusForUnauthorizedUsers(boolean visibleInMenusForUnauthorizedUsers)

### isVisibleInMenusForUnauthorizedUsers

    public boolean isVisibleInMenusForUnauthorizedUsers()

### isLinkableByOtherUsers

    public boolean isLinkableByOtherUsers()

### setLinkableByOtherUsers

    public void setLinkableByOtherUsers(boolean linkableByOtherUsers)

### getPublicationStatus

    public Document.PublicationStatus getPublicationStatus()

### setPublicationStatus

    public void setPublicationStatus(Document.PublicationStatus publicationStatus)