Discussion:
[jira] [Created] (FOP-2495) Missing migration documentation from FOP 1.x
MH (JIRA)
2015-07-02 13:23:04 UTC
Permalink
MH created FOP-2495:
-----------------------

Summary: Missing migration documentation from FOP 1.x
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker


Because of bug FOP-2177 wie couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - now deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!







--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-02 13:23:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MH updated FOP-2495:
--------------------
Description:
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - now deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!





was:
Because of bug FOP-2177 wie couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - now deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
Post by MH (JIRA)
Missing migration documentation from FOP 1.x
--------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - now deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-02 13:24:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MH updated FOP-2495:
--------------------
Description:
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!





was:
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - now deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
Post by MH (JIRA)
Missing migration documentation from FOP 1.x
--------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-02 13:26:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MH updated FOP-2495:
--------------------
Description:
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade our Java code from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!





was:
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).

Now we would like to upgrade from FOP 1.0 to FOP 2.0. The Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says "You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following: ...". The truth is completely different: starting by replacing fop.jar, our code gets dozens of compiler errors! Many methods are simply gone:

FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.

The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.

The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.

E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!

This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!

Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
Post by MH (JIRA)
Missing migration documentation from FOP 1.x
--------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-02 13:27:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MH updated FOP-2495:
--------------------
Summary: Embedding: missing migration documentation from FOP 1.x (was: Missing migration documentation from FOP 1.x)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Jess Holle (JIRA)
2015-07-02 14:39:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14612020#comment-14612020 ]

Jess Holle commented on FOP-2495:
---------------------------------

I have to concur with the original complaint here -- the level of API change from 1.1 to 2.0 without any form of migration guidance whatsoever makes migrating calling code quite challenging -- and needlessly so.

I've got all my calling code compiling and apparently working, but I'm still not actually clear that the new code is doing the equivalent things to the old code. I'm sure I missed some test cases and there's no high-level guidance as to how to safely replace calls to xx.yy() that no longer exists, etc.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-02 15:04:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14612047#comment-14612047 ]

MH commented on FOP-2495:
-------------------------

E.g. URIResolver: FOP 1.0:

FoUserAgent.setURIResolver(javax.xml.transform.URIResolver)

In FOP 2.0 (https://xmlgraphics.apache.org/fop/2.0/embedding.html):

---------
"Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example:

// myResourceResolver is a org.apache.xmlgraphics.io.ResourceResolver
FopFactoryBuilder builder = new FopFactoryBuilder(baseURI, myResourceResolver);"
------------

... but FopFactoryBuilder does not accept javax.xml.transform.URIResolver but requires a org.apache.xmlgraphics.io.ResourceResolver that is an interface ... probably org.apache.fop.apps.io.InternalResourceResolver that has no API to use a javax.xml.transform.URIResolver

Oh boy ...
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-03 14:46:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14612047#comment-14612047 ]

MH edited comment on FOP-2495 at 7/3/15 2:45 PM:
-------------------------------------------------

E.g. URIResolver: FOP 1.0:

FoUserAgent.setURIResolver(javax.xml.transform.URIResolver)

In FOP 2.0 (https://xmlgraphics.apache.org/fop/2.0/embedding.html):

---------
"Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example:

// myResourceResolver is a org.apache.xmlgraphics.io.ResourceResolver
FopFactoryBuilder builder = new FopFactoryBuilder(baseURI, myResourceResolver);"
------------

... but FopFactoryBuilder does not accept javax.xml.transform.URIResolver but requires a org.apache.xmlgraphics.io.ResourceResolver that is an interface ... probably org.apache.fop.apps.io.InternalResourceResolver that has no API to use a javax.xml.transform.URIResolver

Can you please submit an example to set an URIResolver just like

FoUserAgent.setURIResolver()

in FOP 1.0/1.1? Thank you!


was (Author: mhilpert):
E.g. URIResolver: FOP 1.0:

FoUserAgent.setURIResolver(javax.xml.transform.URIResolver)

In FOP 2.0 (https://xmlgraphics.apache.org/fop/2.0/embedding.html):

---------
"Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example:

// myResourceResolver is a org.apache.xmlgraphics.io.ResourceResolver
FopFactoryBuilder builder = new FopFactoryBuilder(baseURI, myResourceResolver);"
------------

... but FopFactoryBuilder does not accept javax.xml.transform.URIResolver but requires a org.apache.xmlgraphics.io.ResourceResolver that is an interface ... probably org.apache.fop.apps.io.InternalResourceResolver that has no API to use a javax.xml.transform.URIResolver

Oh boy ...
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-07-03 15:20:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14613246#comment-14613246 ]

simon steiner commented on FOP-2495:
------------------------------------

test/java/org/apache/fop/URIResolutionTestCase.java has a example where in fop 1.0 it uses setURIResolver and fop 2.0 a ResourceResolver
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-06 10:05:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614806#comment-14614806 ]

MH commented on FOP-2495:
-------------------------

Thanks for the hint, but even though I had some progress (my resolver get's fired), only parts work again. Other parts still don't work:

EVen though I log out all calls of my resolver's getResource() URIs, and adjust them to the paths of our app, we still get file not found errors - e.g. in the IFConcatenator:

------------
111303024 SEVERE SVG error: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
java.io.FileNotFoundException: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.needSource(AbstractImageSessionContext.java:193)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:123)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:123)
at org.apache.fop.svg.AbstractFOPImageElementBridge.createImageGraphicsNode(AbstractFOPImageElementBridge.java:78)
at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(Unknown Source)
at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:319)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:232)
at org.apache.fop.render.intermediate.IFParser$Handler$ImageHandler.endElement(IFParser.java:796)
at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:413)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.apache.fop.render.intermediate.IFParser.parse(IFParser.java:108)
at org.apache.fop.render.intermediate.util.IFConcatenator.appendDocument(IFConcatenator.java:106)
-----------------

