Package com.volantis.mcs.papi

Examples of com.volantis.mcs.papi.AbstractImageAttributes


    protected int elementStartImpl(
            MarinerRequestContext context,
            BlockAttributes blockAttributes)
            throws PAPIException {

        AbstractImageAttributes attributes
                = (AbstractImageAttributes) blockAttributes;

        String url = attributes.getUrl();
        String urlc = attributes.getUrlc();

        // The src is actually the component name.
        String imageComponentName = attributes.getSrc();
        int notNullCount = 0;

        if (url != null) {
            notNullCount++;
        }

        if (imageComponentName != null) {
            notNullCount++;
        }

        if (urlc != null) {
            notNullCount++;
        }

        if (notNullCount > 1) {
            throw new IllegalArgumentException
                    ("Only one of url, urlc and src may be set");
        } else if (notNullCount == 0) {
            throw new IllegalArgumentException
                    ("Either url, urlc or src must be set");
        }

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        VolantisProtocol protocol = pageContext.getProtocol();
        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();
        TextAssetReference altText = resolver.resolveQuotedTextExpression(
                attributes.getAltText());

        pattributes.setId(attributes.getId());
        pattributes.setTitle(attributes.getTitle());
        pattributes.setAltText(altText);
        pattributes.setPane(pageContext.getCurrentPane());
        pattributes.setAssetURLSuffix(attributes.getAssetURLsuffix());

        // Add any event attributes.
        PAPIInternals.initialiseGeneralEventAttributes(pageContext,
                attributes,
                pattributes);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.papi.AbstractImageAttributes

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.