hudson.plugins.collabnet.util
Class CNFormFieldValidator

java.lang.Object
  extended by hudson.plugins.collabnet.util.CNFormFieldValidator

public abstract class CNFormFieldValidator
extends java.lang.Object


Constructor Summary
CNFormFieldValidator()
           
 
Method Summary
static hudson.util.FormValidation assignCheck(org.kohsuke.stapler.StaplerRequest request)
          Class for checking if a user can be assigned a tracker artifact.
static java.lang.String checkInterpretedString(java.lang.String str)
          Utility function to check that a str contains only valid enviromental variables to interpret.
static boolean checkUrl(java.lang.String url)
          Returns true if a url is valid, false otherwise.
static hudson.util.FormValidation cubitKeyCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check if a CUBiT key has the proper format and allows login.
static hudson.util.FormValidation documentPathCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check that the path to a document exists.
static hudson.util.FormValidation groupListCheck(java.lang.String groupStr, java.lang.String userStr)
          Check that a comma-separated list of groups exists.
static hudson.util.FormValidation hostUrlCheck(java.lang.String hostUrl)
          Class for checking if a Host URL is correct.
static hudson.util.FormValidation interpretedCheck(java.lang.String str, java.lang.String name, boolean isRequired)
          Class for checking an unrequired value that may include interpreted strings (i.e.
static hudson.util.FormValidation loginCheck(org.kohsuke.stapler.StaplerRequest request)
          Class for checking that a login to CollabNet is valid.
static hudson.util.FormValidation packageCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check that a package exists.
static hudson.util.FormValidation projectCheck(org.kohsuke.stapler.StaplerRequest request)
          Class for checking that a project name is valid.
static hudson.util.FormValidation regexCheck(java.lang.String regex)
          Class to check for validity of a regex expression.
static hudson.util.FormValidation releaseCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check that a release exists.
static hudson.util.FormValidation repoCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check that a repo exists.
static hudson.util.FormValidation requiredCheck(java.lang.String value, java.lang.String name)
          Class for checking that a required value is set.
static hudson.util.FormValidation requiredInterpretedCheck(java.lang.String str, java.lang.String name)
          Class for checking an interpreted string which is required.
static hudson.util.FormValidation soapUrlCheck(java.lang.String collabNetUrl)
          Class for checking if a URL is correct and corresponds to a CollabNet server.
static hudson.util.FormValidation trackerCheck(org.kohsuke.stapler.StaplerRequest request)
          Class to check that a tracker exists.
static hudson.util.FormValidation unrequiredInterpretedCheck(java.lang.String str, java.lang.String name)
          Class for checking an interpreted string which is unrequired.
static hudson.util.FormValidation userListCheck(java.lang.String userStr)
          Check that a comma-separated list of users exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CNFormFieldValidator

public CNFormFieldValidator()
Method Detail

checkInterpretedString

public static java.lang.String checkInterpretedString(java.lang.String str)
Utility function to check that a str contains only valid enviromental variables to interpret.

Parameters:
str - the string to test.
Returns:
error message, if any variables are missing, null if all are found.

checkUrl

public static boolean checkUrl(java.lang.String url)
Returns true if a url is valid, false otherwise.


requiredCheck

public static hudson.util.FormValidation requiredCheck(java.lang.String value,
                                                       java.lang.String name)
Class for checking that a required value is set. Expects a StaplerRequest with a value set to the value and a name set to the name of what is being set (used for error msg).


interpretedCheck

public static hudson.util.FormValidation interpretedCheck(java.lang.String str,
                                                          java.lang.String name,
                                                          boolean isRequired)
Class for checking an unrequired value that may include interpreted strings (i.e. Hudson environmental values). Expects a StaplerRequest with value. If it's a required value, expects a value name.


unrequiredInterpretedCheck

public static hudson.util.FormValidation unrequiredInterpretedCheck(java.lang.String str,
                                                                    java.lang.String name)
Class for checking an interpreted string which is unrequired.


requiredInterpretedCheck

public static hudson.util.FormValidation requiredInterpretedCheck(java.lang.String str,
                                                                  java.lang.String name)
Class for checking an interpreted string which is required.


hostUrlCheck

public static hudson.util.FormValidation hostUrlCheck(java.lang.String hostUrl)
Class for checking if a Host URL is correct. Expects a StaplerRequest with value set to the url.


soapUrlCheck

public static hudson.util.FormValidation soapUrlCheck(java.lang.String collabNetUrl)
Class for checking if a URL is correct and corresponds to a CollabNet server. Expects a StaplerRequest with value set to the url.


loginCheck

public static hudson.util.FormValidation loginCheck(org.kohsuke.stapler.StaplerRequest request)
Class for checking that a login to CollabNet is valid. Expects a StaplerRequest with url, username, and password set.


projectCheck

public static hudson.util.FormValidation projectCheck(org.kohsuke.stapler.StaplerRequest request)
Class for checking that a project name is valid. Expects a StaplerRequest with url, username, password, and project set.


documentPathCheck

public static hudson.util.FormValidation documentPathCheck(org.kohsuke.stapler.StaplerRequest request)
                                                    throws java.io.IOException
Class to check that the path to a document exists. Warns about any missing folders. Expects a StaplerRequest with url, username, password, project, and path.

Throws:
java.io.IOException

packageCheck

public static hudson.util.FormValidation packageCheck(org.kohsuke.stapler.StaplerRequest request)
Class to check that a package exists. Expects a StaplerRequest with a url, username, password, project, and package.


releaseCheck

public static hudson.util.FormValidation releaseCheck(org.kohsuke.stapler.StaplerRequest request)
Class to check that a release exists. Expects a StaplerRequest with a url, username, password, project, package (optional), and release.


repoCheck

public static hudson.util.FormValidation repoCheck(org.kohsuke.stapler.StaplerRequest request)
Class to check that a repo exists. Expects a StaplerRequest with a url, username, password, and project.


trackerCheck

public static hudson.util.FormValidation trackerCheck(org.kohsuke.stapler.StaplerRequest request)
Class to check that a tracker exists. Expects a StaplerRequest with a url, username, password, project, and tracker.


assignCheck

public static hudson.util.FormValidation assignCheck(org.kohsuke.stapler.StaplerRequest request)
Class for checking if a user can be assigned a tracker artifact. Expects a StaplerRequest with login info (url, username, password), project, and assign (which is the username).


userListCheck

public static hudson.util.FormValidation userListCheck(java.lang.String userStr)
Check that a comma-separated list of users exists. The check only works for a logged-in site-admin. Otherwise, give a warning that we cannot check the users' validity.


groupListCheck

public static hudson.util.FormValidation groupListCheck(java.lang.String groupStr,
                                                        java.lang.String userStr)
Check that a comma-separated list of groups exists. The check only works for a logged-in site-admin. Also warns the current user if s/he will be locked out once that user saves the configuration.


regexCheck

public static hudson.util.FormValidation regexCheck(java.lang.String regex)
Class to check for validity of a regex expression. Expects a StaplerRequest with value set.


cubitKeyCheck

public static hudson.util.FormValidation cubitKeyCheck(org.kohsuke.stapler.StaplerRequest request)
Class to check if a CUBiT key has the proper format and allows login. Expects a StaplerRequest with value (key), hostURL, and user set.



Copyright © 2010. All Rights Reserved.