Hi all,
I've a problem with the RhinoFileTemplate class.
Paragraph showing or hiding doesn't seem to work with this template on
jdk1.5.
I've tried different release of JOpenDocument (1.1, 1.1-jdk5, 1.2, 1.2-
jdk5...) but the paragraph is never shown with the RhinoFileTemplate
wheras there is not problem with JavascriptFileTemplate and jdk1.6.
My code is quite simple, it's the same as in TestTemplate from the src
release, I've just replaced hideParagraph by showParagraph. I didn't
modified the template file "test.odt", it's the one packaged with the
sources.
The code :
File templateFile = new File("test.odt");
File outFile = new File("out.odt");
// Load the template.
RhinoFileTemplate template = new
RhinoFileTemplate(templateFile);
// Fill with sample values.
template.setField("toto", "value set using setField()");
final List<Map<String, String>> months = new
ArrayList<Map<String, String>>();
months.add(createMap("January", "-12", "3"));
months.add(createMap("February", "-8", "5"));
months.add(createMap("March", "-5", "12"));
months.add(createMap("April", "-1", "15"));
months.add(createMap("May", "3", "21"));
template.setField("months", months);
template.showParagraph("p1");
// Save to file.
template.saveAs(outFile);
// Open the document with OpenOffice.org !
OOUtils.open(outFile);
I've seen on this topic
http://groups.google.com/group/jopendocument/browse_thread/thread/867cd12e742aec4/b77b7dfabb4902e5?lnk=gst&q=rhinofiletemplate#b77b7dfabb4902e5,
that someone had the same problem...
Is there any solution or work around ? An easy way to override
RhinoFileTemplate maybe ?
Thanks in advance.