Custom component as plugin for Clover ETl Designer

Discussion on developing CloverETL engine, transformation components etc.

jkad

Custom component as plugin for Clover ETl Designer

Postby jkad » Tue Oct 26, 2010 9:34 am

Hello,

I want to make a custom component as a plugin for a CloverETL Designer. I have the version CloverETL Designer 2.9.7.
I read a manual Integrating a Custom Component in CloverETL Designer, there is the sequence of steps File -> New -> Project -> Plugin Project -> ...

But in my edition of Designer, there is no option Plugin Project. There are only four options: General (Project), CloverETL (C. Project, C. Example Project), Java (Java, Ant Project), Examples (Editing and validating XML...).

How should I act?

Thank you for your time.
Jana Kadlecova

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Re: Custom component as plugin for Clover ETl Designer

Postby avackova » Tue Oct 26, 2010 12:40 pm

Hello Jana,
Plugin project is available in Eclipse for RCP/Plug-in Developers only. But you don't need to create the Plugin project, as all you need to develop is the component and plugin.xml.
Agata Vackova
Javlin a.s.
agata.vackova@javlin.eu

jkad

Re: Custom component as plugin for Clover ETl Designer

Postby jkad » Tue Oct 26, 2010 1:43 pm

Hello,
but I want to see the Component in the Palette. Is it possible?
Thank you
Jana

twaller
Posts: 49
Joined: Mon Feb 23, 2009 4:21 pm

Re: Custom component as plugin for Clover ETl Designer

Postby twaller » Tue Oct 26, 2010 4:04 pm

Hallo Jana,

In addition to your component Java code, the plugin.xml file, you also need to create another xml file, which serves to integrate the component into CloverETL Designer.

(For more details see the following link:http://www.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs_custom_component/integrating-component-into-designer.html)

There is a description of the contents of the "customcomponent.xml" file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

  <ETLComponentList>

    <ETLComponent
        category="Custom"
        className="org.company.gui.components.NewComponent"
        name="AnyVisibleLabel"
        type="NEW_COMPONENT"
        iconPath=
            "platform:/plugin/org.company.gui.components/icons/32.png"
        smallIconPath=
            "platform:/plugin/org.company.gui.components/icons/16.png">

        <shortDescription>Short description.</shortDescription>
        <description>Description.</description>

        <inputPorts>
            <singlePort name="0" required="true" />
        </inputPorts>
        <outputPorts>
            <multiplePort required="true" />
        </outputPorts>

        <properties>
            <property
                category="basic"
                displayName="Delay"
                modifiable="true"
                name="delay"
                nullable="false"
                required="true">
                <singleType name="int"/>
            </property>
        </properties>

    </ETLComponent>

</ETLComponentList>


You need to go to Window->Preferences, expand the CloverETL category and click the Components item.

After that, locate this customcomponents.xml file using the Browse button, click Import and OK.

After restarting CloverETL Designer, the component will be displayed in Palette of Components within specified category with specified icons, label, etc.

Best regards,

Tomas Waller
Tomas Waller
Javlin, a.s.
wallert@mail.javlin.cz

jkad

Re: Custom component as plugin for Clover ETl Designer

Postby jkad » Tue Nov 09, 2010 2:34 pm

Hello,

sorry to bother you again, but I am not able to find the problem, why my new component does not work. I have the component in the palette, but when I run the graph, it ends with an error.

The failure occurs:
ERROR [main] - Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent...
(The whole Exception Message is down.)

I changed the plugin.xml in the folder C:\Program Files\CloverETL Designer\plugins\com.cloveretl.gui_2.9.7\lib\plugins\org.jetel.component

What have I forgotten? There is something about the ComponentFactory, but I don't know what to change and where.

Thanks
Jana






There is information from the Console, if it is needed (I wanted to add it as the txt file, but extension txt is not supported):

ERROR [main] - Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent
at org.jetel.plugin.PluginClassLoader.findClassInPrerequisities(PluginClassLoader.java:119)
at org.jetel.plugin.PluginClassLoader.findClass(PluginClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:104)
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:126)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:476)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:439)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:354)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:284)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:213)
at org.jetel.main.runGraph.main(runGraph.java:334)
Exception in thread "main" java.lang.RuntimeException: Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:108)
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:126)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:476)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:439)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:354)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:284)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:213)
at org.jetel.main.runGraph.main(runGraph.java:334)
Caused by: java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent
at org.jetel.plugin.PluginClassLoader.findClassInPrerequisities(PluginClassLoader.java:119)
at org.jetel.plugin.PluginClassLoader.findClass(PluginClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:104)
... 7 more

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Re: Custom component as plugin for Clover ETl Designer

