Closed GoogleCodeExporter closed 8 years ago
Sorry I am wrong I have modified Developer Class
Original comment by orhu...@gmail.com
on 9 Mar 2012 at 9:01
Hi orhunyz,
There is a bug with FieldsMetadataClassSerializer which computes FieldsMetadata
from Java class
(Developer#getProjecttest()).
This bug must be resolved. To avoid this bug (for the moment) you can fill
fieldsmetada at hand like this :
--------------------------------------------------------------
FieldsMetadata metadata. = report.createFieldsMetadata();
metadata.addFieldAsList("developers.Name");
metadata.addFieldAsList("developers.LastName");
metadata.addFieldAsList("developers.Mail");
metadata.addFieldAsList("developers.Projecttest.Name");
--------------------------------------------------------------
Regards Angelo
Original comment by angelo.z...@gmail.com
on 9 Mar 2012 at 9:07
it solves my problem thanks a lot for your helps
Original comment by orhu...@gmail.com
on 9 Mar 2012 at 11:10
sorry for my questions :)
if I change Project definition to List<Project> in Developer Class how can
I use?
2012/3/9 orhun y�lmaz <orhunyz@gmail.com>
Original comment by orhu...@gmail.com
on 9 Mar 2012 at 12:11
That's it's a good question. You cannot use that for FieldsMetada. FieldsMetada
manage simple case when you have a list (list of pojo) and not with complex
graph list of pojo of list of...
But I'm not sure that's interesting because if you have :
developers.Projects.Name field you must set a start list between developers and
Projects.
FieldsMetada is used for both thing :
* manage lazy loop in table.
* generate fields.xml for MS Macro/OOo extension to help you to design the report.
So the goal is tu use FieldsMetada when it's possible to have those features.
If you cannot use it you can use @before-row/@after-row (see
http://code.google.com/p/xdocreport/wiki/DocxReportingJavaMainListFieldAdvancedT
able).
But for your case, I will do like this :
1) FieldsMetadata
FieldsMetadata metadata. = report.createFieldsMetadata();
metadata.addFieldAsList("projects.Name");
where "projects" key is computed in the docx report with #set. :
-----------------------------------------
#foreach($d in $developers)
#set($projects = $d.Projecttest)
Here you insert the mergefield in a table :
$projects.Name
#end
-----------------------------------------
Regards Angelo
Original comment by angelo.z...@gmail.com
on 9 Mar 2012 at 1:36
Gotcha :
I found the problem
line 140 of "AbstractFieldsMetadataClassSerializer"
was
process( fieldsMetadata, fieldName, clazz, listType );
changed to
process( fieldsMetadata, fieldName, returnTypeClass, listType );
the previous code result in a infinite loop that end up with a OutOfMermoyError.
Original comment by pascal.leclercq
on 13 Mar 2012 at 8:47
Many thanks Pascal.
Could you add it this issue on the features at
http://code.google.com/p/xdocreport/wiki/XDocReport097
Thanks.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 13 Mar 2012 at 9:05
Hi Pascal,
I found another problem if you use complex model it has class which is
using at subclass it gives out of memory error :D it is recursively call
upper class
for example Developer has Project and Project has Developer. it maybe
silly example but if you want to use hibernate class it can be usefull this
type of variable definitions
if AbstractFieldsMetadataClassSerializer.process function has
classDeepLevel properties it will solve this type exceptions
Original comment by orhu...@gmail.com
on 12 Jun 2012 at 10:22
Hi Pascal,
Sorry, it is not required because xDocReport 0.9.8 it solves this problem.
Original comment by orhu...@gmail.com
on 15 Jun 2012 at 5:43
Hi,
>I'm a bit afraid of side effect but so far all the tests passes.
I'm afraid too when you tell that. Hope I had done enough JUnit.
>I'm thinking of using JAXB marshalled/unmarshaller instead besides the
fields.xml >form.
Yes Pascal it's a good idea : having XSD instead of XML fields. But the big big
problem is about the XDocReport OXT and MS Macro which consumes today XML
fields. Parsing XML is more easy than XSD. Parsing XSD can be very complex (ex:
<xs:include, complex XSD, etc...). I'm afraid with that.
>This would make huge changes in xdocreport but so far I think this would cover
all >of our uses cases and this would rely on open standards.
I agree with that, but I think we should dupport the both (XML fields or XSD).
I think before developping this XSD feature you should develop the OXT and MS
Macro which consumes XSD to populate the treeview and I hope you will have no
trouble with that. I would like avoid that you develop XSD feature for nothing
(XML fields are used for OXT+MS Macro).
More I don't know how you will manage the key of the field name.
For instance if you have
------------------------------
Project p = new Project();
context.put("p", p);
------------------------------
You will have XML fields like this (for Velocity):
------------------------------
<field name="p.Name" />
------------------------------
You will have XML fields like this (for Freemarker):
------------------------------
<field name="p.name" />
------------------------------
DO you think it's possible with JAXB?
Regards Angelo
Original comment by angelo.z...@gmail.com
on 15 Jun 2012 at 7:12
Original issue reported on code.google.com by
orhu...@gmail.com
on 9 Mar 2012 at 8:48Attachments: