4.5.1.1. Definition.xml
The definition.xml file defines which parameters are exposed to the user, and defines all the steps that the user will go through to configure and deploy the connector.
The first thing to configure is to give a name to the connector:
<name>My First Connector</name>
<description>This connector allows you to transform an XML into a CSV.</description>
In this connector, we would like to configure two steps for the user:
- One step called “Inbound” to configure the email address that will receive the XML
- One step called “Outbound” to configure the email address where the resulting CSV will be sent.
The definition.xml file included in the ZIP file is just an example (a skeleton) to avoid starting from scratch.
In our example we will configure 2 parameters (EMAIL IN, EMAIL OUT).
<parameters>
<parameter>
<name>InEmailAddress</name>
<type><class>SmtpUserName</class></type>
<label>IN Email Address</label>
<tooltip>Email that will receive the XML file to be transformed.</tooltip>
</parameter>
<parameter>
<name>OutEmailAddress</name>
<type><class>EmailAddress</class></type>
<label>OUT Email Address</label>
<tooltip>Email address on which the CSV will be sent to</tooltip>
</parameter>
</parameters>
NB: All the XML tags will be fully explained in details in the section about the structure of definitions.xml
And we will define two steps that the user will go through to configure these two parameters. Of course, multiple parameters can be defined for each step. Also, one could configure both parameters in the same step as well. This is entirely up to you as you try to make your connector as user friendly as possible.
<steps>
<step>
<name>Inbound</name>
<parameter>InEmailAddress</parameter>
<label>Inbound parameter configuration</label>
<introduction>This step allows you to define on which email address the XML is
received
</introduction>
</step>
<step>
<name>Outbound</name>
<parameter>OutEmailAddress</parameter>
<label>Outbound parameter configuration</label>
<introduction>This step allows you to define on which email address the CSV will
be sent to
</introduction>
</step>
</steps>
Once the parameters have been defined, they need to be referenced in the channels.xml file.