com.cassinidivision.oce.content
Class C_TextContent

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
                          extended bycom.cassinidivision.oce.content.base._C_TextContent
                              extended bycom.cassinidivision.oce.content.C_TextContent
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

public class C_TextContent
extends com.cassinidivision.oce.content.base._C_TextContent

A class representing a chunk of hypertext in a page component (corresponding to a named niche).

The hypertext can be made up of simple characters, entities (&...;), and tags of two different types. There are tags for platform-independent styling information, such as <C_STRONG> and <C_BR>. There are also tags which mark up embedded child objects such as hyperlinks and images (C_LeafContent subclasses). In the latter case, the details of the child are stored in the object, and a simple placeholder tag in the hypertext marks where the child appears.

Note this is different to how the text copy is presented during XML import/export. The entire details of the child objects appear in the generated XML tag, which marks their location. The mapping between these two forms is dealt with by custom implementations of the XMLParser methods for import (within this class), and of the export methods defined in C_Content for export.

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_TextContent()
           
 
Method Summary
 NSArray acceptableClassesOfChildren()
          Reports which classes of children are acceptable within the receiver.
 void addCharacterData(String value)
          Called automatically by XMLParser when character data is found.
 void appendExportXMLForPropertiesToString(StringBuffer returnString)
          Overrides superclass method and does not call super.
 void appendExportXMLForTextCopyToString(StringBuffer returnString)
          Derives the export XML string from the current text copy object.
 void appendXMLForTagToString(String tagString, StringBuffer returnString)
          Compute the XML representation for a given inner hypertext tag.
 void awakeFromInsertion(EOEditingContext ec)
          All newly-created content in the OCE system is immediately instantiated with the following values.
 C_Content copyIntoEC(EOEditingContext ec)
          Extends the superclass copy functionality to include the deep copying of child content.
 String defaultXMLRepresentation()
          Retrieves the default XML representation of the receiving content.
 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 processTagInOutput(String tagString, StringBuffer buf)
          Request XML representations for certain embedded content objects (such as links and images).
 void setStringTextCopy(String value)
          Convenience method: set a string value for the text copy.
 C_Content startElementWithAttributes(String element, NSDictionary attributes)
          Called automatically by XMLParser when an opening tag is found.
 String stringTextCopy()
          Convenience method: return the text copy as a string.
 void takeAttributesFromDictionary(NSDictionary pList)
          Sets up the receiver's instance variables from given values.
 NSData textCopy()
           
 
Methods inherited from class com.cassinidivision.oce.content.base._C_TextContent
ordering, setOrdering, setTextCopy
 
Methods inherited from class com.cassinidivision.oce.content.C_ContentContainer
childContentWithName, contentAtContentPath, createNewChildOfClassWithStem, deleteChild, duplicateChild, fixHyperlinkPathsForImportedChildren, forceDeleteAllChildren, forceDeleteChild, globalIDsForSelfAndAllChildren, globalIDsForSelfAndAllLoadedChildren, longDebuggingOutput, nameForNewChildWithStem, orderedChildren, renameChildToName, selfAndAllChildren, selfAndAllLoadedChildren, selfOrSomeDescendantPublished, willAcceptChild, willAcceptChildOfClass, willAcceptChildren
 
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, allParents, appendExportXMLForAdditionalAttributesToString, appendExportXMLForAttributeNamedKeyPathToString, appendExportXMLForAttributeNamedValueToString, appendExportXMLForAttributesToString, appendExportXMLForAttributeToString, appendExportXMLForClosingTagToString, appendExportXMLForEmptyTagToString, appendExportXMLForObjectToString, appendExportXMLForOpeningTagToString, appendExportXMLForPropertyNamedKeyPathToString, appendExportXMLForPropertyNamedValueToString, appendExportXMLForPropertyToString, appendStringValueForPropertyToString, contentId, contentPath, contentWithContentIdInEditingContext, copyToNewParent, copyWithinEC, deleteSelf, forceDeleteSelf, moveToNewParent, renameSelf, setDataPropertyFromDictionary, setDatePropertyFromDictionary, setNumberPropertyFromDictionary, setStringPropertyFromDictionary, setStringPropertyNamedKeyPathFromDictionary, sortField, startCAttributeList
 
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_TextContent

public C_TextContent()
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_ContentContainer

copyIntoEC

public C_Content copyIntoEC(EOEditingContext ec)
Description copied from class: C_ContentContainer
Extends the superclass copy functionality to include the deep copying of child content.

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

acceptableClassesOfChildren

public NSArray acceptableClassesOfChildren()
Description copied from class: C_ContentContainer
Reports which classes of children are acceptable within the receiver.

The base implementation returns an empty array.

Overrides:
acceptableClassesOfChildren in class C_ContentContainer
Returns:
array of acceptable classes

appendXMLForTagToString

public void appendXMLForTagToString(String tagString,
                                    StringBuffer returnString)
Compute the XML representation for a given inner hypertext tag.

Parameters:
tagString - String containing the inner tag.
returnString - StringBuffer to which to append the generated XML.

appendExportXMLForTextCopyToString

public void appendExportXMLForTextCopyToString(StringBuffer returnString)
Derives the export XML string from the current text copy object.

This is done differently from other classes, as the actual text copy is included into the outgoing XML as CDATA (tags and all) rather than simply as an attribute value.

Parameters:
returnString - string containing export-format XML

appendExportXMLForPropertiesToString

public void appendExportXMLForPropertiesToString(StringBuffer returnString)
Overrides superclass method and does not call super. (this class handles exporting in a different manner).

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

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_ContentContainer

takeAttributesFromDictionary

public void takeAttributesFromDictionary(NSDictionary pList)
Description copied from class: C_Content
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.

Overrides:
takeAttributesFromDictionary in class C_Content
Parameters:
pList - The dictionary of values.

endElement

public boolean endElement(String element)
Description copied from class: C_Content
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.

Overrides:
endElement in class C_Content
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)
Description copied from class: C_Content
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.

Overrides:
addCharacterData in class C_Content
Parameters:
value - The character data which has been parsed.

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_ContentContainer

defaultXMLRepresentation

public String defaultXMLRepresentation()
Description copied from class: C_Content
Retrieves the default XML representation of the receiving content.

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

Overrides:
defaultXMLRepresentation in class C_Content

processTagInOutput

public void processTagInOutput(String tagString,
                               StringBuffer buf)
Request XML representations for certain embedded content objects (such as links and images).

Parameters:
tagString - String containing inner tag (with attributes)
buf - StringBuffer that the generated XML will be appended to

textCopy

public NSData textCopy()

stringTextCopy

public String stringTextCopy()
Convenience method: return the text copy as a string.

The encoding will be that used when the text copy value was originally written.

Returns:
text copy as a string

setStringTextCopy

public void setStringTextCopy(String value)
Convenience method: set a string value for the text copy.

The string encoding used will be the current platform default.

Parameters:
value - string representing the text copy