com.imcode.imcms.api
Class Document

java.lang.Object
  extended bycom.imcode.imcms.api.Document
Direct Known Subclasses:
FileDocument, TextDocument, UrlDocument

public class Document
extends java.lang.Object


Nested Class Summary
static class Document.Comparator
           
static class Document.LifeCyclePhase
           
 
Field Summary
static int STATUS_NEW
           
static int STATUS_PUBLICATION_APPROVED
           
static int STATUS_PUBLICATION_DISAPPROVED
           
 
Constructor Summary
protected Document(imcode.server.document.DocumentDomainObject document, ContentManagementSystem contentManagementSystem)
           
 
Method Summary
 void addCategory(Category category)
           
 void addSection(Section section)
           
 boolean equals(java.lang.Object o)
           
 java.util.Date getActivatedDatetime()
          Deprecated. Use getPublicationStartDatetime()
 java.util.Map getAllRolesMappedToPermissions()
           
 java.util.Date getArchivedDatetime()
           
 Category[] getCategories()
           
 Category[] getCategoriesOfType(CategoryType categoryType)
           
 java.util.Date getCreatedDatetime()
           
 User getCreator()
           
 DocumentPermissionSet getDocumentPermissionSetForUser()
           
 java.lang.String getHeadline()
           
 int getId()
           
 Language getLanguage()
           
 java.lang.String getMenuImageURL()
           
 java.lang.String getMenuText()
           
 java.util.Date getModifiedDatetime()
           
 int getPermissionSetIdForRole(Role role)
           
 DocumentPermissionSet getPermissionSetRestrictedOne()
           
 DocumentPermissionSet getPermissionSetRestrictedTwo()
           
 java.util.Date getPublicationEndDatetime()
           
 java.util.Date getPublicationStartDatetime()
           
 User getPublisher()
           
 Section[] getSections()
           
 int getStatus()
           
 java.lang.String getTarget()
           
 int hashCode()
           
 boolean isVisibleInMenusForUnauthorizedUsers()
           
 void removeCategory(Category category)
           
 void setActivatedDatetime(java.util.Date datetime)
          Deprecated. Use setPublicationStartDatetime(java.util.Date) *
 void setArchivedDatetime(java.util.Date datetime)
           
 void setCreator(User creator)
           
 void setHeadline(java.lang.String headline)
           
 void setLanguage(int lang_id)
           
 void setLanguage(Language language)
           
 void setMenuImageURL(java.lang.String imageUrl)
           
 void setMenuText(java.lang.String menuText)
           
 void setModifiedDatetime(java.util.Date date)
           
 void setPermissionSetForRole(java.lang.String roleName, int permissionSet)
          Deprecated. Use setPermissionSetIdForRole(Role, int) instead. Will be removed in 3.0.
 void setPermissionSetIdForRole(Role role, int permissionSetId)
           
 void setPublicationEndDatetime(java.util.Date datetime)
           
 void setPublicationStartDatetime(java.util.Date datetime)
           
 void setPublisher(User user)
           
 void setSections(Section[] sections)
           
 void setStatus(int status)
           
 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
See Also:
Constant Field Values

STATUS_PUBLICATION_DISAPPROVED

public static final int STATUS_PUBLICATION_DISAPPROVED
See Also:
Constant Field Values

STATUS_PUBLICATION_APPROVED

public static final int STATUS_PUBLICATION_APPROVED
See Also:
Constant Field Values
Constructor Detail

Document

protected Document(imcode.server.document.DocumentDomainObject document,
                   ContentManagementSystem contentManagementSystem)
Method Detail

getId

public int getId()

getAllRolesMappedToPermissions

public java.util.Map getAllRolesMappedToPermissions()
                                             throws NoPermissionException
Returns:
map of rolename String -> DocumentPermissionSet instances.
Throws:
NoPermissionException

getDocumentPermissionSetForUser

public DocumentPermissionSet getDocumentPermissionSetForUser()

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

getPermissionSetRestrictedOne

public DocumentPermissionSet getPermissionSetRestrictedOne()
                                                    throws NoPermissionException
Throws:
NoPermissionException

getPermissionSetRestrictedTwo

public DocumentPermissionSet getPermissionSetRestrictedTwo()
                                                    throws NoPermissionException
Throws:
NoPermissionException

getHeadline

public java.lang.String getHeadline()
                             throws NoPermissionException
Throws:
NoPermissionException

getMenuText

public java.lang.String getMenuText()
                             throws NoPermissionException
Throws:
NoPermissionException

getMenuImageURL

public java.lang.String getMenuImageURL()
                                 throws NoPermissionException
Throws:
NoPermissionException

setHeadline

public void setHeadline(java.lang.String headline)
                 throws NoPermissionException
Throws:
NoPermissionException

setMenuText

public void setMenuText(java.lang.String menuText)
                 throws NoPermissionException
Throws:
NoPermissionException

setMenuImageURL

public void setMenuImageURL(java.lang.String imageUrl)
                     throws NoPermissionException
