com.cassinidivision.oce.content
Class C_Content

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
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_ContentContainer, com.cassinidivision.oce.content.base._C_LeafContent, XMLDummyObject

public class C_Content
extends com.cassinidivision.oce.content.base._C_Content

An abstract EO entity class for representing an arbitrary item of content.

The root entity for all types of OCE content.

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_Content()
           
 
Method Summary
 void addCAttributeWithValues(String element, NSDictionary attributes)
          Called automatically from an XMLParser instance when a C_Attribute tag is found.
 void addCharacterData(String value)
          Called automatically by XMLParser when character data is found.
 NSMutableArray allParents()
          Retrieve all the ancestors of the receiving instance.
 void appendExportXMLForAdditionalAttributesToString(StringBuffer returnString)
          Builds the list of additional key/value pairs associated with this object.
 void appendExportXMLForAttributeNamedKeyPathToString(String attributeName, String keyPath, StringBuffer returnString)
          Builds the XML string for a single attribute (name="value" pair).
 void appendExportXMLForAttributeNamedValueToString(String attributeName, String value, StringBuffer returnString)
          Builds the export XML for a single attribute (name="value" pair).
 void appendExportXMLForAttributesToString(StringBuffer returnString)
          Builds the appropriate string to go into the opening tag for the receiver's objects attributes.
 void appendExportXMLForAttributeToString(String attribute, StringBuffer returnString)
          Builds the XML string for a single attribute (name="value" pair).
 void appendExportXMLForClosingTagToString(StringBuffer returnString)
          Builds the export XML for a closing tag for this object.
 void appendExportXMLForEmptyTagToString(StringBuffer returnString)
          Builds the XML string for a tag representing the receiver as an empty XML tag, ie .
 void appendExportXMLForObjectToString(StringBuffer returnString)
          Builds the XML tag for this object, including the opening tag, any child tags and text content, and the closing tag.
 void appendExportXMLForOpeningTagToString(StringBuffer returnString)
          Builds the export XML for an opening tag representing this object, including attributes.
 void appendExportXMLForPropertiesToString(StringBuffer returnString)
          Called during XML export to append XML corresponding to the receiver's properties (children) to the given string.
 void appendExportXMLForPropertyNamedKeyPathToString(String propertyName, String keyPath, StringBuffer returnString)
          Builds the XML for a child tag.
 void appendExportXMLForPropertyNamedValueToString(String propertyName, String value, StringBuffer returnString)
          Builds the export XML string for a single child tag.
 void appendExportXMLForPropertyToString(String property, StringBuffer returnString)
          Builds the XML for a child tag.
 void appendStringValueForPropertyToString(String property, StringBuffer returnString)
          Builds the XML string value of the given property of the receiver.
 void awakeFromInsertion(EOEditingContext ec)
          All newly-created content in the OCE system is immediately instantiated with the following values.
 C_Content contentAtContentPath(String aPath)
          Locates the content at a given relative path.
 Number contentId()
          Retrieve a unique identifier for the receiving content instance.
 String contentPath()
          Returns a unique location path (URI) in content space for the receiver.
