com.arsdigita.cms.contenttypes
Class ContentGroupAssociation

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

public class ContentGroupAssociation
extends ContentItem

This is an object that places an object in a group. This has to be an object and not an association with link attribute because of the way that CMS versioning handles associations This class should be removed once versioning and persistence support versioned link attributes (sortKey)

Version:
$Revision: #8 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Randy Graebner (randyg@redhat.com)

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String CONTENT_GROUP
           
static String CONTENT_ITEM
           
static String SORT_KEY
           
protected 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
ContentGroupAssociation()
           
ContentGroupAssociation(ContentItem item, ContentGroup group)
          This creates a new association and sets the item and group to the passed in values.
ContentGroupAssociation(com.arsdigita.persistence.DataObject obj)
           
ContentGroupAssociation(com.arsdigita.persistence.OID oid)
          Constructor.
ContentGroupAssociation(String type)
           
 
Method Summary
protected  void beforeSave()
          Make sure the item has a sortKey.
 String getBaseDataObjectType()
           
protected  ContentGroup getContentGroup()
          This returns the content group for this association
protected  ContentItem getContentItem()
          This returns the content item for this association
protected  Integer getSortKey()
          Get the sortKey for this association
protected  void setContentGroup(ContentGroup group)
          This Sets the ContentGroup for this association.
 void setContentItem(ContentItem item)
          Sets the content item for this association
protected  void setSortKey(Integer key)
          Set the sortKey for this association
protected  void swapWithNext()
          This swaps the sort key with the next item in the list or does nothing if no such item exists.
protected  void swapWithPrevious()
          This swaps the sort key with the next item in the list or does nothing if no such item exists.
 
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, 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

protected 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

CONTENT_ITEM

public static final String CONTENT_ITEM
See Also:
Constant Field Values

CONTENT_GROUP

public static final String CONTENT_GROUP
See Also:
Constant Field Values

SORT_KEY

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

ContentGroupAssociation

public ContentGroupAssociation()

ContentGroupAssociation

public ContentGroupAssociation(String type)

ContentGroupAssociation

public ContentGroupAssociation(ContentItem item,
                               ContentGroup group)
This creates a new association and sets the item and group to the passed in values. Both values must be non-null.


ContentGroupAssociation

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

ContentGroupAssociation

public ContentGroupAssociation(com.arsdigita.persistence.DataObject obj)
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

setContentItem

public void setContentItem(ContentItem item)
Sets the content item for this association


setContentGroup

protected void setContentGroup(ContentGroup group)
This Sets the ContentGroup for this association.


getContentItem

protected ContentItem getContentItem()
This returns the content item for this association


getContentGroup

protected ContentGroup getContentGroup()
This returns the content group for this association


getSortKey

protected Integer getSortKey()
Get the sortKey for this association


setSortKey

protected void setSortKey(Integer key)
Set the sortKey for this association


swapWithNext

protected void swapWithNext()
This swaps the sort key with the next item in the list or does nothing if no such item exists. For instance, if the association is 5th before the call, it will be 6th and the 6th item will become the 5th item, if there is a 6th item.


swapWithPrevious

protected void swapWithPrevious()
This swaps the sort key with the next item in the list or does nothing if no such item exists. For instance, if the association is 6th before the call, it will be 5th and the 5th item will become the 6th item. If this item is first in the list then this is a no-op


beforeSave

protected void beforeSave()
Make sure the item has a sortKey.

Overrides:
beforeSave in class ContentItem


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