Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerPageContext


            throws IAPIException {       
        if (parent != null) {
            parent.setArguments(arguments);
            // only pop ourselves of the stack if there was a parent.  if there
            // wasn't we would not have pushed ourselves onto the stack.
            MarinerPageContext pageContext =
                    ContextInternals.getMarinerPageContext(context);
            pageContext.popIAPIElement();
        }               
       
        return CONTINUE_PROCESSING;
    }
View Full Code Here


    protected int exprElementEnd(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

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

        return CONTINUE_PROCESSING;
    }
View Full Code Here

            PAPIAttributes papiAttributes) throws PAPIException {

        XFContentAttributes attributes = (XFContentAttributes) papiAttributes;

        // Get the page context.
        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        // Get the enclosing form element's attributes.
        XFFormElementImpl formElement
                = (XFFormElementImpl) pageContext.getCurrentElement();
        com.volantis.mcs.protocols.XFFormAttributes formAttributes =
                formElement.getProtocolAttributes();

        String paneName = attributes.getPane();
        Pane pane = null;
        if (null == paneName) {
            FormInstance form = (FormInstance) formAttributes.getFormData();
            pane = ((Form) form.getFormat()).getDefaultPane();
            paneName = pane.getName();
        }

        FormatReference formatRef =
                FormatReferenceParser.parsePane(paneName, pageContext);
        NDimensionalIndex paneIndex = formatRef.getIndex();

        if (null == pane) {
            // get hold of the Pane via it's FormatReference
            pane = pageContext.getPane(formatRef.getStem());
            if (null == pane) {
                // nothing to do, skip both the content and the end tag
                skipEndTag = true;
                return SKIP_ELEMENT_BODY;
            }
        }

        paneInstance = (AbstractPaneInstance)
                pageContext.getFormatInstance(pane, paneIndex);
        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"));
        }

        pattributes = new com.volantis.mcs.protocols.XFContentAttributes();
        pattributes.setPane(pane);
        pattributes.setOutputBuffer(buffer);
        pattributes.setStyles(pageContext.getStylingEngine().getStyles());
        // Create the field descriptor.
        FieldDescriptor fieldDescriptor = new FieldDescriptor();
        fieldDescriptor.setType(ContentFieldType.getSingleton());

        // Add a reference to the field descriptor into the attributes.
        pattributes.setFieldDescriptor(fieldDescriptor);
        // Add the attributes to the list.
        formAttributes.addField(pattributes);

        pageContext.pushContainerInstance(paneInstance);
        pageContext.pushOutputBuffer(buffer);

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

        if (skipEndTag) {
            return CONTINUE_PROCESSING;
        }

        // Get the page context.
        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        // pop the Pane & OutputBuffer form the pageContext stacks.
        pageContext.popOutputBuffer(pattributes.getOutputBuffer());
        pageContext.popContainerInstance(paneInstance);

        return CONTINUE_PROCESSING;
    }
View Full Code Here

     */
    protected int exprElementStart(
            MarinerRequestContext context,
            PAPIAttributes baseAttributes) throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        MenuItemGroupAttributes attributes =
                (MenuItemGroupAttributes) baseAttributes;

        MenuModelBuilder builder = pageContext.getMenuBuilder();

        try {
            // Retrive the pane name...
            String paneName = attributes.getPane();

            // Emulating behaviour for BlockAttributes and panes
            if (paneName != null) {
                // Try and find the pane with the specified name, if it could
                // not be found then return and skip the element body.
                FormatReference formatRef =
                        FormatReferenceParser.parsePane(paneName, pageContext);
                Pane pane = pageContext.getPane(formatRef.getStem());

                if (pane == null) {
                    skipped = true;
                    return SKIP_ELEMENT_BODY;
                }
            }

            // Start a new menu group
            builder.startMenuGroup();

            // Setting attributes on the menu group

            // Set the pane attribute
            MenuInternals.setPane(builder, paneName, pageContext);

            // Set the stylistic information in the model for this element.
            MenuInternals.setElementDetails(builder, attributes,
                    pageContext.getStylingEngine().getStyles());

        } catch (BuilderException be) {
            logger.error("menu-building-error", be);
            throw new PAPIException(
                    exceptionLocalizer.format("menu-building-error"), be);
View Full Code Here

            PAPIAttributes baseAttributes) throws PAPIException {

        // Emulating behaviour for BlockAttributes and panes
        if (!skipped) {
            // Only want to do this is the element start did not skip processing
            MarinerPageContext pageContext =
                    ContextInternals.getMarinerPageContext(context);

            MenuModelBuilder builder = pageContext.getMenuBuilder();

            try {
                // End the existing menu group
                builder.endMenuGroup();
            } catch (BuilderException be) {
View Full Code Here

    protected int exprElementStart(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        if (!pageContext.isCanvasFirstChild()) {
            logger.error("layout-must-be-first");
            throw new PAPIException(
                    exceptionLocalizer.format("canvas-layout-not-first"));
        }
        logger.info("device-name-info", pageContext.getDeviceName());
        logger.info("device-info", pageContext.getDevice());
        logger.info("device-layout-info", pageContext.getDeviceLayout());
        logger.info("device-layout-context-info",
                pageContext.getDeviceLayoutContext());

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

    protected int elementStartImpl(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            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
            // by the protocol.
            com.volantis.mcs.protocols.XFUploadAttributes pattributes
                    = new com.volantis.mcs.protocols.XFUploadAttributes();

            // Initialise the attributes specific to this field.
            TextAssetReference object;
            String value;

            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();

            // Set the initial value attribute.
            object = resolver.resolveQuotedTextExpression(
                    attributes.getInitial());
            pattributes.setInitial(object);
View Full Code Here

    protected int exprElementStart(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        RegionAttributes attributes = (RegionAttributes) papiAttributes;

        if (logger.isDebugEnabled()) {
            logger.debug("RegionElement start " + attributes.getName());
        }

        String regionName = attributes.getName();

        if (regionName == null) {
            logger.error("region-name-missing");
            throw new PAPIException(
                    exceptionLocalizer.format("region-name-missing"));
        }

        FormatReference formatRef =
                FormatReferenceParser.parse(regionName, pageContext);
        Region region = pageContext.getRegion(formatRef.getStem());
        NDimensionalIndex regionIndex = formatRef.getIndex();

        if (region == null) {
            logger.info("region-missing", new Object[]{attributes.getName()});
            skipped = true;
            return SKIP_ELEMENT_BODY;
        }

        regionInstance = (RegionInstance) pageContext.getFormatInstance(
                region, regionIndex);
        if (regionInstance.ignore()) {
            skipped = true;
            return SKIP_ELEMENT_BODY;
        }

        pageContext.pushContainerInstance(regionInstance);

        // Fake an open element so that whitespace is handled normally since we
        // have no element to represent pane at the moment.
        pageContext.getCurrentOutputBuffer()
                .handleOpenElementWhitespace();

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

    protected int exprElementEnd(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        // Fake a close element so that whitespace is handled normally since we
        // have no element to represent pane at the moment.
        pageContext.getCurrentOutputBuffer()
                .handleCloseElementWhitespace();

        RegionAttributes attributes = (RegionAttributes) papiAttributes;

        if (logger.isDebugEnabled()) {
            logger.debug("RegionElement end " + attributes.getName());
        }

        if (skipped) {
            return CONTINUE_PROCESSING;
        }

        pageContext.popContainerInstance(regionInstance);

        return CONTINUE_PROCESSING;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.MarinerPageContext

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.