Package com.dotcms.repackage.org.apache.commons.validator

Examples of com.dotcms.repackage.org.apache.commons.validator.ValidatorAction


        results.append(getJavascriptBegin(methods));

        for (Iterator i = actions.iterator(); i.hasNext();)
        {
            ValidatorAction va = (ValidatorAction)i.next();
            int jscriptVar = 0;
            String functionName = null;

            if (va.getJsFunctionName() != null && va.getJsFunctionName().length() > 0)
            {
                functionName = va.getJsFunctionName();
            }
            else
            {
                functionName = va.getName();
            }

            results.append("    function ");
            results.append(jsFormName);
            results.append("_");
            results.append(functionName);
            results.append(" () { \n");

            for (Iterator x = form.getFields().iterator(); x.hasNext();)
            {
                Field field = (Field)x.next();

                // Skip indexed fields for now until there is
                // a good way to handle error messages (and the length
                // of the list (could retrieve from scope?))
                if (field.isIndexed()
                    || field.getPage() != page
                    || !field.isDependency(va.getName()))
                {
                    continue;
                }

                String message =
View Full Code Here


        String methodOperator = " && ";

        StringBuffer methods = null;
        for (Iterator i = actions.iterator(); i.hasNext();)
        {
            ValidatorAction va = (ValidatorAction)i.next();
            if (methods == null)
            {
                methods = new StringBuffer(va.getMethod());
            }
            else
            {
                methods.append(methodOperator);
                methods.append(va.getMethod());
            }
            methods.append("(form)");
        }
        return methods.toString();
    }
View Full Code Here

        // Create list of ValidatorActions based on actionMethods
        for (Iterator i = actionMethods.iterator(); i.hasNext();)
        {
            String depends = (String) i.next();
            ValidatorAction va = resources.getValidatorAction(depends);

            // throw nicer NPE for easier debugging
            if (va == null)
            {
                throw new NullPointerException(
                    "Depends string \"" + depends +
                    "\" was not found in validator-rules.xml.");
            }

            String javascript = va.getJavascript();
            if (javascript != null && javascript.length() > 0)
            {
                actions.add(va);
            }
            else
View Full Code Here

        StringBuffer sb = new StringBuffer("\n\n");

        Iterator actions = resources.getValidatorActions().values().iterator();
        while (actions.hasNext())
        {
            ValidatorAction va = (ValidatorAction) actions.next();
            if (va != null)
            {
                String javascript = va.getJavascript();
                if (javascript != null && javascript.length() > 0)
                {
                    sb.append(javascript + "\n");
                }
            }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.commons.validator.ValidatorAction

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.