Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.VolantisProtocol


            PAPIAttributes papiAttributes)
            throws PAPIException {

        try {
            // Get the protocol.
            VolantisProtocol protocol = pageContext.getProtocol();

            // Open the montage page.
            // @todo pattributes are not set here - does something else do it?
            protocol.openMontagePage(pattributes);

            return PROCESS_ELEMENT_BODY;
        } catch (IOException e) {
            logger.error("unexpected-ioexception", e);
            throw new PAPIException(e);
View Full Code Here


            return CONTINUE_PROCESSING;
        }

        try {
            // Get the protocol.
            VolantisProtocol protocol = pageContext.getProtocol();

            // If this device does not support aggregation then we
            // need to send a redirect to the default segment specified
            // in the layout.
            boolean supportsAggregation
                    = pageContext.getBooleanDevicePolicyValue("aggregation");

            if (!supportsAggregation) {

                MarinerURL requestURL = pageContext.getRequestURL(true);
                RuntimeDeviceLayout deviceLayout =
                        pageContext.getDeviceLayout();
                String defaultSegmentSrc = getDefaultSegmentSrc(deviceLayout,
                        pageContext);

                if (defaultSegmentSrc != null) {
                    // Resolve the defaultSegmentSrc relative to the current request URL
                    MarinerURL url =
                            new MarinerURL(requestURL, defaultSegmentSrc);

                    String destination = url.getExternalForm();

                    if (logger.isDebugEnabled()) {
                        logger.debug("MontageTag: device "
                                + pageContext.getDeviceName()
                                + "does not support aggregation."
                                + " Sending redirect to "
                                + destination);
                    }

                    pageContext.sendRedirect(url);

                    //  redirected = true;
                    return ABORT_PROCESSING;
                } else {
                    throw new PAPIException(exceptionLocalizer.format(
                            "default-segment-missing-no-aggregation",
                            new Object[]{pageContext.getDeviceName(),
                                    deviceLayout.getName()}));
                }
            }

            pageContext.endPhase1BeginPhase2();

            protocol.closeMontagePage(pattributes);
            return CONTINUE_PROCESSING;
        } catch (IOException e) {
            logger.error("unexpected-ioexception", e);
            throw new PAPIException(e);
        } catch (ProtocolException e) {
View Full Code Here

            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();
        protocol.writeDivideHint(pattributes);

        return CONTINUE_PROCESSING;
    }
View Full Code Here

    }

    protected VolantisProtocol createTestableProtocol(
            InternalDevice internalDevice) {
        ProtocolBuilder builder = new ProtocolBuilder();
        VolantisProtocol protocol = builder.build(
                new TestProtocolRegistry.TestMHTMLFactory(), internalDevice);
        return protocol;
    }
View Full Code Here

        if (paneInstance.ignore()) {
            skipEndTag = true;
            return SKIP_ELEMENT_BODY;
        }

        VolantisProtocol protocol = pageContext.getProtocol();
        buffer = protocol.getOutputBufferFactory().createOutputBuffer();
        if (buffer == null) {
            throw new PAPIException(exceptionLocalizer.format(
                    "output-buffer-allocation-failure"));
        }
View Full Code Here

            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();
        if (protocol.getProtocolConfiguration().isFileUploadSupported()) {

            XFUploadAttributes attributes = (XFUploadAttributes) papiAttributes;

            // Create a new protocol attributes object every time, as this element
            // could be reused before the attributes have actually been finished with
View Full Code Here

            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);
        VolantisProtocol protocol = pageContext.getProtocol();

        OutputBufferWriter writer = protocol.getContentWriter();
        configureWriter(writer);
        return writer;
    }
View Full Code Here

            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();
        OutputBufferWriter writer = protocol.getDirectWriter();
        configureWriter(writer);
        return writer;
    }
View Full Code Here

        if (protocolName == null) {
            throw new IllegalStateException("Device protocol policy missing");
        }

        // Create a configured protocol.
        VolantisProtocol protocol = protocolBuilder.build(protocolName, device);

        boolean packagerAssigned = false;
        String packagingType = null;

        // Determine whether we should attempt to set up a multipart packager
        if (volantisBean.isPagePackagingMimeEnabled()) {
            // NB: The mode can only be null if the device policy hasn't been
            // added to the repository or if an invalid value has been
            // supplied. In this case we want "default" behaviour (which we get
            // with the following code)
            MimePackagingMode mode = MimePackagingMode.literal(
                    device.getPolicyValue(
                            DevicePolicyConstants.MIME_PACKAGING_MODE));

            // If packaging mode is never on the device then we never set up
            // a multipart packager
            if (mode != MimePackagingMode.NEVER) {
                // If the protocol supports packaging AND the mode is always OR
                // the request contains the required accept header then use
                // a multipart packager
                packagingType = protocol.getPackagingType();

                if ((packagingType != null) &&
                        ((mode == MimePackagingMode.ALWAYS) ||
                        ((packagingType = findPackaging(protocol,
                                                        requestContext)) !=
View Full Code Here

    // Javadoc inherited
    protected XDIMEResult callOpenOnProtocol(
            XDIMEContextInternal context, XDIMEAttributes attributes)
        throws XDIMEException {

        VolantisProtocol protocol = getProtocol(context);

        try {
            protocol.writeOpenHeading6((HeadingAttributes)protocolAttributes);
        } catch (ProtocolException e) {
            logger.error("rendering-error", getTagName(), e);

            throw new XDIMEException(exceptionLocalizer.format(
                "rendering-error", getTagName()), e);
View Full Code Here

TOP

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

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.