|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.eocontrol.EOCustomObject
com.cassinidivision.core.eoaccess.EOLoader
Core enterprise object to XML import/export functionality.
Nested Class Summary |
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.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.EOCustomObject |
_CLASS |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
_KeyPathSeparatorChar, KeyPathSeparator |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
NullValue |
Constructor Summary | |
EOLoader()
|
Method Summary | |
NSArray |
allEntities()
Convenience method: return all known entities across all known EOModels. |
boolean |
charLegalInXML(char c)
Determine if a character value can be represented in XML. |
boolean |
charMayAppearUnescapedInXML(char c)
Determine if a character value can appear without escape sequences in XML. |
NSMutableDictionary |
contentDictionaryForAllEntities()
Convenience method: return a content dictionary containing data for all entities. |
NSMutableDictionary |
contentDictionaryForEntities(NSArray entityList)
Retrieve all data corresponding to the entities supplied into a single dictionary. |
NSMutableDictionary |
contentDictionaryForEntity(EOEntity entity)
Retrieve all data corresponding to the entity supplied into a single dictionary. |
String |
decodeAmpersands(String s)
Unescape any XML-encoded ampersands found in the string supplied. |
NSData |
decodeFromBase64(NSData data)
Decode data provided from a Base64 representation. |
String |
encodeAmpersands(String s)
XML-escape any ampersands found in the string supplied. |
NSData |
encodeToBase64(NSData data)
Encode data provided into a Base64 representation. |
String |
exportAllContent()
Retrieve XML export data for all known entities. |
void |
importContent(String theXML)
Read XML data and use to build new EO instances. |
void |
importFromFolder(String path)
Read XML import data from the directory path specified. |
void |
processDictionary(NSDictionary dict,
boolean stringwards)
Convert a raw row data dictionary into a format suitable for importing or exporting data. |
void |
processInnerDictionary(NSMutableDictionary row,
boolean stringwards)
Convert a raw row into a format suitable for importing or exporting data. |
NSArray |
rowsForEntity(EOEntity entity,
EOEditingContext ec)
Return all rows for the entity requested. |
String |
stringWithDodgyUnicodeEscaped(String s)
Escape unicode characters that may cause problems in XML documents, including the null (0) character. |
String |
stringWithDodgyUnicodeEscapedIncludeZero(String s,
boolean includeZero)
Escape unicode characters that may cause problems in XML documents, optionally including the null (0) character. |
String |
stringWithDodgyUnicodeUnescaped(String s)
Unescape encoded unicode characters from XML documents. |
void |
writeAllContentToFolder(String path)
Write out all EO data to the top-level directory specified. |
void |
writeContentForEntityIntoFolder(EOEntity entity,
String path)
Export XML data for the given entity to the directory path specified. |
void |
writeObjectsForEntity(NSArray objects,
EOEntity entity,
EOEditingContext ec)
Insert an array of newly-generated enterprise objects into the database. |
String |
xmlEncodeNonASCIICharacters(String string)
Convert string into an XML-compatible format. |
String |
xmlStringForDictionary(NSDictionary dict)
Convert a dictionary containing raw row entity data into an XML format. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public EOLoader()
Method Detail |
public void writeAllContentToFolder(String path)
path
- Location of the directory where XML datafiles should be written.public void writeContentForEntityIntoFolder(EOEntity entity, String path) throws IOException
entity
- The EO entity in question.path
- Location of the directory where XML datafiles should be written.
IOException
public NSMutableDictionary contentDictionaryForAllEntities()
public NSArray allEntities()
public NSArray rowsForEntity(EOEntity entity, EOEditingContext ec)
entity
- The entity in question.ec
- The editing context to fetch the rows with.
public NSMutableDictionary contentDictionaryForEntity(EOEntity entity)
entity
- The entity in question.
public NSMutableDictionary contentDictionaryForEntities(NSArray entityList)
entityList
- An array of EOEntity instances.
public String xmlStringForDictionary(NSDictionary dict)
dict
- The raw row data dictionary.
public String exportAllContent()
public void importFromFolder(String path) throws IOException
path
- The location of the XML data directory.
IOException
public void importContent(String theXML)
theXML
- The XML import data.public void processDictionary(NSDictionary dict, boolean stringwards)
The expected property list format is:
{
"anEntityName" = (
{
"rawRowAttribute1" = "value1";
"rawRowAttribute2" = "value2";
...
},
...
);
...
}
dict
- The raw row data dictionary.stringwards
- Set to true for exporting data to XML, false for importing data from XML.public void processInnerDictionary(NSMutableDictionary row, boolean stringwards)
row
- The raw row data (corresponding to a single entity instance).stringwards
- Set to true for exporting data to XML, false for importing data from XML.public NSData encodeToBase64(NSData data)
data
- The original (unencoded) data.
public NSData decodeFromBase64(NSData data)
data
- The original (Base64 encoded) data.
public boolean charLegalInXML(char c)
c
- The character to test.
public boolean charMayAppearUnescapedInXML(char c)
c
- The character to test.
public String xmlEncodeNonASCIICharacters(String string)
string
- Original string contents.
public String stringWithDodgyUnicodeEscapedIncludeZero(String s, boolean includeZero)
s
- The original stringincludeZero
- Set true to ignore the zero character, false to escape such characters.
public String stringWithDodgyUnicodeUnescaped(String s)
s
- The original XML string data.
public String stringWithDodgyUnicodeEscaped(String s)
s
- The original string
public void writeObjectsForEntity(NSArray objects, EOEntity entity, EOEditingContext ec)
objects
- The EOs to be inserted into the database.entity
- The EOEntity in question.ec
- The editing context to use for database operations.public String encodeAmpersands(String s)
s
- The original string.
public String decodeAmpersands(String s)
s
- The original XML-encoded string.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |