Bug 53400

Summary: [PATCH] new ODT render
Product: Fop - Now in Jira Reporter: Marek Jagielski <marek.jagielski>
Component: generalAssignee: fop-dev
Status: NEW ---    
Severity: enhancement CC: patches
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: PATCH for ODT render
PATCH for ODT render
Image for tests
Output of the tests - *.odt
PATCH for ODT render
PATCH for ODT render
Documentation : Implementation State of patch
PATCH for ODT render
Documentation : Class Diagramm
PATCH for ODT render
Documentation : Implementation State of patch
Documentation : Class Diagram
PATCH for ODT render
PATCH for ODT render
PATCH for ODT render

Description Marek Jagielski 2012-06-11 23:40:13 UTC
Created attachment 28913 [details]
PATCH for ODT render

Hi,
I integrated the new render into my local checkout of FOP's trunk.
From the list gave by Glenn:

    (+) I provided some tests that basic implemented functionalties.
    (+/-) org.apache.fop.cli.CommandLineOptions were extended to execute odt rendering incuding info. I didn't need to change fop.sh to make it run. I don't know if there is something to do (as well in js)
To try, please do: 
            fop foo.fo -odt foo.odt
    (+) I added the documentation in:
            * src/documentation/content/xdocs/trunk/output.xml
            * src/documentation/content/xdocs/trunk/running.xml
    (+) run 'ant checkstyle', and fix all warnings found in build/report_checkstyle.htm
    (+/-) run 'ant findbugs', and fix all warnings found in build/report_findbugs.html (due to odt render) Still left one:
rg.apache.fop.render.odf.ODTFOEventHandlerMaker.getSupportedMimeTypes() may expose internal representation by returning ODTFOEventHandlerMaker.MIMES but I don't undestand its porpuse.
    (+) run 'ant javadocs', and fix any warnings that I have introduced
    (+) I have sent the ICLA to secretary@apache.org
    (+) I created the patch. 

Regards,

