You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jason Harrop <jh...@gmail.com> on 2012/11/08 02:54:50 UTC

post 1.1 config changes

I maintain the docx4j project

I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which
was apparently fixed in July, but didn't make it into FOP 1.1 (just
released).

So, I thought I'd test a FOP nightly (20121107) to verify it has been fixed.

But config seems to have changed extensively post 1.1

Post 1.1, I can see FopFactoryBuilder, mentioned at
http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which
contains

    public FopFactoryBuilder setConfiguration(Configuration cfg) {
        fopFactoryConfigBuilder.setConfiguration(cfg);
        return this;
    }

but that class didn't make it into 1.1 (it has FopFactoryConfigurator)

So, Is it feasible/sensible to try to be interchangeable between FOP 1.1
and whatever is to come?  Has someone written code which facilitates this?

Please excuse if there are posts on this topic already.

thanks .. Jason

Re: post 1.1 config changes

Posted by Jason Harrop <jh...@gmail.com>.
Hi Mehdi

I wrote some code today which can be used to configure FOP 1.1 or current
SVN head.

I noticed FopConfParser doesn't have a constructor which takes a
Configuration object, so existing user/client code which produces a
Configuration has to convert that to an InputStream for FopConfParser, or
be refactored.

Any reason not to add suitable constructors, like so:

Index: src/java/org/apache/fop/apps/FopConfParser.java
===================================================================
--- src/java/org/apache/fop/apps/FopConfParser.java (revision 1469684)
+++ src/java/org/apache/fop/apps/FopConfParser.java (working copy)
@@ -82,6 +82,25 @@
         configure(enviro.getDefaultBaseURI(),
enviro.getResourceResolver(), cfg);
     }

+ public FopConfParser(Configuration cfg, URI defaultBaseURI)
+ throws SAXException, IOException {
+ this(cfg, defaultBaseURI, ResourceResolverFactory
+ .createDefaultResourceResolver());
+ }
+
+    public FopConfParser(Configuration cfg, URI defaultBaseURI,
+            ResourceResolver resourceResolver) throws SAXException,
IOException {
+        this(cfg,
EnvironmentalProfileFactory.createDefault(defaultBaseURI,
resourceResolver));
+    }
+
+    public FopConfParser(Configuration cfg, EnvironmentProfile enviro)
+            throws SAXException, IOException {
+
+        // The default base URI is taken from the directory in which the
fopConf resides
+        fopFactoryBuilder = new
FopFactoryBuilder(enviro).setConfiguration(cfg);
+        configure(enviro.getDefaultBaseURI(),
enviro.getResourceResolver(), cfg);
+    }
+

cheers .. Jason


On Thu, Nov 8, 2012 at 8:56 PM, Mehdi Houshmand <me...@gmail.com> wrote:

> Hi Jason,
>
> I don't think anyone has, or if they have, they haven't published it to
> the community.
>
> Hope that helps,
>
> Mehdi
>
>
> On 8 November 2012 09:53, Jason Harrop <jh...@gmail.com> wrote:
>
>> Hi Mehdi
>>
>> Thanks for your reply.  I'm happy I can write configuration code for
>> current SVN head.  But my question is whether anyone has produced/shared
>> configuration code which works with both current SVN head, and FOP 1.1 ie
>> using reflection as necessary.
>>
>> If not, we may just wait for the next release of FOP, and support only
>> that.
>>
>> thanks .. Jason
>>
>>
>>
>> On Thu, Nov 8, 2012 at 8:44 PM, Mehdi Houshmand <me...@gmail.com>wrote:
>>
>>> Hi Jason,
>>>
>>> The backwards incompatibility of this API has been discussed quite a
>>> lot, and I'm sorry you're having these issues. If you're looking for
>>> examples for how to configure the new FopFactory, I'd say look in the
>>> source [1], there are plenty of examples on how to do it, there's also
>>> quite a bit of information on the wiki [2].
>>>
>>> Sorry for the inconvenience,
>>>
>>> Mehdi
>>>
>>> [1]
>>> http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/
>>> [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration
>>>
>>>
>>> On 8 November 2012 01:54, Jason Harrop <jh...@gmail.com> wrote:
>>>
>>>> I maintain the docx4j project
>>>>
>>>> I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which
>>>> was apparently fixed in July, but didn't make it into FOP 1.1 (just
>>>> released).
>>>>
>>>> So, I thought I'd test a FOP nightly (20121107) to verify it has been
>>>> fixed.
>>>>
>>>> But config seems to have changed extensively post 1.1
>>>>
>>>> Post 1.1, I can see FopFactoryBuilder, mentioned at
>>>> http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which
>>>> contains
>>>>
>>>>     public FopFactoryBuilder setConfiguration(Configuration cfg) {
>>>>         fopFactoryConfigBuilder.setConfiguration(cfg);
>>>>         return this;
>>>>     }
>>>>
>>>> but that class didn't make it into 1.1 (it has FopFactoryConfigurator)
>>>>
>>>> So, Is it feasible/sensible to try to be interchangeable between FOP
>>>> 1.1 and whatever is to come?  Has someone written code which facilitates
>>>> this?
>>>>
>>>> Please excuse if there are posts on this topic already.
>>>>
>>>> thanks .. Jason
>>>>
>>>>
>>>>
>>>
>>
>

Re: post 1.1 config changes

Posted by Mehdi Houshmand <me...@gmail.com>.
Hi Jason,

I don't think anyone has, or if they have, they haven't published it to the
community.

Hope that helps,

Mehdi


On 8 November 2012 09:53, Jason Harrop <jh...@gmail.com> wrote:

