MDS DTD/Schema Elements
The METAXML element is the XML root element as defined in the XML 1.0 Specification. From the METAXML element, there are several elements that describe the MDS repository, and one that is used to set file preferences.
These elements are described in the following sections.
Object Identifiers
The XML import interface allows the use of MDS object GUIDs as object identifiers in addition to using the internal integer object IDs. The use of GUIDs to identify repository objects can be more convenient to the user for two reasons:
XML allows definition of aliases (called entities) for any string of text, enabling users to define symbolic name aliases for GUIDs. In addition, the XML import interface processing of GUIDs allows both upper- and lower-case hexadecimal digits (0-9, A-F, a-f) as well as embedded hyphens and white space to make the GUIDs themselves more readable.
An example of a defining GUID alias is:
<!ENTITY CLSGUID_MetaAIMClass "{C3AD1324-472C-11D1-9E85-0000C071AADA}">
Entities can be referred by name anywhere in an XML file by prefixing the symbolic alias name with an ampersand and suffixing it with a semicolon. Thus, the above GUID alias can be used in the XML file by using the syntax:
&CLSGUID_MetaAIMClass;
PREFERENCES Element for Setting File Defaults
The PREFERENCES element is used to toggle settings for the "action" and "transaction" attributes. It can also be used to set the default behavior of the "update" action.
Example XML script:
<PREFERENCES DefaultAction="traverse" UpdateBehavior="strict" DefaultTxn="yes"/>
<!-- or in another case... --!>
<PREFERENCES DefaultAction="add" UpdateBehavior="upsert" DefaultTxn="no"/>
DTD:
<!ELEMENT PREFERENCES EMPTY>
<!ATTLIST PREFERENCES
DefaultAction (traverse | add | remove | update) #IMPLIED
UpdateBehavior (upsert | strict | upsertVersion | strictVersion) #IMPLIED
DefaultTxn (no | yes) #IMPLIED
>
Elements |
Description |
PREFERENCES |
Used to set user defaults. |
DefaultAction |
If present, sets the “action” for all elements from now to the end of the file, or the next preferences setting. The allowed values are the same as those for the “action” attribute itself. See “Action Attribute Settings” below for details on the settings of the “action” attribute itself. |
UpdateBehavior |
If present, sets the current default behavior for the “update” action. There are four settings “upsert” (the initial default), “strict”, “upsertVersion” and “strictVersion”. See “update” in the “Action Attribute Settings” below for more information on this attribute. This is the only place where the behavior of the “update” action can be specified. |
DefaultTxn |
If present, sets the “transaction” default setting. See “Transactions” on page 446 for more details on the “transaction” attribute itself. |
Action Attribute Settings
Nearly all elements of the metaxml script accept the "action" attribute. This attribute and its setting direct metaxml what to do with the element with respect to the MDS repository. There are four settings allowed: "add," "remove," "update," and "traverse".
The following action attribute values are allowed:
Action |
Description |
Traverse |
This is the initial default for the file. It is intended to be used on already-created objects for which no repository action is to be taken at this time. The metaxml engine merely identifies that they exist, and continues on. This is especially convenient for files that are re-used many times. Existing objects can be left untouched while new ones are added, others deleted and others updated. Objects that are not found will generate an error message. |
Add |
This action will cause a new object to be added to the MDS repository. For meta-model elements (MODELDESC, CLASSDESC, and so on) if an object of the same name already exists in the class, this is an error. However, for the meta-data element (OBJECT), addition of a new object of the same name depends on whether or not the class or (for relationships) collection class allows duplicate names. (This is different from the 2.0 release where an action of "add" would also update an existing object if found. As of the 2.1 release, this is a specific action of the "update" setting.) |
Update |
To allow the user the more flexibility, this action comes in four behaviors two of which are: "upsert" and "strict". The default behavior is "upsert" which means that for object updates, the object will be looked for first, and if found, updated. But if the object is not found, a new one will be created. (This was the "add" action for the 2.0 release.) On the other hand, if the behavior is set to "strict" and the action is "update", the object must be found or an error will be generated. (The behavior can be set only by the PREFERENCES DefaultBehavior attribute, q.v.) In a repository with versioning enabled, "update" causes a new version of an existing object to be created. As of MDS 6.1, there is a variation to each of these two behaviors, that applies to repositories with versioning enabled, and they are "upsertVersion" and "strictVersion". In a repository with versioning enabled, if an existing object is to be updated, but the user wishes the current version be re-written rather than a new version created, they must use one of these behaviors in place of the two described above. This action effectively overrides the default behavior of object updates for a versioned repository, which is to create a new version of an object (with a new object id) anytime an object is updated. Note: The only objects in the repository that are versioned are meta data objects, not metamodel objects (AIMs, classes, properties, relationships, users, groups or security profiles). |
Remove |
This action setting will cause metaxml to attempt to remove the object from the MDS repository. If it is not found, it will generate an error message. For repositories with versioning enabled, this means deleting all versions of the object from the repository |
An element's action attribute, if present, will always override the current default setting. In this way, a DefaultAction can be set for a file that deals with most of the elements in the file, while those elements that are to be dealt with differently can have their action set to whatever is appropriate, and presumably, different from the default.
Elements for Importing AIMS
MODELDESC
The MODELDESC element enables importing an AIM into the MDS repository. This element is a child of the MODELDESCS element. There can be more than one MODELDESC contained within the MODELDESCS element.
Example XML script:
<MODELDESC>
<NAME>AutoWorld</NAME>
<DESCRIPTION>The World of Auto and AutoMakers</DESCRIPTION>
<CLASSDESC linkid="AM">
<NAME>AutoMaker</NAME>
<!—- More elements -->
</CLASSDESC>
<CLASSDESC linkid="AU">
<NAME>Auto</NAME>
<!—- More elements -->
</CLASSDESC>
<RELATIONSHIPDESC>
<NAME>ManufOfAutos</NAME>
<!—- More elements -->
</RELATIONSHIPDESC>
<DERIVEDCLASSDESC>
<NAME>AutoEx</NAME>
<!—- More elements -->
</DERIVEDCLASSDESC>
</MODELDESC>
DTD:
<!ELEMENT MODELDESCS (PREFERENCES*, MODELDESC)+>
<!ELEMENT MODELDESC (NAME, DESCRIPTION, OBJECTGUID?, OWNER?, VERSIONING?, (SECURITYPROFILENAME |
SECURITYPROFILEREF)?, PREFERENCES*, CLASSDESC*, PREFERENCES*, RELATIONSHIPDESC*, PREFERENCES*,DERIVEDCLASSDESC*)>
<!ATTLIST MODELDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
aimversion CDATA #IMPLIED
>
<!ELEMENT VERSIONING EMPTY>
<!ATTLIST VERSIONING
set (on | off) #REQUIRED
deleteObjects (no | yes) "no"
>
Elements and Attributes |
Description |
MODELDESC |
Used to create, update, or delete a model |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Model common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
linkid |
If defined, maps the linkid string to the model identifier for later reference. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Name, Owner, Description and Security Profile can be modified. Any other modified values will be ignored. Note that if the name is to be changed, the GUID must be present. |
transaction |
Is used to override the current default setting. (See “Transactions” on page 446 for more details.) |
aimversion |
The integer value of the version of the metamodel. Setting this value is optional, and is “NULL” in the repository until set by the user. When importing, if a value is present and the current “action” is ‘add’ or ‘update,’ the value is set for the metamodel repository object. If the current “action” is ‘traverse’ or ‘remove,’ the value is ignored. The meaning of the value is solely determined by the user, but the intended use is to track the version of the user-defined metamodel (AIM), when such tracking is necessary. This value maps directly to the AIMVersion property of the MetaAIMClass in the MDSMetamodel. Note: Do not modify the ‘aimversion’ value of any MDS-defined metamodel. |
VERSIONING |
For repositories with versioning enabled, this is used to set versioning for the metamodel. The element has no value, but two attributes: “set” and “deleteObject”. The values of “set” are 'on' or 'off' to indicate that versioning should be set on or off for the metamodel. The “deleteObjects” attribute can be set to 'yes' to indicate that when versioning is 'off', or being set 'off', all non-current versions of every object in the metamodel will be deleted. This will leave only the most recent version of each object, and they will each have their version set to "1". Otherwise, no versions of any object will be removed and all will retain their version number. For a repository with versioning enabled, when a metamodel has versioning set "on" (the default), all classes will also have versioning "on" by default. This means that all objects in the classes will be versioned. When a metamodel has versioning set "off", all its classes will have their versioning set "off" also. This means that all objects created in those classes will not be versioned. (Note: A class can have its versioning "off" for a metamodel that has versioning "on", but when a metamodel has versioning "off", a class in that metamodel cannot turn versioning "on" for itself, versioning must be "on" for the metamodel also.) Using this element makes sense only for a repository with versioning enabled. Any attempt to set versioning “on” for a repository that is not version enabled, will get an error returned by the MDS engine. This element is ignored unless the action for the metamodel is "add" or "update" |
CLASSDESC |
For each CLASSDESC element tag, identifies a class. See the “CLASSDESC” element below. |
RELATIONSHIPDESC |
For each RELATIONSHIPDESC element tag, identifies a relationship. |
CLASSDESC
The CLASSDESC element enables creating, modifying, or deleting a class description in an AIMs. This element is a child of the MODELDESC element.
Example XML script:
<CLASSDESC linkid="AM">
<NAME>AutoMaker</NAME>
<DESCRIPTION>Class contains Auto Makers</DESCRIPTION>
<UNIQUENAMING enable="yes"/>
<ROOTCLASS type="yes"/>
<!-- No unique properties -->
</CLASSDESC>
<CLASSDESC linkid="AU">
<NAME>Auto</NAME>
<DESCRIPTION>Class contains Autos</DESCRIPTION>
<UNIQUENAMING enable="no"/>
<PROPERTYDESC>
<!-- More elements -->
</PROPERTYDESC>
</CLASSDESC>
DTD:
<<!ELEMENT CLASSDESC (NAME, DESCRIPTION, OBJECTGUID?, UNIQUENAMING?, OWNER?, VERSIONING?, (SECURITYPROFILENAME | SECURITYPROFILEREF)?, ROOTCLASS?, ABSTRACTCLASS?, SUPERCLASSES?, PROPERTYDESC*)>
<!ATTLIST CLASSDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT ROOTCLASS EMPTY>
<!ATTLIST ROOTCLASS
type (no | yes) #REQUIRED
>
<!ELEMENT ABSTRACTCLASS EMPTY>
<!ATTLIST ABSTRACTCLASS
type (no | yes) #REQUIRED
>
<!ELEMENT OBJECTDESCS EMPTY>
<!ATTLIST OBJECTDESCS
required (no | yes) #REQUIRED
>
<!ELEMENT SUPERCLASSES (SUPERCLASS+)>
<!ELEMENT SUPERCLASS EMPTY>
<!ATTLIST SUPERCLASS
linkref IDREFS #IMPLIED
objid CDATA #IMPLIED
>
Elements and Attributes |
Description |
CLASSDESC |
Used to create, update or delete a class description. |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Class common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
UNIQUENAMING |
Set <UNIQUENAMING enable="yes"/> to require unique object names in the class. Omit or set <UNIQUENAMING enable="no"/> to disable unique naming checks. |
ROOTCLASS |
Set <ROOTCLASS type="yes"/> to set this class description as a root class. Omit or set <ROOTCLASS type="no"/> if this is not a Root Class. |
linkid |
If defined, maps the linkid string to the class identifier for later reference. |
ABSTRACTCLASS |
Set <ABSTRACTCLASS type="yes"/> to set this class description as an abstract class. An abstract class cannot contain any objects; it is meant to be a super class of other classes, which inherit its properties. Omit or set < ABSTRACTCLASS type="no"/> if this is not an abstract class. |
OBJECTDESCS |
Use this element with the required attribute set to "yes", to indicate that *all* objects in this class must have non-NULL Descriptions. This can be set both at class creation and when updating the class. The default value (that is, when the element is not used), is that object Descriptions are not required. When the element is specified, the required attribute must also be specified. Note that if this is used when updating a class to change it from not required to required, and there are objects in the class that currently do *not* have a non-NULL Description, the update will fail with an engine error indicating that there are objects which do not have their Description set non-NULL. |
SUPERCLASSES |
Use the SUPERCLASSES element to list the super classes for this class, by specifying each super class as a SUPERCLASS child element. The class will inherit both the properties and relationships of each super class. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Name, Owner, Description, Superclass and Security Profile can be modified. Any other modified values will be ignored. Note that if the name is to be changed, the GUID must be present. |
transaction |
Is used to override the current default setting. (See “Transactions” on page 446 for more details.) |
VERSIONING |
For repositories with versioning enabled, this is used to set versioning for the class. The element has no value, but two attributes: "set" and "deleteObject". The values of "set" are 'on' or 'off' to indicate that versioning should be set on or off for the class. The "deleteObjects" attribute can be set to 'yes' to indicate that when versioning is 'off', or being set 'off', all non-current versions of every object in the class will be deleted. This will leave only the most recent version of each object, and they will each have their version set to "1". Otherwise, no versions of any object will be removed and all will retain their version number. For a repository with versioning enabled, when a class has versioning set "on" (the default), all objects in the class will be versioned. When a class has versioning set "off", the objects in the class will not be versioned. (Note: A class can have its versioning "off" for a metamodel that has versioning "on", but when a metamodel has versioning "off", a class in that metamodel cannot turn versioning "on" for itself, versioning must be "on" for the metamodel also.) Using this element makes sense only for a repository with versioning enabled. Any attempt to set versioning "on" for a repository that is not version enabled, we get an error returned by the MDS engine. This element is ignored unless the action for the metamodel is "add" or "update." |
PROPERTYDESC |
For each PROPERTYDESC element tag, identifies a property description in the class. (See the “PROPERTYDESC” element). |
PROPERTYDESC
The PROPERTYDESC element enables creating, modifying or deleting a property of a class in an AIM. This element is a child element of the CLASSDESC element. One PROPERTYDESC element would be needed for each unique property for the class.
Example XML script:
<PROPERTYDESC>
<NAME>CarId</NAME>
<PROPERTYID>501</PROPERTYID>
<DESCRIPTION>CarId description</DESCRIPTION>
<SQLTYPE type="SQL_BINARY"/>
<VARIANTTYPE type="VT_BINARY"/>
<PROPSIZE/>
</PROPERTYDESC>
<!-- Other properties... -->
<PROPERTYDESC>
<NAME>Review</NAME>
<PROPERTYID>508</PROPERTYID>
<DESCRIPTION>Review Description</DESCRIPTION>
<SQLTYPE type="SQL_CHAR"/>
<VARIANTTYPE type="VT_STRING"/>
<PROPSIZE>20000</PROPSIZE>
<CHARACTERSET>Latin</CHARACTERSET>
</PROPERTYDESC>
DTD:
<!ELEMENT PROPERTYDESC (NAME, PROPERTYID, DESCRIPTION, SQLTYPE, VARIANTTYPE, OBJECTGUID?, OWNER, (SECURITYPROFILENAME | SECURITYPROFILEREF)?, PROPSIZE?, DECIMALDIGIT?, CHARACTERSET?)>
<!ATTLIST PROPERTYDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT DECIMALDIGIT (#PCDATA)>
<!ELEMENT PROPSIZE (#PCDATA)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT SQLTYPE EMPTY>
<!ATTLIST SQLTYPE
type (SQL_CHAR | SQL_NUMERIC | SQL_DECIMAL | SQL_INTEGER | SQL_SMALLINT |
SQL_FLOAT | SQL_REAL | SQL_DOUBLE | SQL_DATE | SQL_VARCHAR | SQL_BINARY |
SQL_VARBINARY | SQL_TINYINT | SQL_TIME | SQL_TIMESTAMP) #REQUIRED
>
<!ELEMENT VARIANTTYPE EMPTY>
<!ATTLIST VARIANTTYPE
type (VT_SHORT | VT_INTEGER | VT_DOUBLE | VT_STRING | VT_BOOL | VT_UCHAR |
VT_BINARY | VT_DATE | VT_BYTE) #REQUIRED
>
<!ELEMENT CHARACTERSET (#PCDATA)>
<!ELEMENT VALUEREQUIRED (#PCDATA)>
Elements and Attributes |
Description |
PROPERTYDESC |
Used to create, update or delete a property description. |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Property common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
PROPERTYID, SQLTYPE, VARIANTTYPE, PROPSIZE, DECIMALDIGIT, CHARACTERSET |
Specifies the values for the property description unique properties. PropertyID, SQLType and VariantType are required. See the section on the CMetaClassDesc “CreateMDSPropertyDesc” on page 263 for more information on setting the property description values. |
VALUEREQUIRED |
This element, when present, indicates that a non-NULL value for this property must be specified. When this element is not specified, the property value may be NULL (this is the default). The text of this element (#PCDATA) identifies the "PropertyDefaultValue" attribute for the property, and will be used as the default value for the property for any existing objects in the class (and any sub-classes) when this property is added to the class. It must contain a value and be of the same the type as the property. If the default value is not specified, the engine will return a META_E_CREATEPROPERTY_NOT_ALLOWED error. This attribute cannot be modified after the property has been created. Note: This property attribute is inherited by any sub-classes of this class. |
linkid |
If defined, maps the linkid string to the property identifier for later reference. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Description, Owner, and Security Profile can be modified. It is not allowed to change a Property Name. |
transaction |
Is used to override the current default setting. (See “Transactions” on page 446 for more details.) |
DERIVEDCLASSDESC
The DERIVEDCLASSDESC element is used to reference derived-classes within an AIM, and is a child of the MODELDESC element. A derived class inherits directly from a particular class, called its base class, and so has all the unique properties of that class. It adds "derived" properties by identifying properties from classes in the base class's relationship chain. These properties are created using the DERIVEDPROPERTYDESC element.
Note that a derived class cannot be part of a relationship as an origin or destination class, nor can you add objects to it. Its use is to extend existing classes property lists by adding properties from their parent classes and it automatically "contains" all the objects of its base class.
Example XML script:
<DERIVEDCLASSDESC>
<!--
The AutoEx (derived) class derives from the Auto class
(assumed to be already defined as a class of the AutoWorld model),
so it has all the same properties that Auto has,
and will add two more from the AutoMaker class.
--!>
<NAME>AutoEx</NAME>
<DESCRIPTION>Derived from Autoworld.Auto class</DESCRIPTION>
<BASECLASSNAME>Auto</BASECLASSNAME>
<!-- Derived Property Description elements -->
</DERIVEDCLASSDESC>
DTD:
<!ELEMENT DERIVEDCLASSDESC (NAME, DESCRIPTION, BASECLASSNAME, OBJECTGUID?, OWNER?,
(SECURITYPROFILENAME | SECURITYPROFILEREF)?, DERIVEDPROPERTYDESC*)>
<!ATTLIST DERIVEDCLASSDESC
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT BASECLASSNAME (#PCDATA)>
<!ATTLIST BASECLASSNAME
linkref IDREF #IMPLIED
>
Elements and Attributes |
Description |
DERIVEDCLASSDESC |
Used to reference a derived class description. |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Derived Class common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
BASECLASSNAME |
Required child element used to name the base class for this class. |
DERIVEDPROPERTYDESC |
Elements referencing the derived properties for this derived class. |
action |
Is used to override the current default setting. The value can be “add”, “remove,” “update” or “traverse”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Name, Owner, Description and Security Profile can be modified. Any other modified values will be ignored. Note that if the name is to be changed, the GUID must be present. |
transaction |
Is used to override the current default setting. (See “Transactions” on page 446 for more details.) |
DERIVEDPROPERTYDESC
The DERIVEDPROPERTYDESC element is used to reference a (derived) property within a derived class. This is a child of the DERIVEDCLASSDESC element. In the example below two "common" properties are derived from of the AutoMaker class.
Example XML script:
<DERIVEDCLASSDESC>
<NAME>AutoEx</NAME>
<DESCRIPTION>Derived from Autoworld.Auto class</DESCRIPTION>
<BASECLASSNAME>Auto</BASECLASSNAME>
<DERIVEDPROPERTYDESC>
<!-- Add the "AutoMakerName" property to this derived class -- it is derived
from the "Name" property of the AutoMaker class of AutoWorld, as identified
by the "ManufOfAutos" relationship. The Auto class already has 9 properties,
so we add this one as id 510(one after 509).
--!>
<NAME>AutoMakerName</NAME>
<PROPERTYID>510</PROPERTYID>
<DESCRIPTION> The Maunfacture's name for this Auto.</DESCRIPTION>
<BASEPROPERTYNAME>Name</BASEPROPERTYNAME>
<BASERELATIONSHIPNAME>ManufOfAutos</BASERELATIONSHIPNAME>
<!--
If there were more relationships needed to get to our base property's
class, they would be included here in order.
-->
</DERIVEDPROPERTYDESC>
<DERIVEDPROPERTYDESC>
<!-- Add the " AutoMakerDescription " property to this derived class -- it is
derived
from the "Description" property of the AutoMaker class of AutoWorld, as
identified by the "ManufOfAutos" relationship.
--!>
<NAME>AutoMakerDescription</NAME>
<PROPERTYID>511</PROPERTYID>
<DESCRIPTION> The Manufacture's description for this auto.</DESCRIPTION>
<BASEPROPERTYNAME>Description</BASEPROPERTYNAME>
<BASERELATIONSHIPNAME>ManufOfAutos</BASERELATIONSHIPNAME>
</DERIVEDPROPERTYDESC>
</DERIVEDCLASSDESC>
DTD
<!ELEMENT DERIVEDPROPERTYDESC (NAME, PROPERTYID, DESCRIPTION, OWNER?, OBJECTGUID?,
(SECURITYPROFILENAME | SECURITYPROFILEREF)?, BASEPROPERTYNAME, BASERELATIONSHIPNAME+)>
<!ATTLIST DERIVEDPROPERTYDESC
action (traverse | add | remove | update) #IMPLIED
>
<!ELEMENT BASEPROPERTYNAME (#PCDATA)>
<!ELEMENT BASERELATIONSHIPNAME (#PCDATA)>
<!ATTLIST BASERELATIONSHIPNAME
linkref IDREF #IMPLIED
>
Elements and Attributes |
Description |
DERIVEDPROPERTYDESC |
Used to reference a derived property description. |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Derived Property common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
PROPERTYID |
Required child element used to identify this property's relative ID. Must be an integer number greater than 500 and not currently used within the derived class. |
BASEPROPERTYNAME |
Required child element that is the name of an existing property in one of the base class's parent classes. Which parent class will be identified by the list of BASERELATIONSHIPNAME elements that follow. |
BASERELATIONSHIPNAME |
Required element(s) used to list the relationships needed to identify the property named in the BASEPROPERTYNAME element. The order is significant in that it starts from the base class and works its way back up to the relationship that has as its origin class, the one that contains the base property. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Description, Owner, and Security Profile can be modified. It is not allowed to change a Property Name. |
RELATIONSHIPDESC
The RELATIONSHIPDESC element enables creating a relationship in an AIM. This element is a child of the MODELDESC element. It appears once for each Relationship in the Model (AIM).
Example XML script:
<RELATIONSHIPDESC>
<NAME>ManufOfAutos</NAME>
<DESCRIPTION>Maps the objects in the AutoMaker class to the objects in the Auto class.
</DESCRIPTION>
<ORIGINREF linkref="AM"/>
<DESTINATIONREF linkref="AU"/>
<UNIQUENAMING enable="yes"/>
<PROPAGATEDELETE enable="yes"/>
</RELATIONSHIPDESC>
DTD:
<!ELEMENT RELATIONSHIPDESC (NAME, DESCRIPTION, ORIGINREF, DESTINATIONREF, OBJECTGUID?,
UNIQUENAMING?, PROPAGATEDELETE?, OWNER?, (SECURITYPROFILENAME | SECURITYPROFILEREF)?)>
<!ATTLIST RELATIONSHIPDESC
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT PROPAGATEDELETE EMPTY>
<!ATTLIST PROPAGATEDELETE
enable (no | yes) #REQUIRED
>
<!ELEMENT UNIQUENAMING EMPTY>
<!ATTLIST UNIQUENAMING
enable (no | yes) #REQUIRED
>
<!ELEMENT ORIGINREF EMPTY>
<!ATTLIST ORIGINREF
linkmodel CDATA #IMPLIED
linkclass CDATA #IMPLIED
linkref IDREF #IMPLIED
>
<!ELEMENT DESTINATIONREF EMPTY>
<!ATTLIST DESTINATIONREF
linkmodel CDATA #IMPLIED
linkclass CDATA #IMPLIED
linkref IDREF #IMPLIED
>
Elements and Attributes |
Description |
RELATIONSHIPDESC |
Used to create, update or delete a relationship description. |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Relationship common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
ORIGINREF |
Identifies the origin class of the relationship description. |
DESTINATIONREF |
Identifies the destination class of the relationship description. |
linkmodel, linkclass |
Identifies the origin or destination class by specifying the model name and class description name of the class |
linkref |
Identifies the origin or destination class using a CLASSDESC’s linkid. |
UNIQUENAMING |
Set <UNIQUENAMING enable="yes"/> to require unique object names in the destination collections of this relationship. Omit or set <UNIQUENAMING enable="no"/> to disable unique naming checks. |
PROPAGATEDELETE |
Set <PROPAGATEDELETE enable="yes"/> to enable delete propagation for objects in the collections of this relationship description. Omit or set <PROPAGATEDELETE enable="no"/> to disable delete propagation. |
linkid |
If defined, maps the linkid string to the relationship identifier for later reference. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) When set to update, only the Name, Owner, Description, Security Profile and Unique Naming Values can be modified. Any other modified values will be ignored. Note that if the Name is to be changed, the GUID must be present. |
transaction |
Is used to override the current default setting. If the transaction attribute is “yes” begins an explicit transaction. (See “Transactions” on page 446 for more details.) |
Elements for Importing User-Defined Objects and Relationships
MODEL
The MODEL element identifies the AIM, which will be used to import the repository. If a “linkref” is supplied for the model (referencing a MODELDESC “linkid” in this file), the NAME element, while still required for the file to parse correctly, is ignored.
If any APPLYLABEL elements are present, the label(s) indicated will be applied after all CLASS child elements have completed their actions, whatever they might be. You may look at the labels as being applied at the time of the close of the MODEL element in the script. The result of the APPLYLABEL is that the label identified in each APPLYLABEL element is applied to every object of every class of the metamodel, regardless of whether a class (or any of its objects) explicitly appears a child of the MODEL element. Also, “propagate=yes” is always the default for the MODEL element, and will be ignored by the MDS engine even if set to “no”. The label must already exist in the repository or an error will occur.
Example XML script:
<MODEL>
<NAME>AutoWorld</NAME>
<CLASS>
<NAME>AutoMaker</NAME>
<!—- More elements identifying AutoMaker objects -->
</CLASS>
</MODEL>
DTD:
<!ELEMENT MODEL (NAME?, APPLYLABEL*, (PREFERENCES*, CLASS+)>
<!ATTLIST MODEL
linkref IDREF #IMPLIED
>
CLASS
The CLASS element identifies the class of the data objects to be imported, updated or deleted. If a “linkref” is supplied for the class (referencing a CLASSDESC “linkid” in this file), the NAME element, while still required for the file to parse correctly, is ignored.
If any APPLYLABEL elements are present, the label(s) indicated will be applied after all OBJECTLIST OBJECT elements have completed their actions, whatever they might be. You may look at the labels as being applied at the time of the close of the CLASS element in the script. The result of the APPLYLABEL is that the label identified in each APPLYLABEL element is applied to every object in the class, regardless of whether an object explicitly appears a child of the OBJECTLIST element. Also, the "propagate=yes" attribute value may be used to propagate the label to all destination objects of the class's objects. The label must already exist in the repository or an error will occur.
Example XML script:
<CLASS linkref="AU">
<!--
The Name is provided, but the "AU" linkid is used to get the Auto class
object ID,saving the lookup of this object in the engine.
(This assumes the Auto class is already identified with a linkid of "AU" set.)
-->
<NAME>Auto</NAME>
<OBJECTLIST>
<OBJECT>
<!— More elements -->
</OBJECT>
<OBJECT>
<!—- More elements -->
</OBJECT>
</OBJECTLIST>
</CLASS>
DTD:
<!ELEMENT CLASS (NAME, APPLYLABEL*, OBJECTLIST?)>
<!ATTLIST CLASS
linkref IDREF #IMPLIED
>
OBJECTLIST
The OBJECTLIST element is principally used to group lists of objects by using the OBJECT elements contained in it. For repositories which have versioning enabled, the optional APPLYLABEL allows the user to apply the indicated label(s) to the list of child OBJECT elements.
There are two thing to note about the APPLYLABEL element:
This means is that if some of the OBJECT elements, further identify objects through the RELATIONSHIP/OBJECT set of elements, the objects of the RELATIONSHIP OBJECT child elements will not be labeled. However, as with all cases where the APPLYLABEL element occurs, the user may specify the "propagate=yes" attribute setting to achieve the same effect, without having to include all those objects in RELATIONSHIP-OBJECT sublists.
DTD:
<!ELEMENT OBJECTLIST (PREFERENCES*, OBJECT*)+>
<!ELEMENT APPLYLABEL (#PCDATA)>
<!ATTLIST APPLYLABEL
propagate (no | yes) "no”
>
OBJECT
The OBJECT element identifies the data objects to be imported, updated or deleted. This element is a child element of the OBJECTLIST element. An OBJECT element will be needed for each meta data object you want in the class.
The OBJECT element is the only one where the UpdateBehavior settings of “upsertVersion” and “strictVersion” will be used. This should only be for exceptional cases. See the discussion in “Action Attribute Settings” on page 424.
Since objects are typically mapped to or from other objects in other classes, it is natural to expect that this OBJECT element would be the parent or child of a RELATIONSHIP element to indicate this mapping.
An exception to this occurs if the relationship is inherited from a super class. In this case, the proper class for the object cannot be determined (it may have come form any number of sub-classes). The result is that, to add objects to relationships that are inherited, two steps need to be performed:
1 The object needs to be created/identified the usual way in its class using the usual CLASS/OBJECTLIST/OBJECT elements.
2 The object needs to be tagged with a “linkid.”
This “linkid” is then used in the second step, which is to now use the OBJECT/RELATIONSHIP/OBJECTREF elements to place the object into the proper relationship. See the “AutoWord_IAObjects.xml” sample script in the “samples” directory for an example of how to do this.
Example XML script:
<OBJECT linkid="AA.Colt">
<!-- Later, a 'linkref' of 'AA.Colt' could be used to identify this object -->
<NAME>Colt</NAME>
<DESCRIPTION>American Auto’s Colt</DESCRIPTION>
<PROPERTIES>
<!-- More elements -->
</PROPERTIES>
<RELATIONSHIP>
<!-- More elements -->
</RELATIONSHIP>
</OBJECT>
DTD:
<!ELEMENT OBJECTLIST (PREFERENCES*, OBJECT*)+>
<!ELEMENT OBJECT (NAME?, OBJECTGUID?, DESCRIPTION?, OWNER?, (SECURITYPROFILENAME |
SECURITYPROFILEREF)?, PROPERTIES?, RELATIONSHIP*)>
<!ATTLIST OBJECT
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
class CDATA #IMPLIED
transaction (no | yes) #IMPLIED
>
Elements and Attributes |
Description |
OBJECT |
Used to create, update or delete an object in the MDS repository |
NAME, DESCRIPTION, OBJECTGUID, OWNER, (SECURITYPROFILENAME | SECURITYPROFLEREF) |
Specifies the values for the Model common properties. Name and description are required. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
PROPERTIES |
For each PROPERTY element tag, sets the property value in the object. See the “PROPERTY” element. |
RELATIONSHIP |
For each RELATIONSHIP element tag adds or removes an object from a collection of this object. See the “RELATIONSHIP” element. |
linkid |
If defined, maps the linkid string to the object identifier for later reference. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) |
class |
Used to identify the name of the Class this object is in. Necessary only for objects in an OBJECTSLIST of a RELATIONSHIP that have inherited relationships - where the destination class is not the Relationship destination class. As an example, export one of the “AutoMaker” class objects from the “AutoWorld_IA” metamodel, and compare the XML generated to the AutoWorld_IA Objects.xml file found in the samples\xml directory. |
transaction |
Is used to override the current default setting. If the transaction attribute is “yes” begins an explicit transaction. (See “Transactions” on page 446 for more details.) |
PROPERTY
The PROPERTY element sets the value of an object property. This is a child of the OBJECT element.
Example XML script:
<PROPERTY>
<NAME>Some New Property 1</NAME>
<VALUE type="VT_STRING">abcdef</VALUE>
</PROPERTY>
<PROPERTY>
<PROPERTYID>502</PROPERTYID>
<VALUE type="VT_INTEGER">100</VALUE>
</PROPERTY>
<!-- Running MetaXML to update an existing object... -->
<!-- Set the "StringProperty" value to NULL. (Without the null=yes
attribute, this would change the value to the empty string.)
Note that to "set" to a NULL value at object-create time,
simply do not include the PROPERTY element.
-->
<PROPERTY>
<NAME>StringProperty</NAME>
<VALUE type="VT_STRING" null="yes"/>
</PROPERTY>
<!-- Set the "BinaryProperty" value to NULL; null attribute not necessary.
Note that to "set" to a NULL value at object-create time,
simply do not include the PROPERTY element.
-->
<PROPERTY>
<NAME>BinaryProperty</NAME>
<VALUE type="VT_BINARY"/>
</PROPERTY>
DTD:
<!ELEMENT PROPERTY ((NAME | PROPERTYID), VALUE)>
<!ELEMENT PROPERTYID (#PCDATA)>
<!ELEMENT VALUE (#PCDATA)>
<!ATTLIST VALUE
StringLiteral (no | yes) #IMPLIED
type (VT_SHORT | VT_INTEGER | VT_DOUBLE | VT_STRING | VT_BOOL | VT_UCHAR |
VT_BINARY | VT_DATE | VT_BYTE) #REQUIRED
null (no | yes) #IMPLIED
>
Elements |
Description |
NAME |
Identifies the property by name or property ID. |
StringLiteral |
This attribute, when set to "yes", tells the MDS engine to send the string to Teradata without adding enclosing quotes. It implies the character data has some special meaning, such as 'date' or 'time'. The default is "no". It is silently ignored for non-character properties. |
null |
This attribute, when set to yes changes the property value to NULL. Needed when the type is VT_STRING. For all other types an empty VALUE element results in setting a NULL value. For a property type of VT_STRING, an empty VALUE element without the null attribute will set the string length to empty. Can be used for any "action", but really needed only for updates since when action=add, merely not specifying the property will result in the object being created with a property value of null. |
VALUE |
Sets the property value. Specifying the property type is required. For example: <VALUE type="VT_STRING">abcdef</VALUE> |
RELATIONSHIP
The RELATIONSHIP element adds or removes an object from a collection. This is a child of the OBJECT element, and OBJECT elements can also be its children. In this way, one can uniquely identify a repository object within a Class by using the Relationships for that Model.
There are two things to note about the "action" attribute for the Relationship element. First, to provide compatibility with earlier releases, it is required -- its setting will always over-ride any default set by the PREFERENCES element. And second, its behavior is slightly different than other action attributes in that its MDS action is to add/remove the objects in the associated OBJECTLIST to/from one of its collections. That is, it does not add/remove MDS objects (though the objects in the list may be added/removed themselves), but works instead on its indicated collection.
Limitations: While objects can be added or removed in the object list, it is not recommended to do both at the same time. The issue is that the relationship action can only be one thing (add/remove/traverse), so if child objects are BOTH added and others removed, no action setting for the relationship is going to come out right.
Example XML script:
<OBJECT>
<NAME>American Autos</NAME
<RELATIONSHIP action="add">
<NAME>ManufOfAutos</NAME>
<OBJECT>
<NAME>Colt</NAME>
</OBJECT>
</RELATIONSHIP>
</OBJECT>
DTD:
<!ELEMENT RELATIONSHIP (NAME,(OBJECTREF|OBJECT)*)>
<!ATTLIST RELATIONSHIP
action (traverse | add | remove) #REQUIRED
type (origin | destination) #IMPLIED
linkref IDREF #IMPLIED
transaction (no | yes) #IMPLIED
>
<!ELEMENT OBJECTREF EMPTY>
<!ATTLIST OBJECTREF
linkref IDREFS #REQUIRED
>
Elements |
Description |
RELATIONSHIP |
Used to reference object(s) from a collection by using the list of OBJECT and OBJECTREF elements child elements. |
NAME |
Identifies the relationship description of the collection. |
OBJECT |
Identifies an object reference in the collection. See the “OBJECT” element. |
OBJECTREF |
Identifies an object in the collection by its linkid. |
action |
If the action attribute is “remove”, removes the object(s) from the collection If the action attribute is “add”, adds the object(s) to the collection. The "traverse" action merely identifies (existing) objects in the collection. |
type |
The type attribute (origin or destination) indicates if the object to be added or removed is in the origin or destination class of the relationship. The type attribute can be omitted unless the origin and destination classes of the relationship are the same class. |
linkref |
Identifies the Relationship by the linkid set in a RELATIONSHIPDESC element. The NAME is ignored if this attribute is set. |
transaction |
Is used to override the current default setting. If the transaction attribute is “yes” begins an explicit transaction. (See “Transactions” on page 446 for more details.) |
Elements for Importing MDS Users, Application Groups, Security Profiles, and Labels
METAUSER
The METAUSER element enables creating and deleting MDS Users and changing MDS User passwords.
Example XML script:
<METAUSER linkid="User1">
<NAME>User 1</NAME>
<PASSWORD>0xxxxxxxxxxxxxxx</PASSWORD>
<DESCRIPTION>This is the first user</DESCRIPTION>
</METAUSER>
DTD:
<!ELEMENT METAUSER (NAME,PASSWORD,DESCRIPTION?)>
<!ATTLIST METAUSER
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
superuser (no | yes) "no"
>
<!ELEMENT PASSWORD (#PCDATA)>
<!ATTLIST PASSWORD
encrypt (yes | no) #IMPLIED
>
Elements |
Description |
METAUSER |
Used to add or remove a MDS user |
NAME |
Sets the name of the user |
PASSWORD |
Sets the user’s password |
DESCRIPTION |
Sets a description. Optional. |
linkid |
If defined, maps the linkid string to the user identifier for later reference. |
action |
Used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) |
superuser |
When "yes", this indicates that this user is to be a super user (a.k.a "administrator"). The MDS user running the script must be a super user else this will produce an error. |
encrypt |
encrypt=yes indicates that the specified password is encrypted. The metaxml program provides the means to encrypt a password. Omit or set encrypt=no if the password is not encrypted. |
METAGROUP
The METAGROUP element enables creating and deleting MDS Application Groups and adding and removing users from the groups.
Example XML script:
<METAGROUP>
<NAME>Group 1</NAME>
<METAUSERREF linkref="User1" action="add"/>
</METAGROUP>
<METAGROUP>
<NAME>Group 2</NAME>
<METAUSERREF linkref="User1" action="add"/>
<METAUSERREF linkref="John.Doe" action="remove"/>
</METAGROUP>
DTD:
<!ELEMENT METAGROUP (NAME, DESCRIPTION?, METAUSERREF*)>
<!ATTLIST METAGROUP
action (traverse | add | remove | update) #IMPLIED
>
<!ELEMENT METAUSERREF EMPTY>
<!ATTLIST METAUSERREF
linkname CDATA #IMPLIED
linkref IDREFS #IMPLIED
action (traverse | add | remove) #REQUIRED
>
Elements |
Description |
METAGROUP |
Used to add or remove a MDS application group. |
NAME |
Sets the name of the application group. |
DESCRIPTION |
Sets a description. Optional. |
action |
Used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) |
transaction |
If the transaction attribute is “yes”, begins an explicit transaction. |
METAUSERREF |
Identifies users to add or remove from the application group. |
linkname |
Identifies users to add or remove by the user’s name. |
linkref |
Identifies users to add or remove by an XML linkid. |
SECURITYPROFILE
The SECURITYPROFILE element enables creating, updating and deleting MDS Security Profiles. This element is a child element of the SECURITYPROFILES element. Security Profiles are used by all other repository objects to identify who is allowed what type of access to those objects. This element replaces the PERMISSION and APPLICATIONGROUP elements from the 2.0 release.
Example XML script:
<SECURITYPROFILES>
<SECURITYPROFILE linkid="AMSecProf">
<NAME>AutoMaker Security Profile</NAME>
<DESCRIPTION>Desc</DESCRIPTION>
<SPENTRY access="SP_FULL">
<MDSUSER>user1</MDSUSER>
</SPENTRY>
<SPENTRY access="SP_READ">
<MDSGROUP>AutoWorld Group</MDSGROUP>
</SPENTRY>
</SECURITYPROFILE>
</SECURITYPROFILES>
DTD
<!ELEMENT SECURITYPROFILE (NAME, DESCRIPTION?, OBJECTGUID?, OWNER?, SPENTRY*)>
<!ATTLIST SECURITYPROFILE
linkid ID #IMPLIED
action (traverse | add | remove | update) #IMPLIED
>
<!ELEMENT SPENTRY (MDSUSER | MDSGROUP)>
<!ATTLIST SPENTRY
action (traverse | add | remove | update) #IMPLIED
access (SP_READ | SP_COLLECTION | SP_UPDATE | SP_FULL) #REQUIRED
>
<!ELEMENT MDSUSER (#PCDATA)>
<!ELEMENT MDSGROUP (#PCDATA)>
<!ELEMENT SECURITYPROFILEREF EMPTY>
Elements |
Description |
SECURITYPROFILE |
Used to add or remove an MDS Security Profile. |
NAME, DESCRIPTION, OBJECTGUID, OWNER |
Specifies the values for the Security Profile common properties. Only the Name is required for this element. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. |
linkid |
If set, can be used by other elements to reference this one. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “traverse” or “update”. (See “Action Attribute Settings” on page 424 for more information.) |
SPENTRY |
Identifies an MDS user or group that is associated with this Security Profile. |
MDSUSER |
Identifies the MDS user for this entry. |
MDSGROUP |
Identifies the MDS group for this entry. |
access |
Required attribute of SPENTRY that specifies what access the user/group will have for this Security Profile Entry element. The values SP_READ, SP_COLLECTION, SP_UPDATE, SP_FULL map directly to the MDS engine values of MD_READ, MD_COLLECTION, MD_UPDATE and MD_FULL. |
METALABEL
The METALABEL element is used to create, update or remove labels in the MDS repository. This element is the only child element of the METALABELS element.
DTD:
<!--
Labels are part of versioning; new as of 6.1
-->
<!ELEMENT METALABELS (METALABEL)+>
<!ATTLIST METALABELS
transaction (no | yes) #IMPLIED
>
<!ELEMENT METALABEL (NAME, DESCRIPTION?, CREATORNAME?, OBJECTGUID?, OWNER?, (SECURITYPROFILENAME | SECURITYPROFILEREF)?)>
<!ATTLIST METALABEL
action (traverse | add | remove | update) #IMPLIED
>
<!ELEMENT CREATORNAME (#PCDATA)>
Elements and Attributes |
Description |
METALABEL |
Used to add, update or remove an MDS Label. |
NAME, OBJECTGUID, DESCRIPTION, OWNER, (SECURITYPROFILENAME | SECURITYPROFILEREF) |
Specifies the values for the Label common properties. Only the Name is required for this element. The owner will default to the MDS user running the script. The OBJECTGUID will be supplied by the MDS engine by default. The default Security Profile is MDSDefaultSecurityProfile. |
action |
Is used to override the current default setting. The value can be “add”, “remove”, “update” or “traverse”. (See “Action Attribute Settings” on page 424 for more information. |
CREATORNAME |
Used to identify the creator of this label, and can be different than the creating MDS user. Any string up to 255 character is valid. This is optional and if not specified, it will be set the same as the creating MDS user name. |