Package com.volantis.mcs.protocols.assets

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


        // could be reused before the attributes have actually been finished with
        // by the protocol.
        pattributes = new com.volantis.mcs.protocols.XFSelectAttributes();

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

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the errmsg as a mariner expression.
View Full Code Here


            }
           
            elementIndex--;
        }

        TextAssetReference caption =
            ((XFFormFieldAttributes)protocolAttributes).getCaption();

        // when we found wizard we have to associate this submit button
        // with complete action on wizard.
        if(null != wizard){
            VolantisProtocol protocol = getProtocol(context);
            ButtonScriptHandlerAttributes buttonAttributes = new ButtonScriptHandlerAttributes();
           
            String submitId = protocolAttributes.getId();
            if(null == submitId){
                submitId = protocol.getMarinerPageContext().generateUniqueFCID();
                protocolAttributes.setId(submitId);
            }
           
            buttonAttributes.setId(submitId);

            //if xf:label element was not specified for xf:submit element
            //then set label to the default value
            if (null == caption) {
                ((XFFormFieldAttributes)protocolAttributes)
                    .setCaption(new LiteralTextAssetReference(
                            DEFAULT_SUBMIT_CAPTION));
            }
           
            // wizard is embracing this element
            // wizard id is needed for proper action reference desciption
            WizardAttributes wizardAttrs = (WizardAttributes)wizard.getProtocolAttributes();
            final String wizardId = wizardAttrs.getId();
           
            // associate button with complete action
            final List memberList = new ArrayList();
            memberList.add(ActionName.COMPLETE);
            buttonAttributes.setActionReference(new ActionReference() {
                public String getWidgetId() {return wizardId;}
                public List getMemberNames() {return memberList;}
            });
           
            WidgetModule widgetModule = protocol.getWidgetModule();
           
            try {
                WidgetRenderer renderer =
                    widgetModule.getWidgetRenderer(buttonAttributes);
                renderer.renderClose(protocol, buttonAttributes);
               
                WizardRenderer wizardRenderer = (WizardRenderer)
                    widgetModule.getWidgetRenderer(wizardAttrs);
                             
                // remember submit id in wizard renderer
                wizardRenderer.setSubmitId(submitId);
            } catch (ProtocolException e) {
                throw new XDIMEException(e);
            }
        }

        // If an action field is tagged to indicate that its query parameters
        // should contain an extra name value pair (used to indicate things
        // like which of two submit buttons was pressed to trigger the
        // submission) then HTMLActionFieldHandler appends this name value pair
        // using the name and initial value specified in the field descriptor.
        // If this submit element had a child setvalue element, then it
        // requires this name value pair and we should set the flag. We set the
        // flag to the caption string (for backwards compatibility with XDIME1
        // - there is no other reason to set it to this string).
        if (caption != null) {
            // We only want to map fields that have an initial value (i.e. had
            // a child setvalue element with either a value attribute or some
            // body content).
            if (fieldDescriptor.getInitialValue() != null) {
                String captionString =
                        caption.getText(TextEncoding.PLAIN);
                fieldDescriptor.setFieldTag(captionString);
                ((XFFormFieldAttributes)protocolAttributes).
                        setFieldDescriptor(fieldDescriptor);
            }
        }
View Full Code Here

            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();

            // Process the shortcut
            TextAssetReference shortcutObj =
                    resolver.resolveQuotedTextExpression(shortcut);
            builder.setShortcut(shortcutObj);

            //Process the href as a mariner expression
            LinkAssetReference href = resolver.resolveQuotedLinkExpression(
                    attributes.getHref(), PageURLType.MENU_ITEM);
            builder.setHref(href);

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

            // Set the title.
            builder.setTitle(attributes.getTitle());
View Full Code Here

                new MarinerPageContextMock("pageContext", expectations);
        PolicyReferenceResolverMock policyRefResolver =
                new PolicyReferenceResolverMock("policyRefResolver", expectations);
        SelectOptionMock attributes =
                new SelectOptionMock("attributes", expectations);
        TextAssetReference textAssetRef = new LiteralTextAssetReference("");
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        StylesMock labelStyles = new StylesMock("labelStyles", expectations);
        StylingEngineMock stylingEngine =
                new StylingEngineMock("stylingEngine", expectations);
View Full Code Here

                new MarinerPageContextMock("pageContext", expectations);
        PolicyReferenceResolverMock policyRefResolver =
                new PolicyReferenceResolverMock("policyRefResolver", expectations);
        XFFormFieldAttributesMock attributes =
                new XFFormFieldAttributesMock("attributes", expectations);
        TextAssetReference textAssetRef = new LiteralTextAssetReference("");
        StylesMock labelStyles = new StylesMock("labelStyles", expectations);
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        StylingEngineMock stylingEngine =
                new StylingEngineMock("stylingEngine", expectations);
View Full Code Here

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);
        XFOptionGroupAttributes xfoga =
                (XFOptionGroupAttributes) papiAttributes;
        optiongroup = new SelectOptionGroup();
        TextAssetReference object;

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the caption as a mariner expression.
View Full Code Here

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Set the client variable name
        TextAssetReference reference = resolver.resolveQuotedTextExpression(
                attributes.getClientVariableName());
        String clientVariableName = getPlainText(reference);

        // One of value and clientVariableName must be specified.
        if (value == null && clientVariableName == null) {
View Full Code Here

            // Get the value of the targetLocation attribute, which could be
            // a text component.
            PolicyReferenceResolver resolver =
                    pageContext.getPolicyReferenceResolver();
            TextAssetReference reference = resolver.resolveQuotedTextExpression(
                    attributes.getTargetLocation());
            String target;
            if (reference != null) {
                target = reference.getText(TextEncoding.PLAIN);
            } else {
                target = null;
            }

            pattributes.setTargetLocation(target);
View Full Code Here

        // 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.
View Full Code Here

     */
    protected String getTextFallbackFromLink(LinkAssetReference object) {
        String text = null;
        // if object must be a LinkComponentName
        if (object != null) {
            TextAssetReference textReference = object.getTextFallback();
            if (textReference != null) {
                text = textReference.getText(TextEncoding.PLAIN);
            }
        }
        return text;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.assets.TextAssetReference

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.