Okay, it's done:
https://issues.apache.org/jira/browse/OFBIZ-1414
Comments welcome.
-Adrian
Adrian Crum wrote:
Currently, the ApacheFopFactory class does nothing more than return a
FopFactory class instance. Looking through the project, I see a lot of
redundant code to render documents via FOP. I'd like to refactor the
ApacheFopFactory to include some helper methods that would eliminate
much of the redundant code.
Here is what I have in mind:
1. Rename ApacheFopFactory to something like ApacheFopWorker, OR create
a new class that references ApacheFopFactory.
2. Move a lot of the stream preparation and rendering code to
ApacheFopWorker.
3. Update existing OFBiz code to use the new class.
There are two things I can see being accomplished:
1. Code reduction.
2. Decouple FOP code from the multitude of classes that currently use
it. If OFBiz code only called ApacheFopWorker class methods, then the
code base would be shielded from FOP API changes. If the FOP API
changes, only the ApacheFopWorker would have to be updated.
It would be the same basic concept as the current FreeMarkerWorker class.
What do you think?
-Adrian