I did some minor textual tweaks based on your comments. I image elaborating a little and including an example template will make things more clear. The answers below should get you going.

The page does not describe where to get the template processor from. Quote: "you should request the service from the current context". What context? The bundle context? And if so, shouldn't it be retrieved using a service dependency? And if so, is the service registered in the PLATFORM space or in each TENANTS space?

I rephrased "current context" to "service registry". It is just a regular OSGi service so you can retrieve it in any way you like. AFAIK we do not force the use of dependencymanager on anybody. AFAIK the current implementation is non-multitenant so you must bring it into scope.

What is the purpose of the TemplateContext?

It holds the model against which the template is processed.

The VelocityBean in the example seems to come from itest package? And what does it do?

It's just a Java bean. I renamed it to ExampleBean to avoid further confusion. It just shows you can use beans to build a more complex model to let velocity evaluate the template against.

In my case I have a container.js file, which holds placeholders for configuration entries retrieved from config admin (i.e. $

Unknown macro: {org.amdatu.opensocial.shindig/workdir}
) and system properties (i.e. $
Unknown macro: {system/amdatu.contextpath}
). These placeholders should be replaced at runtime and written to file on disk. How should I do that?

You are responsible for building up the context and deciding when to (regenerate) a template (see [0] for background on why). In this case you should probably monitor the relevant configurations yourself. When anything changes, build a context and regenerate the template by calling your favorite TemplateProcessor.generateX method.

[0] http://www.amdatu.org/confluence/display/Amdatu/Template+config

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers

Reply via email to