It seems that the resolver is not fired through FI concatenation!?


We also get thousands of font errors:

Font "FrutigerIC,normal,400" not found. Substituting with "any,normal,400".

even though I set a fixed (correct) <font-base> URI in the config.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-06 13:14:09 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614806#comment-14614806 ]

MH edited comment on FOP-2495 at 7/6/15 1:14 PM:
-------------------------------------------------

Thanks for the hint, but even though I had some progress (my resolver get's fired), only parts work again. Other parts still don't work:

EVen though I log out all calls of my resolver's getResource() URIs, and adjust them to the paths of our app, we still get file not found errors - e.g. in the IFConcatenator:

------------
111303024 SEVERE SVG error: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
java.io.FileNotFoundException: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.needSource(AbstractImageSessionContext.java:193)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:123)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:123)
at org.apache.fop.svg.AbstractFOPImageElementBridge.createImageGraphicsNode(AbstractFOPImageElementBridge.java:78)
at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(Unknown Source)
at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:319)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:232)
at org.apache.fop.render.intermediate.IFParser$Handler$ImageHandler.endElement(IFParser.java:796)
at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:413)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.apache.fop.render.intermediate.IFParser.parse(IFParser.java:108)
at org.apache.fop.render.intermediate.util.IFConcatenator.appendDocument(IFConcatenator.java:106)
-----------------

It seems that the resolver is not fired through FI concatenation!? It worked in FOP 1.0.
I worked around it by adding an additional XMLHandler to replace paths in the IF-XML-FIles. :-(

###########

We also get thousands of font errors:

Font "FrutigerIC,normal,400" not found. Substituting with "any,normal,400".

even though I set a fixed (correct) <font-base> URI in the config. I can't find anything wrong or different on the Apache Font pages for FOP 2.0 compared to FOP 1.1. Except setting an explizit absolut path (URI) for <font-base>. But FOP 2.0 still doesn't find the fonts.
What else changed in FOP 2.0 concerning the FONT resolvement?


was (Author: mhilpert):
Thanks for the hint, but even though I had some progress (my resolver get's fired), only parts work again. Other parts still don't work:

EVen though I log out all calls of my resolver's getResource() URIs, and adjust them to the paths of our app, we still get file not found errors - e.g. in the IFConcatenator:

------------
111303024 SEVERE SVG error: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
java.io.FileNotFoundException: Image not found: file:1_4986/3_R_Result_40/C_PerfFigSer_M.svg
at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.needSource(AbstractImageSessionContext.java:193)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:123)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:123)
at org.apache.fop.svg.AbstractFOPImageElementBridge.createImageGraphicsNode(AbstractFOPImageElementBridge.java:78)
at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(Unknown Source)
at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:319)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:232)
at org.apache.fop.render.intermediate.IFParser$Handler$ImageHandler.endElement(IFParser.java:796)
at org.apache.fop.render.intermediate.IFParser$Handler.endElement(IFParser.java:413)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.apache.fop.render.intermediate.IFParser.parse(IFParser.java:108)
at org.apache.fop.render.intermediate.util.IFConcatenator.appendDocument(IFConcatenator.java:106)
-----------------

It seems that the resolver is not fired through FI concatenation!?


We also get thousands of font errors:

Font "FrutigerIC,normal,400" not found. Substituting with "any,normal,400".

even though I set a fixed (correct) <font-base> URI in the config.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-06 15:29:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14615173#comment-14615173 ]

MH commented on FOP-2495:
-------------------------

For the last font Problem I also found a very ugly workaround: I had to read the configuration , get the value of font-base and set it during the FopFactoryBuilder construction:

