Package org.apache.fop

Examples of org.apache.fop.ResourceEventProducer$Provider


     */
    public void createCatalogResolver(FOUserAgent userAgent) {
        String[] classNames = new String[] {
                "org.apache.xml.resolver.tools.CatalogResolver",
                "com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver"};
        ResourceEventProducer eventProducer =
            ResourceEventProducer.Provider.get(userAgent.getEventBroadcaster());
        Class resolverClass = null;
        for (int i = 0; i < classNames.length && resolverClass == null; ++i) {
            try {
                resolverClass = Class.forName(classNames[i]);
            } catch (ClassNotFoundException e) {
                // No worries
            }
        }
        if (resolverClass == null) {
            eventProducer.catalogResolverNotFound(this);
            return;
        }
        try {
            entityResolver = (EntityResolver) resolverClass.newInstance();
            uriResolver = (URIResolver) resolverClass.newInstance();
        } catch (InstantiationException e) {
            log.error("Error creating the catalog resolver: " + e.getMessage());
            eventProducer.catalogResolverNotCreated(this, e.getMessage());
        } catch (IllegalAccessException e) {
            log.error("Error creating the catalog resolver: " + e.getMessage());
            eventProducer.catalogResolverNotCreated(this, e.getMessage());
        }
    }
View Full Code Here


                                ImageSessionContext sessionContext
                                    = userAgent.getImageSessionContext();
                                ImageInfo info = manager.getImageInfo(uri, sessionContext);
                                bkg.setImageInfo(info);
                            } catch (ImageException e) {
                                ResourceEventProducer eventProducer
                                    = ResourceEventProducer.Provider.get(
                                        this.userAgent.getEventBroadcaster());
                                eventProducer.imageError(this, uri, e, getLocator());
                            } catch (FileNotFoundException fnfe) {
                                ResourceEventProducer eventProducer
                                    = ResourceEventProducer.Provider.get(
                                        this.userAgent.getEventBroadcaster());
                                eventProducer.imageNotFound(this, uri, fnfe, getLocator());
                            } catch (IOException ioe) {
                                ResourceEventProducer eventProducer
                                    = ResourceEventProducer.Provider.get(
                                        this.userAgent.getEventBroadcaster());
                                eventProducer.imageIOError(this, uri, ioe, getLocator());
                            }

                            String repeat = attributes.getValue("bkg-repeat");
                            if (repeat != null) {
                                bkg.setRepeat(repeat);
View Full Code Here

        ImageManager manager = userAgent.getFactory().getImageManager();
        ImageInfo info = null;
        try {
            info = manager.getImageInfo(url, userAgent.getImageSessionContext());
        } catch (ImageException e) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageError(this, url, e, getLocator());
        } catch (FileNotFoundException fnfe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageNotFound(this, url, fnfe, getLocator());
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageIOError(this, url, ioe, getLocator());
        }
        if (info != null) {
            this.intrinsicWidth = info.getSize().getWidthMpt();
            this.intrinsicHeight = info.getSize().getHeightMpt();
            int baseline = info.getSize().getBaselinePositionFromBottom();
View Full Code Here

                            pageViewport.loadPage(in);
                        } finally {
                            IOUtils.closeQuietly(in);
                        }
                        if (!tempFile.delete()) {
                            ResourceEventProducer eventProducer
                                = ResourceEventProducer.Provider.get(
                                        renderer.getUserAgent().getEventBroadcaster());
                            eventProducer.cannotDeleteTempFile(this, tempFile);
                        }
                        pageMap.remove(pageViewport);
                    } catch (Exception e) {
                        AreaEventProducer eventProducer
                            = AreaEventProducer.Provider.get(
                                renderer.getUserAgent().getEventBroadcaster());
                        eventProducer.pageLoadError(this, pageViewport.getPageNumberString(), e);
                    }
                }

                renderPage(pageViewport);
                pageViewport.clear();
View Full Code Here

                    hints, sessionContext);

        try {
            drawImage(img, rect, context);
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageWritingError(this, ioe);
        }
    }
View Full Code Here

        ImageManager manager = getFopFactory().getImageManager();
        try {
            ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
            return manager.getImageInfo(uri, sessionContext);
        } catch (ImageException ie) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageError(this, uri, ie, null);
        } catch (FileNotFoundException fe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageNotFound(this, uri, fe, null);
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageIOError(this, uri, ioe, null);
        }
        return null;
    }
View Full Code Here

            ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
            info = manager.getImageInfo(uri, sessionContext);

            drawImageUsingImageHandler(info, rect);
        } catch (ImageException ie) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageError(this, (info != null ? info.toString() : uri), ie, null);
        } catch (FileNotFoundException fe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageNotFound(this, (info != null ? info.toString() : uri), fe, null);
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageIOError(this, (info != null ? info.toString() : uri), ioe, null);
        }
    }
View Full Code Here

        try {
            info = manager.preloadImage(null, new DOMSource(doc));

            drawImageUsingImageHandler(info, rect);
        } catch (ImageException ie) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageError(this,
                    (info != null ? info.toString() : INSTREAM_OBJECT_URI), ie, null);
        } catch (FileNotFoundException fe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageNotFound(this,
                    (info != null ? info.toString() : INSTREAM_OBJECT_URI), fe, null);
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageIOError(this,
                    (info != null ? info.toString() : INSTREAM_OBJECT_URI), ioe, null);
        }
    }
View Full Code Here

                ImageXMLDOM imgXML = (ImageXMLDOM)img;
                renderDocument(imgXML.getDocument(), imgXML.getRootNamespace(),
                        pos, foreignAttributes);
            }
        } catch (ImageException ie) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageError(this, (info != null ? info.toString() : uri), ie, null);
        } catch (FileNotFoundException fe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageNotFound(this, (info != null ? info.toString() : uri), fe, null);
        } catch (IOException ioe) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    getUserAgent().getEventBroadcaster());
            eventProducer.imageIOError(this, (info != null ? info.toString() : uri), ioe, null);
        }
    }
View Full Code Here

                log.trace("Using ImageHandler: " + handler.getClass().getName());
            }
            handler.generateForm(formContext, img, form);

        } catch (ImageException ie) {
            ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                    userAgent.getEventBroadcaster());
            eventProducer.imageError(resTracker, (info != null ? info.toString() : uri),
                    ie, null);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.ResourceEventProducer$Provider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.