com.cassinidivision.oce.content
Class C_ContentContainer

java.lang.Object
  extended bycom.webobjects.eocontrol.EOCustomObject
      extended bycom.webobjects.eocontrol.EOGenericRecord
          extended bycom.cassinidivision.oce.content.base._C_Content
              extended bycom.cassinidivision.oce.content.C_Content
                  extended bycom.cassinidivision.oce.content.base._C_ContentContainer
                      extended bycom.cassinidivision.oce.content.C_ContentContainer
All Implemented Interfaces:
_EOPrivateMemento, EODeferredFaulting, EOEnterpriseObject, EOFaulting, EOKeyValueCoding, EOKeyValueCoding._BestBindingCreation._ForwardingBindingCheck, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCodingAdditions, EORelationshipManipulation, EOValidation, NSKeyValueCoding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._ReflectionKeyBindingCreation.Callback, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable
Direct Known Subclasses:
com.cassinidivision.oce.content.base._C_Directory, com.cassinidivision.oce.content.base._C_Feature, com.cassinidivision.oce.content.base._C_FeaturePage, com.cassinidivision.oce.content.base._C_PageComponent, com.cassinidivision.oce.content.base._C_PageVersion, com.cassinidivision.oce.content.base._C_TextContent

public class C_ContentContainer
extends com.cassinidivision.oce.content.base._C_ContentContainer

An abstract class for representing hierarchical content, which can have children and other items of content contained within it.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOGenericRecord
EOGenericRecord._DictionaryBinding, EOGenericRecord._LazyDictionaryBinding
 
Nested classes inherited from class com.webobjects.eocontrol.EOCustomObject
EOCustomObject._BooleanFieldBinding, EOCustomObject._FieldBinding, EOCustomObject._LazyFieldBinding, EOCustomObject._NumberFieldBinding
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueCodingAdditions
EOKeyValueCodingAdditions.DefaultImplementation, EOKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueCoding
EOKeyValueCoding._BestBindingCreation, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCoding._StoredForwardingBinding
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Nested classes inherited from class com.webobjects.eocontrol._EOPrivateMemento
_EOPrivateMemento.DefaultImplementation
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOGenericRecord
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
C_ContentContainer()
           
 
Method Summary
 NSArray acceptableClassesOfChildren()
          Reports which classes of children are acceptable within the receiver.
 void appendExportXMLForPropertiesToString(StringBuffer returnString)
          Calculates the export XML string for all properties (child tags and child text) owned by the receiver, and appends it to the given string.
 void awakeFromInsertion(EOEditingContext ec)
          All newly-created content in the OCE system is immediately instantiated with the following values.
 C_Content childContentWithName(String aName)
          Locates the existing child of the receiver which has the given name.
 C_Content contentAtContentPath(String aPath)
          Locates the content at a given relative path.
 C_Content copyIntoEC(EOEditingContext ec)
          Extends the superclass copy functionality to include the deep copying of child content.
 C_Content createNewChildOfClassWithStem(Class aClass, String aStem)
          Creates a new child within the receiver.
 void deleteChild(C_Content aChild)
          Deletes the given child from the receiver.
 C_Content duplicateChild(C_Content aChild)
          Creates a new copy of the specified child within the receiver, with an appropriate new (unique) name.
 StringBuffer exportXMLForAttributes()
          Called during XML export: builds a StringBuffer holding all the attribute name="value" pairs for the receiver's XML.
 void fixHyperlinkPathsForImportedChildren(NSArray importedChildren)
          Recurses through an array of recently imported child objects and fixes any hyperlink connections found.
 void forceDeleteAllChildren()
          Forcibly remove all children from the receiver.
 void forceDeleteChild(C_Content aChild)
          Deletes a child, ignoring any special rules which may normally deny the deletion.
 NSArray globalIDsForSelfAndAllChildren()
          Retrieves an array of global IDs for the receiver and all of it's descendents.
 NSArray globalIDsForSelfAndAllLoadedChildren()
          Retrieves an array of globalIDs for the receiver and all the descendants which are already loaded (which are not faults).
 String longDebuggingOutput()
           
 String nameForNewChildWithStem(String aStem)
          Calculates the appropriate name for a new child, ensuring there are no two children with the same name.
 NSArray orderedChildren()
          Sorts the children of the receiver by name.
 boolean renameChildToName(C_Content aChild, String aName)
          Renames the given child to have the new name.
 NSArray selfAndAllChildren()
          Retrieve an array consisting of the receiver and all the children.
 NSArray selfAndAllLoadedChildren()
          Retrieve an array consisting of the receiver and all children that were previously fetched from the database.
 boolean selfOrSomeDescendantPublished()
          Extends the super implementation to check if any children were published.
 C_Content startElementWithAttributes(String element, NSDictionary attributes)
          Called automatically by XMLParser when an opening tag is found.
 boolean willAcceptChild(C_Content aChild)
          Reports whether or not receiver will accept a given content class instance.
 boolean willAcceptChildOfClass(Class aNewClass)
          Reports whether or not the receiver will accept children of the given class.
 boolean willAcceptChildren(NSArray someChildren)
          Reports whether or not the receiver will accept all the children in the given array.
 