> Hi Mehdi
>
> Thanks for your reply.  I'm happy I can write configuration code for
> current SVN head.  But my question is whether anyone has produced/shared
> configuration code which works with both current SVN head, and FOP 1.1 ie
> using reflection as necessary.
>
> If not, we may just wait for the next release of FOP, and support only
> that.
>
> thanks .. Jason
>
>
>
> On Thu, Nov 8, 2012 at 8:44 PM, Mehdi Houshmand <me...@gmail.com> wrote:
>
>> Hi Jason,
>>
>> The backwards incompatibility of this API has been discussed quite a lot,
>> and I'm sorry you're having these issues. If you're looking for examples
>> for how to configure the new FopFactory, I'd say look in the source [1],
>> there are plenty of examples on how to do it, there's also quite a bit of
>> information on the wiki [2].
>>
>> Sorry for the inconvenience,
>>
>> Mehdi
>>
>> [1]
>> http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/
>> [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration
>>
>>
>> On 8 November 2012 01:54, Jason Harrop <jh...@gmail.com> wrote:
>>
>>> I maintain the docx4j project
>>>
>>> I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which
>>> was apparently fixed in July, but didn't make it into FOP 1.1 (just
>>> released).
>>>
>>> So, I thought I'd test a FOP nightly (20121107) to verify it has been
>>> fixed.
>>>
>>> But config seems to have changed extensively post 1.1
>>>
>>> Post 1.1, I can see FopFactoryBuilder, mentioned at
>>> http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which
>>> contains
>>>
>>>     public FopFactoryBuilder setConfiguration(Configuration cfg) {
>>>         fopFactoryConfigBuilder.setConfiguration(cfg);
>>>         return this;
>>>     }
>>>
>>> but that class didn't make it into 1.1 (it has FopFactoryConfigurator)
>>>
>>> So, Is it feasible/sensible to try to be interchangeable between FOP 1.1
>>> and whatever is to come?  Has someone written code which facilitates this?
>>>
>>> Please excuse if there are posts on this topic already.
>>>
>>> thanks .. Jason
>>>
>>>
>>>
>>
>

Re: post 1.1 config changes

Posted by Jason Harrop <jh...@gmail.com>.
Hi Mehdi

Thanks for your reply.  I'm happy I can write configuration code for
current SVN head.  But my question is whether anyone has produced/shared
configuration code which works with both current SVN head, and FOP 1.1 ie
using reflection as necessary.

If not, we may just wait for the next release of FOP, and support only that.

thanks .. Jason


On Thu, Nov 8, 2012 at 8:44 PM, Mehdi Houshmand <me...@gmail.com> wrote:

> Hi Jason,
>
> The backwards incompatibility of this API has been discussed quite a lot,
> and I'm sorry you're having these issues. If you're looking for examples
> for how to configure the new FopFactory, I'd say look in the source [1],
> there are plenty of examples on how to do it, there's also quite a bit of
> information on the wiki [2].
>
> Sorry for the inconvenience,
>
> Mehdi
>
> [1]
> http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/
> [2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration
>
>
> On 8 November 2012 01:54, Jason Harrop <jh...@gmail.com> wrote:
>
>> I maintain the docx4j project
>>
>> I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which
>> was apparently fixed in July, but didn't make it into FOP 1.1 (just
>> released).
>>
>> So, I thought I'd test a FOP nightly (20121107) to verify it has been
>> fixed.
>>
>> But config seems to have changed extensively post 1.1
>>
>> Post 1.1, I can see FopFactoryBuilder, mentioned at
>> http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which
>> contains
>>
>>     public FopFactoryBuilder setConfiguration(Configuration cfg) {
>>         fopFactoryConfigBuilder.setConfiguration(cfg);
>>         return this;
>>     }
>>
>> but that class didn't make it into 1.1 (it has FopFactoryConfigurator)
>>
>> So, Is it feasible/sensible to try to be interchangeable between FOP 1.1
>> and whatever is to come?  Has someone written code which facilitates this?
>>
>> Please excuse if there are posts on this topic already.
>>
>> thanks .. Jason
>>
>>
>>
>

Re: post 1.1 config changes

Posted by Mehdi Houshmand <me...@gmail.com>.
Hi Jason,

The backwards incompatibility of this API has been discussed quite a lot,
and I'm sorry you're having these issues. If you're looking for examples
for how to configure the new FopFactory, I'd say look in the source [1],
there are plenty of examples on how to do it, there's also quite a bit of
information on the wiki [2].

Sorry for the inconvenience,

Mehdi

[1]
http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/
[2] http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration


On 8 November 2012 01:54, Jason Harrop <jh...@gmail.com> wrote:

> I maintain the docx4j project
>
> I reported https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 which
> was apparently fixed in July, but didn't make it into FOP 1.1 (just
> released).
>
> So, I thought I'd test a FOP nightly (20121107) to verify it has been
> fixed.
>
> But config seems to have changed extensively post 1.1
>
> Post 1.1, I can see FopFactoryBuilder, mentioned at
> http://wiki.apache.org/xmlgraphics-fop/FopFactoryConfiguration which
> contains
>
>     public FopFactoryBuilder setConfiguration(Configuration cfg) {
>         fopFactoryConfigBuilder.setConfiguration(cfg);
>         return this;
>     }
>
> but that class didn't make it into 1.1 (it has FopFactoryConfigurator)
>
> So, Is it feasible/sensible to try to be interchangeable between FOP 1.1
> and whatever is to come?  Has someone written code which facilitates this?
>
> Please excuse if there are posts on this topic already.
>
> thanks .. Jason
>
>
>