ArcFM Desktop Overview > Designer Overview > Compatible Units > Importing and Exporting Compatible Units |
This topic applies to Designer versions 10.0.2 and earlier.
Designer provides tools for the import and export of the CU library. This functionality is part of the Favorites Editor, but interfaces exist that allow you to programmatically perform imports and exports as well.
The ArcFM Favorites Manager allows you to export your CU library to an XML file. You can then use this file to import the CU library into another designer geodatabase, prepare a CU library report (by using XSL style sheets), or to import into your WMS using a custom import tool.
The following code snippet demonstrates how you can export system favorites from the System Favorites Editor to an XML document using D8CuTypeClass. This snippet uses a value from the mmXMLFormat enumeration to specify the data to be exported (compatible unit).
Copy Code
|
|
---|---|
using Miner.Interop; //Miner.Interop.Framework & Miner.Interop.Geodatabase using Miner.Interop.msxml2; //Miner.Interop.msxml2 ///.... ///<get your workspace here> ///.... D8CuTypeClass cutypeclass = new D8CuTypeClass(); cutypeclass.LoadFromDB("mmSystemCUs", workspace); DOMDocumentClass documentClass = new DOMDocumentClass(); cutypeclass.SaveToDOM(mmXMLFormat.mmXMLFCUDef, documentClass); documentClass.save(@"D:\test.xml"); |
Like the design, the CU has a specific schema that Designer expects. This schema specifies the information that a CU can store and should be followed when writing any CU export utilities, specifically when CUs are exported from the WMS. If the XML resulting from your integration is consistent with the CU schema, then Designer will be able to import the CUs into its CU Library (via the ArcFM Favorites Manager). Otherwise, the XML parser (Microsoft XML 2.5) will generate an error. Currently, like the design schema, the CU schema is specified by a DTD file that is installed with Designer. The name of the DTD file is CU.dtd and can be found under the ArcFM Solution\bin\XML directory.
Following are descriptions of the various objects in the CU schema.
CU_TYPE
The CU_TYPE node is the top-level object in the CU schema. Therefore it can contain all the other CU objects, including further instances of itself. A CU_TYPE object carries three attributes:
- ProgID - Specifies the object type for CU_TYPE. Designer uses this progID to create an instance of the D8CuType object.
- CUType - Numeric attribute which identifies the type of CUs that are contained by the node. The possible values represent an enumeration defined as follows:
1 = CUSystem
2 = CUCustomSystem
3 = CUUser
4 = CUCustomUser
5 = FeatureSystem
6 = FeatureCustomSystem
7 = FeatureUser
8 = FeatureCustomUser
- Owner - Specifies that the CUs contained by the CU_TYPE node are either defined as system CUs or as user-defined; the two possible values are ‘System’ and ‘User.’
DESCRIPTION
Describes the CU_DEFINITION object. This node is obsolete and maintained for backward compatibility.
USERNAME
Specifies the user to which the object belongs.
GISUNIT
The GISUNIT node serves to provide a table name and subtype mapping to symbolized CUs. The GISUNIT node contains two attributes:
- ProgID - Specifies the object type for GISUNIT. Designer uses this progID to create an instance of the MMGISUnit object.
- Owner - Specifies that the CUs contained by the GISUNIT node are either defined as system CUs or as user-defined; the two possible values are ‘System’ and ‘User.’
TABLENAME
Specifies the table name in the geodatabase to which the object applies.
SUBTYPE
Specifies the subtype to which the object applies.
CU
The CU node describes a compatible unit as it exists in the WMS and is used to link Designer CUs to CUs defined in the WMS. A CU object is usually contained by a GISUNIT, but can exist independently in cases of Non-GIS Compatible Units. The CU node carries one attribute:
- ProgID - Specifies the object type for CU. Designer uses this progID to create an instance of the CU object.
CUNAME
This node shows the display name of the CU object which is shown on the CUs tab in ArcFM.
WMS_CODE
Identifies the CU object uniquely within the WMS and maps Designer CUs to those defined in the WMS.
AVAILABLEWORKFUNCTIONS
This node lists the available work functions for the object.
METADATA
Provides a text string of additional data. Delimited by a bar character ( | ).
EDM
Stores WMS-specific data. Contains the EDMPROP element.
EDMPROP
Stores WMS-specific data. The Name property corresponds with a field in the Extended Data Definition (EDD) table.
WORK_FUNCTION
Specifies the work function assigned to the object.
WF_STATUS
Represents the workflow status of the CU.
CUDEF_ATTRIBUTE
The CUDEF_ATTRIBUTE node functions to provide an attribute assignment to the CU. A CU can have attributes that define it or that provide default values for the object that they represent in the GIS.
- ProgID - Specifies the object type for COMPOSITE. Designer uses this progID to create an instance of the COMPOSITE object.
- AttributeType - specifies the type of attribute; can be one of two values:
Default specifies that the attribute defined by the CUDEF_ATTRIBUTE node is a default attribute.
Defining specifies that the attribute functions as a CU Defining Attribute.
NAME
Specifies the field name to which the CUDEF_ATTRIBUTE object applies.
VALUE
Specifies the value to be applied to the CUDEF_ATTRIBUTE field.
SHAPE
Stores geometry for the CUDEF_ATTRIBUTE object.
COMPOSITE
The COMPOSITE node serves to provide a tablename and subtype mapping to symbolized CUs. The COMPOSITE node carries one attribute:
- ProgID - Specifies the object type for COMPOSITE. Designer uses this progID to create an instance of the COMPOSITE object.
TEMPLATE
This node is the XML representation of a Template object in Designer. The TEMPLATE node carries one attribute:
- ProgID - Specifies the object type for TEMPLATE. Designer uses this progID to create an instance of the TEMPLATE object.
TEMPLATENODEPOINT
This node is the XML representation of a point object within a template in Designer. The TEMPLATENODEPOINT node carries one attribute:
- ProgID - Specifies the object type for TEMPLATENODEPOINT. Designer uses this progID to create an instance of the TEMPLATENODEPOINT object.
TEMPLATENODEEDGE
This node is the XML representation of an edge object within a template in Designer. The TEMPLATENODEEDGE node carries one attribute:
- ProgID - Specifies the object type for TEMPLATENODEEDGE. Designer uses this progID to create an instance of the TEMPLATENODEEDGE object.
FAVORITE
This node is the XML representation of a Favorite object in ArcFM. The FAVORITE node carries four attributes:
- ProgID - Specifies the object type for FAVORITE. Designer uses this progID to create an instance of the FAVORITE object.
- TableName - The TableName attribute specifies the table name in the GIS to which the CU is mapped. This task is handled by the GISUNIT object in Designer versions 8.1 and later.
- CUType - This attribute identifies the type of CU that the FAVORITE node defines. This attribute has three possible values: Base, Macro, and MHolder. This attribute is obsolete and doesn’t have to be set. The default value is Base.
- Owner - Specifies that the CUs contained by the FAVORITE node are either defined as system CUs or as user-defined; the two possible values are System and User.
CODE
Represents an object’s general identifier for use with the ArcFM Favorites Manager. This node is obsolete and is maintained for backward compatibility.
EDITTASK
Specifies the edit task to be used when placing a composite favorite or template.
OWNERTYPE
Specifies ownership by an administrator or specific user. This node is obsolete and is maintained for backward compatibility.
CUTYPE
This node represents the attribute that specifies the type of CU.
WORKLOCATION
This node is the XML representation of a Work Location object in Designer. The WORKLOCATION node carries one attribute:
- ProgID - Specifies the object type for WORKLOCATION. Designer uses this progID to create an instance of the WORKLOCATION object.
MACROUNIT
This node is the XML representation of a Macro object in Designer. The MACROUNIT node carries two attributes:
- ProgID - Specifies the object type for MACROUNIT. Designer uses this progID to create an instance of the MACROUNIT object.
- Owner - Specifies that the CUs contained by the MACROUNIT node are either defined as system CUs or as user-defined; the two possible values are System and User.
RELATIONSHIP
This node is the XML representation of a relationship object in ArcFM. The RELATIONSHIP node carries four attributes:
- ProgID - Specifies the object type for RELATIONSHIP. Designer uses this progID to create an instance of the RELATIONSHIP object.
- RelationshipClass_ID - Specifies the ID of the relationship class between the two associated tables.
- Relationship_Direction - Specifies the direction of the relationship between the two associated tables.
- Parent_Table - Specifies the table of the source.
CU_DEFINITION
The CU_DEFINITION node was used to define CUs in pre-8.1 versions of Designer. This object is now obsolete and is maintained in order to preserve backward compatibility with CUs.
- ProgID - Specifies the object type for CU_DEFINITION. Designer uses this progID to create an instance of the D8CuDefinition object.
- TableName - The TableName attribute specifies the table name in the GIS to which the CU is mapped. This task is handled by the GISUNIT object in Designer versions 8.1 and later.
- CUType - This attribute identifies the type of CU that the CU_DEFINITION node defines. This attribute has three possible values: Base, Macro, and MHolder. This attribute is obsolete and doesn’t have to be set. The default value is Base.
- Owner - Specifies that the CUs contained by the CU_DEFINITION node are either defined as system CUs or as user-defined; the two possible values are System and User.
CUDESCRIPTION
This node describes the CU_DEFINITION object. This node is obsolete and is maintained for backward compatibility.
WMSCODE
Identifies the CU object uniquely within the WMS and maps Designer CUs to those defined in the WMS. This node is obsolete and maintained for backward compatibility.