[resolved] Load jar and add import to job in custom component

[resolved] Load jar and add import to job in custom component

Hi,
I want to design an custom component to load an custom jar, do standard code and add import to my job (I use my customs classes in other tJava). My objectif is put this component in all job to preset imports and jar load. I can build my component and refer to my jar but I can't found how add import in job imports section like tJava component, I want an import parameter in advanced settings and put to import class.
Someone know how do it? I look in tutorials on Net but found nothing.
Please help!

Accepted Solutions

Re: [resolved] Load jar and add import to job in custom component

Hi all,
Just to inform, parameter field MEMO_IMPORT is the way to add import.
Regards.

All Replies
Moderator

Re: [resolved] Load jar and add import to job in custom component

Hi,
Do you mean how to import and use a external jar?
There are two ways for you to export the external jar files:
1)Using tLibraryload component to load the jar file at the begininig of job. for example:
tLibraryLoad
|
tJava(on tJava, use the external API)
2)Creating custom routine, import the external jar file by clicking on the rouinte name and edting the routine libraries, and then call this routine in the job.
Is that what you need, please check and tell us the result.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: [resolved] Load jar and add import to job in custom component

Hi Sabrina,
I actually use the tLibraryLoad and tJava model in my job but I want encapsulate this in a component to just have one component to drop. I have a ot of jobs and other developpers use my jar. So with an preset component it will easier to use.
Also, I can't use an routine cause I have multiple projects in same deploiement and all projects export routine in "userroutine.jar" so I can't have more that one jar with same name.
I progress in my developpement of my component but the only think I miss is how add import in job by component like the tJava advenced setting do?
Thanks
Tousmaintertrade

Re: [resolved] Load jar and add import to job in custom component

Hi,
I re-post my question : How add import in job by component like the tJava advenced setting do?
Please help me quickly, I really need-it Smiley Happy

Re: [resolved] Load jar and add import to job in custom component

Hi all,
Just to inform, parameter field MEMO_IMPORT is the way to add import.
Regards.
Moderator

Re: [resolved] Load jar and add import to job in custom component

Hi,
Thanks for your feedback.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: [resolved] Load jar and add import to job in custom component

You can import the external jars using tLibraryLoad component or Editing Routine Libraries.
For more information visit
http://vikramtakkar.blogspot.in/2013/03/importing-external-jar-or-library-files.html
Thanks & Regards
Vikram Takkar
http://vikramtakkar.blogspot.in
One Star

Re: [resolved] Load jar and add import to job in custom component

I want my custom component to call into my very own custom JARs. How do I do that? Where do I place those JARs? How do I declare them in <CODEGENERATION.../> section of my ..._java.xml file?
Community Manager

Re: [resolved] Load jar and add import to job in custom component

Hi vshlimovich
I suggest you to refer to the official components, the source files of official components are located in <Talend Studio install dir>/plugins/org.talend.designer.components.localprovider_x.x.x.rxxxxxx\components folder.
- Put the jars in the same folder as the source files of component.
- In the ..._java.xml file, declare the jars in the <CODEGENERATION> element, for example:
 <CODEGENERATION>
<IMPORTS>
<IMPORT NAME="filecopy" MODULE="filecopy.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business