Examples of LiteralLinkAssetReference


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

     * Helper method used to populate a menu item in the most minimal manner
     * such that it is valid.
     */
    protected void configureMinimalItem() throws Exception {
        // The currently open menu item must have a specified href
        builder.setHref(new LiteralLinkAssetReference("dummy"));

        // It must also have a label
        builder.startLabel();
        configureMinimalLabel(true);
        builder.endLabel();
View Full Code Here

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

        } catch (BuilderException e) {
            // expected condition
        }

        // The currently open menu item must have a specified href
        builder.setHref(new LiteralLinkAssetReference("dummy"));

        configureIncompleteLabel();

        try {
            // This leaves the menu item incompletely specified
View Full Code Here

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

    public void testSetHref() throws Exception {
        doBuildDataMethodTest(new BuildDataMethodTester() {
            /**
             * Sample data for use in testing
             */
            LinkAssetReference href = new LiteralLinkAssetReference("href");

            // javadoc inherited
            public void invoke() throws Exception {
                builder.setHref(href);
            }
View Full Code Here

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

     * This method also shows one of the weaknesses in the
     * getLinkFromReference method in that the String can be any string yet
     * the returned value is according to the method supposed to be a link.
     */
    public void testGetLinkFromReference() {
        LinkAssetReference s = new LiteralLinkAssetReference("string");

        String link = protocol.getLinkFromReference(s);

        assertEquals(s.getURL(), link);
    }
View Full Code Here

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

                new MarinerPageContextMock("pageContextMock",
                        expectations);
        protocol.setMarinerPageContext(pageContextMock);

        LinkAssetReference reference =
                new LiteralLinkAssetReference(assetURL);

        final InternalDeviceMock deviceMock =
                new InternalDeviceMock("deviceMock", expectations);

        pageContextMock.expects.getRequestURL(false)
View Full Code Here

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

            throws Throwable {

        final String assetURL = "http://test.url";

        LinkAssetReference reference =
                new LiteralLinkAssetReference(assetURL);

        String link = protocol.getRewrittenLinkFromObject(reference, false);

        assertEquals(assetURL, link);
    }
View Full Code Here

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

        default_FD.setContainingFormName("__DEFAULT__");
        XFFormAttributes formAttributes1 = new XFFormAttributes();
        final FragmentableFormData form =
                new FragmentableFormData(default_FD, -1, false, new ArrayList());
        formAttributes1.setFormData(form);
        formAttributes1.setAction(new LiteralLinkAssetReference(action1));
        default_FD.setFormAttributes(formAttributes1);

        final String action2 = "http://www.smudge.com";
        FD2 = new EmulatedXFormDescriptor(action2, "get", "s2");
        FD2.setContainingFormName("model2");
        XFFormAttributes formAttributes2 = new XFFormAttributes();
        final FragmentableFormData form2 =
                new FragmentableFormData(FD2, -1, false, new ArrayList());
        formAttributes2.setFormData(form2);
        formAttributes2.setAction(new LiteralLinkAssetReference(action2));
        FD2.setFormAttributes(formAttributes2);

        final String action3 = "http://www.volantis.com/delivery";
        FD3 = new EmulatedXFormDescriptor(action3, "get", "s3");
        FD3.setContainingFormName("model3");
        XFFormAttributes formAttributes3 = new XFFormAttributes();
        final FragmentableFormData form3 =
                new FragmentableFormData(FD3, -1, false, new ArrayList());
        formAttributes3.setFormData(form3);
        formAttributes3.setAction(new LiteralLinkAssetReference(action3));
        FD3.setFormAttributes(formAttributes3);

        // set expectations
        psf.expects.getDOMFactory().returns(domFactory);
        pageContext.expects.getEmulatedXFormDescriptor("__DEFAULT__").returns(default_FD);
View Full Code Here

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

    public void setHref(LinkAssetReference href) {
        this.href = href;
    }

    public void setHref(String href) {
        setHref(new LiteralLinkAssetReference(href));
    }
View Full Code Here

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

        String expression = (String) event.getArgument(String.class);
        if (expression == null) {
            return null;
        } else {
            return new LiteralLinkAssetReference(expression);
        }
    }
View Full Code Here

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

                // If the URL is not to be rewritten using page URI rewriter
                // for which the current state of the page context is important,
                // simply create a LinkAssetReference in standard way.
                // The URL will be rewritten by PageURLRewriter when the
                // getUrl() method gets called.
                linkAssetReference = new LiteralLinkAssetReference(url, assetResolver,
                        PageURLType.ANCHOR);

            } else {
                // If the URL possibly is to be rewritten using page URI
                // rewriter, rewrite the URL in-place, since at the moment the
                // getUrl() method would be invoked, the page context would
                // change and the page URI rewriter would return different
                // result than expected.
                url = assetResolver.rewriteURLWithPageURLRewriter(url, PageURLType.ANCHOR);

                try {
                    url = uriRewriter.rewrite(new URI(url), PageURLType.ANCHOR).toString();
                } catch (URISyntaxException e) {
                    throw new XDIMEException("Invalid URI: " + url, e);
                }

                // Create an instance of LinkAssetReference with already
                // rewritten URL.
                linkAssetReference = new LiteralLinkAssetReference(url);
            }
        }

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