Throws:
NoPermissionException

getCreator

public User getCreator()
                throws NoPermissionException
Throws:
NoPermissionException

setCreator

public void setCreator(User creator)
                throws NoPermissionException
Throws:
NoPermissionException

getLanguage

public Language getLanguage()
                     throws NoPermissionException
Throws:
NoPermissionException

setLanguage

public void setLanguage(int lang_id)
                 throws NoPermissionException
Throws:
NoPermissionException

addCategory

public void addCategory(Category category)
                 throws NoPermissionException
Throws:
NoPermissionException

removeCategory

public void removeCategory(Category category)
                    throws NoPermissionException
Throws:
NoPermissionException

getCategories

public Category[] getCategories()
                         throws NoPermissionException
Returns:
An array of Categories, an empty if no one found.
Throws:
NoPermissionException

setPermissionSetForRole

public void setPermissionSetForRole(java.lang.String roleName,
                                    int permissionSet)
                             throws NoSuchRoleException,
                                    NoPermissionException
Deprecated. Use setPermissionSetIdForRole(Role, int) instead. Will be removed in 3.0.

Throws:
NoSuchRoleException
NoPermissionException

setPermissionSetIdForRole

public void setPermissionSetIdForRole(Role role,
                                      int permissionSetId)
                               throws NoSuchRoleException,
                                      NoPermissionException
Parameters:
permissionSetId - One of the constants in DocumentPermissionSet.
Throws:
NoSuchRoleException
NoPermissionException
Since:
2.0

getPermissionSetIdForRole

public int getPermissionSetIdForRole(Role role)
Since:
2.0

getCategoriesOfType

public Category[] getCategoriesOfType(CategoryType categoryType)
                               throws NoPermissionException
Parameters:
categoryType -
Returns:
an array of Categories, empty array if no one found.
Throws:
NoPermissionException

getPublisher

public User getPublisher()
                  throws NoPermissionException
Throws:
NoPermissionException

getTarget

public java.lang.String getTarget()
                           throws NoPermissionException
Throws:
NoPermissionException

getActivatedDatetime

public java.util.Date getActivatedDatetime()
                                    throws NoPermissionException
Deprecated. Use getPublicationStartDatetime()

Throws:
NoPermissionException

getPublicationStartDatetime

public java.util.Date getPublicationStartDatetime()
                                           throws NoPermissionException
Throws:
NoPermissionException

setActivatedDatetime

public void setActivatedDatetime(java.util.Date datetime)
                          throws NoPermissionException
Deprecated. Use setPublicationStartDatetime(java.util.Date) *

Throws:
NoPermissionException

setPublicationStartDatetime

public void setPublicationStartDatetime(java.util.Date datetime)
                                 throws NoPermissionException
Throws:
NoPermissionException

getArchivedDatetime

public java.util.Date getArchivedDatetime()
                                   throws NoPermissionException
Throws:
NoPermissionException

setArchivedDatetime

public void setArchivedDatetime(java.util.Date datetime)
                         throws NoPermissionException
Throws:
NoPermissionException

setPublisher

public void setPublisher(User user)
                  throws NoPermissionException
Throws:
NoPermissionException

getSections

public Section[] getSections()
                      throws NoPermissionException
Returns:
An array of Sections, an empty arrya if no one found.
Throws:
NoPermissionException

setSections

public void setSections(Section[] sections)
                 throws NoPermissionException
Throws:
NoPermissionException

getModifiedDatetime

public java.util.Date getModifiedDatetime()
                                   throws NoPermissionException
Throws:
NoPermissionException

setModifiedDatetime

public void setModifiedDatetime(java.util.Date date)
                         throws NoPermissionException
Throws:
NoPermissionException

getCreatedDatetime

public java.util.Date getCreatedDatetime()
                                  throws NoPermissionException
Throws:
NoPermissionException

addSection

public void addSection(Section section)
                throws NoPermissionException
Throws:
NoPermissionException

setStatus

public void setStatus(int status)
               throws NoPermissionException
Throws:
NoPermissionException

setLanguage

public void setLanguage(Language language)
                 throws NoPermissionException
Throws:
NoPermissionException

setPublicationEndDatetime

public void setPublicationEndDatetime(java.util.Date datetime)
                               throws NoPermissionException
Throws:
NoPermissionException

getPublicationEndDatetime

public java.util.Date getPublicationEndDatetime()
                                         throws NoPermissionException
Throws:
NoPermissionException

getStatus

public int getStatus()
              throws NoPermissionException
Throws:
NoPermissionException

setVisibleInMenusForUnauthorizedUsers

public void setVisibleInMenusForUnauthorizedUsers(boolean visibleInMenusForUnauthorizedUsers)
                                           throws NoPermissionException
Throws:
NoPermissionException

isVisibleInMenusForUnauthorizedUsers

public boolean isVisibleInMenusForUnauthorizedUsers()
                                             throws NoPermissionException
Throws:
NoPermissionException