Marek
Comment 1 Glenn Adams 2012-06-13 21:25:08 UTC
(In reply to comment #0)
> Created attachment 28913 [details]
> PATCH for ODT render

I'm not sure which tool you used to create the patch file, but I am having difficulty applying it due to the presence of binary data (*.odt files) in the diff. Could you separate out any binary files to be added into a separate TGZ file separately attached?

Also, I see that you patch adds a number of ODF libraries to the runtime libs required to run FOP. Although these are coming from an ASF incubator project [1], a vote will have to be taken on creating this new dependency in FOP. You should also supply the required versions of the JAR files containing these new libraries in the TGZ attachment described above.

[1] http://incubator.apache.org/projects/odftoolkit.html
Comment 2 Marek Jagielski 2012-06-14 09:31:43 UTC
Created attachment 28941 [details]
PATCH for ODT render
Comment 3 Marek Jagielski 2012-06-14 09:39:44 UTC
I used eclipse envirement with its plugins.The odt files aren't realy necesairy as they are only the outputs of test fo-files. I am putting now diff files without odt-files included made with command line svn.

For odt generation I have used :
 + odfdom-java-0.8.7.jar
 + simply-odf-0.6.6.jar

Odfdom, it was what I have found the simplest and that is licence compatible to fop. Odfdom is really low level api but it was advantage for me that odt render is a transformation of one xml (fo) to another (.odt).

For the simple-odf I am not glad. I started to develop from this, as I was beginner in fop and odt. However, during development I was constantly removing dependencies of its api as I found that odfdom is sufficient. Simply-odf is still used for Paragraph abstraction but I hope to refactor this to have everything on xml tags abstraction. So simply-odf is for me a temporary dependence.
 
To this comment I attache :
 + odt_render_without_bin.path : contains only *.java, *.fo
 + img.jpg : file to test should be in ./fop/test/odf/odt/fo_external_grphic/img.jpg (but it is find by google, so I don't know about the rights to use it, this file can be change by any)
 + odt_outputs.tgz : contains *.odt (names are appropriate to *.fo input files)
 + odt_libraries.tgz : contains odfdom-java-0.8.7.jar, simply-odf-0.6.6.jar

Marek(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 28913 [details]
> > PATCH for ODT render
> 
> I'm not sure which tool you used to create the patch file, but I am having
> difficulty applying it due to the presence of binary data (*.odt files) in
> the diff. Could you separate out any binary files to be added into a
> separate TGZ file separately attached?
> 
> Also, I see that you patch adds a number of ODF libraries to the runtime
> libs required to run FOP. Although these are coming from an ASF incubator
> project [1], a vote will have to be taken on creating this new dependency in
> FOP. You should also supply the required versions of the JAR files
> containing these new libraries in the TGZ attachment described above.
> 
> [1] http://incubator.apache.org/projects/odftoolkit.html
Comment 4 Marek Jagielski 2012-06-14 09:42:17 UTC
Created attachment 28942 [details]
Image for tests
Comment 5 Marek Jagielski 2012-06-14 10:08:31 UTC
Created attachment 28943 [details]
Output of the tests  - *.odt
Comment 6 Marek Jagielski 2012-06-14 10:13:18 UTC
ODT liraries please find here:

https://docs.google.com/open?id=0Bxy7yhoOWhbidXdPeGRiMGxaUUk
Comment 7 Glenn Adams 2012-06-14 18:52:49 UTC
(In reply to comment #3)
> For the simple-odf I am not glad. I started to develop from this, as I was
> beginner in fop and odt. However, during development I was constantly
> removing dependencies of its api as I found that odfdom is sufficient.
> Simply-odf is still used for Paragraph abstraction but I hope to refactor
> this to have everything on xml tags abstraction. So simply-odf is for me a
> temporary dependence.

I will wait until you finish eliminating the simple-odf dependency before further considering this patch. Please submit a new patch when you have done that.
Comment 8 Marek Jagielski 2012-06-20 16:52:17 UTC
Created attachment 28972 [details]
PATCH for ODT render

I removed all references to simply-odf.
Comment 9 Marek Jagielski 2012-06-20 16:53:35 UTC
I removed all references to simply-odf.
Comment 10 Marek Jagielski 2012-07-10 14:06:18 UTC
Created attachment 29044 [details]
PATCH for ODT render

Some corrections and synchronization with trunk.
Comment 11 Marek Jagielski 2012-08-25 13:50:44 UTC
Created attachment 29279 [details]
Documentation : Implementation State of patch

According to spec http://www.w3.org/TR/xsl11/ I summarize the implementation state of attached patch.

Gray : attribute not aplicable;
Gray Light : conffusion in spec, probably applicable
X : attribute applicable;
Green : functionality implemented;
Comment 12 Marek Jagielski 2012-08-25 14:21:33 UTC
Hi,
 After looking into spec, I realized that I have implemented Font Properties for fo:basic-link (by the fop api) that isn't the part of specification.
Why we can retrvie these informations from object model?
Marek
Comment 13 Marek Jagielski 2012-09-07 02:52:10 UTC
Created attachment 29338 [details]
PATCH for ODT render

Huge refactoring  of "Styles". The reference implementation is BlockTag with "fonts" properties. The other code should follow this pattern.
Comment 14 Marek Jagielski 2012-09-09 17:09:51 UTC
Created attachment 29346 [details]
Documentation : Class Diagramm
Comment 15 Marek Jagielski 2012-09-09 20:36:14 UTC
Created attachment 29347 [details]
PATCH for ODT render

A little bit of comments and cleaning as well as implementation of text-decoration, baseline-shift.
Comment 16 Marek Jagielski 2012-09-09 20:39:30 UTC
Created attachment 29348 [details]
Documentation : Implementation State of patch
Comment 17 Marek Jagielski 2012-09-09 20:46:26 UTC
Good source of samples :

http://www.xmlmind.com/foconverter/samples.html

Marek
Comment 18 Glenn Adams 2012-09-10 01:51:40 UTC
(In reply to comment #17)
> Good source of samples :
> 
> http://www.xmlmind.com/foconverter/samples.html

While it is useful to include documentation in a bug report, it doesn't help the community so much. I would suggest you create a wiki page at [1].

[1] http://wiki.apache.org/xmlgraphics-fop/DeveloperPages

Eventually, if ODT is to be supported, you will also need to add documentation in [2] and possibly create a new file at [3].

[2] src/documentation/content/xdocs/trunk/output.xml
[3] src/documentation/content/xdocs/trunk/odt.xml
Comment 19 Marek Jagielski 2012-09-12 23:29:25 UTC
The wiki page available at:
http://wiki.apache.org/xmlgraphics-fop/ODT_render
Comment 20 Marek Jagielski 2012-09-24 10:06:27 UTC
Created attachment 29413 [details]
Documentation : Class Diagram
Comment 21 Marek Jagielski 2012-10-04 21:53:33 UTC
Created attachment 29448 [details]
PATCH for ODT render

Small refactoring. BackgroundColor property shows how to create different implementations of property for different tags.
Comment 22 Marek Jagielski 2012-10-06 00:25:06 UTC
Created attachment 29451 [details]
PATCH for ODT render

Bord and padding
Comment 23 Marek Jagielski 2012-10-06 13:21:16 UTC
Created attachment 29452 [details]
PATCH for ODT render

Refactoring, TagFactory Enhancement, PageSequence correction (Exception).