Examples of XFImplicitAttributes


Examples of com.volantis.mcs.papi.XFImplicitAttributes

        requestContext.pushProject(runtimeProjectMock);
        pageContext.pushRequestContext(requestContext);

        // Create the XFImplicit element and attributes
        implicitElement = new XFImplicitElementImpl();
        papiAttributes = new XFImplicitAttributes();
    }
View Full Code Here

Examples of com.volantis.mcs.papi.XFImplicitAttributes

                                    logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _D" + vname + " to " + inputAttributes.getName() );
                                }
                                sessionMap.setAttribute(getFormName(pageContext), "_D"+vname, inputAttributes.getName());
                            }
                        } else {                           
                            XFImplicitAttributes ia = new XFImplicitAttributes();
                            ia.setName( "i_" + vname );
                            ia.setValue( inputAttributes.getInitial() );

                            writer.openElement(ia);
                            writer.closeElement(ia);

                            if (logger.isDebugEnabled()) {
                                logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _V" + vname + " to " + inputAttributes.getName() );
                            }
                            sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
                        }
                    } else {
                        if (logger.isDebugEnabled()) {
                            logger.debug ("hidden-input-undefined");
                        }
                        XFImplicitAttributes ia = new XFImplicitAttributes();
                        ia.setName( inputAttributes.getName() );
                        ia.setValue( inputAttributes.getInitial() );

                        writer.openElement(ia);
                        writer.closeElement(ia);
                                               
                    }
View Full Code Here

Examples of com.volantis.mcs.papi.XFImplicitAttributes

            throws PAPIException {

        MarinerPageContext pageContext
                = ContextInternals.getMarinerPageContext(context);

        XFImplicitAttributes attributes = (XFImplicitAttributes) papiAttributes;

        // Create a new protocol attributes object every time, as this element
        // could be reused before the attributes have actually been finished with
        // by the protocol.
        com.volantis.mcs.protocols.XFImplicitAttributes pattributes
                = new com.volantis.mcs.protocols.XFImplicitAttributes();

        // Get the enclosing form element's attributes.
        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(
View Full Code Here

Examples of com.volantis.mcs.papi.XFImplicitAttributes

                            if(logger.isDebugEnabled()){
                                logger.debug ( "Hidden input. Setting session attribute _V" + vname + " to " + inputAttributes.getName() );
                            }  
                            session.setAttribute( new String( "_V"+vname ), new String( inputAttributes.getName() ) );

                            XFImplicitAttributes ia = new XFImplicitAttributes();
                            ia.setName( "i_" + vname );
                            ia.setValue( inputAttributes.getInitial() );

                            writer.openElement(ia);
                            writer.closeElement(ia);
                        }
                    } else {
                        if(logger.isDebugEnabled()){
                            logger.debug ( "Hidden input  vname is undefined" );
                        }
                        XFImplicitAttributes ia = new XFImplicitAttributes();
                        ia.setName( inputAttributes.getName() );
                        ia.setValue( inputAttributes.getInitial() );

                        writer.openElement(ia);
                        writer.closeElement(ia);
                    }
                }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

        TestMarinerPageContext context = new TestMarinerPageContext();
        protocol.setMarinerPageContext(context);

        XMLReader reader = DOMUtilities.getReader();

        XFImplicitAttributes attributes = new XFImplicitAttributes();
        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);

        String actual = DOMUtilities.toString(
                buffer.getRoot(), protocol.getCharacterEncoder());
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

    /**
     * Test getXFImplicitAttributesValue with no attributes
     */
    public void testGetXFImplicitAttributesValueNoAttributes() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        assertNull("should be null when value and clientVariableName not supplied",
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

    /**
     * Test getXFImplicitAttributesValue with just a value attribute
     */
    public void testGetXFImplicitAttributesValueValueAttribute() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test just value set
        attributes.setValue("value");
        assertEquals("wrong value returned", "value",
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

    /**
     * Test getXFImplicitAttributesValue with just clientVariableName
     */
    public void testGetXFImplicitAttributesValueClientVariableName() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test just clientVariableName set
        attributes.setClientVariableName("clientVariableName");
        assertEquals("wrong clientVariableName returned",
                WMLVariable.WMLV_NOBRACKETS + "clientVariableName" +
                WMLVariable.WMLV_NOBRACKETS,
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

     * Test getXFImplicitAttributesValue with both clientVariableName
     * and value attributes
     */
    public void testGetXFImplicitAttributesValueBothAttributes() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test that clientVariableName takes precedence over value
        attributes.setClientVariableName("clientVariableName");
        attributes.setValue("value");
        assertEquals("wrong clientVariableName returned",
                WMLVariable.WMLV_NOBRACKETS + "clientVariableName" +
                WMLVariable.WMLV_NOBRACKETS,
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFImplicitAttributes

     * Test addPostField puts the correct element in the output buffer when
     * we pass it no XFImplicit attributes.
     */
    public void testAddPostFieldNoAttributes() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test with no attributes
        protocol.addPostField(buffer, attributes);
    }
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.