static C_Content contentWithContentIdInEditingContext(Number aContentId, EOEditingContext ec)
          Fetches the C_Content instance related to the unique content identifier requested (works across all subclasses).
 C_Content copyIntoEC(EOEditingContext ec)
          Make a copy of the receiver into the given editing context.
 C_Content copyToNewParent(C_ContentContainer newParent)
          Perform a deep copy of the receiver into a new parent container.
 C_Content copyWithinEC()
          Makes a copy of the receiver within the current editing context.
 String defaultXMLRepresentation()
          Retrieves the default XML representation of the receiving content.
 void deleteSelf()
          Attempt to remove the receiver from the parent instance (if there is one).
 boolean endElement(String element)
          Called automatically by the XML parser when an end tag is found.
 StringBuffer exportXMLForAttributes()
          Called during XML export: builds a StringBuffer holding all the attribute name="value" pairs for the receiver's XML.
 void forceDeleteSelf()
          Forcibly remove the receiver from the parent instance (if there is one).
 NSArray globalIDsForSelfAndAllChildren()
          Locates content IDs for self and any children.
 NSArray globalIDsForSelfAndAllLoadedChildren()
          Locates content IDs for self and any children that were previously loaded from the database (non-fault instances).
 String longDebuggingOutput()
           
 void moveToNewParent(C_ContentContainer newParent)
          Moves the receiver from the existing parent to the new one.
 boolean renameSelf(String newName)
          Rename the receiving content.
 NSArray selfAndAllLoadedChildren()
          Retrieve the receiver all related child content.
 boolean selfOrSomeDescendantPublished()
          Uncover if the receiver or any descendent children have been published.
 void setDataPropertyFromDictionary(String property, NSDictionary pList)
          Sets one NSData-type instance variable in the receiver to the appropriate value from the dictionary.
 void setDatePropertyFromDictionary(String property, NSDictionary pList)
          Sets one Date-type instance variable in the receiver to the appropriate value from the dictionary.
 void setNumberPropertyFromDictionary(String property, NSDictionary pList)
          Sets one Number-type instance variable in the receiver to the appropriate value from the dictionary.
 void setStringPropertyFromDictionary(String property, NSDictionary pList)
          Sets one String-type instance variable in the receiver to the appropriate value from the dictionary.
 void setStringPropertyNamedKeyPathFromDictionary(String propertyName, String keyPath, NSDictionary pList)
          Sets one instance variable in the receiver to the appropriate value from the dictionary.
 String sortField()
          Provides a field which can be used to sort C_Content objects of any one type, by simply sorting on the given field alphabetically.
 void startCAttributeList()
          Convenience method used to ensure that attribute dictionaries are cleared before new attributes are added.
 C_Content startElementWithAttributes(String element, NSDictionary attributes)
          Called automatically by XMLParser when an opening tag is found.
 void takeAttributesFromDictionary(NSDictionary pList)
          Sets up the receiver's instance variables from given values.
 
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_Content

public C_Content()
Method Detail

awakeFromInsertion

public void awakeFromInsertion(EOEditingContext ec)
All newly-created content in the OCE system is immediately instantiated with the following values.

See Also:
EOEnterpriseObject.awakeFromInsertion(com.webobjects.eocontrol.EOEditingContext)

contentWithContentIdInEditingContext

public static C_Content contentWithContentIdInEditingContext(Number aContentId,
                                                             EOEditingContext ec)
Fetches the C_Content instance related to the unique content identifier requested (works across all subclasses).

Parameters:
aContentId - Number indicating the unique content ID.
ec - The editing context to be used for the requested content.
Returns:
The C_Content requested.

contentId

public Number contentId()
Retrieve a unique identifier for the receiving content instance.

Returns:
Number indicating the unique content ID.

contentAtContentPath

public C_Content contentAtContentPath(String aPath)
Locates the content at a given relative path.

Parameters:
aPath - The relative path from the content root to the desired content.
Returns:
The content requested.

contentPath

public String contentPath()
Returns a unique location path (URI) in content space for the receiver.

Returns:
The absolute path of the receiving content, delimited by forward-slashes "/".

allParents

public NSMutableArray allParents()
Retrieve all the ancestors of the receiving instance.

Returns:
An array containing all the ancestors of the receiver.

selfAndAllLoadedChildren

public NSArray selfAndAllLoadedChildren()
Retrieve the receiver all related child content.

The base implementation simply returns the receiver in an array (no children).

Returns:
Array containing the receiver.

globalIDsForSelfAndAllLoadedChildren

public NSArray globalIDsForSelfAndAllLoadedChildren()
Locates content IDs for self and any children that were previously loaded from the database (non-fault instances).

The base implementation returns the unique ID of the receiver, as obviously there are no children.

Note this method does not check if the content IDs are not temporary.

Returns:
An array containing the global ID of the receiver.

globalIDsForSelfAndAllChildren

public NSArray globalIDsForSelfAndAllChildren()
Locates content IDs for self and any children.

The base implementation returns the unique ID of the receiver, as obviously there are no children.

Returns:
An array containing the global ID of the receiver.

sortField

public String sortField()
Provides a field which can be used to sort C_Content objects of any one type, by simply sorting on the given field alphabetically.

The default implementation returns the name attribute; subclasses may override as necessary.

Returns:
String which can be used to sort content objects.

copyWithinEC

public C_Content copyWithinEC()
Makes a copy of the receiver within the current editing context.

The new content will be associated with a new content ID when saved to the database. For this and other reasons, the content should be renamed prior to saving to preserve uniqueness in the content URI namespace.

Returns:
The new copy.

copyIntoEC

public C_Content copyIntoEC(EOEditingContext ec)
Make a copy of the receiver into the given editing context.

