You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2015/08/11 13:45:49 UTC
svn commit: r1695270 -
/xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext
Author: ssteiner
Date: Tue Aug 11 11:45:49 2015
New Revision: 1695270
URL: http://svn.apache.org/r1695270
Log:
2.0 migration: Patch from Thanasis Giannimaras
Modified:
xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext
Modified: xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext?rev=1695270&r1=1695269&r2=1695270&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/upgrading.mdtext Tue Aug 11 11:45:49 2015
@@ -1,7 +1,58 @@
Title: Upgrading from an Earlier Version of Apache™ FOP
+Title: Upgrading from an Earlier Version of Apache™ FOP
+
#Upgrading from an Earlier Version of Apache™ FOP
+## Upgrading from Version 1.1
+
+When upgrading from 1.x or earlier version of fop there are some significant changes that the user must be aware of:
+
+FOUriResolver and FOPFactoryConfigurator classes have been removed
+
+In their place, the following classes have been added:
+
+- InternalResourceResolver
+- ResourceResolverFactory
+- FopConfParser (parses the configuration file and returns a FOPFactoryBuilder instance)
+- FOPFactoryBuilder (a builder class that can be used for setting Configuration)
+
+Instead of manually editing the FOPFactory you can use the above classes:
+
+ :::xml
+ File xconf = new File("fop.xconf");
+ FopConfParser parser = new FopConfParser(xconf); //parsing configuration
+ FopFactoryBuilder builder = parser.getFopFactoryBuilder(); //building the factory with the user options
+ FOPFactory fopFactory = builder.build();
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
+
+or equally reading from an xml file
+
+ :::xml
+ DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
+ Configuration cfg = cfgBuilder.buildFromFile(new File("mycfg.xml"));
+ fopFactoryBuilder = new FopFactoryBuilder(baseURI).setConfiguration(cfg);
+
+The above can be used instead of fopFactory.setUserConfig(cfg) which is not available anymore.
+
+Another important change is the way fops resolves URI.
+Class FOURIResolver has been replaced with InternalResourceResolver (holds a reference to both the ResourceResolver needed for resource acquisition and the base URI from which to resolve URI's).
+ResourceResolverFactory (a factory class for Resource resolver).
+
+Use of custom resource resolvers is now available through the use of FopFactoryBuilder.
+
+ :::xml
+ FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI(), resolver);
+
+resolver is an object of org.apache.xmlgraphics.io.ResourceResolver.
+
+Instead of fopFactory.setURIResolver(uriResolver); where uriResolver is an object of URIResolver.
+
+More information on how to configure Apache FOP programmatically and customizing the User Agent can be found in [embedding](embedding.html)
+
+Moreover more information on providing org.apache.xmlgraphics.io.ResourceResolver for custom URI resolution can be found in [servlets](servlets.html)
+
+
## Upgrading from Version 1.0 { #fop-1.0}
You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following:
@@ -59,4 +110,4 @@ When you use your existing FO files or X
- The `fox:outline` extension is not implemented in the current version: it has been superseded by the bookmark elements from XSL-FO 1.1.
-- The `fox:continued-label` extension is not implemented in this version anymore. It has been superseded by the `fo:retrieve-table-marker` element from XSL-FO 1.1.
+- The `fox:continued-label` extension is not implemented in this version anymore. It has been superseded by the `fo:retrieve-table-marker` element from XSL-FO 1.1.
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org