DOFObjectIDcreate Method (String)OpenDOF Object Access Library
Constructs a DOFObjectID from a String in the standard string format defined by the OpenDOF Technical Committee.

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
public static DOFObjectID create(
	string format
)

Parameters

format
Type: SystemString
The standard format string for the object identifier.

Return Value

Type: DOFObjectID
The newly created object identifier.
Remarks

Constructs a DOFObjectID from a String in the standard string format defined by the OpenDOF Technical Committee. To use the standard string format, you first need to obtain the identifier assigned to the OID class by the DOF Technical Committee (DTC). The DTC maintains an OID class registry that lists the class identifiers for all currently registered classes.

The basic rules for the standard string format are as follows:

  1. The string must be enclosed in square braces ([]).
  2. Within the square braces the format is <class identifier>:<OID data>.
  3. Hexadecimal values in the OID data must be enclosed in curly braces ({}).
  4. The OID data may contain spaces if the OID class definition permits them; however, the string must not contain any spaces outside the data field.
The following is an example of how to create a DOFObjectID using a GUID (in hexadecimal) as the OID data:
DOFObjectID myOID = DOFObjectID.create("[128:{050234706bb1453289d9461055cef60c}]");
The following is an example of how to create a domain class DOFObjectID:
DOFObjectID myOID = DOFObjectID.create("[6:provider.opendof.org]");
The following is an example of how to create an email class DOFObjectID:
DOFObjectID myOID = DOFObjectID.create("[3:provider@opendof.org]");
Attributes can be added to the standard string format to create an OID with attributes. To format an attribute in the standard string format, you must know its attribute identifier. Attribute identifiers, like OID classes, must be registered with the OpenDOF Project.

The following rules apply to the standard string format for attributes:

  1. Attributes must be contained within parentheses after the OID data, but before the closing square brace.
  2. Within the square braces the format is <attribute identifier>:<attribute data>.
  3. Multiple attributes must be separated using a pipe symbol (|).
  4. If the attribute data is itself an OID, it must follow the rules for OIDs listed above.
  5. The attribute data may contain spaces if the definition permits them; however, the string must not contain any spaces outside the data field.
The following example shows how you would create an email class OID with provider and group attributes:
DOFObjectID myOID = DOFObjectID.create("[3:provider@opendof.org(0:[3:service@opendof.org]|2:[3:group@opendof.org])]");
An alternative to using this method to create the entire OID with its attributes is to use this method to create the base OID, use one of the Attribute.create(byte, byte[]) methods to create the attributes, and then pass the base OID and attributes to the create(DOFObjectID, Attribute[]) method.

See Also

Reference