Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Wednesday, March 23, 2011

Organizing Custom Components in Talend Open Studio

When you create a custom component in Talend Open Studio, you control its display in the Pallete using the FAMILIES element in the component's XML descriptor.  The FAMILIES element follows the HEADER element and precedes the DOCUMENTATION element.  FAMILIES is a container for FAMILY elements.

For example, the following XML fragment is used in the tHiveConnection component.  See tHiveConnection_java.xml.  If the component supports Perl, it will be in the _perl.xml as well.

</HEADER>

<FAMILIES>
<FAMILY>Databases/Hive </FAMILY>
<FAMILY>ELT/Connections </FAMILY>
</FAMILIES>

<DOCUMENTATION>

This screen in Component Designer will list tHelloWorld2 under two families: Sample and Misc.

Screenshot of Component Listed in Two Families

Hierarchical Display

This will list the tHiveConnection under two Families in the pallete: Database/Hive and ELT/Connections.  Families can be organized in hierarchies called Drawers (like folders)  The "/" character allows for nesting such that there is a Hive Drawer under the Database Drawer and a Connections Drawer under the ELT Drawer.  tPaloCheckElements is nested three deep with "Business_Intelligence/OLAP_Cube/Palo".

Component Using Nested FAMILY

tHelloWorld (from the Talend Exchange) uses this simpler definition which lists the tHelloWorld component in a folder "Mirom" that is not nested.  tHelloWorld is listed only once in the Pallete.
<FAMILIES>
<FAMILY>Mirom</FAMILY>
</FAMILIES>

When you specify a FAMILY for a custom component, the FAMILY is loaded into the Pallete if it's not there already.  If you don't specify a FAMILY, your component won't be listed in the Pallete and won't be searchable either.

Internationalized

Families are internationalized, standarizing on an English name.  To add a new internationalized Family, edit the messages properties in the local provider folder.  (On my installation, this is %TOS_HOME%\plugins\org.talend.designer.components.localprovider_4.1.0.r49467.)  Prepend the Family name with "FAMILY.".  for example, FAMILY.Connections=Connections is used in message.properties and message_en.properties; in message_es.properties this is FAMILY.Connections=Conexiones.

Select a meaningful FAMILY for your custom component so that it's easy to find.  If it's convenient and not confusing to the users, cross-reference the FAMILY in other areas.

No comments:

Post a Comment