com.arsdigita.cms
Class Asset

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.versioning.VersionedACSObject
                  extended bycom.arsdigita.cms.ContentItem
                      extended bycom.arsdigita.cms.Asset
All Implemented Interfaces:
com.arsdigita.auditing.Audited, CustomCopy
Direct Known Subclasses:
BinaryAsset, TextAsset

public abstract class Asset
extends ContentItem

Assets are extra content associated with a content item. An image, for instance, may be an asset of a news article.

Version:
$Revision: #20 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Jack Chung

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String DESCRIPTION
           
static String MIME_TYPE
           
static String NAME
           
static String versionId
           
 
Fields inherited from class com.arsdigita.cms.ContentItem
ANCESTORS, AUDITING, CHILDREN, CONTENT_SECTION, CONTENT_TYPE, DRAFT, DRAFT_VERSION, LANGUAGE, LIVE, 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
 
Constructor Summary
  Asset()
           
  Asset(com.arsdigita.persistence.DataObject obj)
           
  Asset(com.arsdigita.persistence.OID oid)
          Constructor.
protected Asset(String type)
           
 
Method Summary
 String getBaseDataObjectType()
           
 String getDescription()
           
 com.arsdigita.mimetypes.MimeType getMimeType()
           
 void setDescription(String value)
          A description of what this asset represents.
 void setMimeType(com.arsdigita.mimetypes.MimeType value)
           
abstract  void writeToFile(File file)
          Write the content of this asset to a file.
 
Methods inherited from class com.arsdigita.cms.ContentItem
addCategory, addPendingVersion, afterSave, assertDraft, assertLive, assertMaster, assertPending, beforeDelete, beforeSave, canPublishToFS, copy, copy, copyProperty, copyProperty, copyServices, copyServicesFrom, createLiveVersion, createPendingVersion, get, getCategories, getCategoryCollection, getChildren, getContentSection, getContentType, getCreationDate, getCreationIP, getCreationUser, getDisplayName, getDraftVersion, getLanguage, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, getLifecycle, getLiveVersion, getLocale, getName, getParent, getPath, getPathInfo, getPathInfo, getPathNoJsp, getPendingVersions, getPublicVersion, getVersion, getWorkingVersion, initialize, isDraftVersion, isLive, isLiveVersion, isPendingVersion, isPublished, makeCopy, promotePendingVersion, publish, publishToFS, removeCategory, removeLifecycle, removePendingVersion, set, setContentSection, setContentType, setDefaultCategory, setLanguage, setLifecycle, setLive, setLiveVersion, setName, 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, delete, 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
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

MIME_TYPE

public static final String MIME_TYPE
See Also:
Constant Field Values
Constructor Detail

Asset

public Asset()

Asset

public Asset(com.arsdigita.persistence.OID oid)
      throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by oid.

Parameters:
oid - The OID for the retrieved DataObject.

Asset

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

Asset

protected Asset(String type)
Method Detail

getBaseDataObjectType

public String getBaseDataObjectType()
Overrides:
getBaseDataObjectType in class ContentItem
Returns:
the base PDL object type for this item. Child classes should override this method to return the correct value

getDescription

public String getDescription()

setDescription

public void setDescription(String value)
A description of what this asset represents. For example, an image might have the caption "Happy kids." The description might say "This is a photo of some happy day-care children playing at the park by the riverbank." For text assets, the description could be used to store a short summary of that asset. For example, if you upload a PDF of a thesis, the description could be used to store an abstract.

Parameters:
value - The description to store

getMimeType

public com.arsdigita.mimetypes.MimeType getMimeType()

setMimeType

public void setMimeType(com.arsdigita.mimetypes.MimeType value)

writeToFile

public abstract void writeToFile(File file)
                          throws IOException
Write the content of this asset to a file.

Parameters:
file - The file on the server to write to.
Throws:
IOException


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2352 UTC