The transformation function definition file defines the configuration of the transformation function invoked from the custom function. Use the file to
- Create the Java form file
- Define the custom function
The following is a descriptive example of the transformation function definition file. The slanting part is data specified by the user.
<?xml version="1.0" encoding="UTF-8"?>
<func:customFunc xmlns:func="http://www.hitachi.co.jp/soft/xml/cosminexus/cscdt/functions">
<func:jar name="sample.jar">
<func:package name="jp.co.Hitachi.soft.sample">
<func:class name="SampleClass">
<func:method name="sampleFunction">
<func:comment>Description of sampleFunction</func:comment>
<func:arguments>
<func:argument name="arg1">
<func:comment>Description of arg1</func:comment>
</func:argument>
<func:argument name="arg2">
<func:comment>Description of arg2</func:comment>
</func:argument>
<func:argument name="arg3">
<func:comment>Description of arg3</func:comment>
</func:argument>
</func:arguments>
</func:method>
<func:method name="sampleStringFunction">
<func:comment>Description of sampleStringFunction</func:comment>
<func:arguments>
<func:argument name="arg1" type="String">
<func:comment>Description of arg1</func:comment>
</func:argument>
</func:arguments>
<func:return type="String"/>
</func:method>
<func:method name="sampleNodeListFunction">
<func:comment>Description of sampleNodeListFunction</func:comment>
<func:arguments>
<func:argument name="arg1" type="Object">
<func:comment>Description of arg1</func:comment>
</func:argument>
</func:arguments>
<func:return type="NodeList"/>
</func:method>
</func:class>
</func:package>
</func:jar>
</func:customFunc> |
The user creates the transformation function definition file using the XML editor. The following points describes how to create the transformation function definition file using the XML editor of Eclipse.
- In the Eclipse menu, choose File, New and Others.
The New dialog box appears.
- Choose XML and XML (basic template) and then click Next.
The XML file page appears.
- Specify the directory for saving the transformation function definition file and the file name and then click Next.
The Create the XML file from the following page appears.
- Choose the Create the SML file from XML schema or file radio button and then click Next.
The Choose XML schema or file page appears.
- Click Import file.
The Import dialog box appears.
- Specify the following directory in From the following directories.
uCosminexus Service Architect installation directory\CSCTE\resources\customfunc
- Check the customfunc check box and the customfunction_XMLSchema.xsd check box.
- Specify the folder for importing the schema file in Import--destination folder.
- Click End.
The Choose XML schema or file page reappears.
- Click Next.
The Choose root element page appears.
- Specify customFunc in Root element and then click End.
The form of the transformation function definition file is created.
![[Figure]](figure/zs070900.gif)
- Add the required elements in the form of the transformation function definition file and create the file.
The following tabs are used in the transformation function definition file.
Table 6-8 List of tabs used in the transformation function definition file
Item no. | Element or attribute name | Contents | Type | Number of items | Number of characters |
---|
Minimum | Maximum | Minimum | Maximum |
---|
1 | customFunc | Transformation function definition | Element | 1 | 1 | -- | -- |
2 | jar | jar file information | Element | 1 | 255 | -- | -- |
3 | name | jar file name | Attribute | 1 | 1 | 1 | 100 |
4 | package | Package information | Element | 1 | 255 | -- | -- |
5 | name | Package name | Attribute | 1 | 1 | 1 | 255 |
6 | class | Class information | Element | 1 | 255 | -- | -- |
7 | name | Class name | Attribute | 1 | 1 | 1 | 100 |
8 | method | Method information | Element | 1 | 255 | -- | -- |
9 | name | Method name | Attribute | 1 | 1 | 1 | 100 |
10 | comment | Method comment | Element | 0 | 1 | 0 | 1,024 |
11 | arguments | Argument information | Element | 0 | 1 | -- | -- |
12 | argument | Argument | Element | 1 | 255 | -- | -- |
13 | name | Argument name | Attribute | 1 | 1 | 1 | 100 |
14 | Type | Argument type (String or Object) | Attribute | 0 | 1 | - | - |
15 | comment | Argument comment | Element | 0 | 1 | 0 | 1,024 |
16 | return | Return value | Element | 0 | 1 | - | - |
17 | type | Return value type (String or NodeList) | Attribute | 1 | 1 | - | - |
- (Legend)
- --:There is no limit on the number of characters.
Note the following when creating the transformation function definition file:
- Do not use the same class name and method name.
- Do not specify String in the class name.
- An unintended result such as Java syntax error etc might occur depending on the contents because the comment is embedded as it is in 1 line of the specified character string. If an unintended result occurs, modify the Java file directly.