Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.IncludeXMLConsumer


            if (content != null) {
                if (content.length > 0) {
                    XMLDeserializer interpreter = null;
                    try {
                        interpreter = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                        interpreter.setConsumer(new IncludeXMLConsumer(consumer, consumer));
                        interpreter.deserialize(content);
                    } catch (ComponentException e) {
                        throw new ProcessingException("Component for XMLDeserializer not found." + e, e);
                    } finally {
                        if (interpreter != null) this.manager.release(interpreter);
View Full Code Here


        }
    }

    protected IncludeXMLConsumer getConsumer() {
        if(consumer == null) {
            consumer = new IncludeXMLConsumer(this);
        }
        return consumer;
    }
View Full Code Here

                Request request = ObjectModelHelper.getRequest(this.objectModel);

                try {
                    if (transformations != null && transformations.getLength() > 0) {
                        selector = (ComponentSelector) this.manager.lookup(Transformer.ROLE + "Selector");
                        nextConsumer = new IncludeXMLConsumer(nextConsumer);
                        for(int k = transformations.getLength()-1; k >=0; k--) {
                            xslT = (Transformer)selector.select("xslt");
                            transformers.add(xslT);
                            xslT.setup(resolver,
                                       objectModel,
                                       DOMUtil.getValueOfNode(transformations.item(k)),
                                       new Parameters());
                            xslT.setConsumer(nextConsumer);
                            nextConsumer = xslT;
                        }
                        nextConsumer.startDocument();
                    }
                    boolean includeFragment = true;
                    boolean handlesParameters = DOMUtil.getValueAsBooleanOf(copletConf, "configuration/handlesParameters", true);
                    String size = p.getParameter("size", "max");
                    includeFragment = size.equals("max");
                    if (includeFragment == false) {
                        if (this.logger.isWarnEnabled() == true) {
                            this.logger.warn("Minimized coplet '"+copletID+"' not handled correctly.");
                        }
                    }
                    if ( includeFragment ) {
                        if (this.logger.isDebugEnabled() ) {
                            this.logger.debug("portal: Loading coplet " + copletID);
                        }
                        // add the parameters to the request attributes
                        Map info = new HashMap(3);
                        SessionContextImpl.copletInfo.set(info);
                        info.put(PortalConstants.COPLETINFO_PARAMETERS, p);
                        info.put(PortalConstants.COPLETINFO_PORTALURI, request.getRequestURI());
                        info.put(PortalConstants.COPLETINFO_STATUSPROFILE, loadedCoplet[7]);
                        XMLConsumer xc = new IncludeXMLConsumer(nextConsumer);
                        Source source = null;
                        try {
                            source = SourceUtil.getSource(resource,
                                                          null,
                                                          (handlesParameters == true ? p : null),
View Full Code Here

        }
    }

    private void insertBean (String name, Object bean, String map) {
        try {
            Marshaller marshaller = new Marshaller(new IncludeXMLConsumer(super.contentHandler));
            try {
                Mapping mapping = null;
                if (map != null) {
                    mapping = loadMapping(map);
                } else {
View Full Code Here

            handler.startDocument();
            handler.startPrefixMapping(PREFIX, URI);
            handler.startElement(URI, RESULTSET, QRESULTSET, attributes);

            IncludeXMLConsumer includeHandler = new IncludeXMLConsumer(handler);

            // Print search results
            ResourceIterator results = resultSet.getIterator();
            while (results.hasMoreResources()) {
                XMLResource result = (XMLResource)results.nextResource();
View Full Code Here

                        if (transformer.interpreter != null) {
                            interpreter = (XMLDeserializer)manager.lookup(XMLDeserializer.ROLE);
                        }
                        parser.parse(new InputSource(new StringReader("<root>"+value+"</root>")), compiler);

                        IncludeXMLConsumer filter = new IncludeXMLConsumer(transformer, transformer);
                        filter.setIgnoreRootElement(true);

                        interpreter.setConsumer(filter);

                        interpreter.deserialize(compiler.getSAXFragment());
                    } catch (Exception local) {
View Full Code Here

            DOMBuilder builder = new DOMBuilder();
            builder.startDocument();
            builder.startElement("", "root", "root", new AttributesImpl());

            IncludeXMLConsumer filter = new IncludeXMLConsumer(builder, builder);
            parser.parse(input, filter);

            builder.endElement("", "root", "root");
            builder.endDocument();
View Full Code Here

        String mimeTypeHint = null;
        if (typeParameters != null) {
            mimeTypeHint = typeParameters.getParameter("mime-type", mimeTypeHint);
        }
        if (filterDocumentEvent) {
            IncludeXMLConsumer filter = new IncludeXMLConsumer(handler);
            toSAX(source, mimeTypeHint, filter);
        } else {
            toSAX(source, mimeTypeHint, handler);
        }
    }
View Full Code Here

                String mimeType = null;
                if ( null != this.configurationParameters ) {
                    mimeType = this.configurationParameters.getParameter("mime-type", mimeType);                   
                }
                if ( this.compiling ) {
                    this.resolver.toSAX(source, mimeType, new IncludeXMLConsumer(this.contentHandler, this.lexicalHandler));
                } else {
                    this.resolver.toSAX(source, mimeType, this.filter);
                }
            }
View Full Code Here

                        }
                    } else {
                        SAXParser parser = null;
                        try {
                            parser = (SAXParser)manager.lookup(SAXParser.ROLE);
                            IncludeXMLConsumer xinclude_handler = new IncludeXMLConsumer(super.contentHandler,super.lexicalHandler);
                            parser.parse(input, xinclude_handler);
                        } finally {
                            this.manager.release((Component)parser);
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.xml.IncludeXMLConsumer

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.