Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerPageContext


                            PAPIAttributes mcsiAttributes)
            throws PAPIException {

        GeneratedResourcesAttributes attrs = (GeneratedResourcesAttributes)
                mcsiAttributes;
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        generatedResourcesConfiguration = new GeneratedResourcesConfiguration();
        generatedResourcesConfiguration.setBaseDir(attrs.getBaseDir());

        parent = findParent(pageContext, elementName);

        pageContext.pushMCSIElement(this);

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here


        if (parent != null) {
            parent.setGeneratedResourcesConfiguration(
                    generatedResourcesConfiguration);
            // 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.popMCSIElement();
        }

        return CONTINUE_PROCESSING;
    }
View Full Code Here

    public void testRenderAltText() {
        privateSetUp();

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);       

        protocol.renderAltText("alt text",new ImageAttributes());
        String result = null;

        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());
        assertEquals(result,"alt text");
    }
View Full Code Here

    public void testWriteHorizontalRule(){
        privateSetUp();
        String result = null;

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);

        protocol.doHorizontalRule(new DOMOutputBuffer(),new HorizontalRuleAttributes());
        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());

        assertEquals("---",result);
    }
View Full Code Here

        String result = null;
        OutputBuffer outputBuffer = new SMS_DOMOutputBuffer();
        outputBuffer.writeText(expectedResult);

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);


        protocol.writeRowIteratorPaneElementContents(outputBuffer);
        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());
       
        assertEquals(expectedResult, result);
    }
View Full Code Here

        String result = null;
        String expectedResult = "output buffer content";

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);

        try {
            OutputBuffer outputBuffer = new SMS_DOMOutputBuffer();
            outputBuffer.writeText(expectedResult);
            protocol.writePaneContents(outputBuffer);
        } catch (IOException e) {
            e.printStackTrace();
        }

        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());
        assertEquals(expectedResult, result);
    }
View Full Code Here

    /**
     * Tests if writing out a pre element keeps white-spaces.
     */
    public void testPre() throws Exception {
        final DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);
        final PreAttributes attributes = new PreAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        protocol.writeOpenPre(attributes);
        final DOMOutputBuffer buffer =
            (DOMOutputBuffer) context.getCurrentOutputBuffer();
        assertNotEquals(rootBuffer, buffer);

        buffer.writeText("     before     ");
        context.getCurrentOutputBuffer().writeText("     child     text     ");
        buffer.writeText("     after     ");
        protocol.writeClosePre(attributes);

        // check the result
        checkResultForPre(rootBuffer);
View Full Code Here

        String result = null;

        SMS_DOMOutputBuffer emptyBuffer = new SMS_DOMOutputBuffer();       

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);

        ListItemAttributes listItemAttributes = new ListItemAttributes();

        protocol.openOrderedList(emptyBuffer, new OrderedListAttributes());
        protocol.openListItem( emptyBuffer, listItemAttributes);
        protocol.openListItem( emptyBuffer, listItemAttributes);
        protocol.openListItem( emptyBuffer, listItemAttributes);
        protocol.openListItem( emptyBuffer, listItemAttributes);
        protocol.closeOrderedList(emptyBuffer, new OrderedListAttributes());

        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());
        assertEquals("1 2 3 4",result);
    }
View Full Code Here

    public void testWriteClosePhoneNumber(){
        privateSetUp();
        String result = null;

        final SMS_DOMOutputBuffer rootBuffer = new SMS_DOMOutputBuffer();
        final MarinerPageContext context = protocol.getMarinerPageContext();
        context.pushOutputBuffer(rootBuffer);

        PhoneNumberAttributes phoneNumberAttributes = new PhoneNumberAttributes();
        phoneNumberAttributes.setDefaultContents("+4444444444");
        protocol.writeOpenPhoneNumber(phoneNumberAttributes);

        protocol.writeClosePhoneNumber(phoneNumberAttributes);

        result = getMarkup((DOMOutputBuffer)context.getCurrentOutputBuffer());
        assertEquals(result,"(+4444444444)");
    }
View Full Code Here

    public int elementStart(MarinerRequestContext context,
                            PAPIAttributes mcsiAttributes)
            throws PAPIException {
               
        XmlPoliciesAttributes attrs = (XmlPoliciesAttributes) mcsiAttributes;
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        InternalProjectFactory factory =
                InternalProjectFactory.getInternalInstance();

        policySource = factory.createXMLPolicySource(null, attrs.getDirectory());

        parent = findParent(pageContext, elementName);

        pageContext.pushMCSIElement(this);

        return PROCESS_ELEMENT_BODY;
    }
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.