Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerPageContext


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

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        BlockAttributes attributes = (BlockAttributes) papiAttributes;

        // Try and find the pane with the specified name, if it could not be
        // found then return and skip the element body.
        String paneName = attributes.getPane();
        if (paneName != null) {
            FormatReference formatRef =
                    FormatReferenceParser.parsePane(paneName, pageContext);
            Pane pane = pageContext.getPane(formatRef.getStem());
            NDimensionalIndex paneIndex = formatRef.getIndex();

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

            paneInstance = (AbstractPaneInstance)
                    pageContext.getFormatInstance(pane, paneIndex);
            if (paneInstance.ignore()) {
                skipped = true;
                return SKIP_ELEMENT_BODY;
            }

            pageContext.pushContainerInstance(paneInstance);
        } else if (pageContext.getCurrentPane() == null) {
            if (pageContext.getEnclosingRegionInstance() == null) {
                // this element doesn't have a pane specified and the pane and
                // region stacks are empty. This is not allowed.
                throw new PAPIException(
                        exceptionLocalizer.format("pane-name-not-found"));
            }
        }

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

        return elementStartImpl(context, attributes);
    }
View Full Code Here


        if (skipped) {
            return CONTINUE_PROCESSING;
        }

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

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

        int result = elementEndImpl(context,
                (BlockAttributes) papiAttributes);

        if (paneInstance != null) {
            pageContext.popContainerInstance(paneInstance);
        }

        return result;
    }
View Full Code Here

    public int styleElementStart(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes)
            throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
        SelectAttributes attributes = (SelectAttributes) papiAttributes;
        Precept precept = Precept.MATCH_FIRST;
        Value expr = BooleanValue.TRUE;

        if (attributes.getPrecept() != null) {
            precept = Precept.literal(attributes.getPrecept());

            if (precept == null) {
                throw new PAPIException(exceptionLocalizer.format(
                        "unrecognized-precept-value",
                        attributes.getPrecept()));
            }
        }

        if (attributes.getExpr() != null) {
            ExpressionContext expressionContext =
                    ContextInternals.getEnvironmentContext(context).
                            getExpressionContext();

            try {
                expr = expressionContext.getFactory().
                        createExpressionParser().
                        parse(attributes.getExpr()).evaluate(expressionContext);
            } catch (ExpressionException e) {
                throw new PAPIException(e);
            }
        }

        pageContext.pushSelectState(new SelectState(precept, expr));

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

    // javadoc inherited
    public int styleElementEnd(
            MarinerRequestContext context,
            PAPIAttributes papiAttributes) throws PAPIException {

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
        pageContext.popSelectState();

        return CONTINUE_PROCESSING;
    }
View Full Code Here

           
            tabsRenderer.renderOpen(
                    getProtocol(context),
                    (WidgetAttributes)protocolAttributes);
           
            MarinerPageContext pageContext = getPageContext(context);       

            //create anonymous layout for tab's contents
            contentsRegionInstance = createAnonymousRegion(pageContext);

            //create anonymous layout for tab's labels
View Full Code Here

        throws DissectionException {

        RuntimeDissectionContext runtimeDissectionContext
            = (RuntimeDissectionContext) dissectionContext;

        MarinerPageContext context
            = runtimeDissectionContext.getMarinerPageContext();

        int currentIndex = context.getFragmentationIndex();

        // Generate the value of the request parameter.
        String value
            = PageGenerationCache.makeShardChangeSpecifier(currentIndex,
                                                           changeIndex);
View Full Code Here

        throws DissectionException {

        RuntimeDissectionContext runtimeDissectionContext
            = (RuntimeDissectionContext) dissectionContext;

        MarinerPageContext context
            = runtimeDissectionContext.getMarinerPageContext();

        return makeURL(context, documentURL, LARGE_FRAGMENTATION_SPECIFIER);
    }
View Full Code Here

        final VolantisProtocol protocol = getProtocol();

        MethodInvoker invoker = new MethodInvoker() {
            public void invoke() throws Exception {
                if (protocol instanceof DOMProtocol) {
                    MarinerPageContext context = protocol.getMarinerPageContext();
                    FormInstance formInstance = (FormInstance) context.
                            getFormatInstance(attributes.getForm(), NDimensionalIndex.ZERO_DIMENSIONS);
                    ((DOMOutputBuffer) formInstance.getContentBuffer(true)).
                            saveInsertionPoint();
                }
                protocol.writeOpenForm(attributes);
View Full Code Here

    public void createPackage(MarinerRequestContext context,
                              PackageBodySource bodySource,
                              Object bodyContext)
        throws PackagingException {
        MarinerPageContext pageContext =
            ContextInternals.getMarinerPageContext(context);

        // Construct the MIME multipart package
        MimeMultipart pkg = new MimeMultipart();
View Full Code Here

                new AbstractPackageBodyOutput() {
                    public OutputStream getRealOutputStream() {
                        return stream;
                    }
                    public Writer getRealWriter() {
                        MarinerPageContext pageContext =
                                ContextInternals.getMarinerPageContext(
                                        requestContext);
                        Encoding charsetEncoding =
                                pageContext.getCharsetEncoding();
                        if (charsetEncoding == null) {
                            throw new RuntimeException(
                                "No charset found, unable to generate page");
                        }
                        return new CharsetEncodingWriter(
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.