----------------------------------
/**
* Set up new FOP factory with a configuartion file.
*
* @param defaultBaseURI Base URI to read user config file (e.g. "\\PC1\instDir\reports\xml\fonts").
* @param userConfigFile (e.g. "userconfig.xml")
* @param resolver Custom resolver.
* @param uri URI of current working path..
* @throws Exception on error.
*/
public final void setUserConfigFile(final File defaultBaseURI, final File userConfigFile, final ResourceResolver resolver, final URI uri) throws Exception {
if (userConfigFile != null) {
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(userConfigFile);

//read font-base from configuration file:
URI fontBase = defaultBaseURI.toURI(); //default (e.g. "file:////PC1/instDir/reports/xml/fonts/") - network shares doesn't work!
Configuration[] cfgs = cfg.getChildren();
for (final Configuration c : cfgs) { //e.g. "base", "font-base", "source-resolution", "target-resolution", "default-page-settings", "renderers"
if ("font-base".equals(c.getName())) {
String v = c.getValue(); //has to be a URI!
fontBase = URI.create(v); //e.g. "file:///K:/reports/xml/fonts/"
break;
}
}

if (resolver != null) {
builder = new FopFactoryBuilder(fontBase, resolver);
} else {
builder = new FopFactoryBuilder(fontBase);
}
builder.setConfiguration(cfg);
builder.setBaseURI(uri); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = builder.build();
} else {
fopFactory = FopFactory.newInstance(new File(".").toURI());
}

foUserAgent = fopFactory.newFOUserAgent();
}//setUserConfigFile()
-----------------------------------

This is so ugly, I wonder how FOP 2.0 has so many things made worse! But it's still not like FOP 1.0 - now we get lots of errors and warnings for some fonts, e.g.

--------------
...
lte50058.AFM: named character 'quoteright' has an incorrect code point: 146. Changed to 39
...
java.lang.RuntimeException: SVG graphic could not be built. Reason: java.lang.RuntimeException: SVG error: The font PMN_Caecilia_45_Light.ttf is not embeddable due to a licensing restriction.
...
-------------

that we didn't get with FOP 1.0 (for the very same font files, of course).
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-06 16:10:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14615173#comment-14615173 ]

MH edited comment on FOP-2495 at 7/6/15 4:09 PM:
-------------------------------------------------

For the last font Problem I also found a very ugly workaround: I had to read the configuration , get the value of font-base and set it during the FopFactoryBuilder construction:

----------------------------------
/**
* Set up new FOP factory with a configuartion file.
*
* @param defaultBaseURI Base URI to read user config file (e.g. "\\PC1\instDir\reports\xml\fonts").
* @param userConfigFile (e.g. "userconfig.xml")
* @param resolver Custom resolver.
* @param uri URI of current working path..
* @throws Exception on error.
*/
public final void setUserConfigFile(final File defaultBaseURI, final File userConfigFile, final ResourceResolver resolver, final URI uri) throws Exception {
if (userConfigFile != null) {
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(userConfigFile);

//read font-base from configuration file:
URI fontBase = defaultBaseURI.toURI(); //default (e.g. "file:////PC1/instDir/reports/xml/fonts/") - network shares doesn't work!
Configuration[] cfgs = cfg.getChildren();
for (final Configuration c : cfgs) { //e.g. "base", "font-base", "source-resolution", "target-resolution", "default-page-settings", "renderers"
if ("font-base".equals(c.getName())) {
String v = c.getValue(); //has to be a URI!
fontBase = URI.create(v); //e.g. "file:///K:/reports/xml/fonts/"
break;
}
}

if (resolver != null) {
builder = new FopFactoryBuilder(fontBase, resolver);
} else {
builder = new FopFactoryBuilder(fontBase);
}
builder.setConfiguration(cfg);
builder.setBaseURI(uri); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = builder.build();
} else {
fopFactory = FopFactory.newInstance(new File(".").toURI());
}

foUserAgent = fopFactory.newFOUserAgent();
}//setUserConfigFile()
-----------------------------------

This is so ugly, I wonder how FOP 2.0 has so many things made worse! But it's still not like FOP 1.0 - now we get lots of errors and warnings for some fonts, e.g.

--------------
...
lte50058.AFM: named character 'quoteright' has an incorrect code point: 146. Changed to 39
...
java.lang.RuntimeException: SVG graphic could not be built. Reason: java.lang.RuntimeException: SVG error: The font PMN_Caecilia_45_Light.ttf is not embeddable due to a licensing restriction.
...
-------------

that we didn't get with FOP 1.0 (for the very same font files, of course). I also had to give up our windows networkshare names because FOP does vreak them up: even thoug

URI fontBase = defaultBaseURI.toURI();

creates the correct and valid URI "file:////PC1/instDir/reports", we get errors:

----
java.io.FileNotFoundException: \PC1\instDir\reports\xml\fonts\LTe50327.ttf (Das System kann den angegebenen Pfad nicht finden)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1038)
at org.apache.fop.apps.io.ResourceResolverFactory$NormalResourceResolver.getResource(ResourceResolverFactory.java:224)
---------
If we use Windows paths with local letters like "K:/instDir/reports", everything works. But this makes path configuration worse, as a Windows Share directory can't be used anymore! As a workaround I have to copy the fonts directory to each app server to be correctly read with windows letters. Is this an open bug or is this another "not supported anymore" "feature" of FOP 2.0?





