Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.SaxBuffer$Comment


        if (colonPos != -1) {
            catalogueID = key.substring(0, colonPos);
            key = key.substring(colonPos + 1, key.length());
        }

        final SaxBuffer text = getMessage(catalogueID, key);
        if (text == null) {
            getLogger().warn("Translation not found for attribute " +
                             name + " in element <" + element + ">");
            return untranslated;
        }
        return text.toString();
    }
View Full Code Here


     * A default value is returned if message is not found.
     *
     * @return SaxBuffer containing message, or defaultValue if not found.
     */
    private ParamSaxBuffer getMessage(String key, ParamSaxBuffer defaultValue) {
        SaxBuffer value = getMessage(currentCatalogueId, key);
        if (value == null) {
            return defaultValue;
        }

        return new ParamSaxBuffer(value);
View Full Code Here

     * XMLizable can be obtained by the matching {@link #endSAXRecording} call.
     * @since 2.1.5
     */
    public void startSAXRecording()
    throws SAXException {
        addRecorder(new SaxBuffer());
        sendStartPrefixMapping();
    }
View Full Code Here

        }

        if (usePerRequestCache) {
            // Search the sax buffer in request attributes
            String attributeName = "DynamicSelectionListCache/" + url;
            SaxBuffer saxBuffer = (request != null ? (SaxBuffer)request.getAttribute(attributeName) : null);
           
            if (saxBuffer == null) {
                // Not found: generate the list and store it
                saxBuffer = new SaxBuffer();
                generateSaxFragmentFromSrc(url, saxBuffer, locale);
                if (request != null) {
                    request.setAttribute(attributeName, saxBuffer);
                }
            }
           
            // Output the stored saxBuffer to the contentHandler
            saxBuffer.toSAX(contentHandler);
        } else { // We don't use usePerRequestCache => re-read from the source.
            generateSaxFragmentFromSrc(url, contentHandler, locale);
        }
    }
View Full Code Here

            return hBuffer;
        }

        public void endElement(String uri, String loc, String raw)
        throws SAXException {
            SaxBuffer buffer = endBuffer();
            final Repeater repeater = (Repeater) contextWidget;
            final int rowCount = repeater.getSize();
            pushHandler(hNested);
            contextWidgets.addFirst(contextWidget);
            for (int i = 0; i < rowCount; i++) {
                contextWidget = repeater.getRow(i);
                if (isVisible(contextWidget)) {
                    buffer.toSAX(EffectWidgetReplacingPipe.this);
                }
            }
            contextWidget = (Widget) contextWidgets.removeFirst();
            popHandler();
            widget = null;
View Full Code Here

            return hBuffer;
        }

        public void endElement(String uri, String loc, String raw)
        throws SAXException {
            SaxBuffer buffer = endBuffer();
            final Repeater repeater = (Repeater) widget;
            final int rowCount = repeater.getSize();
            pushHandler(hNested);
            contextWidgets.addFirst(contextWidget);
            for (int i = 0; i < rowCount; i++) {
                contextWidget = repeater.getRow(i);
                if (isVisible(contextWidget)) {
                    buffer.toSAX(EffectWidgetReplacingPipe.this);
                }
            }
            contextWidget = (Widget) contextWidgets.removeFirst();
            popHandler();
            widget = null;
View Full Code Here

     */
    protected class NewHandler extends CopyHandler {
        public Handler startElement(String uri, String loc, String raw, Attributes attrs)
        throws SAXException {
            String id = getRequiredAttributeValue(loc, attrs, "id");
            SaxBuffer buffer = (SaxBuffer) classes.get(id);
            if (buffer == null) {
                throw new SAXException("New: Class '" + id + "' does not exist, " +
                                       "at " + getLocation());
            }
            pushHandler(hNested);
            buffer.toSAX(EffectWidgetReplacingPipe.this);
            popHandler();
            return this;
        }
View Full Code Here

            return hBuffer;
        }

        public void endElement(String uri, String loc, String raw)
        throws SAXException {
            SaxBuffer buffer = endBuffer();
            final Repeater repeater = (Repeater) contextWidget;
            final int rowCount = repeater.getSize();
            pushHandler(hNested);
            contextWidgets.addFirst(contextWidget);
            for (int i = 0; i < rowCount; i++) {
                contextWidget = repeater.getRow(i);
                if (isVisible(contextWidget)) {
                    buffer.toSAX(EffectWidgetReplacingPipe.this);
                }
            }
            contextWidget = (Widget) contextWidgets.removeFirst();
            popHandler();
            widget = null;
View Full Code Here

            return hBuffer;
        }

        public void endElement(String uri, String loc, String raw)
        throws SAXException {
            SaxBuffer buffer = endBuffer();
            final Repeater repeater = (Repeater) widget;
            final int rowCount = repeater.getSize();
            pushHandler(hNested);
            contextWidgets.addFirst(contextWidget);
            for (int i = 0; i < rowCount; i++) {
                contextWidget = repeater.getRow(i);
                if (isVisible(contextWidget)) {
                    buffer.toSAX(EffectWidgetReplacingPipe.this);
                }
            }
            contextWidget = (Widget) contextWidgets.removeFirst();
            popHandler();
            widget = null;
View Full Code Here

     */
    protected class NewHandler extends CopyHandler {
        public Handler startElement(String uri, String loc, String raw, Attributes attrs)
        throws SAXException {
            String id = getRequiredAttributeValue(loc, attrs, "id");
            SaxBuffer buffer = (SaxBuffer) classes.get(id);
            if (buffer == null) {
                throw new SAXException("New: Class '" + id + "' does not exist, " +
                                       "at " + getLocation());
            }
            pushHandler(hNested);
            buffer.toSAX(EffectWidgetReplacingPipe.this);
            popHandler();
            return this;
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.xml.SaxBuffer$Comment

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.