Examples of LiteralTextAssetReference


Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

     * This test the method generateBooleanGrammar    
     */
    public void testGenerateBooleanGrammar() throws Exception {

        final TextAssetReference trueReference =
                new LiteralTextAssetReference("yes, yep, yeah");
       
        final TextAssetReference falseReference =
                new LiteralTextAssetReference("no, nope");
       
        TestMarinerPageContext context = new TestMarinerPageContext();
       
        ProtocolBuilder protocolBuilder = new ProtocolBuilder();
        VoiceXMLRoot protocol = (VoiceXMLRoot) protocolBuilder.build(
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        };

        protocol.setMarinerPageContext(context);

        SpanAttributes attributes = new SpanAttributes();
        attributes.setSrc(new LiteralTextAssetReference(text));

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        protocol.openSpan(buffer, attributes);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        };

        protocol.setMarinerPageContext(context);

        SpanAttributes attributes = new SpanAttributes();
        attributes.setSrc(new LiteralTextAssetReference(text));

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        protocol.openSpan(buffer, attributes);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

                "mcs-aural-dtmf-allocation: automatic; " +
                "mcs-aural-menu-scope: document"));

        // We use Strings for errmsg, prompt, and help to avoid having to
        // resolve TextComponentIdentity which would require a repository
        menuAttrs.setErrmsg(new LiteralTextAssetReference(
                "<noinput>Sorry I did not hear you</noinput>" +
                            "<nomatch>Sorry I did not understand you</nomatch>"));
        menuAttrs.setHelp(new LiteralTextAssetReference("<help>Please select an option from the menu</help>"));
        menuAttrs.setPrompt(new LiteralTextAssetReference("<prompt>Welcome home.<enumerate>For <value " +
                            "expr=\"_prompt\"/>, press <value expr=\"_dtmf\"/> or say " +
                            "<value expr=\"_prompt\"/></enumerate></prompt>"));

        MenuItem item1 = new MenuItem();
        item1.setText("Sports News");
        item1.setHref("http://www.volantis.com:8080/volantis/sports.jsp");
        menuAttrs.addItem(item1);

        MenuItem item2 = new MenuItem();
        item2.setText("Astrology");
        item2.setHref("http://www.volantis.com:8080/volantis/astrology.jsp");
        item2.setPrompt(new LiteralTextAssetReference("<prompt><audio src=\"rtsp://www.volantis.com/" +
                        "mysticmeg.wav\">Mystic Megs Astrology</audio></prompt>"));
        menuAttrs.addItem(item2);

        MenuItem item3 = new MenuItem();
        item3.setText("Fun and Games");
        item3.setHref("http://www.volantis.com:8080/volantis/games.jsp");
        item3.setShortcut(new LiteralTextAssetReference("9"));
        menuAttrs.addItem(item3);

        protocol.doMenu(menuAttrs);

        String actual = DOMUtilities.toString(
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        XMLReader reader = DOMUtilities.getReader();

        MenuItem item1 = new MenuItem();
        item1.setText("Website Index.");
        item1.setHref("http://www.volantis.com/index.jsp");
        item1.setShortcut(new LiteralTextAssetReference("9"));
        MenuAttributes attributes = new MenuAttributes();
        attributes.setManualDTMF(true);
        protocol.doMenuItem(buffer, attributes, item1);
        String actual = DOMUtilities.toString(
                buffer.getRoot(), protocol.getCharacterEncoder());

        String expected = "<choice next=\"http://www.volantis.com/index." +
                "jsp\" dtmf=\"9\">Website Index.</choice>";
        Document expectedDom = DOMUtilities.read(reader, expected);
        String expectedDOMAsString =
                DOMUtilities.toString(
                        expectedDom, protocol.getCharacterEncoder());

        assertEquals("the processed DOM is not as expected.",
                     expectedDOMAsString, actual);


        // Same again but with manualDTMF set to false.
        buffer = getNewDOMOutputBuffer();
        expected = "<choice next=\"http://www.volantis.com/index.jsp\">" +
                "Website Index.</choice>";
        expectedDom = DOMUtilities.read(reader, expected);
        expectedDOMAsString = DOMUtilities.toString(
                expectedDom, protocol.getCharacterEncoder());

        attributes.setManualDTMF(false);
        protocol.doMenuItem(buffer, attributes, item1);
        actual = DOMUtilities.toString(
                buffer.getRoot(), protocol.getCharacterEncoder());

        assertEquals("the processed DOM is not as expected.",
                     expectedDOMAsString, actual);


        // With a prompt in the source this time.  Demonstrates that the text
        // attribute is overriden by the prompt attribute.
        buffer = getNewDOMOutputBuffer();
        MenuItem item2 = new MenuItem();
        item2.setText("Website Index.");
        item2.setHref("http://www.volantis.com/index.jsp");
        item2.setPrompt(new LiteralTextAssetReference("<prompt><audio src=\"rtsp://www.volantis" +
                        ".com/mysticmeg.wav\">Mystic Megs Astrology</audio>" +
                        "</prompt>"));

        expected = "<choice next=\"http://www.volantis.com/index.jsp\">" +
                "<prompt><audio src=\"rtsp://www.volantis.com/mysticmeg" +
                ".wav\">Mystic Megs Astrology</audio></prompt></choice>";
        expectedDom = DOMUtilities.read(reader, expected);
        expectedDOMAsString = DOMUtilities.toString(
                expectedDom, protocol.getCharacterEncoder());

        attributes.setManualDTMF(true);
        protocol.doMenuItem(buffer, attributes, item2);
        actual = DOMUtilities.toString(
                buffer.getRoot(), protocol.getCharacterEncoder());

        assertEquals("the processed DOM is not as expected.",
                     expectedDOMAsString, actual);

        // Null Href - there should be no output from the doMenuItem method.
        buffer = getNewDOMOutputBuffer();
        MenuItem item3 = new MenuItem();
        item3.setText("Some arbitrary text.");
        item3.setShortcut(new LiteralTextAssetReference("5"));

        expectedDOMAsString = "";

        attributes.setManualDTMF(true);
        protocol.doMenuItem(buffer, attributes, item3);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        String caption = "This is my caption";
        String value = "This is my value";

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);
        // todo XDIME-CP style forms correctly.
//        attributes.setStyleClass(style);

        // Setup test to ensure that link style form submision fallsback to the
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";
        //String value = "This is my value";

        attributes.setShortcut(new LiteralTextAssetReference(shortcut));
        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        //attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

                this.inline = inline;
                this.supportsAccessKeys = supportsAccessKeys;
                this.expected = expected;
                attributes = new XFActionAttributes();
                attributes.setStyles(StylesBuilder.getInitialValueStyles());
                attributes.setShortcut(new LiteralTextAssetReference(shortcut));
                attributes.setCaption(new LiteralTextAssetReference(caption));
                attributes.setTitle(title);
            }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralTextAssetReference

        XFSelectAttributes attributes = new XFSelectAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        attributes.setEntryContainerInstance(new PaneInstance(null));
        attributes.setShortcut(new LiteralTextAssetReference("shortcut"));
        attributes.setName("name");
        FormInstance formInstance = new FormInstance(NDimensionalIndex.ZERO_DIMENSIONS);
        formInstance.setFormat(new Form(null));
        attributes.setFormData(formInstance);
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.