Package com.volantis.mcs.runtime.policies

Examples of com.volantis.mcs.runtime.policies.PolicyReferenceResolver


        String value;
        TextAssetReference shortcut = null;
        TextAssetReference accessKey = null;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Resolve the shortcut string to a mariner expression
        if ((value = attributes.getShortcut()) != null) {
            shortcut = resolver.resolveQuotedTextExpression(value);
        }

        // Resolve the accesskey string to a mariner expression
        if ((value = attributes.getAccessKey()) != null) {
            accessKey = resolver.resolveQuotedTextExpression(value);
        }

        if (shortcut != null) {
            if (accessKey != null) {
                throw new PAPIException(exceptionLocalizer.
View Full Code Here


                    textLabel = labelContent.getStandardCSS();
                }
            } else if (labelContent instanceof StyleComponentURI) {

                // Get asset and policy resolvers, resolve component policy
                PolicyReferenceResolver referenceResolver = protocol.getMarinerPageContext().getPolicyReferenceResolver();
                AssetResolver assetResolver = protocol.getMarinerPageContext()
                        .getAssetResolver();
                RuntimePolicyReference policyReference = referenceResolver
                        .resolvePolicyExpression(((StyleComponentURI)labelContent).getExpression());

                // Create image asset from the policy and get fallback
                DefaultComponentImageAssetReference imageAsset = new DefaultComponentImageAssetReference(
                        policyReference, assetResolver);
View Full Code Here

        // The link text could be null if it should come from the CONTENT style
        // property (see DefaultContentInserter).
        final String linkText = link.getLinkText();
        if (linkText != null) {
            PolicyReferenceResolver resolver =
                    context.getPolicyReferenceResolver();
            TextAssetReference linkTextReference =
                    resolver.resolveQuotedTextExpression(linkText);
            action.setCaption(linkTextReference);
        }

        // An action button is always a submit.
        action.setType("submit");
View Full Code Here

        // Initialise the attributes specific to this field.
        TextAssetReference object;
        String value;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the errmsg as a mariner expression.
        object = resolver.resolveQuotedTextExpression(
                attributes.getErrmsg());
        pattributes.setErrmsg(object);

        // Set the initial value attribute.
        object = resolver.resolveQuotedTextExpression(attributes.getInitial());
        pattributes.setInitial(object);

        // Set the max length attribute.
        value = attributes.getMaxLength();
        if (value != null) {
            pattributes.setMaxLength(Integer.parseInt(value));
        }

        // Set the type attribute, the default is "text".
        value = attributes.getType();
        if (value == null) {
            value = "text";
        }
        pattributes.setType(value);

        // Set the inputMode attribute
        value = attributes.getInputMode();
        if (value != null) {
            pattributes.setInputMode(value);
        }

        // Process the validate value as a mariner expression and store the
        // resulting object in the styles. The value if specified always
        // overrides the styles.
        StyleValue validate = resolver.resolveQuotedTextExpressionAsStyleValue(
                attributes.getValidate());
        if (validate != null) {
            MutablePropertyValues propertyValues = styles.getPropertyValues();
            propertyValues.setComputedAndSpecifiedValue(
                    MCS_INPUT_FORMAT, validate);
View Full Code Here

        pattributes.setName(name);

        // get the styles for the current element and set it on the MCSAttributes
        pattributes.setStyles(pageContext.getStylingEngine().getStyles());

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Resolve the src string to a mariner expression
        LinkAssetReference expression = resolver.resolveQuotedLinkExpression(
                attributes.getSrc(), PageURLType.SEGMENT);
        pattributes.setSrc(expression);

        pattributes.setLongDesc(attributes.getLongDesc());
        pattributes.setTitle(attributes.getTitle());
View Full Code Here

        // get styles for the current element and set it on the MCSAttributes
        final StylingEngine stylingEngine = pageContext.getStylingEngine();
        pattributes.setStyles(stylingEngine.getStyles());

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        TextAssetReference object;
        // Process the caption as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getCaption());
        pattributes.setCaption(object);

        // Process the prompt as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getPrompt());
        pattributes.setPrompt(object);

        // Set the value attribute.
        pattributes.setValue(attributes.getValue());
View Full Code Here

        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);
        try {
            if (imageComponentName != null) {

                // Resolve the expression to a reference.
                RuntimePolicyReference reference =
                        resolver.resolveUnquotedPolicyExpression(
                                imageComponentName, PolicyType.IMAGE);

                AssetResolver assetResolver = pageContext.getAssetResolver();

                SelectedVariant selected =
View Full Code Here

        pattributes.setTitle(attributes.getTitle());

        // get styles for the current element and set it on the MCSAttributes
        pattributes.setStyles(pageContext.getStylingEngine().getStyles());

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the caption as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getCaption());
        pattributes.setCaption(object);

        // Process the help as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getHelp());
        pattributes.setHelp(object);

        // Set the name attribute.
        String name = attributes.getName();
        pattributes.setName(name);

        // Process the prompt as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getPrompt());
        pattributes.setPrompt(object);

        // Process the shortcut as a mariner expression.
        object = resolver.resolveQuotedTextExpression(attributes.getShortcut());
        pattributes.setShortcut(object);

        // Add a reference to the field descriptor into the attributes.
        pattributes.setFieldDescriptor(fieldDescriptor);
View Full Code Here

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        SpanAttributes attributes = (SpanAttributes) papiAttributes;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        TextAssetReference srcReference =
                resolver.resolveQuotedTextExpression(attributes.getSrc());
        if (srcReference != null && srcReference.isPolicy()) {
            pattributes.setSrc(srcReference);
        }

        int result = super.styleElementStart(context,
View Full Code Here

        String value;

        // Copy the base attributes.
        pattributes.setId(attributes.getId());

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the action as a mariner expression.
        linkReference = resolver.resolveQuotedLinkExpression(
                attributes.getAction(), PageURLType.FORM);
        pattributes.setAction(linkReference);

        // Set the form attribute.
        FormInstance formInstance =
                (FormInstance) pageContext.getFormatInstance(
                        form, NDimensionalIndex.ZERO_DIMENSIONS);
        pattributes.setFormData(formInstance);

        // Process the help as a mariner expression.
        textReference =
                resolver.resolveQuotedTextExpression(attributes.getHelp());
        pattributes.setHelp(textReference);

        // Set the method attribute, the default is "get".
        value = attributes.getMethod();
        if (value == null) {
            value = "get";
        }
        pattributes.setMethod(value);

        // Set the name attribute.
        String name = attributes.getName();
        pattributes.setName(name);

        // Process the prompt as a mariner expression.
        textReference = resolver.resolveQuotedTextExpression(
                attributes.getPrompt());
        pattributes.setPrompt(textReference);

        // Set the segment attribute.
        pattributes.setSegment(attributes.getSegment());
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.policies.PolicyReferenceResolver

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.