was (Author: mhilpert):
For the last font Problem I also found a very ugly workaround: I had to read the configuration , get the value of font-base and set it during the FopFactoryBuilder construction:

----------------------------------
/**
* Set up new FOP factory with a configuartion file.
*
* @param defaultBaseURI Base URI to read user config file (e.g. "\\PC1\instDir\reports\xml\fonts").
* @param userConfigFile (e.g. "userconfig.xml")
* @param resolver Custom resolver.
* @param uri URI of current working path..
* @throws Exception on error.
*/
public final void setUserConfigFile(final File defaultBaseURI, final File userConfigFile, final ResourceResolver resolver, final URI uri) throws Exception {
if (userConfigFile != null) {
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration cfg = cfgBuilder.buildFromFile(userConfigFile);

//read font-base from configuration file:
URI fontBase = defaultBaseURI.toURI(); //default (e.g. "file:////PC1/instDir/reports/xml/fonts/") - network shares doesn't work!
Configuration[] cfgs = cfg.getChildren();
for (final Configuration c : cfgs) { //e.g. "base", "font-base", "source-resolution", "target-resolution", "default-page-settings", "renderers"
if ("font-base".equals(c.getName())) {
String v = c.getValue(); //has to be a URI!
fontBase = URI.create(v); //e.g. "file:///K:/reports/xml/fonts/"
break;
}
}

if (resolver != null) {
builder = new FopFactoryBuilder(fontBase, resolver);
} else {
builder = new FopFactoryBuilder(fontBase);
}
builder.setConfiguration(cfg);
builder.setBaseURI(uri); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = builder.build();
} else {
fopFactory = FopFactory.newInstance(new File(".").toURI());
}

foUserAgent = fopFactory.newFOUserAgent();
}//setUserConfigFile()
-----------------------------------

This is so ugly, I wonder how FOP 2.0 has so many things made worse! But it's still not like FOP 1.0 - now we get lots of errors and warnings for some fonts, e.g.

--------------
...
lte50058.AFM: named character 'quoteright' has an incorrect code point: 146. Changed to 39
...
java.lang.RuntimeException: SVG graphic could not be built. Reason: java.lang.RuntimeException: SVG error: The font PMN_Caecilia_45_Light.ttf is not embeddable due to a licensing restriction.
...
-------------

that we didn't get with FOP 1.0 (for the very same font files, of course).
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-07-06 17:44:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14615370#comment-14615370 ]

simon steiner commented on FOP-2495:
------------------------------------

You can use a resource resolver to return a inputstream to any files to avoid these issues:

static class MyResourceResolver implements ResourceResolver {
public Resource getResource(URI uri) throws IOException {
return new Resource(xxx);
}
public OutputStream getOutputStream(URI uri) throws IOException {
throw new RuntimeException(uri.toString());
}
}

