## com.arsdigita.cms.docmgr
Class Document

    java.lang.Object
      com.arsdigita.domain.DomainObject
          com.arsdigita.domain.ObservableDomainObject
              com.arsdigita.kernel.ACSObject
                  com.arsdigita.versioning.VersionedACSObject
                      com.arsdigita.cms.ContentItem
                          com.arsdigita.cms.ContentPage
                              com.arsdigita.cms.docmgr.Document

All Implemented Interfaces:
  com.arsdigita.auditing.Audited, com.arsdigita.cms.CustomCopy, Resource

public class Document
extends com.arsdigita.cms.ContentPage
implements Resource

This content type represents a document.

Author:
  Crag Wolfe

Field Summary
`static String` `AUTHOR`
`static String` `AUTHOR_LAST_NAME`
`static String` `BASE_DATA_OBJECT_TYPE` Data object type for this domain object
`static String` `CREATOR`
`static String` `DESCRIPTION` PDL properties
`static String` `FILE`
`static String` `LAST_MOD_LOCAL`
`static String` `REPOSITORY`
`static String` `TYPE` Data object type for this domain object (for CMS compatibility)

Fields inherited from class com.arsdigita.cms.ContentPage
`LAUNCH_DATE, PAGES_IN_CATEGORY, PAGES_IN_FOLDER, QUERY_CATEGORY_ID, QUERY_PAGE, QUERY_ROOT_ID, QUERY_TYPE, SUMMARY, TITLE, versionId`

Fields inherited from class com.arsdigita.cms.ContentItem
`ANCESTORS, AUDITING, CHILDREN, CONTENT_SECTION, CONTENT_TYPE, DRAFT, DRAFT_VERSION, extraXMLGenerators, LANGUAGE, LIVE, NAME, PARENT, PENDING, VERSION, VERSIONS`

Fields inherited from class com.arsdigita.versioning.VersionedACSObject
`IS_DELETED, MASTER`

Fields inherited from class com.arsdigita.kernel.ACSObject
`CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE`

Fields inherited from interface com.arsdigita.cms.docmgr.Resource
`SEPARATOR, SEPARATOR_CHAR`

Constructor Summary
`Document()`
`Document(BigDecimal id)`
`Document(com.arsdigita.persistence.DataObject obj)`
`Document(com.arsdigita.persistence.OID id)`
`Document(String type)`

Method Summary
`protected void` `beforeSave()`
`Resource` `copyTo(Resource parent)` Copies the resource into another location.
`Resource` `copyTo(String name)` Copies the resource into the same location (same parent) with a new name.
`Resource` `copyTo(String name, Resource parent)` Copies the resource into another location with a new name.
`void` `delete()` Deletes the Parent ContentBundle of this Document.
`String` `getAuthor()`
`String` `getAuthorLastName()`
`com.arsdigita.kernel.User` `getCreator()`
`String` `getDescription()` Returns a description of the resource, or null if no description has been provided.
`com.arsdigita.cms.Folder.ItemCollection` `getDocumentsWithName(com.arsdigita.cms.Folder parentFolder, String name)`
`com.arsdigita.cms.FileAsset` `getFile()` Accessor.
`String` `getImpliedAuthor()`
`Date` `getLastModifiedLocal()`
`Resource` `getParentResource()` Returns the path name of this resource's parent, or null if this resource does not have a parent.
`String` `getPrettyMimeType()`
`Repository` `getRepository()`
`String` `getSearchLanguage()`
`String` `getSearchLinkText()`
`byte[]` `getSearchRawContent()`
`String` `getSearchUrlStub()`
`BigDecimal` `getSize()` Returns the size of the file in bytes.
`boolean` `isFile()` Tests whether this resource is a file.
`boolean` `isFolder()` Tests whether this resource is a folder.
`boolean` `isRoot()` Is this the root?
`static Document` `retrieveDocument(com.arsdigita.persistence.DataObject documentData)` Returns a document for the given data object.
`void` `setAuthor(String author)`
`void` `setCategories(String[] catIDs)`
`void` `setCreator(com.arsdigita.kernel.User creator)`
`void` `setDescription(String description)`
`void` `setFile(com.arsdigita.cms.FileAsset file)` Mutator.
`void` `setLastModifiedLocal(Date last)`
`void` `setParentResource(Resource r)` Set parent object
`void` `setRepository(Repository repository)`
`void` `setTitle(String title)`
`URL` `toURL()` Returns the URL corresponding to this resource.

