Retrieve all valid freemarker fields/directives

70 views
Skip to first unread message

Shervin

unread,
Sep 15, 2011, 7:33:21 AM9/15/11
to jodreports-users
Hi.

How can I simply get out all freemarker fields/directives?
Or all possible fields jodreports support?

The directives are not imporant though.

Ansgar Konermann

unread,
Sep 15, 2011, 3:40:13 PM9/15/11
to jodrepor...@googlegroups.com
To be honest: I'd be glad to help you, but I can't make sense of your
problem statement. Could you explain a bit more detailed what you're
trying to accomplish? Can you give an example?

Best

Ansgar


Shervin Asgari

unread,
Sep 16, 2011, 2:45:48 AM9/16/11
to jodrepor...@googlegroups.com
Hi.

Sure, sorry if I was unclear.
In the documentation I read that you can insert simple fields or directives.
http://jodreports.sourceforge.net/?q=node/24

You can also in OpenOffice.org Writer insert a visual field from the menu Insert / Fields / Other... (or just press Ctrl+F2) (reference to my previous email)

Now what I was wondering was, how you could easily get out all those fields. Freemarker directives are not that important really. I am mostly looking to get out the fields.

What we are building, is a system where admins can upload template for users. However, I would want somehow to test the templates and give some feedback to the admins before the users start using the templates.

Its difficult to "try" the templates the admins are creating, because its based on the users runtime objects, which the admins sort of have no permission to view. However, I was thinking of maybe creating mock objects which could act as the same way for admins, so that they can at least try to run createDocument and see the output to see if they are happy with how the template will look. And maybe detect errors before the user is using the templates.

Regards Shervin

Ansgar Konermann

unread,
Sep 16, 2011, 4:47:37 PM9/16/11
to jodrepor...@googlegroups.com
Am 16.09.2011 08:45, schrieb Shervin Asgari:
Hi.

Sure, sorry if I was unclear.
In the documentation I read that you can insert simple fields or directives.
http://jodreports.sourceforge.net/?q=node/24

You can also in OpenOffice.org Writer insert a visual field from the menu Insert / Fields / Other... (or just press Ctrl+F2) (reference to my previous email)

Now what I was wondering was, how you could easily get out all those fields. Freemarker directives are not that important really. I am mostly looking to get out the fields.

What we are building, is a system where admins can upload template for users. However, I would want somehow to test the templates and give some feedback to the admins before the users start using the templates.

Its difficult to "try" the templates the admins are creating, because its based on the users runtime objects, which the admins sort of have no permission to view. However, I was thinking of maybe creating mock objects which could act as the same way for admins, so that they can at least try to run createDocument and see the output to see if they are happy with how the template will look. And maybe detect errors before the user is using the templates.

Creating mock objects for testing is certainly appropriate to test templates. I'd suggest you document the data model you expect the admins to use when creating their templates, maybe even provide them with a JAR file and some javadoc.

You could also write a tiny, command line based test driver which does nothing more than create one full data model and feed it into the template given on the command line. Give this test driver to your admins and tell them their templates must generate successfully using this test driver.

There's one assumption in my suggestions though: all the templates use the same data model (if this is not the case, things get a bit more complicated: each admin has to get his own data model and test driver).

Hope this helps a bit.

Regards

Ansgar
Reply all
Reply to author
Forward
0 new messages