Implementing Types
To implement a registered type interface:
Note:
Implement registered types as PeopleCode application classes.
-
In Application Designer, create an application package for each functional module using the naming convention <NAMESPACE_PREFIX>_TYPES.
Use the first level sub-package to group implementation classes by function and the second level to group classes by versions.
-
Create the application class that is implementing the interface type.
When you create the application class, you must ensure that it:
-
Extends the baseType class.
-
Imports the package with the baseType parent class definition.
-
Exposes a read-only property IUD with the type string.
-
Has a IUD property that contains the correct IUD of the corresponding registry entry.
-
Instantiates any array properties defined in the class as array properties with 0 elements.
-
Implements the following mandatory public methods: toXmlNode, toXmlNodeString, fromXmlNode, and truncateType.
-
-
Copy the stub code the system created when you clicked the Generate Class Code button on the Registry Wizard - Implementation page for this interface and paste it into the application class implementing the interface type.
The generated type stub code includes the following mandatory methods:
method toxmlNode(&parentNode As XmlNode);method fromXmlNode(&parentNode As XmlNode);method toXmlNodeString(&nodeName As string) Returns string;method TruncateType();The system uses the XML mandatory methods to marshal and unmarshal the type to or from an xml representation, which is required in order to use this type in a remote service invocation. The truncateType mandatory method resents the value of all type elements.
-
Access the registry entry for the type interface in the Registry Wizard and add the application class to the type's implementation details.