Does not copy XML attributes attached to the receiver, and does not copy the content ID or creation/modification dates, so a new copy will have a new identifier and timestamps.

Parameters:
ec - The editing context with which to create the copy.
Returns:
The new copy.

deleteSelf

public void deleteSelf()
Attempt to remove the receiver from the parent instance (if there is one).


forceDeleteSelf

public void forceDeleteSelf()
Forcibly remove the receiver from the parent instance (if there is one).


renameSelf

public boolean renameSelf(String newName)
Rename the receiving content.

Parameters:
newName - The new name of the receiver.
Returns:
true if the rename process succeeded, false otherwise.

selfOrSomeDescendantPublished

public boolean selfOrSomeDescendantPublished()
Uncover if the receiver or any descendent children have been published.

The base implementation returns false, as abstract content cannot be published.

Returns:
true if any descendents have been published, false otherwise.

moveToNewParent

public void moveToNewParent(C_ContentContainer newParent)
Moves the receiver from the existing parent to the new one.

May throw exceptions if the process fails.

The current implementation does not check if the new parent resides in a different editing context.

Parameters:
newParent - The new parent content instance.

copyToNewParent

public C_Content copyToNewParent(C_ContentContainer newParent)
Perform a deep copy of the receiver into a new parent container.

Parameters:
newParent - The new parent content instance.
Returns:
A copy of the receiver, associated with the new content.

appendExportXMLForPropertiesToString

public void appendExportXMLForPropertiesToString(StringBuffer returnString)
Called during XML export to append XML corresponding to the receiver's properties (children) to the given string.

The base implementation does nothing (there are no children, so there cannot be any properties).

Parameters:
returnString - A StringBuffer to which the XML will be appended to.

exportXMLForAttributes

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

Returns:
a New StringBuffer holding the receiver's attribute string.

appendExportXMLForPropertyNamedKeyPathToString

public void appendExportXMLForPropertyNamedKeyPathToString(String propertyName,
                                                           String keyPath,
                                                           StringBuffer returnString)
Builds the XML for a child tag.

Parameters:
propertyName - The name of the child tag.
keyPath - A key-path which will be resolved to determine the contents of the tag.
returnString - The StringBuffer to which to append the child tag.

appendExportXMLForAttributeNamedKeyPathToString

public void appendExportXMLForAttributeNamedKeyPathToString(String attributeName,
                                                            String keyPath,
                                                            StringBuffer returnString)
Builds the XML string for a single attribute (name="value" pair).

Parameters:
attributeName - The name of the attribute.
keyPath - A key-path which will be resolved to determine the value of the attribute.
returnString - The StringBuffer to which to append the results.

appendStringValueForPropertyToString

public void appendStringValueForPropertyToString(String property,
                                                 StringBuffer returnString)
Builds the XML string value of the given property of the receiver.

This is the basic valueForKeyPath value, with dates output in the desired format and special XML characters escaped.

Parameters:
property - The key-path to be resolved to give the value.
returnString - The StringBuffer to which the results are appended.

appendExportXMLForPropertyToString

public void appendExportXMLForPropertyToString(String property,
                                               StringBuffer returnString)
Builds the XML for a child tag.

Parameters:
property - The name of both the child tag to be output and the key to resolve to obtain the value.
returnString - The StringBuffer to which to append the child tag.

appendExportXMLForAttributeToString

public void appendExportXMLForAttributeToString(String attribute,
                                                StringBuffer returnString)
Builds the XML string for a single attribute (name="value" pair).

Parameters:
attribute - The name of both the attribute to be output and the key to resolve to obtain its value.
returnString - The StringBuffer to which the results are appended.

appendExportXMLForEmptyTagToString

public void appendExportXMLForEmptyTagToString(StringBuffer returnString)
Builds the XML string for a tag representing the receiver as an empty XML tag, ie .

Does not check the receiver will be correctly represented by an empty tag, i.e. that the receiver does not wish to export any child tags or text contents.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForAdditionalAttributesToString

public void appendExportXMLForAdditionalAttributesToString(StringBuffer returnString)
Builds the list of additional key/value pairs associated with this object.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForObjectToString

public void appendExportXMLForObjectToString(StringBuffer returnString)
Builds the XML tag for this object, including the opening tag, any child tags and text content, and the closing tag.

Does not check if an empty tag is appropriate.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForOpeningTagToString

public void appendExportXMLForOpeningTagToString(StringBuffer returnString)
Builds the export XML for an opening tag representing this object, including attributes.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForClosingTagToString

