Examples of EmulatedXFormDescriptor


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

            String referencedSubmission)
            throws XDIMEException {

        XDIMEContextInternal context = new XDIMEContextImpl();
        final XFormBuilder xFormBuilder = context.getXFormBuilder();
        EmulatedXFormDescriptor fd = new EmulatedXFormDescriptor();
        xFormBuilder.addModel(MODEL_ID, fd);
        context.setInitialRequestContext(requestContext);

        attributes = new XDIMEAttributesImpl(XFormElements.SETVALUE);
        attributes.setValue(XDIMESchemata.XML_EVENTS_NAMESPACE, "event", eventName);
View Full Code Here

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

     * a value for ref that does exist in the model suceeds and the initial
     * value is set to the value of the item referenced.
     */
    public void testSetInitialValueWithRealRef() throws XDIMEException {

        builder.addModel(MODEL_ID, new EmulatedXFormDescriptor());
        builder.addItem(REF, CONTENT);

        // verify that the item exists, is not referenced and the specified
        // model exists
        SIItem item = builder.getItem(REF, MODEL_ID);
View Full Code Here

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

     * value is set to the value of the item referenced.
     * The initial value contains commas, but it shouldn't make a difference.
     */
    public void testSetInitialValueWithComma() throws XDIMEException {

        builder.addModel(MODEL_ID, new EmulatedXFormDescriptor());
        builder.addItem(REF, "a, b, c");

        // verify that the item exists, is not referenced and the specified
        // model exists
        SIItem item = builder.getItem(REF, MODEL_ID);
View Full Code Here

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

        pageContext = new MarinerPageContextMock("pageContext", expectations);

        // Create test objects
        domFactory = DOMFactory.getDefaultInstance();
        final String action1 = "http://www.volantis.com";
        default_FD = new EmulatedXFormDescriptor(action1, "get", "s1");
        default_FD.setContainingFormName("__DEFAULT__");
        XFFormAttributes formAttributes1 = new XFFormAttributes();
        final FragmentableFormData form =
                new FragmentableFormData(default_FD, -1, false, new ArrayList());
        formAttributes1.setFormData(form);
        formAttributes1.setAction(new LiteralLinkAssetReference(action1));
        default_FD.setFormAttributes(formAttributes1);

        final String action2 = "http://www.smudge.com";
        FD2 = new EmulatedXFormDescriptor(action2, "get", "s2");
        FD2.setContainingFormName("model2");
        XFFormAttributes formAttributes2 = new XFFormAttributes();
        final FragmentableFormData form2 =
                new FragmentableFormData(FD2, -1, false, new ArrayList());
        formAttributes2.setFormData(form2);
        formAttributes2.setAction(new LiteralLinkAssetReference(action2));
        FD2.setFormAttributes(formAttributes2);

        final String action3 = "http://www.volantis.com/delivery";
        FD3 = new EmulatedXFormDescriptor(action3, "get", "s3");
        FD3.setContainingFormName("model3");
        XFFormAttributes formAttributes3 = new XFFormAttributes();
        final FragmentableFormData form3 =
                new FragmentableFormData(FD3, -1, false, new ArrayList());
        formAttributes3.setFormData(form3);
View Full Code Here

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

        psf = new ProtocolSupportFactoryMock("psf", expectations);
        psf.expects.getDOMFactory().returns(null);
        protocol = new DOMProtocolMock("protocol", expectations, psf,
                protocolConfig);
        events = new EventAttributes();
        TEST_FD = new EmulatedXFormDescriptor();
        TEST_FD.setContainingFormName(MODEL_ID);
        TEST_FD2 = new EmulatedXFormDescriptor();
        TEST_FD2.setContainingFormName(MODEL_ID2);
        TEST_FD_DEFAULT = new EmulatedXFormDescriptor();
        TEST_FD_DEFAULT.setContainingFormName(DEFAULT_MODEL_ID);

        builder = new XFormBuilderImpl();
    }
View Full Code Here

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

                returns(null);

        builder.registerControl(xdimeAttributes);

        XFFormAttributes attributes = model.getXFFormAttributes();
        EmulatedXFormDescriptor fd = model.getXFormDescriptor();

        assertNotNull(attributes);
        assertEquals(MODEL_ID, attributes.getId());
        assertEquals(MODEL_ID, attributes.getName());
        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();
        assertFalse(attFields.isEmpty());
        assertEquals(1, attFields.size());
        assertEquals(fieldAttributes, attFields.get(0));

        final List fdFields = fd.getFields();
        assertFalse(fdFields.isEmpty());
        assertEquals(1, fdFields.size());
        assertTrue(fieldDescriptor == fdFields.get(0));
    }
View Full Code Here

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

            // if no id is specified, this is the default model.
            id = XFormBuilder.DEFAULT_MODEL_ID;
        }

        // Attempt to retrieve the form descriptor from the session
        EmulatedXFormDescriptor fd = getPageContext(context).
                getEmulatedXFormDescriptor(id);

        if (fd == null) {
            // Create a new fd if none exists in the session.
            fd = new EmulatedXFormDescriptor();
            fd.setContainingFormName(id);
            fd.setName(id);
        }

        context.getXFormBuilder().addModel(id, fd);
    }
View Full Code Here

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

        // callCloseOnProtocol assumes that callOpenOnProtocol and
        // initialiseAttributes will have been called first, so duplicate this
        XDIMEContextInternal context = new XDIMEContextImpl();
        final XFormBuilder xFormBuilder = context.getXFormBuilder();
        final String modelID = "modelID";
        EmulatedXFormDescriptor fd = new EmulatedXFormDescriptor();
        xFormBuilder.addModel(modelID, fd);
        XDIMEAttributes attributes = new XDIMEAttributesImpl(getElementType());
        attributes.setValue("", XDIMEAttribute.ID.toString(), "controlID");
        attributes.setValue("", XDIMEAttribute.MODEL.toString(), modelID);
        xFormBuilder.registerControl(attributes);
View Full Code Here

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

            String containingFormName) {
        // Get any form data stored in the session for this form.
        SessionFormData sessionFormData = getFormDataManager().
                getSessionFormDataByName(containingFormName);

        EmulatedXFormDescriptor xfd = null;
        if (sessionFormData != null) {
            FormDescriptor fd = sessionFormData.getFormDescriptor();
            if (fd instanceof EmulatedXFormDescriptor) {
                xfd = (EmulatedXFormDescriptor)fd;
            } else {
View Full Code Here

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

    StylesMock styles;
    MutablePropertyValuesMock values;

    protected void setUp() throws Exception {
        super.setUp();
        model = new XFormModelImpl("ModelID", new EmulatedXFormDescriptor());
        styles = new StylesMock("styles", expectations);
        values = new MutablePropertyValuesMock("values", expectations);
    }
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.