Methods inherited from class com.arsdigita.cms.ContentPage
`getBaseDataObjectType, getContentBundle, getDisplayName, getLaunchDate, getPagesInSectionQuery, getPagesInSectionQuery, getPagesInSectionQuery, getPagesInSectionQuery, getSearchSummary, getTitle, setLaunchDate, setName, setPagesQueryParameters, setPagesQueryParameters`

Methods inherited from class com.arsdigita.cms.ContentItem

`addCategory, addPendingVersion, afterSave, assertDraft, assertLive, assertMaster, assertPending, beforeDelete, canPublishToFS, copy, copy, copyProperty, copyProperty, copyServices, copyServicesFrom, createLiveVersion, createPendingVersion, get, getCategories, getCategoryCollection, getChildren, getContentSection, getContentType, getCreationDate, getCreationIP, getCreationUser, getDraftVersion, getExtraXMLGenerators, getLanguage, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, getLifecycle, getLiveVersion, getLocale, getName, getParent, getPath, getPathInfo, getPathInfo, getPathNoJsp, getPendingVersions, getPublicVersion, getPublishListenerClassName, getVersion, getWorkingVersion, initialize, isDraftVersion, isLive, isLiveVersion, isPendingVersion, isPublished, makeCopy, promotePendingVersion, publish, publishToFS, removeCategory, removeLifecycle, removePendingVersion, republish, set, setContentSection, setContentType, setDefaultCategory, setLanguage, setLifecycle, setLive, setLiveVersion, setParent, setVersion, setVersionRecursively, unpublish, unpublishFromFS`

Methods inherited from class com.arsdigita.versioning.VersionedACSObject
`applyTag, applyUniqueTag, autoPropagateMaster, getMaster, getRolledBackTo, getTransactions, getTransactions, isMaster, isRolledBack, isSubtype, permanentlyDelete, propagateMaster, recordAttributeChange, rollBackTo, rollBackTo, rollForward, save, setMaster, trackChanges`

Methods inherited from class com.arsdigita.kernel.ACSObject
`assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID`

Methods inherited from class com.arsdigita.domain.ObservableDomainObject
`addObserver, getObservers`

Methods inherited from class com.arsdigita.domain.DomainObject
`add, add, addToAssociation, afterDelete, clear, disconnect, equals, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString`

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

Methods inherited from interface com.arsdigita.cms.docmgr.Resource
`getID, getPath, getTitle, save, toString`

Field Detail

### DESCRIPTION

    public static final String DESCRIPTION

  PDL properties

  See Also:
    Constant Field Values

### FILE

    public static final String FILE

See Also:
  Constant Field Values

### AUTHOR

    public static final String AUTHOR

See Also:
  Constant Field Values

### CREATOR

    public static final String CREATOR

See Also:
  Constant Field Values

### LAST_MOD_LOCAL

    public static final String LAST_MOD_LOCAL

See Also:
  Constant Field Values

### AUTHOR_LAST_NAME

    public static final String AUTHOR_LAST_NAME

See Also:
  Constant Field Values

### REPOSITORY

    public static final String REPOSITORY

See Also:
  Constant Field Values

### BASE_DATA_OBJECT_TYPE

    public static final String BASE_DATA_OBJECT_TYPE

  Data object type for this domain object

  See Also:
    Constant Field Values

### TYPE

    public static final String TYPE

  Data object type for this domain object (for CMS compatibility)

  See Also:
    Constant Field Values

Constructor Detail

### Document

    public Document()

### Document

    public Document(BigDecimal id)
             throws com.arsdigita.domain.DataObjectNotFoundException

### Document

    public Document(com.arsdigita.persistence.OID id)
             throws com.arsdigita.domain.DataObjectNotFoundException

### Document

    public Document(com.arsdigita.persistence.DataObject obj)

### Document

    public Document(String type)

Method Detail

### retrieveDocument

    public static Document retrieveDocument(com.arsdigita.persistence.DataObject documentData)

  Returns a document for the given data object. Use this method instead of the new Document(DataObject) method. This method uses the domain object factory to produce the appropriate document class.

  Parameters:
    `documentData` - the document `DataObject`
  Returns:
    the document for the given data object.

### getDescription

    public String getDescription()

  Description copied from interface: `Resource`
  Returns a description of the resource, or null if no description has been provided.

  Specified by:
    `getDescription` in interface `Resource`

