Package com.volantis.mcs.protocols.forms

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


    // Javadoc inherited.
    protected void setSimpleSingleExpectations() {

        EnvironmentContextMock environmentContextMock = new EnvironmentContextMock("environmentContextMock", expectations);
        FormDataManagerMock fdm = new FormDataManagerMock("fdm", expectations);
        FormDescriptor fdesc = new FormDescriptor();
        SessionFormDataMock sessionFormData = new SessionFormDataMock(
                "formData", expectations, "s0", fdesc);

        pageContext.expects.getEnvironmentContext().returns(environmentContextMock).any();
        environmentContextMock.expects.getContextPathURL().returns(new MarinerURL("/")).any();
View Full Code Here


    // Javadoc inherited.
    protected void setSimpleMultipleExpectations() {

        EnvironmentContextMock environmentContextMock = new EnvironmentContextMock("environmentContextMock", expectations);
        FormDataManagerMock fdm = new FormDataManagerMock("fdm", expectations);
        FormDescriptor fdesc = new FormDescriptor();
        SessionFormDataMock sessionFormData = new SessionFormDataMock(
                "formData", expectations, "s0", fdesc);

        pageContext.expects.getEnvironmentContext().returns(environmentContextMock).any();
        environmentContextMock.expects.getContextPathURL().returns(new MarinerURL("/")).any();
View Full Code Here

        XFFormElementImpl formElement
                = (XFFormElementImpl) pageContext.getCurrentElement();
        XFFormAttributes formAttributes = formElement.getProtocolAttributes();

        // Get the enclosing form element's descriptor.
        FormDescriptor formDescriptor = formElement.getFormDescriptor();

        // Add a reference back to the form attributes.
        pattributes.setFormAttributes(formAttributes);
        pattributes.setFormData(formAttributes.getFormData());

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

        // Set the value.
        String value = attributes.getValue();
        pattributes.setValue(value);

        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) {
            throw new PAPIException(exceptionLocalizer.format(
                    "xfimplicit-value-or-client-variable-name"));
        }

        pattributes.setClientVariableName(clientVariableName);

        // Create the field descriptor.
        FieldDescriptor fieldDescriptor = new FieldDescriptor();
        fieldDescriptor.setName(name);
        fieldDescriptor.setType(ImplicitFieldType.getSingleton());
        fieldDescriptor.setInitialValue(value);

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

        // Add the attributes to the list.
        formAttributes.addField(pattributes);

        // Add the field descriptor to the list.
        formDescriptor.addField(fieldDescriptor);

        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

        String absoluteLink = externalURL.getExternalForm();
        if (logger.isDebugEnabled()) {
            logger.debug("URL after Rewriting is " + absoluteLink);
        }

        final FormDescriptor fd = attributes.getFormDescriptor();
        SessionFormData formData = context.getFormDataManager().getSessionFormData(fd);
        final String linkName = link.getLinkName();
        formData.setFieldValue(linkName, absoluteLink);

        if (logger.isDebugEnabled()) {
View Full Code Here

        // Get the form data manager.
        FormDataManager manager = context.getFormDataManager();

        String formSpecifier = attributes.getFormSpecifier();
        FormDescriptor formDescriptor = attributes.getFormDescriptor();

        if (formSpecifier == null) {
            // This will add the form descriptor to the cache and create the a
            // new form specifier for it if none exists, or return an existing
            // specifier if the descriptor is already in the cache.
View Full Code Here

        FieldDescriptor uploadDescriptor = new FieldDescriptor();
        uploadDescriptor.setType(UploadFieldType.getSingleton());
        uploadDescriptor.setName("fileToUpload");

        // Create descriptor for the enclosing form
        FormDescriptor formDescriptor = new FormDescriptor();
        formDescriptor.addField(uploadDescriptor);

        // Create atributes of the upload element
        uploadAttrs = new XFUploadAttributes();
        uploadAttrs.setFieldDescriptor(uploadDescriptor);
        uploadAttrs.setName(uploadDescriptor.getName());
View Full Code Here

TOP

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

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.