com.arsdigita.cms
Class ArticleImageAssociation

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.ArticleImageAssociation
All Implemented Interfaces:
com.arsdigita.auditing.Audited, CustomCopy

public class ArticleImageAssociation
extends ContentItem

This class associates an Article and an Image with a particular caption.

Version:
$Revision: #16 $ $Date: 2004/04/07 $
Author:
Jack Chung (flattop@arsdigita.com)

Field Summary
protected static String ARTICLE
           
protected static String ARTICLE_ID
           
static String BASE_DATA_OBJECT_TYPE
           
protected static String CAPTION
           
protected static String IMAGE
           
protected static String IMAGE_ID
           
static String versionId
           
 
Fields inherited from class com.arsdigita.cms.ContentItem
ANCESTORS, AUDITING, CHILDREN, CONTENT_SECTION, CONTENT_TYPE, DRAFT, DRAFT_VERSION, 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
 
Constructor Summary
ArticleImageAssociation()
          Default constructor.
ArticleImageAssociation(com.arsdigita.persistence.DataObject obj)
           
ArticleImageAssociation(com.arsdigita.persistence.OID oid)
          Constructor.
ArticleImageAssociation(String type)
           
 
Method Summary
 boolean copyProperty(CustomCopy source, com.arsdigita.persistence.metadata.Property property, ItemCopier copier)
          Auto-publish the associated ReusableImageAssociation if it is not yet live
 Article getArticle()
           
 BigDecimal getArticleID()
           
 String getCaption()
           
 ImageAsset getImage()
           
 BigDecimal getImageID()
           
static boolean imageHasAssociation(BigDecimal imageID)
          This returns true if the image is associated with at least one article.
static boolean imageHasAssociation(ImageAsset image)
          This returns true if the image is associated with at least one article, checking both liveand draft versions
static boolean imageHasDirectAssociation(BigDecimal imageID)
          This returns true if the image is associated with at least one article.
static ArticleImageAssociation retrieveAssociation(BigDecimal articleID, BigDecimal imageID)
          This returns the association object that is specified by the passed in IDs or it returns null if no such association exists
 void setArticle(Article article)
           
 void setCaption(String caption)
           
 void setImage(ImageAsset image)
           
 
Methods inherited from class com.arsdigita.cms.ContentItem
addCategory, addPendingVersion, afterSave, assertDraft, assertLive, assertMaster, assertPending, beforeDelete, beforeSave, canPublishToFS, copy, copy, copyProperty, copyServices, copyServicesFrom, createLiveVersion, createPendingVersion, get, getBaseDataObjectType, 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

ARTICLE

protected static final String ARTICLE
See Also:
Constant Field Values

IMAGE

protected static final String IMAGE
See Also:
Constant Field Values

CAPTION

protected static final String CAPTION
See Also:
Constant Field Values

ARTICLE_ID

protected static final String ARTICLE_ID
See Also:
Constant Field Values

IMAGE_ID

protected static final String IMAGE_ID
See Also:
Constant Field Values
Constructor Detail

ArticleImageAssociation

public ArticleImageAssociation()
Default constructor.


ArticleImageAssociation

public ArticleImageAssociation(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.

ArticleImageAssociation

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

ArticleImageAssociation

public ArticleImageAssociation(String type)
Method Detail

retrieveAssociation

public static ArticleImageAssociation retrieveAssociation(BigDecimal articleID,
                                                          BigDecimal imageID)
This returns the association object that is specified by the passed in IDs or it returns null if no such association exists


imageHasDirectAssociation

public static boolean imageHasDirectAssociation(BigDecimal imageID)
This returns true if the image is associated with at least one article.


imageHasAssociation

public static boolean imageHasAssociation(BigDecimal imageID)
This returns true if the image is associated with at least one article.


imageHasAssociation

public static boolean imageHasAssociation(ImageAsset image)
This returns true if the image is associated with at least one article, checking both liveand draft versions


getArticleID

public BigDecimal getArticleID()

getArticle

public Article getArticle()

setArticle

public void setArticle(Article article)

getImageID

public BigDecimal getImageID()

getImage

public ImageAsset getImage()

setImage

public void setImage(ImageAsset image)

getCaption

public String getCaption()

setCaption

public void setCaption(String caption)

copyProperty

public boolean copyProperty(CustomCopy source,
                            com.arsdigita.persistence.metadata.Property property,
                            ItemCopier copier)
Auto-publish the associated ReusableImageAssociation if it is not yet live

Specified by:
copyProperty in interface CustomCopy
Overrides:
copyProperty in class ContentItem
Parameters:
source - the source CustomCopy item
property - the property to copy
copier - a temporary class that is able to copy a child item correctly.
Returns:
true if the property was copied; false to indicate that regular metadata-driven methods should be used to copy the property.


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