Postby avackova » Tue Nov 09, 2010 4:08 pm

Hello Jana,
check if your plugin is loaded and if you have correct path in your plugin.xml file. Similar problem was resolved in Custom component and 3.0.0 release topic.
Agata Vackova

Javlin a.s.

agata.vackova@javlin.eu

jkad

Re: Custom component as plugin for Clover ETl Designer

Postby jkad » Wed Nov 10, 2010 3:00 pm

Hello,

I have done everything again according the docs, which is included in my edition of CloverETL Designer.

The first capture is about doing plugin into the Engine.
I copied the the org.company.components folder into the folder:
C:\Program Files\CloverETL Designer\plugins\com.cloveretl.gui_2.9.7\lib\plugins
1) Is it in the right folder?

There are files plugin.xml and the customcomponent.xml in this project
2) I have imported the customcomponent.xml, like it is written above, but the plugin.xml I was not able to import. I think it is necessary to give some connections between the component and plugin.xml, but I don't know how. The plugin is exactly the same as in the manual.


3) I think, the my plugin.xml is not well loaded. Where can I find out, if my plugin.xml is loaded?
In the console (and in the log too) there is only information about loading the plugin org.company.components:
DEBUG [main] - Plugin org.company.components loaded.
id - org.company.components
version - 1.0.0
provider-name - null
component { className = org.company.components.NewComponent; type = NEW_COMPONENT; }

4) I see the component in the Palette, I can use it, but it does not have the icon, just only red square.

5) When I run the graph (only one UniversalDataReader, my component and UniversalDataWriter), it does not end, The UniversalDataWriter is still running, the other components not. I tried it with different writers, but the result was the same, it is cycling. But any error message doesn't occur.

Where did I missunderstand? I think I need the punctual description please. And can you write me the meaning of the plugin.xml file too?
Jana

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Re: Custom component as plugin for Clover ETl Designer

Postby avackova » Thu Nov 11, 2010 10:00 am

Hello Jana,
it seems, that your plug-in is loaded and the component works, but doesn't inform the downstream component, that it has finished processing.
Usually the execute method looks like follows:

Code: Select all

public Result execute() throws Exception {
           DataRecord outRecord = new DataRecord(getOutputPort(OUTPUT_PORT).getMetadata());
           outRecord.init();
           DataRecord inRecord = new DataRecord(getOutputPort(INPUT_PORT).getMetadata());
           inRecord.init();

           while ((inRecord = readRecord(INPUT_PORT, inRecord)) != null && runIt) {
                //process your input record into the output one
           }
      
           broadcastEOF();
           return runIt ? Result.FINISHED_OK : Result.ABORTED;
}


Check if you for sure returns Result.FINISHED_OK, Result.ABORTED, Result.ERROR or throw an exception.
Agata Vackova

Javlin a.s.

agata.vackova@javlin.eu

dpavlis
Posts: 180
Joined: Sat Mar 10, 2007 8:12 pm

Re: Custom component as plugin for Clover ETl Designer

Postby dpavlis » Wed Nov 13, 2013 6:07 pm

This CloverETL Blog post provides step-by-step custom component development tutorial.
David Pavlis
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com


cron