Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerPageContext


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

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        XFActionAttributes attributes = (XFActionAttributes) 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.XFActionAttributes pattributes
                = new com.volantis.mcs.protocols.XFActionAttributes();

        // Validate the type attribute.
        String type = attributes.getType();
        if (type == null) {
            throw new PAPIException(exceptionLocalizer.format("type-required"));
        }

        if (inline()) {
            if (!TYPE_PERFORM.equals(type)) {
                throw new PAPIException(
                        exceptionLocalizer.format("inline-xfaction-type-error",
                                new Object[]{TYPE_PERFORM,
                                        type}));
            }
        } else {
            if (!TYPE_SUBMIT.equals(type) && !TYPE_RESET.equals(type)) {
                // MCSPA0044X="Form xfaction must either be of type '{2}' or '{3}', not '{4}'"
                throw new PAPIException(
                        exceptionLocalizer.format("invalid-xfaction-type",
                                new Object[]{TYPE_SUBMIT,
                                        TYPE_RESET,
                                        type}));
            }
        }

        // Set the type attribute.
        pattributes.setType(type);

        // Set the value attribute, for backward compatability if the value is not
        // set then it defaults to the caption.
        String value = attributes.getValue();
        if (value == null) {
            // This code should be removed when we stop defaulting to the caption
            // value.
            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();
            TextAssetReference object
                    = resolver.resolveQuotedTextExpression(
                    attributes.getCaption());
            String caption = getPlainText(object);
            if (caption != null) {
View Full Code Here


    public Writer getContentWriter(
            MarinerRequestContext context,
            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

     */
    private MarinerRequestContext getMarinerRequestContext() {
        MarinerRequestContextMock requestContext =
                new MarinerRequestContextMock("requestContext", expectations);

        MarinerPageContext pageContext = getMarinerPageContext(requestContext);

        requestContext.expects.getMarinerPageContext().
                returns(pageContext).any();

        return requestContext;
View Full Code Here

    // Javadoc inherited from super class.
    public Writer getDirectWriter(MarinerRequestContext context)
            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

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

        // Extract the mariner request context from the expression context and
        // the page context from there
        MarinerRequestContext requestContext =
                (MarinerRequestContext)expressionContext.getProperty(
                        MarinerRequestContext.class);
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(requestContext);

        // The first parameter is the stem name of the format
        String name = values[0].stringValue().asJavaString();

        // Convert the values array int indeces.
        int[] indeces = new int[values.length - 1];
        for (int i = 0; i < indeces.length; i += 1) {
            indeces[i] = getIntValue(values[i + 1]);
        }

        FormatReferenceFinder formatReferenceFinder =
                pageContext.getFormatReferenceFinder();
        FormatReference reference =
                formatReferenceFinder.getFormatReference(name, indeces);

        return new FormatReferenceValueImpl(
                expressionContext.getFactory(), reference);
View Full Code Here

    public void createPackage(MarinerRequestContext context,
                              PackageBodySource bodySource,
                              Object bodyContext)
        throws PackagingException {

        final MarinerPageContext pageContext =
             ContextInternals.getMarinerPageContext(context);

        try {
            // Perform basic page response initialization
            pageContext.initialiseResponse();

            final Encoding encoding = pageContext.getCharsetEncoding();
            if (encoding == null) {
                throw new PackagingException(
                            exceptionLocalizer.format("no-charset"));
            }
            final EnvironmentContext envContext =
                    pageContext.getEnvironmentContext();

            // Get the body source written to the response writer
            bodySource.write(new AbstractPackageBodyOutput() {
                // Retrieve the output stream from the page context and
                // filter up any errors
View Full Code Here

    public void render(final FormatRendererContext context, final FormatInstance instance)
            throws RendererException {
        try {
            if (context.isFragmentationSupported()) {
                if (!instance.isEmpty()) {
                    final MarinerPageContext pageContext =
                        context.getDeviceLayoutContext().getMarinerPageContext();
                    final ResponseCachingDirectives cachingDirectives =
                        pageContext.getEnvironmentContext().getCachingDirectives();
                    // caching is not supported for fragmented pages
                    if (cachingDirectives != null) {
                        cachingDirectives.disable();
                    }
View Full Code Here

     * This Constructor can be used to obtain a PaneFormat for the current pane.
     * It should only be used after an opening <pane> element.
     */

    public PaneFormatImpl(MarinerRequestContext req) {
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(req);
        mPane = pageContext.getCurrentPane();
    }
View Full Code Here

    }

    // Javadoc inherited
    protected void callCloseOnProtocol(XDIMEContextInternal context) {

        final MarinerPageContext pageContext = getPageContext(context);
        pageContext.popOutputBuffer(bodyContentBuffer);

        // We store the canvas initialisation data on the grandparent html
        // element. So get a reference to the grandparent html element.
        Stack elementStack = ((XDIMEContextImpl)context).getStack();
        int stackSize = elementStack.size();
View Full Code Here

            MarinerRequestContext context,
            AbstractAnchorBaseAttributes attributes,
            AnchorBaseAttributes pattributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        pattributes.setId(attributes.getId());
        pattributes.setTitle(attributes.getTitle());

        // Initialise the general event attributes
        PAPIInternals.initialiseGeneralEventAttributes(pageContext,
                attributes,
                pattributes);

        // Initialise the focus event attributes
        PAPIInternals.initialiseFocusEventAttributes(pageContext,
                attributes,
                pattributes);

        String value;
        TextAssetReference shortcut = null;
        TextAssetReference accessKey = null;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Resolve the shortcut string to a mariner expression
        if ((value = attributes.getShortcut()) != null) {
            shortcut = resolver.resolveQuotedTextExpression(value);
        }
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.