Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.DissectingPaneAttributes


                          prevLink);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        pane.setAttribute(FormatConstants.MAXIMUM_CONTENT_SIZE_ATTRIBUTE, maxContentSize);

        DissectingPaneAttributes atts = new DissectingPaneAttributes();
        atts.setDissectingPane(pane);
        atts.setInclusionPath(inclusionPath);
        atts.setIsNextLinkFirst(nextLinkFirst);

        protocol.setDissecting(true);
        protocol.openDissectingPane(buffer, atts);

        if (protocol.isDissectionSupported()) {
            Element el = null;
            try {
                el = buffer.closeElement
                    (DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
            } catch (IllegalStateException ise) {
                fail(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT +
                " element not found.");
            }

            // check that all the attributes have been written out
            assertEquals("Invalid inclusion path attribute",
                    el.getAttributeValue
                    (DissectionConstants.INCLUSION_PATH_ATTRIBUTE),
                    atts.getInclusionPath());

            assertEquals("Invalid pane name attribute",
                    el.getAttributeValue
                    (DissectionConstants.DISSECTING_PANE_NAME_ATTRIBUTE),
                    atts.getDissectingPane().getName());

            assertEquals("Invalid next shard shortcut attribute",
                    el.getAttributeValue
                    (DissectionConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE),
                    nextShortcut);
View Full Code Here


        // Set the protocol to allow tranformations
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        DissectingPaneAttributes atts = setupDissectingPaneTests();

        protocol.setDissecting(true);
        protocol.openDissectingPane(buffer, atts);

        Element el = null;
        try {
            el = buffer.closeElement
                    (DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
        } catch (IllegalStateException ise) {
            fail(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT +
                    " element not found.");
        }

        DissectableAreaIdentity dissectableAreaIdentity
                = ((DissectableAreaAttributes) el.getAnnotation()).
                getIdentity();
        // check that all the attributes have been written out
        assertEquals("Invalid inclusion path attribute",
                atts.getInclusionPath(),
                dissectableAreaIdentity.getInclusionPath());

        assertEquals("Invalid pane name attribute",
                atts.getDissectingPane().getName(),
                dissectableAreaIdentity.getName());
    }
View Full Code Here

        dlc.setMarinerPageContext(pageContext);
        dlc.setDeviceLayout(runtimeDeviceLayout);
        dlc.initialise();
        pageContext.pushDeviceLayoutContext(dlc);

        DissectingPaneAttributes atts = new DissectingPaneAttributes();
        atts.setDissectingPane(pane);
        atts.setInclusionPath(inclusionPath);
        atts.setIsNextLinkFirst(nextLinkFirst);
        // we have to set the text for the links in the attributes since
        // ShardLinkMenuModelBuilder.buildShardLinkMenuModel() depends on these values
        // being set
        atts.setLinkText(nextLink);
        atts.setBackLinkText(prevLink);
        atts.setStyles(StylesBuilder.getEmptyStyles());
        return atts;
    }
View Full Code Here

        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        pane.setAttribute(FormatConstants.MAXIMUM_CONTENT_SIZE_ATTRIBUTE,
                          maxContentSize);

        DissectingPaneAttributes atts = new DissectingPaneAttributes();
        atts.setDissectingPane(pane);
        atts.setInclusionPath(inclusionPath);
        atts.setIsNextLinkFirst(nextLinkFirst);

        protocol.setDissecting(true);
        protocol.openDissectingPane(buffer, atts);

        if (protocol.isDissectionSupported()) {
            Element el = null;
            try {
                el = buffer.closeElement("div");
                el = buffer.closeElement
                        (DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
            } catch (IllegalStateException ise) {
                fail(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT +
                     " element not found.");
            }

            // check that all the attributes have been written out
            assertEquals("Invalid inclusion path attribute",
                         el.getAttributeValue
                         (DissectionConstants.INCLUSION_PATH_ATTRIBUTE),
                         atts.getInclusionPath());

            assertEquals("Invalid pane name attribute",
                         el.getAttributeValue
                         (DissectionConstants.DISSECTING_PANE_NAME_ATTRIBUTE),
                         atts.getDissectingPane().getName());

            assertEquals("Invalid next shard shortcut attribute",
                         el.getAttributeValue
                         (DissectionConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE),
                         nextShortcut);
View Full Code Here

                          nextClass);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
                          prevShortcut);
        pane.setAttribute(FormatConstants.PREVIOUS_SHARD_LINK_CLASS_ATTRIBUTE,
                          prevClass);
        DissectingPaneAttributes attributes = new DissectingPaneAttributes();
        attributes.setLinkText(nextLink);
        attributes.setBackLinkText(prevLink);
        attributes.setDissectingPane(pane);
        attributes.setInclusionPath(inclusionPath);
        attributes.setIsNextLinkFirst(true);
        attributes.setStyles(StylesBuilder.getCompleteStyles(
                "mcs-menu-orientation: horizontal"));

        // Build the Menu from the DissectingPaneAttributes.
        OutputBufferFactory outputBufferFactory =
                new TestDOMOutputBufferFactory();
View Full Code Here

     * This method tests the method public void writeOpenDissectingPane (
     * DissectingPaneAttributes ) for the
     * com.volantis.mcs.protocols.VolantisProtocol class.
     */
    public void testWriteOpenDissectingPane() throws Exception {
        final DissectingPaneAttributes attributes =
                (DissectingPaneAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(DissectingPaneAttributes.class);

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

        String inclusionPath = context.getInclusionPath();
        DissectingPaneInstance paneInstance = (DissectingPaneInstance)
                abstractPaneInstance;

        // Initialise the attributes.
        DissectingPaneAttributes attributes =
                factory.createDissectingPaneAttributes();

        // Copy the tagname and style class from the old attributes
        // Dont just throw them away.
        PaneAttributes oldattr = paneInstance.getAttributes();
        attributes.setStyles(oldattr.getStyles());

        attributes.setInclusionPath(inclusionPath);
        attributes.setDissectingPane(pane);
        attributes.setIsNextLinkFirst(pane.isNextLinkFirst());
        attributes.setLinkText(paneInstance.getLinkToText());
        attributes.setBackLinkText(paneInstance.getLinkFromText());

        // If the output is going to be dissected then write a protocol
        // specific marker in the text which the protocol parser will
        // recognise.
        LayoutModule module = context.getLayoutModule();
View Full Code Here

    /**
     * Create a new <code>DissectingPaneInstance</code>.
     */
    public DissectingPaneInstance(NDimensionalIndex index) {
        super(index);
        attributes = new DissectingPaneAttributes();
    }
View Full Code Here

public class LayoutAttributesFactoryImpl
        implements LayoutAttributesFactory {

    // Javadoc inherited.
    public DissectingPaneAttributes createDissectingPaneAttributes() {
        return new DissectingPaneAttributes();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.DissectingPaneAttributes

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.