Package com.volantis.mcs.protocols.html

Examples of com.volantis.mcs.protocols.html.XHTMLBasic



    // Javadoc inherited.
    public DOMProtocol createProtocol(ProtocolConfiguration protocolConfig,
            ProtocolSupportFactory psf) {
        return new XHTMLBasic(psf, protocolConfig) {
            protected MarinerURL rewriteFormURL(MarinerURL url) {
                return url;
            }
        };
    }
View Full Code Here


        }

        public VolantisProtocol createProtocol(
                ProtocolSupportFactory supportFactory,
                ProtocolConfiguration configuration) {
            return new XHTMLBasic(supportFactory, configuration);
        }
View Full Code Here

    private void render(VolantisProtocol protocol, MultipleValidatorBuilder builder,
            MultipleValidator validator) throws ProtocolException {

        // This should always work, since this implementation of rendered is
        // tightly coupled with XHTMLBasic protocol
        XHTMLBasic actualProtocol = (XHTMLBasic) protocol;

        // Render script element.
        DOMOutputBuffer currentBuffer = getCurrentBuffer(protocol);

        openScriptElement(currentBuffer);

        StringWriter scriptWriter = new StringWriter();

        StylesExtractor stylesExtractor = new StylesExtractor();

        try {
            // Render multiple validator registration.
            String id = validator.getAttributes().getId();

            boolean renderRegistration = (id != null);

            if (renderRegistration) {
                scriptWriter.write("Widget.register(" + createJavaScriptString(id) + ",");
            }

            // Render multiple validator instantiation
            scriptWriter.write("new Widget.MultipleValidator({");

            // Render fields involved in validation.
            scriptWriter.write("fields:{");

            Iterator fieldsIterator = validator.getFieldsIterator();

            boolean firstField = true;

            while (fieldsIterator.hasNext()) {
                FieldAttributes fieldAttributes = (FieldAttributes) fieldsIterator.next();

                // Get attributes of refered input element.
                String inputId = fieldAttributes.getRef();

                XFFormFieldAttributes formFieldAttributes = actualProtocol.getFormFieldAttributes(inputId);

                // If no attributes were found, it means that the refered text
                // input field
                // does not exist. In that case, don't render it.
                if (formFieldAttributes != null) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.html.XHTMLBasic

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.