SCA

SDO Data Factory API

SDO Data Factory API

Function Index

SDOFACTORY getDataFactory ()
 Returns the context SDOFACTORY for creating, registering, and finding types. More...
 
SDOFACTORY dfAlloc (char *name)
 Returns a fresh SDOFACTORY containing just the build-in XML Schema datatypes. More...
 
void dfFree (SDOFACTORY df)
 Deallocates the argument SDOFACTORY. More...
 
SDOLIST getTypes (SDOFACTORY df)
 Returns a list of types declared in the argument datafactory. More...
 
DATAOBJECT doAlloc (SDOFACTORY df, char *namespace, char *name)
 Create a dataobject having the named type. More...
 
DATAOBJECT doAllocByType (SDOFACTORY df, SDOTYPE type)
 Creates a dataobject having the specified type. More...
 
DATAOBJECT doAllocRoot (SDOFACTORY df, char *namespace, char *name, char *element_name)
 Variant of doAlloc() which also allows a document element to be specified (as might be desired for a freely/schemaless created response dataobject). More...
 
SDOPROPERTY defineOpenContentProperty (SDOFACTORY pdf, char *uri, char *name, SDOTYPE propertyType)
 Creates an open content property for subsequent use in calls to getList() and other introspection API functions manipulating values by SDO properties. More...
 

Function Details

SDOFACTORY getDataFactory ( )

Returns the context SDOFACTORY for creating, registering, and finding types.

When implementing services, getDataFactory() returns a data factory prepoulated with the service's public schema types, in addition to standard built-in XML Schema datatypes.

SDOFACTORY dfAlloc ( char *  name)

Returns a fresh SDOFACTORY containing just the build-in XML Schema datatypes.

Parameters
nameignored (just provided for SDO API compatibilty)
void dfFree ( SDOFACTORY  df)

Deallocates the argument SDOFACTORY.

Note the default datafactory (as of getDataFactory()) can't be deallocated.

SDOLIST getTypes ( SDOFACTORY  df)

Returns a list of types declared in the argument datafactory.

Returns
a type list (SDOLIST) declared in the datafactorie's schema, not including builtin (XML Schema) types
DATAOBJECT doAlloc ( SDOFACTORY  df,
char *  namespace,
char *  name 
)

Create a dataobject having the named type.

NO: The created dataobject, when serialized to XML, will also have an element name derived from the type name.

Parameters
dfdata factory to use for creating the dataobject
namespacenamespace for the type of the dataobject to create
namename of the type type of the dataobject to create
Returns
the created dataobject, or 0 if the type name couldn't be resolved
DATAOBJECT doAllocByType ( SDOFACTORY  df,
SDOTYPE  type 
)

Creates a dataobject having the specified type.

Parameters
dfdata factory to use for creating the dataobject
typetype of the dataobject to create
DATAOBJECT doAllocRoot ( SDOFACTORY  df,
char *  namespace,
char *  name,
char *  element_name 
)

Variant of doAlloc() which also allows a document element to be specified (as might be desired for a freely/schemaless created response dataobject).

Note: SDO API extension

TODO: could (mis)use data graph API to force a particular element on a dataobject (ie. as side-effect of creating the object using data graph API)

SDOPROPERTY defineOpenContentProperty ( SDOFACTORY  pdf,
char *  uri,
char *  name,
SDOTYPE  propertyType 
)

Creates an open content property for subsequent use in calls to getList() and other introspection API functions manipulating values by SDO properties.

Open content properties are a mechanism for attaching ad-hoc properties to a dataobject not declared by its type. Conceptually, these are modelled after XML Schema global elements (so that element wildcards in content models can contstrain the set of applicable elements to those declared in the containing schema), but in $product SDO aren't represented as element declarations/components since schemata aren't serialized, and dynamic type definitions aren't supported. Instead, a generic "anytype" property is returned, that is interpreted by introspection API functions specially.

Note: special support for open content properties as argument to set/get methods is only supported for getList. Support for open content by getList() is essential so an empty string list can be returned by getList() on a multivalued instance property which has no initial values (yet). In this case, calling getList() is the only way to construct an empty string list that can be used to append string values to (followed by calling setList()).

Note: only the variant where the namespace URI is NULL is supported (cf SDO spec; note moreover that the SDO spec erroneously uses defineOpenContentProperty with SDOTYPE rather than DATAFACTORY as first param type).

Note: retrieving an open content property via getOpenContentProperty() isn't supported; instead open content properties can just be re-created as needed.

Parameters
ptproperty to
urimust be 0
namename of instance property to address
propertyTypetype of instance property to address; TODO: ignored
Returns
an open content property, or 0 on error