Methods inherited from class com.cassinidivision.oce.content.base._C_ContentContainer
addToChildren, children, removeFromChildren, setChildren
 
Methods inherited from class com.cassinidivision.oce.content.C_Content
addCAttributeWithValues, addCharacterData, allParents, appendExportXMLForAdditionalAttributesToString, appendExportXMLForAttributeNamedKeyPathToString, appendExportXMLForAttributeNamedValueToString, appendExportXMLForAttributesToString, appendExportXMLForAttributeToString, appendExportXMLForClosingTagToString, appendExportXMLForEmptyTagToString, appendExportXMLForObjectToString, appendExportXMLForOpeningTagToString, appendExportXMLForPropertyNamedKeyPathToString, appendExportXMLForPropertyNamedValueToString, appendExportXMLForPropertyToString, appendStringValueForPropertyToString, contentId, contentPath, contentWithContentIdInEditingContext, copyToNewParent, copyWithinEC, defaultXMLRepresentation, deleteSelf, endElement, forceDeleteSelf, moveToNewParent, renameSelf, setDataPropertyFromDictionary, setDatePropertyFromDictionary, setNumberPropertyFromDictionary, setStringPropertyFromDictionary, setStringPropertyNamedKeyPathFromDictionary, sortField, startCAttributeList, takeAttributesFromDictionary
 
Methods inherited from class com.cassinidivision.oce.content.base._C_Content
addToXmlAttributes, className, creationDate, modificationDate, name, parent, removeFromXmlAttributes, setClassName, setCreationDate, setModificationDate, setName, setParent, setXmlAttributes, setXmlLabel, xmlAttributes, xmlLabel
 
Methods inherited from class com.webobjects.eocontrol.EOGenericRecord
__setClassDescription, _keyGetBindingForKey, _keySetBindingForKey, _otherStorageBinding, _storedKeyGetBindingForKey, _storedKeySetBindingForKey, classDescription, usesDeferredFaultCreation
 
Methods inherited from class com.webobjects.eocontrol.EOCustomObject
__classDescription, __clearPendingChanges, __editingContext, __globalID, __hasAuxillaryObservers, __hasPendingChanges, __hasPendingUpdate, __isInitialized, __isPendingDeletion, __isPendingInsertion, __isShared, __lastSnapshot, __originalSnapshot, __retainCount, __setAuxillaryObservers, __setEditingContext, __setGlobalID, __setInitialized, __setLastSnapshot, __setOriginalSnapshot, __setPendingDeletion, __setPendingInsertion, __setPendingUpdate, __setRetainCount, __setShared, _createKeyGetBindingForKey, _createKeySetBindingForKey, _createStoredKeyGetBindingForKey, _createStoredKeySetBindingForKey, _fieldKeyBinding, _forwardingBindingNeededForClass, _methodKeyGetBinding, _methodKeySetBinding, addObjectToBothSidesOfRelationshipWithKey, addObjectToPropertyWithKey, allPropertyKeys, attributeKeys, awakeFromClientUpdate, awakeFromFetch, canAccessFieldsDirectly, changesFromSnapshot, classDescriptionForDestinationKey, clearFault, clearProperties, deleteRuleForRelationshipKey, editingContext, entityName, eoDescription, eoShallowDescription, equals, faultHandler, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hashCode, inverseForRelationshipKey, invokeRemoteMethod, isFault, isToManyKey, opaqueState, ownsDestinationObjectsForRelationshipKey, prepareValuesForClient, propagateDeleteWithEditingContext, reapplyChangesFromDictionary, removeObjectFromBothSidesOfRelationshipWithKey, removeObjectFromPropertyWithKey, shouldUseStoredAccessors, snapshot, storedValueForKey, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, takeValuesFromDictionaryWithMapping, toManyRelationshipKeys, toOneRelationshipKeys, toString, turnIntoFault, unableToSetNullForKey, updateFromSnapshot, userPresentableDescription, validateClientUpdate, validateForDelete, validateForInsert, validateForSave, validateForUpdate, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath, valuesForKeys, valuesForKeysWithMapping, willChange, willRead, willReadRelationship
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

C_ContentContainer

public C_ContentContainer()
Method Detail

awakeFromInsertion

public void awakeFromInsertion(EOEditingContext ec)
Description copied from class: C_Content
All newly-created content in the OCE system is immediately instantiated with the following values.

Specified by:
awakeFromInsertion in interface EOEnterpriseObject
Overrides:
awakeFromInsertion in class C_Content
See Also:
EOEnterpriseObject.awakeFromInsertion(com.webobjects.eocontrol.EOEditingContext)

copyIntoEC

public C_Content copyIntoEC(EOEditingContext ec)
Extends the superclass copy functionality to include the deep copying of child content.

Overrides:
copyIntoEC in class C_Content
Parameters:
ec - editing context to copy into
Returns:
the new copy
See Also:
C_Content.copyIntoEC(com.webobjects.eocontrol.EOEditingContext)

contentAtContentPath

public C_Content contentAtContentPath(String aPath)
Description copied from class: C_Content
Locates the content at a given relative path.

Overrides:
contentAtContentPath in class C_Content
Parameters:
aPath - The relative path from the content root to the desired content.
Returns:
The content requested.

orderedChildren

public NSArray orderedChildren()
Sorts the children of the receiver by name.

Returns:
sorted array of children

childContentWithName

public C_Content childContentWithName(String aName)
Locates the existing child of the receiver which has the given name.

Note this method does not create any new children.

Parameters:
aName - name of the required child
Returns:
the child content if found, or null if not found

nameForNewChildWithStem

public String nameForNewChildWithStem(String aStem)
Calculates the appropriate name for a new child, ensuring there are no two children with the same name.

This method is called automatically when creating new children.

Parameters:
aStem - the desired name
Returns:
the resulting name

duplicateChild

public C_Content duplicateChild(C_Content aChild)
Creates a new copy of the specified child within the receiver, with an appropriate new (unique) name.

Parameters:
aChild - the child to duplicate
Returns:
the new copy of the child

deleteChild

public void deleteChild(C_Content aChild)
Deletes the given child from the receiver.

Can be overridden in subclasses to do additional checks / refuse deletion etc.

Parameters:
aChild - the child to be deleted.

renameChildToName

public boolean renameChildToName(C_Content aChild,
                                 String aName)
Renames the given child to have the new name.

This method does not modify the given name for uniqueness, but refuses the renaming if the new name is not unique.

Parameters:
aChild - the child to be renamed
aName - the new name for the child
Returns:
true if the the rename succeeded, false otherwise

createNewChildOfClassWithStem

public C_Content createNewChildOfClassWithStem(Class aClass,
                                               String aStem)
Creates a new child within the receiver.

This method throws exceptions if it is illegal for the receiver to have children of the requested class.

Parameters:
aClass - desired class for the new child
aStem - desired name for the new child (which will be modified for uniqueness)
Returns:
the new child

acceptableClassesOfChildren

public NSArray acceptableClassesOfChildren()
Reports which classes of children are acceptable within the receiver.

The base implementation returns an empty array.

Returns:
array of acceptable classes

willAcceptChildOfClass

public boolean willAcceptChildOfClass(Class aNewClass)
Reports whether or not the receiver will accept children of the given class.

