Search in sources :

Example 1 with URIResolverAdapter

use of org.apache.xmlgraphics.io.URIResolverAdapter in project exist by eXist-db.

the class ApacheFopProcessorAdapter method getResourceResolver.

/**
 * Returns a scheme aware ResourceResolver which supports:
 * file://
 * exist:// (which will be translated to xmldb:exist://)
 * http://
 * https://
 *
 * @return The resource resolver
 */
private ResourceResolver getResourceResolver(final DBBroker broker, final String baseUri) {
    final ResourceResolverFactory.SchemeAwareResourceResolverBuilder builder = ResourceResolverFactory.createSchemeAwareResourceResolverBuilder(ResourceResolverFactory.createDefaultResourceResolver());
    final URIResolverAdapter uriResolver = new URIResolverAdapter(new EXistURISchemeURIResolver(new EXistURIResolver(broker.getBrokerPool(), baseUri)));
    builder.registerResourceResolverForScheme("exist", uriResolver);
    builder.registerResourceResolverForScheme("http", uriResolver);
    builder.registerResourceResolverForScheme("https", uriResolver);
    return builder.build();
}
Also used : URIResolverAdapter(org.apache.xmlgraphics.io.URIResolverAdapter) EXistURIResolver(org.exist.xslt.EXistURIResolver) ResourceResolverFactory(org.apache.fop.apps.io.ResourceResolverFactory) EXistURISchemeURIResolver(org.exist.util.EXistURISchemeURIResolver)

Aggregations

ResourceResolverFactory (org.apache.fop.apps.io.ResourceResolverFactory)1 URIResolverAdapter (org.apache.xmlgraphics.io.URIResolverAdapter)1 EXistURISchemeURIResolver (org.exist.util.EXistURISchemeURIResolver)1 EXistURIResolver (org.exist.xslt.EXistURIResolver)1