Package com.volantis.mcs.protocols.forms

Examples of com.volantis.mcs.protocols.forms.FieldDescriptor


            formDescriptor = formElement.getFormDescriptor();

            // If the current form is fragmented then we may not have to output
            // anything for this field in the current fragment but we still need to
            // create its descriptor.
            fieldDescriptor = new FieldDescriptor();
            fieldDescriptor.setName(attributes.getName());
            fieldDescriptor.setInitialValue(getInitialValue(pageContext,
                    attributes));
            fieldDescriptor.setType(getFieldType(attributes));
View Full Code Here


        pattributes = new com.volantis.mcs.protocols.XFContentAttributes();
        pattributes.setPane(pane);
        pattributes.setOutputBuffer(buffer);
        pattributes.setStyles(pageContext.getStylingEngine().getStyles());
        // Create the field descriptor.
        FieldDescriptor fieldDescriptor = new FieldDescriptor();
        fieldDescriptor.setType(ContentFieldType.getSingleton());

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

        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes attributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        attributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        XFSetValueElementImpl setValue =
View Full Code Here

        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
View Full Code Here

        strategy.expects.getCharacterData().returns(null);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
View Full Code Here

        fdm.expects.getSessionFormData("s0").returns(sessionFormData);
        sessionFormData.expects.setFieldValue(URLConstants.ACTION_FORM_FRAGMENT, "http://www.volantis.com");
       
        for (int i = 0; i < SINGLE_DEFAULT_FIELDS.length; i++ ) {
            FieldDescriptor fd = new FieldDescriptor();
            fd.setName((String) SINGLE_DEFAULT_FIELDS[i][0]);
            fd.setType((FieldType) SINGLE_DEFAULT_FIELDS[i][1]);
            default_FD.addField(fd);
        }
    }
View Full Code Here

        fdm.expects.getSessionFormData("s0").returns(sessionFormData);
        sessionFormData.expects.setFieldValue(URLConstants.ACTION_FORM_FRAGMENT, "/delivery");
               
        for (int i = 0; i < MULTIPLE_DEFAULT_FIELDS.length; i++ ) {
            FieldDescriptor fd = new FieldDescriptor();
            fd.setName((String) MULTIPLE_DEFAULT_FIELDS[i][0]);
            fd.setType((FieldType) MULTIPLE_DEFAULT_FIELDS[i][1]);
            default_FD.addField(fd);
        }

        for (int i = 0; i < MULTIPLE_MODEL2_FIELDS.length; i++ ) {
            FieldDescriptor fd = new FieldDescriptor();
            fd.setName((String) MULTIPLE_MODEL2_FIELDS[i][0]);
            fd.setType((FieldType) MULTIPLE_MODEL2_FIELDS[i][1]);
            FD2.addField(fd);
        }

        for (int i = 0; i < MULTIPLE_MODEL3_FIELDS.length; i++ ) {
            FieldDescriptor fd = new FieldDescriptor();
            fd.setName((String) MULTIPLE_MODEL3_FIELDS[i][0]);
            fd.setType((FieldType) MULTIPLE_MODEL3_FIELDS[i][1]);
            FD3.addField(fd);
        }
    }
View Full Code Here

        assertEquals(model, builder.modelBeingWritten);
    }

    public void testUpdateControlWhenNoneHaveBeenRegistered() {
        // this shouldn't happen, but test just in case...
        FieldDescriptor fd = new FieldDescriptor();
        XFFormFieldAttributesMock attributes =
                new XFFormFieldAttributesMock("attributes", expectations);
        try {
            builder.updateControl(fd, attributes);
            fail("Should throw an exception if attempting to update a control" +
View Full Code Here

        assertTrue(attributes.getFields().isEmpty());
        assertNotNull(fd);
        assertEquals(MODEL_ID, fd.getContainingFormName());
        assertTrue(fd.getFields().isEmpty());

        FieldDescriptor fieldDescriptor = new FieldDescriptor();
        XFFormFieldAttributesMock fieldAttributes =
                new XFFormFieldAttributesMock("fieldAttributes", expectations);
        builder.updateControl(fieldDescriptor, fieldAttributes);

        final List attFields = attributes.getFields();
View Full Code Here

                    ((XFSubmitElementImpl)element).getProtocolAttributes());
            parentAttributes.setName(name);
            parentAttributes.setInitial(value);
            parentAttributes.setValue(value);
           
            FieldDescriptor fd = parentAttributes.getFieldDescriptor();
            fd.setName(name);
            fd.setInitialValue(value);           
        } else {           
            String localizedException = EXCEPTION_LOCALIZER.format(
                    "xforms-invalid-setvalue-parent",
                    element.getElementType().getLocalName());
            LOGGER.error(localizedException);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.forms.FieldDescriptor

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.