Parameters:
aNewClass - class to be tested
Returns:
true if the class is acceptable, false otherwise

willAcceptChild

public boolean willAcceptChild(C_Content aChild)
Reports whether or not receiver will accept a given content class instance.

Extends willAcceptChildOfClass(Class) to check that the given instance is not already present amongst the existing children.

Parameters:
aChild - the potential child
Returns:
true if the child instance is acceptable, false otherwise

willAcceptChildren

public boolean willAcceptChildren(NSArray someChildren)
Reports whether or not the receiver will accept all the children in the given array.

Parameters:
someChildren - array of potential children
Returns:
true if all the children are acceptable, false otherwise

selfAndAllChildren

public NSArray selfAndAllChildren()
Retrieve an array consisting of the receiver and all the children.

Returns:
array of content objects

selfAndAllLoadedChildren

public NSArray selfAndAllLoadedChildren()
Retrieve an array consisting of the receiver and all children that were previously fetched from the database.

Any faults found will not be included.

Overrides:
selfAndAllLoadedChildren in class C_Content
Returns:
array of content objects

globalIDsForSelfAndAllChildren

public NSArray globalIDsForSelfAndAllChildren()
Retrieves an array of global IDs for the receiver and all of it's descendents.

Overrides:
globalIDsForSelfAndAllChildren in class C_Content
Returns:
array of global IDs

globalIDsForSelfAndAllLoadedChildren

public NSArray globalIDsForSelfAndAllLoadedChildren()
Retrieves an array of globalIDs for the receiver and all the descendants which are already loaded (which are not faults).

Overrides:
globalIDsForSelfAndAllLoadedChildren in class C_Content
Returns:
array of global IDs

selfOrSomeDescendantPublished

public boolean selfOrSomeDescendantPublished()
Extends the super implementation to check if any children were published.

Overrides:
selfOrSomeDescendantPublished in class C_Content
Returns:
true if any descendents have been published, false otherwise.
See Also:
C_Content.selfOrSomeDescendantPublished()

exportXMLForAttributes

public StringBuffer exportXMLForAttributes()
Description copied from class: C_Content
Called during XML export: builds a StringBuffer holding all the attribute name="value" pairs for the receiver's XML.

Overrides:
exportXMLForAttributes in class C_Content
Returns:
a New StringBuffer holding the receiver's attribute string.

appendExportXMLForPropertiesToString

public void appendExportXMLForPropertiesToString(StringBuffer returnString)
Calculates the export XML string for all properties (child tags and child text) owned by the receiver, and appends it to the given string.

Overrides:
appendExportXMLForPropertiesToString in class C_Content
Parameters:
returnString - StringBuffer to which the result will be appended
See Also:
C_Content.appendExportXMLForPropertiesToString(java.lang.StringBuffer)

startElementWithAttributes

public C_Content startElementWithAttributes(String element,
                                            NSDictionary attributes)
Description copied from class: C_Content
Called automatically by XMLParser when an opening tag is found.

For a discussion of which objects receive messages about which opening tags, see XMLParser.

Overrides:
startElementWithAttributes in class C_Content
Parameters:
element - The name of the start tag found.
attributes - A dictionary of the attribute keys and values in the start tag.

fixHyperlinkPathsForImportedChildren

public void fixHyperlinkPathsForImportedChildren(NSArray importedChildren)
Recurses through an array of recently imported child objects and fixes any hyperlink connections found.

This is done because internal links (links between two pieces of content both being imported in one go) cannot be set at import time, as the link target may not yet have been loaded. So the relationships are actually set here.

Parameters:
importedChildren - array of imported children

forceDeleteChild

public void forceDeleteChild(C_Content aChild)
Deletes a child, ignoring any special rules which may normally deny the deletion.

This method should normally only be used by framework-internal routines. Client programs (and similar) should normally call deleteChild(C_Content).

Parameters:
aChild - the child to be deleted.

forceDeleteAllChildren

public void forceDeleteAllChildren()
Forcibly remove all children from the receiver.

Special rules which would normally deny the deletion are ignored.


longDebuggingOutput

public String longDebuggingOutput()
Overrides:
longDebuggingOutput in class C_Content