Creo Elements/Direct Model Manager Customization Guide > Additional Customizations > Get the Creo Elements/Direct Manager Server schema
Get the Creo Elements/Direct Manager Server schema
You can get the Creo Elements/Direct Manager Server database schema by calling the XMLTranslator object. This object has three methods used for retrieving schema information:
getInstance returns the XMLTranslator instance.
getXMLSchema returns the entire Creo Elements/Direct Manager Server schema.
getElementForClass returns the schema for only the class you specify.
For example, if you want to retrieve the entire Creo Elements/Direct Manager Server database schema, you could include the following line in a method in your class:
Document doc = XMLTranslator.getInstance().getXMLSchema();
The Creo Elements/Direct Manager Server schema is returned as a JDOM Document object. You can find more information and their JavaDoc at the JDOM Web site. Please refer to the entry for the Document class for the methods and other information you need to use this object.
The schema is in the XML Schema Definition (XSD) format. If you are not yet familiar with this format, you can find information and resources on the W3C site or complete the tutorial at W3Schools.com.
The following example is XSD output for the MODEL_3D class on one database:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MODEL_3D">
<xs:complexType>
<xs:sequence>
<xs:element name="ALID" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="14" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="APPROVED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType> <xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="APPROVED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BOM_INDICATOR" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="30" />
<xs:enumeration value="assembly" />
<xs:enumeration value="part" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CLASS_NAME" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="20" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CLASS_TYPE" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="20" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CREATED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="CREATED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CREATE_DATE" type="xs:date" maxOccurs="1" />
<xs:element name="DESCRIPTION" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="250" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="DESCRIPTION2" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="250" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ELID" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="14" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="IN_PACKET_DMS" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="14" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="LASTUPDATED_BY" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="LASTUPDATE_DATE" type="xs:date" maxOccurs="1" />
<xs:element name="MODEL_ID" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MODEL_ID_NAME" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="250" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MODEL_ID_VERS" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MODEL_OBJTYPE" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="NAME" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false">
<xs:simpleType>
<xs:restriction>
<xs:length value="250" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ORG_APPROVED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="ORG_APPROVED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ORG_CREATED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="ORG_CREATED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ORG_RELEASED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="ORG_RELEASED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="OWNER" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PROJECT_ID" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="14" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="RELEASED_AT" type="xs:date" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction />
</xs:simpleType>
</xs:element>
<xs:element name="RELEASED_BY" type="xs:string" maxOccurs="1" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction>
<xs:length value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SFU" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="512" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="STATE" type="xs:string" maxOccurs="1" minOccurs="1" default="work" nillable="false">
<xs:simpleType>
<xs:restriction>
<xs:length value="250" />
<xs:enumeration value="approved" />
<xs:enumeration value="archived" />
<xs:enumeration value="for_approval" />
<xs:enumeration value="locked" />
<xs:enumeration value="released" />
<xs:enumeration value="work" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="STATE_DATE" type="xs:date" maxOccurs="1" />
<xs:element name="UNIQUE_ID_STRING" type="xs:string" maxOccurs="1">
<xs:simpleType>
<xs:restriction>
<xs:length value="1020" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="VERSION" type="xs:string" maxOccurs="1" minOccurs="1" default="1" nillable="false">
<xs:simpleType>
<xs:restriction>
<xs:length value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PART" type="xs:string" maxOccurs="1" />
<xs:element name="STORE_TYPE" type="xs:string" maxOccurs="1" />
<xs:element name="BOM_DESCRIPTION" type="xs:string" maxOccurs="1" />
<xs:element name="CHANGE_NOTE" type="xs:string" maxOccurs="1" />
<xs:element name="POS" type="xs:integer" maxOccurs="1" />
<xs:element name="BOM_DESCRIPTION2" type="xs:string" maxOccurs="1" />
<xs:element name="EFFECTIVE_FROM" type="xs:date" maxOccurs="1" />
<xs:element name="SPARES" type="xs:decimal" maxOccurs="1" />
<xs:element name="OPTION_NAME" type="xs:string" maxOccurs="1" />
<xs:element name="EFFECTIVE_TO" type="xs:date" maxOccurs="1" />
<xs:element name="OVERWRITES" type="xs:decimal" maxOccurs="1" />
<xs:element name="VIEW_NAME" type="xs:string" maxOccurs="1" />
<xs:element name="QUANTITY_DMS" type="xs:decimal" maxOccurs="1" />
<xs:element ref="DRAWING_2D" minOccurs="0" />
<xs:element ref="WM_FILES" minOccurs="0" />
<xs:element ref="LIBRARY_3D" minOccurs="0" />
<xs:element ref="MODEL_3D" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
* 
Your schema may contain different attributes for the MODEL_3D class shown in this example.
Was this helpful?