Examples of MarinerPageContext


Examples of com.volantis.mcs.context.MarinerPageContext

            MarinerRequestContext context,
            PAPIAttributes papiAttributes) throws PAPIException {

        NoScriptAttributes attributes = (NoScriptAttributes) papiAttributes;

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();

        try {
            // Check to see whether the protocol supports java script, if it
            // does then check if we have a idRef to a script and if the script
            // asset is invalid, if so then put out plain markup without
            // <noscript></noscript> elements, but wrapped in span elements.
            //
            if (protocol.supportsJavaScript()) {
                // Is there and idref attribute?
                if (attributes.getIdref() != null) {
                    // Is the idref's asset valid?
                    if (pageContext.getIdValue(attributes.getIdref()) == null) {
                        // We need to skip the tags but still send the plain
                        // markup wrapped in a span element.
                        skipped = true;
                        SpanAttributes spanAttributes = new SpanAttributes();
                        spanAttributes.setStyles(pattributes.getStyles());
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

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

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();

        if (skipped) {
            // span attributes are unused in the close method.
            protocol.writeCloseSpan(null);
        } else {
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

                attributes.getLayoutName());

        // Push the style sheet associated with the montage onto the styling
        // engine before we try and process the element. This is required since
        // montage can itself have styles.
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
        getThemeStyleSheets().pushAll(pageContext.getStylingEngine());

        return super.elementStart(context, papiAttributes);
    }
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

        int result = super.elementEnd(context, papiAttributes);

        // Now that montage has finished processing, remove the style sheet
        // associated with the montage element.
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
        getThemeStyleSheets().popAll(pageContext.getStylingEngine());

        return result;
    }
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

                            IAPIAttributes iapiAttributes)
            throws IAPIException {
       
        ArgumentAttributes attrs = (ArgumentAttributes) iapiAttributes;
       
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);       
       
        ArgumentsElement parent = null;
        try {
            parent = (ArgumentsElement) pageContext.peekIAPIElement();
        } catch (Exception e) {
            logger.error("iapi-element-no-parent-arguments", e);
             throw new IAPIException(
                         exceptionLocalizer.format(
                                     "iapi-element-no-parent-arguments"),
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

    protected int elementEndImpl(
            MarinerRequestContext context,
            BlockAttributes blockAttributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        // Pop this element
        pageContext.popElement(this);

        MenuModelBuilder builder = pageContext.getMenuBuilder();

        try {
            Menu menu = builder.endMenu();

            // If a menu is completed (i.e. this is not nested) then need to
            // process it and output against specific renderer and markup.
            if (menu != null) {
                // Obtain a suitable renderer
                MenuRendererSelectorLocator rendererLocator =
                        pageContext.getRendererLocator();
                MenuRendererSelector rendererSelector =
                        rendererLocator.getMenuRendererSelector(pageContext);
                if (rendererSelector == null) {
                    logger.error("selector-rendering-error", "menu");
                    throw new PAPIException(exceptionLocalizer.format(
                            "missing-renderer-selector", "menu"));
                }

                MenuRenderer renderer =
                        rendererSelector.selectMenuRenderer(menu);

                final ShortcutProperties shortcutProperties =
                        menu.getShortcutProperties();
                if (null != shortcutProperties) {
                    // If the device cannot support mixed content in the body
                    // of a link, then update the shortcut properties so that
                    // span elements will not be used.
                    String supportsMixedContent = pageContext.
                            getDevicePolicyValue(DevicePolicyConstants.
                                    X_ELEMENT_A_SUPPORTS_MIXED_CONTENT);
                    if (DevicePolicyConstants.NO_SUPPORT_POLICY_VALUE.equals
                            (supportsMixedContent)) {
                        shortcutProperties.setSupportsSpan(false);
                    }

                    // If the device inserts line breaks before links, then
                    // shortcuts must appear in the active area or the layout
                    // will be incorrect (regardless of the value specified in
                    // the styles).
                    String insertsLineBreaks = pageContext.getDevicePolicyValue(
                            DevicePolicyConstants.X_ELEMENT_A_BREAKS_LINE);
                    if ("before".equals(insertsLineBreaks)) {
                        shortcutProperties.setActive(true);
                    }
                }
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

    protected int elementStartImpl(
            MarinerRequestContext context,
            BlockAttributes blockAttributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        MenuAttributes attributes = (MenuAttributes) blockAttributes;

        // Get hold of the menu builder - this will be initialised if needed
        MenuModelBuilder builder = pageContext.getMenuBuilder();

        try {
            // Starting a new menu
            builder.startMenu();

            // Setting attributes on the menu

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

            // Get the styling property values for the current element
            Styles styles = pageContext.getStylingEngine().getStyles();

            // Emulate deprecated menu styles if necessary
            useDeprecatedMenuTypes(styles, attributes.getType());

            // Store the propertyvalues for any child use
            menuProperties = styles.getPropertyValues();

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

            // Set the event handling
            MenuInternals.setEvents(builder, attributes, pageContext);

            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();

            // Set the prompt
            builder.setPrompt(resolver.resolveQuotedTextExpression(
                    attributes.getPrompt()));

            // Set the error message
            builder.setErrorMessage(resolver.resolveQuotedTextExpression(
                    attributes.getErrmsg()));

            // Set the help
            builder.setHelp(resolver.resolveQuotedTextExpression(
                    attributes.getHelp()));

            // Set the title
            builder.setTitle(attributes.getTitle());

            // Set the Shortcut properties.
            setShortcutPropertiesOnBuilder(pageContext, builder, styles);

            // Push this element
            pageContext.pushElement(this);

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

Examples of com.volantis.mcs.context.MarinerPageContext

    // Javadoc inherited from IAPIElement interface
    public int elementStart(MarinerRequestContext context,
                            IAPIAttributes iapiAttributes)
            throws IAPIException {
        // Push this element onto the IAPI stack.
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
        pageContext.pushIAPIElement(this);

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

    // Javadoc inherited from IAPIElement interface
    public int elementEnd(MarinerRequestContext context,
                          IAPIAttributes iapiAttributes)
            throws IAPIException {
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        MarkupPluginManager manager =
                pageContext.getVolantisBean().getMarkupPluginManager();

        InvokeAttributes attrs = (InvokeAttributes) iapiAttributes;

        final String pluginName = attrs.getName();
        MarkupPlugin plugin = manager.getMarkupPlugin(context, pluginName);

        String name = attrs.getName();
        String methodName = attrs.getMethodName();

        MarkupPluginMethod method = MarkupPluginMethod.literal(methodName);
        if (MarkupPluginMethod.INITIALIZE == method) {
            // Get the MarinerApplication to pass to the plugin initialise
            // method.
            MarinerApplication application
                    = context.getMarinerApplication();
            if (arguments == null) {
                arguments = new HashMap();
            }
            arguments.put(IntegrationPlugin.APPLICATION, application);
            doPluginInitialize(plugin, arguments, name);

        } else if (MarkupPluginMethod.PROCESS == method) {
            doPluginProcess(context, plugin, arguments, name);
        } else if (MarkupPluginMethod.RELEASE == method) {
            doPluginRelease(plugin, name);
        } else {
            logger.warn("plugin-method-invocation-failure",
                        new Object[]{methodName, name,
                                     MarkupPlugin.class.getName()});
        }

        // pop this element off the IAPI stack.
        pageContext.popIAPIElement();

        return CONTINUE_PROCESSING;
    }
View Full Code Here

Examples of com.volantis.mcs.context.MarinerPageContext

    // Javadoc inherited from IAPIElement interface
    public int elementStart(MarinerRequestContext context,
                            IAPIAttributes iapiAttributes)
            throws IAPIException {
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);       
       
        arguments = new HashMap();
       
        parent = null;
        try {
            parent = (InvokeElement) pageContext.peekIAPIElement();
        } catch (Exception e) {           
            logger.error("iapi-element-no-parent-markup-plugin", e);
             throw new IAPIException(
                         exceptionLocalizer.format(
                                     "iapi-element-no-parent-markup-plugin"),
                         e);
        }
       
        if (parent == null) {
            logger.error("iapi-element-no-parent-markup-plugin");
            throw new IAPIException(
                         exceptionLocalizer.format(
                                     "iapi-element-no-parent-markup-plugin"));
        }
       
        pageContext.pushIAPIElement(this);
               
        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.