Examples of LinkAssetReference


Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

     */
    public void testHref() {
        ConcreteMenuItem item = MenuModelHelper.createMenuItem(itemName);

        // Test getting a null href
        LinkAssetReference testHref = item.getHref();
        assertNull("Should be no prompt", testHref);

        // Test setting a href
        LinkAssetReference href = new LiteralLinkAssetReference(
                "relative/url/to/something");
        item.setHref(href);

        // Test getting a non-null href
        testHref = item.getHref();
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

    // JavaDoc inherited
    public void openAnchor(DOMOutputBuffer dom, AnchorAttributes attributes) {
        Element element = dom.openStyledElement("test-anchor", attributes);

        LinkAssetReference reference = attributes.getHref();
        String value;
        if (reference != null && (value = reference.getURL()) != null) {
            element.setAttribute("href", value);
        }
        TextAssetReference text = attributes.getShortcut();
        if (text != null && (value = text.getText(TextEncoding.PLAIN)) != null) {
            element.setAttribute("shortcut", value);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

     * 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.LinkAssetReference

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

        LinkAssetReference reference =
                new LiteralLinkAssetReference(assetURL);

        final InternalDeviceMock deviceMock =
                new InternalDeviceMock("deviceMock", expectations);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

    public void testGetLinkFromReferenceEncodeSegmentURLFalse()
            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.LinkAssetReference

    // Javadoc inherited from super class.
    protected int elementStartImpl(
            MarinerRequestContext context,
            BlockAttributes blockAttributes)
            throws PAPIException {
        LinkAssetReference expression;
        String value;

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

        // open the option
        Element element = buffer.openStyledElement("option", menuItem);

        // ok get hold of the href
        LinkAssetReference reference = menuItem.getHref();
        String href = reference.getURL();

        if (logger.isDebugEnabled()) {
            logger.debug("writing numeric shortcut menu item with href " +
                         href);
        }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

        if (attributes == null) {
            logger.error("segment-attributes-missing", new Object[]{name});
            return null;
        }

        LinkAssetReference object = attributes.getSrc();
        if (object == null) {
            logger.error("segment-src-missing", new Object[]{name});
            return null;
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Src object is " + object);
        }

        String src = object.getURL();
        if (src == null) {
            logger.error("segment-no-src-object", new Object[]{name});
            return null;
        }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

        boolean isAccesskeyPrefixKeyNeeded =
                !device.getBooleanPolicyValue(DevicePolicyConstants.
                                              SUPPORTS_WML_ACCESSKEY_AUTOMAGIC_NUMBER_DISPLAY);

        // Extract the href from the menu item.
        LinkAssetReference reference = menuItem.getHref();
        String href = reference.getURL();
       
        // Extract the text from the menu item.
        String text = menuItem.getText();
       
        // Add the dummy access key prefix to the text if necessary.
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.LinkAssetReference

        ctx.addTitleAttribute(select, attributes);

        Element option = dom.openElement("option");
        ctx.addTitleAttribute(option, attributes);

        LinkAssetReference reference = attributes.getHref();
        if (reference != null) {
            option.setAttribute("onpick", reference.getURL());
        }
        dom.addOutputBuffer((DOMOutputBuffer) attributes.getLinkText());

        dom.closeElement(option);
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.