public static void main(String[] args) throws TransformerException, SAXException, IOException {
String fopxconf = "<fop version=\"1.0\"></fop>";

ResourceResolver cloudResourceResolver = new MyResourceResolver();
FopFactoryBuilder confBuilder = new FopConfParser(new ByteArrayInputStream(fopxconf.getBytes()),
EnvironmentalProfileFactory.createRestrictedIO(new File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder();
FopFactory fopFactory = confBuilder.build();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
FileOutputStream fos = new FileOutputStream("out.png");
Fop fop = fopFactory.newFop("image/png", foUserAgent, fos);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(new ByteArrayInputStream(fo.getBytes()));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
fos.close();
}
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-07-06 17:45:07 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14615370#comment-14615370 ]

simon steiner edited comment on FOP-2495 at 7/6/15 5:44 PM:
------------------------------------------------------------

You can use a resource resolver to return a inputstream to any files to avoid these issues:
{code}
static class MyResourceResolver implements ResourceResolver {
public Resource getResource(URI uri) throws IOException {
return new Resource(xxx);
}
public OutputStream getOutputStream(URI uri) throws IOException {
throw new RuntimeException(uri.toString());
}
}

public static void main(String[] args) throws TransformerException, SAXException, IOException {
String fopxconf = "<fop version=\"1.0\"></fop>";

ResourceResolver cloudResourceResolver = new MyResourceResolver();
FopFactoryBuilder confBuilder = new FopConfParser(new ByteArrayInputStream(fopxconf.getBytes()),
EnvironmentalProfileFactory.createRestrictedIO(new File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder();
FopFactory fopFactory = confBuilder.build();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
FileOutputStream fos = new FileOutputStream("out.png");
Fop fop = fopFactory.newFop("image/png", foUserAgent, fos);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(new ByteArrayInputStream(fo.getBytes()));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
fos.close();
}
{code}


was (Author: ssteiner1):
You can use a resource resolver to return a inputstream to any files to avoid these issues:

static class MyResourceResolver implements ResourceResolver {
public Resource getResource(URI uri) throws IOException {
return new Resource(xxx);
}
public OutputStream getOutputStream(URI uri) throws IOException {
throw new RuntimeException(uri.toString());
}
}

public static void main(String[] args) throws TransformerException, SAXException, IOException {
String fopxconf = "<fop version=\"1.0\"></fop>";

ResourceResolver cloudResourceResolver = new MyResourceResolver();
FopFactoryBuilder confBuilder = new FopConfParser(new ByteArrayInputStream(fopxconf.getBytes()),
EnvironmentalProfileFactory.createRestrictedIO(new File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder();
FopFactory fopFactory = confBuilder.build();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
FileOutputStream fos = new FileOutputStream("out.png");
Fop fop = fopFactory.newFop("image/png", foUserAgent, fos);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(new ByteArrayInputStream(fo.getBytes()));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
fos.close();
}
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 08:51:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616382#comment-14616382 ]

MH commented on FOP-2495:
-------------------------

Simon, I don't see in your code what you mean by "inputstream".
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 08:54:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616385#comment-14616385 ]

MH commented on FOP-2495:
-------------------------

Next problem: when I try to change the base URI:

builder.setBaseURI(uri);

I get this exception:

------------
java.lang.IllegalStateException: The final FOP Factory configuration has already been built
at org.apache.fop.apps.FopFactoryBuilder$CompletedFopFactoryConfigBuilder.throwIllegalStateException(FopFactoryBuilder.java:515)
at org.apache.fop.apps.FopFactoryBuilder$CompletedFopFactoryConfigBuilder.setBaseURI(FopFactoryBuilder.java:528)
at org.apache.fop.apps.FopFactoryBuilder.setBaseURI(FopFactoryBuilder.java:182)
-------------


Very bad! That means I have to create everything from scratch for each document: (!!!):

---
if (resolver != null) {
builder = new FopFactoryBuilder(fontBase, resolver);
} else {
builder = new FopFactoryBuilder(fontBase);
}
builder.setConfiguration(cfg);
builder.setBaseURI(fontBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = builder.build();
-----

In FOP 1.0, I was able to change the baseURI via

foUserAgent.setBaseURL();

for each document - but FOP 2.0 does nott have such a method anymore. :-(
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-07-07 09:08:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616392#comment-14616392 ]

simon steiner commented on FOP-2495:
------------------------------------

eg in your ResourceResolver so you bypass fop looking at relative urls
{code}
public Resource getResource(URI uri) throws IOException {
return new Resource(new FileInputStream());
}
{code}
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 09:53:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616444#comment-14616444 ]

MH commented on FOP-2495:
-------------------------

... I don't know what you are refering to. The parth problem is with Windowsnetwork shares like "\\PC1\...". I set the correct URI (tested in Windows Explorer) "file:////PC1/.." but somehoe, FOP is changing this to an invalid path.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 10:03:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616452#comment-14616452 ]

MH commented on FOP-2495:
-------------------------

The missing foUserAgent.setBaseURL() (or setBaseURI()) is a major problem! Even calling it on the factory builder:

fopFactoryBuilder.setBaseURI(uriBase); //since FOP 2.0

is not enough: "IllegalStateException: The final FOP Factory configuration has already been built"

I have to setup complete FOP for each single document to get things working:

-----------------------
/**
* Set current base directory.
*
* @param defaultBase URI to default base directory (e.g. ".", "file:/K:/reports/xml/fonts/")
* @param currentBase URI to current working directory (e.g. "file:///C:/Temp/").
* @param resolver Optional custom resolver.
* @throws Exception on error.
*/
public final void setupFOP(final URI defaultBase, final URI currentBase, final ResourceResolver resolver) throws Exception {
if (fopConfig != null) {
if (resolver != null) {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase, resolver);
} else {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase);
}

fopFactoryBuilder.setConfiguration(fopConfig);
fopFactoryBuilder.setBaseURI(currentBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = fopFactoryBuilder.build();
} else {
fopFactory = FopFactory.newInstance(currentBase);
}
foUserAgent = fopFactory.newFOUserAgent();
}//setupFOP()
------------------------------

only to replace FOP 1.0 foUserAgent.setBaseURL() ... :-(
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 10:05:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616452#comment-14616452 ]

MH edited comment on FOP-2495 at 7/7/15 10:04 AM:
--------------------------------------------------

The missing foUserAgent.setBaseURL() (or setBaseURI()) is a major problem! Even calling it on the factory builder:

fopFactoryBuilder.setBaseURI(uriBase); //since FOP 2.0

is not enough: "IllegalStateException: The final FOP Factory configuration has already been built"

I have to setup complete FOP for each single document to get things working:

-----------------------
/**
* Set current base directory.
*
* @param defaultBase URI to default base directory (e.g. ".", "file:/K:/reports/xml/fonts/")
* @param currentBase URI to current working directory (e.g. "file:///C:/Temp/").
* @param resolver Optional custom resolver.
* @throws Exception on error.
*/
public final void setupFOP(final URI defaultBase, final URI currentBase, final ResourceResolver resolver) throws Exception {
if (fopConfig != null) {
if (resolver != null) {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase, resolver);
} else {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase);
}

fopFactoryBuilder.setConfiguration(fopConfig);
fopFactoryBuilder.setBaseURI(currentBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = fopFactoryBuilder.build();
} else {
fopFactory = FopFactory.newInstance(currentBase);
}
foUserAgent = fopFactory.newFOUserAgent();
}//setupFOP()
------------------------------

... only to replace FOP 1.0 foUserAgent.setBaseURL() ... just because someone thought that this is not really required ... :-(


was (Author: mhilpert):
The missing foUserAgent.setBaseURL() (or setBaseURI()) is a major problem! Even calling it on the factory builder:

fopFactoryBuilder.setBaseURI(uriBase); //since FOP 2.0

is not enough: "IllegalStateException: The final FOP Factory configuration has already been built"

I have to setup complete FOP for each single document to get things working:

-----------------------
/**
* Set current base directory.
*
* @param defaultBase URI to default base directory (e.g. ".", "file:/K:/reports/xml/fonts/")
* @param currentBase URI to current working directory (e.g. "file:///C:/Temp/").
* @param resolver Optional custom resolver.
* @throws Exception on error.
*/
public final void setupFOP(final URI defaultBase, final URI currentBase, final ResourceResolver resolver) throws Exception {
if (fopConfig != null) {
if (resolver != null) {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase, resolver);
} else {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase);
}

fopFactoryBuilder.setConfiguration(fopConfig);
fopFactoryBuilder.setBaseURI(currentBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = fopFactoryBuilder.build();
} else {
fopFactory = FopFactory.newInstance(currentBase);
}
foUserAgent = fopFactory.newFOUserAgent();
}//setupFOP()
------------------------------

only to replace FOP 1.0 foUserAgent.setBaseURL() ... :-(
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-07 10:06:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616452#comment-14616452 ]

MH edited comment on FOP-2495 at 7/7/15 10:05 AM:
--------------------------------------------------

The missing foUserAgent.setBaseURL() (or setBaseURI()) is a major problem! Even calling it on the factory builder:

fopFactoryBuilder.setBaseURI(uriBase); //since FOP 2.0

is not enough: "IllegalStateException: The final FOP Factory configuration has already been built"

I have to setup complete FOP for each single document just to change the base URI to get things working:

-----------------------
/**
* Set current base directory.
*
* @param defaultBase URI to default base directory (e.g. ".", "file:/K:/reports/xml/fonts/")
* @param currentBase URI to current working directory (e.g. "file:///C:/Temp/").
* @param resolver Optional custom resolver.
* @throws Exception on error.
*/
public final void setupFOP(final URI defaultBase, final URI currentBase, final ResourceResolver resolver) throws Exception {
if (fopConfig != null) {
if (resolver != null) {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase, resolver);
} else {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase);
}

fopFactoryBuilder.setConfiguration(fopConfig);
fopFactoryBuilder.setBaseURI(currentBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = fopFactoryBuilder.build();
} else {
fopFactory = FopFactory.newInstance(currentBase);
}
foUserAgent = fopFactory.newFOUserAgent();
}//setupFOP()
------------------------------

... only to replace FOP 1.0 foUserAgent.setBaseURL() ... just because someone thought that this is not really required ... :-(


was (Author: mhilpert):
The missing foUserAgent.setBaseURL() (or setBaseURI()) is a major problem! Even calling it on the factory builder:

fopFactoryBuilder.setBaseURI(uriBase); //since FOP 2.0

is not enough: "IllegalStateException: The final FOP Factory configuration has already been built"

I have to setup complete FOP for each single document to get things working:

-----------------------
/**
* Set current base directory.
*
* @param defaultBase URI to default base directory (e.g. ".", "file:/K:/reports/xml/fonts/")
* @param currentBase URI to current working directory (e.g. "file:///C:/Temp/").
* @param resolver Optional custom resolver.
* @throws Exception on error.
*/
public final void setupFOP(final URI defaultBase, final URI currentBase, final ResourceResolver resolver) throws Exception {
if (fopConfig != null) {
if (resolver != null) {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase, resolver);
} else {
fopFactoryBuilder = new FopFactoryBuilder(defaultBase);
}

fopFactoryBuilder.setConfiguration(fopConfig);
fopFactoryBuilder.setBaseURI(currentBase); //since FOP 2.0
//builder.setStrictFOValidation(false);
fopFactory = fopFactoryBuilder.build();
} else {
fopFactory = FopFactory.newInstance(currentBase);
}
foUserAgent = fopFactory.newFOUserAgent();
}//setupFOP()
------------------------------

... only to replace FOP 1.0 foUserAgent.setBaseURL() ... just because someone thought that this is not really required ... :-(
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-09 08:47:06 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620142#comment-14620142 ]

MH commented on FOP-2495:
-------------------------

Next bug found: some SVGs produce errors with FOP 2.0 that work with FOP 1.0 (see exception below). The path in the fo (e.g. "images/TestLogo.dvg") somehow gets an invalid path ("images\images\TestLogo.svg"). We noticed this on SVGs generated with inkscape that has "url()" calls like this:

----------------------
...
<g id="Gruppe3" clip-path="url(#Clip0)">
<g id="g3096" clip-path="url(#Clip1)">
<g id="Gruppe1" clip-path="url(#Clip2)">
<path ...
...
------------------------

Result:

-----------------
Error while rendering page 1
java.lang.RuntimeException: SVG graphic could not be built. Reason: org.apache.batik.bridge.BridgeException: images\images\TestLogo.svg (Das System kann den angegebenen Pfad nicht finden)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:76)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy4.svgNotBuilt(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:107)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:292)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:173)
at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1295)
at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1282)
at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:863)
at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:927)
at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:343)
at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)
at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:738)
at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:262)
at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:586)
at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:140)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at de.icomps.xml.FOP.transformFO(FOP.java:1006)
at de.icomps.xml.FOP.fo2PDF(FOP.java:762)
at de.icomps.rep.Report.createWithFOP(Report.java:3750)
at de.icomps.rep.Report.processReport(Report.java:2104)
at de.icomps.rep.ReportProtocol.createProtocolReport(ReportProtocol.java:201)
at de.icomps.rep.ReportProtocol.createReport(ReportProtocol.java:69)
at de.icomps.rep.Report.startProcessing(Report.java:1650)
at de.icomps.ijs.JobTask.startJob(Unknown Source)
at de.icomps.ijs.JobTask.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.batik.bridge.BridgeException: images\images\B10250.svg (Das System kann den angegebenen Pfad nicht finden)
at org.apache.batik.bridge.BridgeContext.getReferencedNode(Unknown Source)
at org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
at org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
... 61 more
--------------------------

