com.arsdigita.cms.contenttypes
Class ContentGroup

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

public class ContentGroup
extends ContentItem

This is an identifiable group of content that is used by the index page.

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 ITEM_ASSOCIATIONS
           
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
ContentGroup()
           
ContentGroup(BigDecimal id)
          Constructor.
ContentGroup(com.arsdigita.persistence.DataObject obj)
           
ContentGroup(com.arsdigita.persistence.OID oid)
          Constructor.
ContentGroup(String type)
           
 
Method Summary
 void addContentItem(ContentItem item)
          This adds an item to the group.
 void clearContentItems()
          This removes all items from the group.
 String getBaseDataObjectType()
           
 ItemCollection getContentGroupAssociations()
          This returns the related items, in order.
 ItemCollection getContentItems()
          This returns the related items, in order.
protected  int getMaxSortKey()
          Get the highest sortKey for associations in this ContentGroup.
 void removeContentItem(ContentItem item)
          This removes an item from the group.
 void swapWithNext(ContentItem item)
          This swaps the sort key with the next item in the list or does nothing if no such item exists.
 void swapWithPrevious(ContentItem item)
          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, 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

ITEM_ASSOCIATIONS

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

ContentGroup

public ContentGroup()

ContentGroup

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

ContentGroup

public ContentGroup(BigDecimal id)
             throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by id and getBaseDataObjectType().

Parameters:
id - The id for the retrieved DataObject.

ContentGroup

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

ContentGroup

public ContentGroup(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

addContentItem

public void addContentItem(ContentItem item)
This adds an item to the group. This actually saves the item. If the item has already been added then this is a no-op


removeContentItem

public void removeContentItem(ContentItem item)
This removes an item from the group. If the item was not associated with this group then this is a no-op. This actually deletes the item so there is no need to call save.


clearContentItems

public void clearContentItems()
This removes all items from the group. This actually deletes objects so you do not need to save after calling this


getContentItems

public ItemCollection getContentItems()
This returns the related items, in order.


getContentGroupAssociations

public ItemCollection getContentGroupAssociations()
This returns the related items, in order.


swapWithNext

public void swapWithNext(ContentItem item)
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. If the content item is not associated with this group then this is a no-op.


swapWithPrevious

public void swapWithPrevious(ContentItem item)
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. If the content item is not associated with this group then this is a no-op.


getMaxSortKey

protected int getMaxSortKey()
Get the highest sortKey for associations in this ContentGroup. If there are no associations, returns -1.



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