public void appendExportXMLForClosingTagToString(StringBuffer returnString)
Builds the export XML for a closing tag for this object.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForAttributesToString

public void appendExportXMLForAttributesToString(StringBuffer returnString)
Builds the appropriate string to go into the opening tag for the receiver's objects attributes.

This will be the return value from exportXMLForAttributes with the space removed from the end and one added to the beginning.

Parameters:
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForPropertyNamedValueToString

public void appendExportXMLForPropertyNamedValueToString(String propertyName,
                                                         String value,
                                                         StringBuffer returnString)
Builds the export XML string for a single child tag.

Parameters:
propertyName - The name for the child tag.
value - The text to go inside the child tag.
returnString - The StringBuffer to which the results will be appended.

appendExportXMLForAttributeNamedValueToString

public void appendExportXMLForAttributeNamedValueToString(String attributeName,
                                                          String value,
                                                          StringBuffer returnString)
Builds the export XML for a single attribute (name="value" pair).

Checks first with the XMLSerializationController instance that we wish to export attributes with this name.

Parameters:
attributeName - The name to use for the attribute.
value - The value for the attribute.
returnString - The StringBuffer to which the results will be appended.

endElement

public boolean endElement(String element)
Called automatically by the XML parser when an end tag is found.

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

Parameters:
element - The name of the ending tag.
Returns:
true if the object is done with receiving XML import messages, false otherwise.

addCharacterData

public void addCharacterData(String value)
Called automatically by XMLParser when character data is found.

For a discussion of which objects receive messages about which pieces of character data, see XMLParser.

Parameters:
value - The character data which has been parsed.

startElementWithAttributes

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

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

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

startCAttributeList

public void startCAttributeList()
Convenience method used to ensure that attribute dictionaries are cleared before new attributes are added.


addCAttributeWithValues

public void addCAttributeWithValues(String element,
                                    NSDictionary attributes)
Called automatically from an XMLParser instance when a C_Attribute tag is found.

This will add a key/value pair to the C_Attributes list for this object.

Parameters:
element - Name of the start tag.
attributes - The dictionary of attributes for this tag.
See Also:
C_Attribute, XMLParser

takeAttributesFromDictionary

public void takeAttributesFromDictionary(NSDictionary pList)
Sets up the receiver's instance variables from given values.

The values will normally have come from the attributes of an XML start element tag.

Parameters:
pList - The dictionary of values.

setStringPropertyNamedKeyPathFromDictionary

public void setStringPropertyNamedKeyPathFromDictionary(String propertyName,
                                                        String keyPath,
                                                        NSDictionary pList)
Sets one instance variable in the receiver to the appropriate value from the dictionary.

Parameters:
propertyName - The key in the given dictionary providing the appropriate value.
keyPath - The key-path to set with the retrieved value.
pList - The dictionary of values.

setStringPropertyFromDictionary

public void setStringPropertyFromDictionary(String property,
                                            NSDictionary pList)
Sets one String-type instance variable in the receiver to the appropriate value from the dictionary.

Parameters:
property - The name of both the key in the dictionary to access the value and the key in the receiver for which to set the value.
pList - The dictionary of values.

setDataPropertyFromDictionary

public void setDataPropertyFromDictionary(String property,
                                          NSDictionary pList)
Sets one NSData-type instance variable in the receiver to the appropriate value from the dictionary.

Parameters:
property - The name of both the key in the dictionary to access the value and the key in the receiver for which to set the value.
pList - The dictionary of values.

setDatePropertyFromDictionary

public void setDatePropertyFromDictionary(String property,
                                          NSDictionary pList)
Sets one Date-type instance variable in the receiver to the appropriate value from the dictionary.

Parameters:
property - The name of both the key in the dictionary to access the value and the key in the receiver for which to set the value.
pList - The dictionary of values.

setNumberPropertyFromDictionary

public void setNumberPropertyFromDictionary(String property,
                                            NSDictionary pList)
Sets one Number-type instance variable in the receiver to the appropriate value from the dictionary.

Parameters:
property - The name of both the key in the dictionary to access the value and the key for which to set the value in the receiver.
pList - The dictionary of values.

defaultXMLRepresentation

public String defaultXMLRepresentation()
Retrieves the default XML representation of the receiving content.

The base implementation throws an exception (purely abstract content has no representation).


longDebuggingOutput

public String longDebuggingOutput()