I don't know if this is a Batik bug in FOP...
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Andreas L. Delmelle (JIRA)
2015-07-09 16:09:06 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620754#comment-14620754 ]

Andreas L. Delmelle commented on FOP-2495:
------------------------------------------

I definitely do not mean to be a pain here -- I fully understand the frustrations -- but can we please distinguish between:

a) the core issue that was reported, which was related to missing migration documentation: comments related to that belong here
b) other issues: comments should be deleted here, and moved to other, separate JIRA entries

Right now, all the comments put together no longer form a coherent discussion about the core issue. This in turn does not really invite developers to even try to resolve it -- TLDR, stuff like that...
That would be a shame, since I consider the point to be very valuable: significant API changes simply *MUST NOT* be released without proper documentation.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-09 18:25:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14621007#comment-14621007 ]

MH commented on FOP-2495:
-------------------------

I understand your point. So if I would delete all the problems, what would be the result? The result would be: "oh sure - and can you proof it?". So I added just the examples that were show stoppers because I had to try out and browse the internet to get bits of peaces to finally get it to run. So, as the topic is almost self explainable, the comments just show various examples what APIs need to be documented.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-09 18:26:04 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14621007#comment-14621007 ]

MH edited comment on FOP-2495 at 7/9/15 6:25 PM:
-------------------------------------------------

