Hosting templates in modules

Any way to host/load a template object (from the project) in a SDK-developed module?
Unfortunately i don’t see template-related classes in the javadocs :frowning:
Thanks

Hi Mario,
This is how we do it. We store the templates to a proj file, and import with the following one liner

new ProjectImporter(context, Project.fromXML(getClass().getResourceAsStream("templates.proj"))).open()

That should do it!

uh,
very interesting.
is “templates.proj” the gateway file path of the project file?
once loaded, how can i draw a template holder in a vision client module? this is the main question.
i didn’t find in the SDK manual or in the javadocs any possibility to do this.
thank you!

Sorry for my delayed response. This code would have to run in the designer. Typically, we would have this code inside a called, as an example, system.ctg.install().

This will do some code, and when the snippet I supplied is executed, it will pop up the import window in the designer.

Hello Kyle,
I’m also intersted in marioquark’s question. Next my tests: started with the HelloWorldComponent included in the SDK example - it works pretty good! Then I asked myself: can this HelloWorldComponent instantiate, configure and bind one or more of the Templates defined in my project automatically, i.e. just by adding some lines to the HelloWorldComponent.java class provided in the SDK - e.g. like addTemplate(“xxxx”) …?

Any suggestion?

Thank you in advance, regards