Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[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!
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

8 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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 0683p000009MACn.png
Anonymous
Not applicable
Author

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

Hi,
Thanks for your feedback.
Best regards
Sabrina
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

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