I understand your point. So if I would delete all the problems, what would be the result? The result would be: "oh sure - and can you proof it?". So I added just the examples that were show stoppers because I had to try out and browse the internet to get bits of pieces to finally get it to run. So, as the topic is almost self explainable, the comments just show various examples what APIs need to be documented.


was (Author: mhilpert):
I understand your point. So if I would delete all the problems, what would be the result? The result would be: "oh sure - and can you proof it?". So I added just the examples that were show stoppers because I had to try out and browse the internet to get bits of peaces to finally get it to run. So, as the topic is almost self explainable, the comments just show various examples what APIs need to be documented.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
MH (JIRA)
2015-07-09 20:52:08 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MH updated FOP-2495:
--------------------
Comment: was deleted

(was: Next bug found: some SVGs produce errors with FOP 2.0 that work with FOP 1.0 (see exception below). The path in the fo (e.g. "images/TestLogo.dvg") somehow gets an invalid path ("images\images\TestLogo.svg"). We noticed this on SVGs generated with inkscape that has "url()" calls like this:

----------------------
...
<g id="Gruppe3" clip-path="url(#Clip0)">
<g id="g3096" clip-path="url(#Clip1)">
<g id="Gruppe1" clip-path="url(#Clip2)">
<path ...
...
------------------------

Result:

-----------------
Error while rendering page 1
java.lang.RuntimeException: SVG graphic could not be built. Reason: org.apache.batik.bridge.BridgeException: images\images\TestLogo.svg (Das System kann den angegebenen Pfad nicht finden)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:76)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy4.svgNotBuilt(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:107)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:292)
at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:173)
at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1295)
at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1282)
at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:863)
at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:927)
at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
at org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:343)
at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)
at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:738)
at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:262)
at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:586)
at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:140)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at de.icomps.xml.FOP.transformFO(FOP.java:1006)
at de.icomps.xml.FOP.fo2PDF(FOP.java:762)
at de.icomps.rep.Report.createWithFOP(Report.java:3750)
at de.icomps.rep.Report.processReport(Report.java:2104)
at de.icomps.rep.ReportProtocol.createProtocolReport(ReportProtocol.java:201)
at de.icomps.rep.ReportProtocol.createReport(ReportProtocol.java:69)
at de.icomps.rep.Report.startProcessing(Report.java:1650)
at de.icomps.ijs.JobTask.startJob(Unknown Source)
at de.icomps.ijs.JobTask.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.batik.bridge.BridgeException: images\images\B10250.svg (Das System kann den angegebenen Pfad nicht finden)
at org.apache.batik.bridge.BridgeContext.getReferencedNode(Unknown Source)
at org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
at org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
... 61 more
--------------------------