### setDescription

    public void setDescription(String description)

### getCreator

    public com.arsdigita.kernel.User getCreator()

### setCreator

    public void setCreator(com.arsdigita.kernel.User creator)

### getRepository

    public Repository getRepository()

### setRepository

    public void setRepository(Repository repository)

### getLastModifiedLocal

    public Date getLastModifiedLocal()

### setLastModifiedLocal

    public void setLastModifiedLocal(Date last)

### getImpliedAuthor

    public String getImpliedAuthor()

### getAuthor

    public String getAuthor()

### setAuthor

    public void setAuthor(String author)

### getAuthorLastName

    public String getAuthorLastName()

### setTitle

    public void setTitle(String title)

### getFile

    public com.arsdigita.cms.FileAsset getFile()

  Accessor. Get the file associated with this item.

### setFile

    public void setFile(com.arsdigita.cms.FileAsset file)

  Mutator. Set the file associated with this item.

### isFolder

    public boolean isFolder()

  Description copied from interface: `Resource`
  Tests whether this resource is a folder.

  Specified by:
    `isFolder` in interface `Resource`

### isFile

    public boolean isFile()

  Description copied from interface: `Resource`
  Tests whether this resource is a file.

  Specified by:
    `isFile` in interface `Resource`

### copyTo

    public Resource copyTo(Resource parent)
                    throws ResourceExistsException

  Copies the resource into another location. Preserves the original name of the resource but places the copy inside a new parent resource.

  Specified by:
    `copyTo` in interface `Resource`
  Parameters:
    `parent` - the parent of the copy
  Returns:
    a copy of the original resource
  Throws:
    `ResourceExistsException`

### copyTo

    public Resource copyTo(String name,
                           Resource parent)
                    throws ResourceExistsException

  Copies the resource into another location with a new name.

  Specified by:
    `copyTo` in interface `Resource`
  Parameters:
    `name` - the name of the copy
    `parent` - the parent of the copy
  Returns:
    a copy of the original resource.
  Throws:
    `ResourceExistsException`

### copyTo

    public Resource copyTo(String name)
                    throws ResourceExistsException

  Copies the resource into the same location (same parent) with a new name.

  Specified by:
    `copyTo` in interface `Resource`
  Parameters:
    `name` - the name of the copy
  Returns:
    a copy of the original resource.
  Throws:
    `ResourceExistsException`

### toURL

    public URL toURL()

  Description copied from interface: `Resource`
  Returns the URL corresponding to this resource.

  Specified by:
    `toURL` in interface `Resource`

### getSize

    public BigDecimal getSize()

  Returns the size of the file in bytes.

  Returns:
    the size of the file in bytes, or 0 (should be -1?) if the size cannot be computed.

### isRoot

    public boolean isRoot()

  Description copied from interface: `Resource`
  Is this the root?

  Specified by:
    `isRoot` in interface `Resource`

### getPrettyMimeType

    public String getPrettyMimeType()

### getParentResource

    public Resource getParentResource()

  Description copied from interface: `Resource`
  Returns the path name of this resource's parent, or null if this resource does not have a parent.

  Specified by:
    `getParentResource` in interface `Resource`

### setParentResource

    public void setParentResource(Resource r)

  Description copied from interface: `Resource`
  Set parent object

  Specified by:
    `setParentResource` in interface `Resource`

### beforeSave

    protected void beforeSave()

### setCategories

    public void setCategories(String[] catIDs)

### getDocumentsWithName

    public com.arsdigita.cms.Folder.ItemCollection getDocumentsWithName(com.arsdigita.cms.Folder parentFolder,
                                                                        String name)

### delete

    public void delete()
                throws com.arsdigita.persistence.PersistenceException

  Deletes the Parent ContentBundle of this Document.

  Specified by:
    `delete` in interface `Resource`
  Throws:
    `com.arsdigita.persistence.PersistenceException`
  See Also:
    `DomainObject.delete()`

### getSearchLanguage

    public String getSearchLanguage()

### getSearchRawContent

    public byte[] getSearchRawContent()

### getSearchUrlStub

    public String getSearchUrlStub()

### getSearchLinkText

    public String getSearchLinkText()

Copyright (c) 2006 Red Hat, Inc. Corporation. All Rights Reserved. Generated at June 1 2006:1113 UTC