Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.OutputBuffer


            // Notify the manager of the componentType of content that we are
            // about to write to its managed OutputBuffer.
            separatorManager.beforeContent(componentType);

            // Get the OutputBuffer.
            OutputBuffer outputBuffer = separatorManager.getOutputBuffer();

            // Append the contents of temporary OutputBuffer to the managed one.
            outputBuffer.transferContentsFrom(temporaryBuffer);
        }
    }
View Full Code Here


        if (logger.isDebugEnabled()) {
            logger.debug("Pane.writeOutput() for " + pane.getName());
        }

        // Write out the contents of the content buffer
        OutputBuffer contentBuffer =
                abstractPaneInstance.getCurrentBuffer(false);

        // Write out the contents of this buffer, trim off any leading
        // or trailing white space.
        if (contentBuffer != null) {
View Full Code Here

        if (pageContext.getPageTagId() != null) {
            a.setId(pageContext.getPageTagId());
        }
        a.setName(fragmentName);

        final OutputBuffer linkBuffer = getLinkBuffer(destination, toEnclosing);

        a.setLinkText(linkBuffer);

        VolantisProtocol protocol = pageContext.getProtocol();
        try {
View Full Code Here

     * @return the output buffer containing the link
     */
    OutputBuffer getLinkBuffer(final Fragment fragment,
                               final boolean toEnclosing) {
        String linkText = null;
        OutputBuffer linkBuffer = null;
        FragmentInstance fragmentContext = (FragmentInstance) pageContext.
            getDeviceLayoutContext().getCurrentFormatInstance(fragment);

        // Check whether to use linkText or backLinkText.
        if (null != fragmentContext) {
            if (toEnclosing) {
                linkBuffer = fragmentContext.getLinkFromBuffer();
                if (linkBuffer == null) {
                    linkText = fragmentContext.getLinkFromText();
                }

                // To maintain backwards compabillity get linkToText
                // if not back link text is specified.
                if ((linkBuffer == null || linkBuffer.isEmpty()) &&
                     (linkText == null || linkText.length() == 0)) {
                    linkBuffer = fragmentContext.getLinkToBuffer();
                    if (linkBuffer == null) {
                        linkText = fragmentContext.getLinkToText();
                    }
                }
            } else {
                linkBuffer = fragmentContext.getLinkToBuffer();
                if (linkBuffer == null) {
                    linkText = fragmentContext.getLinkToText();
                }
            }
        }

        // Extract project to resolve policy expressions against.
        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        TextAssetReference textReference =
                resolver.resolveQuotedTextExpression(linkText);

        // Retrive the text from asset and set the
        // linkText if textReference is a text asset.
        if (textReference != null) {
            linkText = textReference.getText(TextEncoding.PLAIN);

            linkBuffer =
                pageContext.getDeviceLayoutContext().allocateOutputBuffer();
            linkBuffer.writeText(linkText);
        }

        if (logger.isDebugEnabled()) {
            logger.debug("LinkText = " + linkText);
        }
        if (linkBuffer == null) {
            linkBuffer =
                pageContext.getDeviceLayoutContext().allocateOutputBuffer();
        }
        if (linkBuffer.isEmpty()) {
            linkBuffer.writeText(fragment.getName());
        }
        return linkBuffer;
    }
View Full Code Here

    public void writeOpenGridRow(GridRowAttributes attributes) {
        // Don't write anything out for the grid row.

        // Push a buffer onto the stack into which the grid will write the
        // contents of this row.
        OutputBuffer rowBuffer = rowBuffers.getBuffer(attributes.getRow());
        outputBufferStack.pushOutputBuffer(rowBuffer);
    }
View Full Code Here

    public void writeCloseGridRow(GridRowAttributes attributes) {
        // Don't write anything out for the grid row.

        // Pop the buffer into which the grid wrote the contents of this row.
        OutputBuffer rowBuffer = rowBuffers.getBuffer(attributes.getRow());
        outputBufferStack.popOutputBuffer(rowBuffer);
    }
View Full Code Here

     */
    private Writer getDelegate() {
        MarinerPageContext pageContext = ContextInternals.getMarinerPageContext(
                context.getInitialRequestContext());

        OutputBuffer outputBuffer = pageContext.getCurrentOutputBuffer();
        return outputBuffer.getWriter();
    }
View Full Code Here

        // The previous call to protocol.openCanvas will push the page and body
        // output buffers onto the stack, hiding the output buffer for the
        // anonymous region so push that on again. This needs to be done to
        // ensure that by default content from inside the body element
        // goes into the region and not into the body buffer.
        OutputBuffer anonymousBuffer =
                anonymousRegionInstance.getCurrentBuffer();
        pageContext.pushOutputBuffer(anonymousBuffer);
    }
View Full Code Here

        VolantisProtocol protocol = getProtocol(context);
        MarinerPageContext pageContext = getPageContext(context);
        try {
            // Pop the anonymous region buffer that was pushed on at the
            // end of the openCanvas() method.
            OutputBuffer anonymousBuffer =
                    anonymousRegionInstance.getCurrentBuffer();
            pageContext.popOutputBuffer(anonymousBuffer);

            pageContext.endPhase1BeginPhase2();
View Full Code Here

    }

    // Javadoc inherited
    public void callCloseOnProtocol(XDIMEContextInternal context) {
        MarinerPageContext pageContext = getPageContext(context);
        OutputBuffer buffer = pageContext.getCurrentOutputBuffer();
       
        ResponseTimerAttributes responseTimerAttributes = (ResponseTimerAttributes) protocolAttributes;
       
        buffer.writeText("{start: "+responseTimerAttributes.getStartTime());
        buffer.writeText(",stop: "+responseTimerAttributes.getStopTime());
        buffer.writeText("} ");
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.OutputBuffer

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.