Closed GoogleCodeExporter closed 8 years ago
Hi ruslancusnir,
As you override the velocity.properties, it doesn't contains the XDocReport
resource loader (load a XML entry (ex : word/document.xml) from a zip
(XDocArchive)), and throw your error :
See
https://code.google.com/p/xdocreport/source/browse/template/fr.opensagres.xdocre
port.template.velocity/src/main/java/fr/opensagres/xdocreport/template/velocity/
discovery/VelocityTemplateEngineDiscovery.java
--------------------------------------------------------------------------------
velocityEngineProperties.setProperty( "report.resource.loader.class",
XDocReportEntryResourceLoader.class.getName() );
--------------------------------------------------------------------------------
To resolve your problem, you must add in the velocity.properties the line :
--------------------------------------------------------------------------------
fr.opensagres.xdocreport.template.velocity.cache.XDocReportEntryResourceLoader
--------------------------------------------------------------------------------
But perhaps it's a bad idea to test :
--------------------------------------------------
if(velocityDefaultProperties != null){
velocityEngineProperties.putAll(velocityDefaultProperties);
}else{
...
//Only if default velocity properties are not reads at velocity.properties
--------------------------------------------------
and do every time the code after the else.
Is it possible to test that?
If it works, I could commit that.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 21 Mar 2013 at 8:48
Hi Angelo,
I tested and I configured velocity.properties to use report loader. Bottom is
the part from velocity.properties which will configure velocity template engine
to load resources from xdoc resource loader:
--------------------------------------
#velocity other properties
....
#resource loader config
resource.loader=report
report.resource.loader.class=fr.opensagres.xdocreport.template.velocity.cache.XD
ocReportEntryResourceLoader
report.resource.loader.cache=true
report.resource.loader.modificationCheckInterval=1
....
#other velocity properties
-----------------------------
If it is possible, please add this somewhere to wiki with note that in this
case templates will be loaded ONLY and ONLY from xdocreport template.
Original comment by ruslancu...@gmail.com
on 21 Mar 2013 at 9:37
As I said you, I tell me it's perhaps a bad idea to test :
--------------------------------------------------
if(velocityDefaultProperties != null){
velocityEngineProperties.putAll(velocityDefaultProperties);
}else{
...
//Only if default velocity properties are not reads at velocity.properties
--------------------------------------------------
If else is removed, perhaps you could add velocity.properties without crashing
XDocReport. Could you test that please.
Original comment by angelo.z...@gmail.com
on 21 Mar 2013 at 9:42
I get you...
In this case, it is need to add XDocReport specific properties to velocity
properties.
Unfortunately I use version 1.0.0 for development, and I have no posibility to
test with version 1.0.1 because it is missing in maven, and I have no time to
reconfigure the project to use xdocreport from local repository.
A question, there are some unit test which test this?
I can create a patch which will add xdoc report specific properties and just
run test.
Original comment by ruslancu...@gmail.com
on 21 Mar 2013 at 9:46
I don't remember if we have JUnit about that.
I will try to see my idea when I will find time.
Original comment by angelo.z...@gmail.com
on 21 Mar 2013 at 10:55
Original comment by angelo.z...@gmail.com
on 18 Feb 2014 at 2:16
Original issue reported on code.google.com by
ruslancu...@gmail.com
on 21 Mar 2013 at 8:02