<kColl id = "tags"> <kColl id = "data"> <field id="otherType" value="myPackage.MyDataField"/> ... ... </kColl> ... ... </kColl>
Depending on how the processes using this data field are distributed, the definition may need to exist in the configuration files for both the client and the server.
Alternatively, you can use implClass attribute to specify the class when you are defining an instance of the new entity in the data definition file. For example, you could add the following definition to the data file:
<otherType id="myName" implClass="myPackage.MyDataField"/>
Since you have already specified the implementation class name, you do not need to add the mapping between the tag name "otherType" and the class name "myPackage.MyDataField" in the tags keyed collection of dse.ini.
/** * Initialize MyDataField with the Tag attributes. * @return java.lang.Object * @param aTag com.ibm.dse.base.Tag * @exception java.io.IOException */ public Object initializeFrom(Tag aTag) throws java.io.IOException { value = null; super.initializeFrom(aTag); for (int i=0; i<aTag.getAttrList().size(); i++) { TagAttribute attribute = (TagAttribute) aTag.getAttrList().elementAt(i); if (attribute.getName().equals("myAttribute")) { setMyAttribute((String)(attribute.getValue())); } } return this; }
public String toString() { String s="<otherType "; s=JavaExtensions.addAttribute(s,"id",getName()); s=JavaExtensions.addAttribute(s,"value",""+getValue()); s=JavaExtensions.addAttribute(s,"description",getDescription()); s=JavaExtensions.addAttribute(s,"myAttribute",getMyAttribute()); s=s+">"; return s; }The visual representation of an instance of this new data element type appears in the XML file as follows:
<otherType id="myName" value="100" myAttribute="xxx"/>