Examples of XFFormAttributes


Examples of com.volantis.mcs.papi.XFFormAttributes

        // Create the xfform form element surrounding the xfimplicit. This is
        // required as XFImplicitElement.elementStart gets the current element
        // from the page context.
        formElement = new XFFormElementImpl();
        formAttributes = new XFFormAttributes();
        formAttributes.setAction("action");
        formAttributes.setMethod("post");
        formAttributes.setName("form");

        pageContext.setPolicyReferenceResolver(
View Full Code Here

Examples of com.volantis.mcs.papi.XFFormAttributes

     * Test the field event attributes initialization. The events checked are:
     * - ON_SUBMIT
     * - ON_RESET
     */
    public void testInitialiseFormEventAttributes() throws Exception {
        XFFormAttributes papiAttributes = new XFFormAttributes();
        final String ON_SUBMIT = "OnSubmit";
        final String ON_RESET = "OnRest";

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_SUBMIT)
            .returns(new LiteralScriptAssetReference(ON_SUBMIT)).any();

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_RESET)
            .returns(new LiteralScriptAssetReference(ON_RESET)).any();

        papiAttributes.setOnSubmit(ON_SUBMIT);
        papiAttributes.setOnReset(ON_RESET);

        CanvasAttributes attributes = new CanvasAttributes();

        EventAttributes events = attributes.getEventAttributes(false);
        ScriptAssetReference event = events.getEvent(EventConstants.ON_LOAD);
View Full Code Here

Examples of com.volantis.mcs.papi.XFFormAttributes

        paneInstance.setDeviceLayoutContext(deviceLayoutContext);
        pageContext.setFormatInstance(paneInstance);
        pageContext.addPaneMapping(testPane);

        // set up xfform element
        final XFFormAttributes xfFormAttributes = new XFFormAttributes();
        final XFFormElementImpl xfFormElement = new XFFormElementImpl();
        xfFormElement.elementStart(requestContext, xfFormAttributes);
        pageContext.setCurrentElement(xfFormElement);

        // set up xfsiselect element
View Full Code Here

Examples of com.volantis.mcs.papi.XFFormAttributes

                pageContext.getEnvironmentContext().getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.disable();
        }

        XFFormAttributes attributes = (XFFormAttributes) papiAttributes;

        // Try and find the form with the specified name, if it could not be
        // found then return and skip the element body.
        String formName = attributes.getName();
        Form form = pageContext.getForm(formName);
        if (form == null) {
            skipped = true;
            return SKIP_ELEMENT_BODY;
        }

        TextAssetReference textReference;
        LinkAssetReference linkReference;
        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());

        // Setup the fragmentation state for the form
        try {
            pageContext.updateFormFragmentationState(form);
        }
View Full Code Here

Examples of com.volantis.mcs.papi.XFFormAttributes


    /** Creates new VolantisDSPFormTag */
    public VolantisDSPFormTag() {
        super();
        formAttributes = new XFFormAttributes();
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFFormAttributes

        final String xfName = "xfImplicitAtributesName";
        final String xfValue = "xfImplicitAtributesValue";
        attributes.setName(xfName);
        attributes.setValue(xfValue);

        XFFormAttributes formAttributes = new XFFormAttributes();
        String name = "This is the name";
        formAttributes.setName(name);
        Form form = new Form(new CanvasLayout());
        FormInstance formInstance = new FormInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formInstance.setFormat(form);

        formAttributes.setFormData(formInstance);
        attributes.setFormAttributes(formAttributes);
        attributes.setFormData(formInstance);

        protocol.doImplicitValue(attributes);
View Full Code Here

Examples of com.volantis.mcs.protocols.XFFormAttributes

            throws Exception {
        privateSetUp();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        XFFormAttributes formAttributes = new XFFormAttributes();
        attributes.setFormAttributes(formAttributes);

        if (field != null) {
            formAttributes.addField(field);
        }

        protocol.addActionReset(buffer, attributes);
        assertEquals(transformMarkup(expected, protocol),
                     DOMUtilities.toString(
View Full Code Here

Examples of com.volantis.mcs.protocols.XFFormAttributes

        privateSetUp();

        XFActionAttributes attributes = new XFActionAttributes();;
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        XFFormAttributes formAttributes = new XFFormAttributes();
        attributes.setFormAttributes(formAttributes);

        XFTextInputAttributes field = new XFTextInputAttributes();
        field.setInitial("InitialValue");
        field.setName("Name");
        field.setEntryContainerInstance(new PaneInstance(null));
        formAttributes.addField(field);
        protocol.addActionReset(buffer, attributes);
        String expected = transformMarkup(
                "<refresh><setvar name=\"Name\" value=\"InitialValue\"/>" +
                "</refresh>",
                protocol);
View Full Code Here

Examples of com.volantis.mcs.protocols.XFFormAttributes

        privateSetUp();
        testable.setPageHead(new TestPageHead(protocol));
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        XFFormAttributes formAttributes = new XFFormAttributes();
        Form form = new Form(new CanvasLayout());
        FormInstance formInstance = new FormInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formInstance.setFormat(form);
        formAttributes.setAction(new LiteralLinkAssetReference("testaction"));
        formAttributes.setFormData(formInstance);
        formAttributes.setMethod("post");
        formAttributes.setFormSpecifier("test");
        attributes.setFormAttributes(formAttributes);
        attributes.setName("TestAction");
        attributes.setType("submit");
        protocol.doActionInput(buffer, attributes);
        Element element = buffer.getCurrentElement();
View Full Code Here

Examples of com.volantis.mcs.protocols.XFFormAttributes

    /**
     * There should be absolutely no form output for this protocol
     */
    public void testDoForm() {
        XFFormAttributes attributes = new XFFormAttributes();
        protocol.doForm(attributes);
        // Should simply do nothing and come out.
        // @todo later add the actual testing in here!
    }
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.