I don't know if this is a Batik bug in FOP...)
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-07-28 15:03:05 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

simon steiner updated FOP-2495:
-------------------------------
Assignee: Robert Meyer
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Assignee: Robert Meyer
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2015-08-11 12:38:46 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

simon steiner updated FOP-2495:
-------------------------------
Assignee: (was: Robert Meyer)
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Bjoern Sandkamp (JIRA)
2016-09-05 08:10:20 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15464407#comment-15464407 ]

Bjoern Sandkamp commented on FOP-2495:
--------------------------------------

Hi,
is there anything new regarding to the “setBaseURL“-problem? Because of performance reasons it is not an option in our project to create a new Factory for each pdf.
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Blocker
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
simon steiner (JIRA)
2017-03-17 10:02:41 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

simon steiner updated FOP-2495:
-------------------------------
Priority: Major (was: Blocker)
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
Robert Oschwald (JIRA)
2018-10-02 13:15:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635462#comment-16635462 ]

Robert Oschwald commented on FOP-2495:
--------------------------------------

Any news on this? Would be great if the upgrade document would be extended to show how to set the baseUrl / fontBaseUrl in FOP >= 2.0 when upgrading.

 

 

 

 
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Major
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
simon steiner (JIRA)
2018-10-02 13:23:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635475#comment-16635475 ]

simon steiner commented on FOP-2495:
------------------------------------

Not sure you can change baseurl without creating a new fopfactory, so you may need to use custom resource resolver
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Major
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Robert Oschwald (JIRA)
2018-10-02 14:48:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635608#comment-16635608 ]

Robert Oschwald commented on FOP-2495:
--------------------------------------

If you have fonts in other locations than the base url  (e.g. other path, Classpath, etc.) it seems the only possible way currently is to implement a custom ResourceResolver which tries to get the resource from fontBaseUrl and if not found, from the default ResourceResolver. Not very efficient imho.

But thats not the point. The upgrade document needs an update, or FOP should re-introduce the fontBaseUrl.

 

 
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Major
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
simon steiner (JIRA)
2018-10-02 14:57:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/FOP-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635628#comment-16635628 ]

simon steiner commented on FOP-2495:
------------------------------------

Or use

{color:#000080}new {color}FopConfBuilder().setFontBaseURI({color:#008000}"xyx"{color}).build(); and pass into fopfactory
Post by MH (JIRA)
Embedding: missing migration documentation from FOP 1.x
-------------------------------------------------------
Key: FOP-2495
URL: https://issues.apache.org/jira/browse/FOP-2495
Project: FOP
Issue Type: Bug
Components: documentation
Affects Versions: 2.0
Environment: WIndows, Java 8, FOP 1.0
Reporter: MH
Priority: Major
Labels: documentation
Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 has solved this bug (tested with standalone FOP scripts).
FopFactory.newInstance()
FoUserAgent.setBaseURL(String);
FopFactory.getFontManager().setFontBaseURL(String)
FopFactory.setURIResolver(URIResolver);
etc.
The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints how to replace old methods.
The FOP 2.0 embedding page (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple examples to start from the ground. I can't find any migration help how to replace old code.
E.g. how can I set the font base? FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find any equivalent code for FOP 2.0!
This is a major bug in FOP 2.0 as API changes are not documented to upgrade from FOP 1.x Java API to FOP 2.0!
Now I just can search and try and experiment if I get our old code somehow running with all those undocumented API changes. Can you please state a migration documentation for all methods (method signatures) that don't exist anymore? We can't start coding all over again from scratch. Thank you very much!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Loading...