vs72737 / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Could not find template in cache #414

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I just want to write a simple example but it don't work

BasicConfigurator.configure();
Chapter chapter = new Chapter("Test", "Test1");
InputStream in = new FileInputStream("template.docx");
            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in,
                    TemplateEngineKind.Freemarker);
            IContext context = report.createContext();
            context.put("chapter", chapter);
            OutputStream out = new FileOutputStream(new File("out.docx"));
            report.process(context, out);

What is the expected output? What do you see instead?

0 [main] DEBUG freemarker.cache  - Could not find template in cache, creating 
new one; 
id=["fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/document.xm
l"["en_US",UTF-8,parsed] ]
4 [main] DEBUG freemarker.cache  - Compiling FreeMarker template 
"fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/document.xml"["
en_US",UTF-8,parsed]  from 
"fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@504be958"
256 [main] DEBUG freemarker.cache  - Could not find template in cache, creating 
new one; 
id=["fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/styles.xml"
["en_US",UTF-8,parsed] ]
256 [main] DEBUG freemarker.cache  - Compiling FreeMarker template 
"fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/styles.xml"["en
_US",UTF-8,parsed]  from 
"fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@2f5ca208"
344 [main] DEBUG freemarker.cache  - Could not find template in cache, creating 
new one; 
id=["fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/_rels/docum
ent.xml.rels"["en_US",UTF-8,parsed] ]
345 [main] DEBUG freemarker.cache  - Compiling FreeMarker template 
"fr.opensagres.xdocreport.document.docx.DocxReport@1a3ae8ac!word/_rels/document.
xml.rels"["en_US",UTF-8,parsed]  from 
"fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@13bca8e2"

What version of the product are you using? On what operating system?

- Lastet
- Windows7

Please provide any additional information below.

Original issue reported on code.google.com by phongdt...@gmail.com on 28 Jun 2014 at 6:30

Attachments:

GoogleCodeExporter commented 8 years ago
Follow the instructions in 
https://code.google.com/p/xdocreport/wiki/DocxDesignReport, i inserted 
"$chapter.title" then my program printed the above messages and out.docx has  
got unexpected content.
But when I entered "${chapter.title}", although this printed same message but 
file output contains has my wished values.

Original comment by phongdt...@gmail.com on 28 Jun 2014 at 8:01

GoogleCodeExporter commented 8 years ago
> Follow the instructions in 
https://code.google.com/p/xdocreport/wiki/DocxDesignReport,

This explanation uses Velocity syntax.

You must use ${chapter.title} for Freemarker.

Is your problem is resolved?

Original comment by angelo.z...@gmail.com on 28 Jun 2014 at 5:15

GoogleCodeExporter commented 8 years ago
Thanks Angelo.

My problem is resolved. But the program always prints some messages in 
OutputStream.
I think, it may be a error or something similar, but i cannot know how to 
resolved it.

28826 [main] DEBUG freemarker.cache  - 
"fr.opensagres.xdocreport.document.docx.DocxReport@29ecc3e!word/styles.xml"["en_
US",UTF-8,parsed]  using cached since 
fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@5db75d7d 
didn't change.
28827 [main] DEBUG freemarker.cache  - 
"fr.opensagres.xdocreport.document.docx.DocxReport@29ecc3e!word/_rels/document.x
ml.rels"["en_US",UTF-8,parsed]  using cached since 
fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@26b409f4 
didn't change.

Original comment by phongdt...@gmail.com on 29 Jun 2014 at 9:11

GoogleCodeExporter commented 8 years ago
No it's not a problem. It's just a debug message of Freemarker. You should 
customize your logger (log4j?,...) to ignore debug level message of freemarker 
if you wish to disaable this message.

I close this issue.

Original comment by angelo.z...@gmail.com on 29 Jun 2014 at 9:23