Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   package hudson.plugins.collabnet.tracker;
   
   import  com.collabnet.ce.soap50.webservices.tracker.ArtifactSoapDO;
   import hudson.Extension;
   import hudson.Launcher;
  
  
  public class CNTracker extends Notifier {
      private static int DEFAULT_PRIORITY = 3;
  
      // listener is used for logging and will only be
      // set at the beginning of perform.
      private transient BuildListener listener = null;
      
      // data from jelly
      private boolean override_auth = true;
      private String username = null;
      private String password = null;
      private String collabNetUrl = null;
      private String project = null;
      private String tracker = null;
      private String title = null;
      private String assign_user = null;
      private int priority = ;
      private boolean attach_log = true;
      private boolean always_update = false;
      private boolean close_issue = true;
      private String release;
  
      // collabNet object
      private transient CollabNetApp cna = null;
  
      private transient static TeamForgeShare.TeamForgeShareDescriptor 
          shareDescriptor = null;

    
Constructs a new CNTracker instance.

Parameters:
username to login as.
password to login with.
collabNetUrl URL of the CollabNet server.
project project name.
tracker tracker name.
title title to use when create new tracker artifacts OR to find existing tracker artifacts.
assign_user user to assign new tracker artifacts to.
priority of new tracker artifacts.
attach_log if true, Hudson build logs will be uploaded and attached when creating/updating tracker artifacts.
always_update if true, always update the tracker artifacts (or create one), even if build is successful and the tracker artifact is closed. If false, only update when the tracker artifact is failing or is open.
close_issue if true, the tracker artifact will be closed if the Hudson build is successful. Otherwise, open issues will be updated with a successful message, but remain open.
release to report the tracker artifact in.
  
      public CNTracker(String usernameString passwordString collabNetUrl
                       String projectString trackerString title
                       String assign_userString priorityboolean attach_log
                       boolean always_updateboolean close_issue
                       String releaseboolean override_auth) {
          this. = username;
          this. = password;
          this. = CNHudsonUtil.sanitizeCollabNetUrl(collabNetUrl);
          this. = project;
          this. = tracker;
         this. = title;
         this. = assign_user;
         this. = Integer.parseInt(priority);
         this. = attach_log;
         this. = always_update;
         this. = close_issue;
         this. = release;
         this. = override_auth;
     }

    
Setting the listener allows logging to work.

Parameters:
listener handles build events.
 
     private void setupLogging(BuildListener listener) {
         this. = listener;
     }

    
Logging will only work once the listener is set. Otherwise, it will fail (silently).

Parameters:
message to print to the console.
 
     private void log(String message) {
         if (this. != null) {
             message = "CollabNet Tracker: " + message;
             this..getLogger().println(message);
         }
     }

    
Convenience method to log RemoteExceptions.

Parameters:
methodName in progress when the exception occurred.
re RemoteException that occurred.
 
     private void log(String methodNameRemoteException re) {
         this.log(methodName + " failed due to " + re.getClass().getName() + 
                  ": " + re.getMessage());
     }

    

Returns:
whether or not auth is overriden
 
     public boolean overrideAuth() {
         return this.;
     }

    

Returns:
username to login as.
 
     public String getUsername() {
         if (this.overrideAuth()) {
             return this.;            
         } else {
             return getTeamForgeShareDescriptor().getUsername();
         }
     }
    
    

Returns:
password to login with.
 
     public String getPassword() {
         if (this.overrideAuth()) {
             return this.;
         } else {
             return getTeamForgeShareDescriptor().getPassword();
         }
     }

    

Returns:
URL of the CollabNet server.
 
     public String getCollabNetUrl() {
         if (this.overrideAuth()) {
             return this.;
         } else {
             return getTeamForgeShareDescriptor().getCollabNetUrl();
         }
     }
    
    

Returns:
project name.
 
     public String getProject() {
         return this.;
     }
    
    

Returns:
tracker name.
 
     public String getTracker() {
         return this.;
     }
    
    

Returns:
title for the Tracker Artifact.
 
     public String getTitle() {
         return this.;
     }

    

Returns:
the user to assign new Tracker Artifacts to.
 
     public String getAssignUser() {
         if (this. == null || this..equals("")) {
             return null;
         } else {
             return this.;
         }
     }
    
    

Returns:
the priority to set new Tracker Artifacts to.
 
     public int getPriority() {
         return this.;
     }
    
    

Returns:
true, if logs should be attached to Tracker Artifacts.
 
     public boolean attachLog() {
         return this.;
     }
    
    

Returns:
true, if artifact creation/update should happen, even if the Hudson build is successful and the artifact is not open.
 
     public boolean alwaysUpdate() {
         return this.;
     }
    
    

Returns:
true, if artifacts should be closed when the Hudson build succeeds.
 
     public boolean closeOnSuccess() {
         return this.;
     }
    
    

Returns:
the name of the release which new Tracker Artifacts will be reported in.
 
     public String getRelease() {
         return this.;
     }

    

Returns:
the TeamForge share descriptor.
 
     public static TeamForgeShare.TeamForgeShareDescriptor 
         getTeamForgeShareDescriptor() {
         if ( == null) {
              = TeamForgeShare.getTeamForgeShareDescriptor();
         }
         return ;
     }

    

Returns:
the list of all possible projects, given the login data.
 
     public String[] getProjects() {
         CollabNetApp cna = CNHudsonUtil.getCollabNetApp(this.getCollabNetUrl(),
                                                         this.getUsername(), 
                                                         this.getPassword());
         Collection<Stringprojects = ComboBoxUpdater.ProjectsUpdater
             .getProjectList(cna);
         CNHudsonUtil.logoff(cna);
         return projects.toArray(new String[0]);
     }

    

Returns:
the list of all possible trackers, given the login data.
 
     public String[] getTrackers() {
         CollabNetApp cna = CNHudsonUtil.getCollabNetApp(this.getCollabNetUrl(),
                                                         this.getUsername(), 
                                                         this.getPassword());
         String projectId = this.getProjectId(this.getProject());
         Collection<Stringtrackers = ComboBoxUpdater.TrackersUpdater
             .getTrackerList(cnaprojectId);
         CNHudsonUtil.logoff(cna);
         return trackers.toArray(new String[0]);
     }

    

Returns:
the list of all project members, given the login data.
 
     public String[] getUsers() {
         CollabNetApp cna = CNHudsonUtil.getCollabNetApp(this.getCollabNetUrl(),
                                                         this.getUsername(), 
                                                         this.getPassword());
         String projectId = this.getProjectId(this.getProject());
         Collection<Stringusers = ComboBoxUpdater.UsersUpdater
             .getUserList(cnaprojectId);
         CNHudsonUtil.logoff(cna);
         return users.toArray(new String[0]);
     }

    

Returns:
the list of all possible releases, given the login data.
 
     public String[] getReleases() {
         CollabNetApp cna = CNHudsonUtil.getCollabNetApp(this.getCollabNetUrl(),
                                                         this.getUsername(), 
                                                         this.getPassword());
         String projectId = this.getProjectId(this.getProject());
         Collection<Stringreleases = ComboBoxUpdater.ReleasesUpdater
             .getProjectReleaseList(cnaprojectId);
         CNHudsonUtil.logoff(cna);
         return releases.toArray(new String[0]);
     }
 
     @Override
         return .;
     }
    
    
Create/Update/Close the tracker issue, according to the Hudson build status.

Parameters:
build the current Hudson build.
launcher unused.
listener receives events that occur during a build; used for logging.
Returns:
false if a critical error occurred, true otherwise.
 
     @Override
     public boolean perform(AbstractBuild<?, ?> buildLauncher launcher,
                            BuildListener listener
         throws InterruptedExceptionIOException {
         this.setupLogging(listener);
         this. = CNHudsonUtil.getCollabNetApp(this.getCollabNetUrl(),
                                                 this.getUsername(),
                                                 this.getPassword());
         if (this. == null) {
             this.log("Critical Error: login to " + this. + 
                      " failed.  Setting build status to UNSTABLE (or worse).");
             Result previousBuildStatus = build.getResult();
             build.setResult(previousBuildStatus.combine(.));
             return false;
         }
         String projectId = this.getProjectId(this.);
         if (projectId == null) {
             this.log("Critical Error: projectId cannot be found for " + 
                      this. + ".  This could mean that the project " +
                      "does not exist OR that the user logging in does not " +
                      "have access to that project.  " +
                      "Setting build status to UNSTABLE (or worse).");
             Result previousBuildStatus = build.getResult();
             build.setResult(previousBuildStatus.combine(.));
             this.logoff();
             return false;
         }
         String trackerId = this.getTrackerId(projectIdthis.);
         if (trackerId == null) {
             this.log("Critical Error: trackerId cannot be found for " + 
                      this. + ".  This could mean the tracker does " +
                      "not exist OR that the user logging in does not have " +
                      "access to that tracker.  " 
                      + "Setting build status to UNSTABLE (or worse).");
             Result previousBuildStatus = build.getResult();
             build.setResult(previousBuildStatus.combine(.));
             this.logoff();
             return false;
         }
         ArtifactSoapDO issue = this.findTrackerArtifact(trackerIdbuild);
         Result buildStatus = build.getResult();
         // no issue and failure found
         if (issue == null &&
             buildStatus.isWorseThan(.)) {
             this.log("Build is not successful; opening a new issue.");
             String description = "The build has failed.  Latest " +
                 "build status: " + build.getResult() + ".  For more info, " +
                 "see " + this.getBuildUrl(build);
             this.createNewTrackerArtifact(projectIdtrackerId
                                           "Open"descriptionbuild);
             // no issue and success may open a new issue if we're updating
             // no matter what
         } else if (issue == null &&
                buildStatus.isBetterOrEqualTo(.)) {
             this.log("Build is successful!");
             if (this.alwaysUpdate()) {
                 String description = "The build has succeeded.  For " +
                     "more info, see " + this.getBuildUrl(build);
                 this.createNewTrackerArtifact(projectIdtrackerId
                                               "Closed"descriptionbuild);
             }
         // update existing fail -> fail
         } else if (issue.getStatusClass().equals("Open") &&
                    buildStatus.isWorseThan(.)) {
             this.log("Build is continuing to fail; updating issue.");
             this.updateFailingBuild(issuebuild);
         }
         // close or update existing  fail -> succeed
         else if (issue.getStatusClass().equals("Open") &&
                  buildStatus.isBetterOrEqualTo(.)) {
             if (this.closeOnSuccess()) {
                 this.log("Build succeeded; closing issue.");
                 this.closeSucceedingBuild(issuebuild);
             } else {
                 // just update
                 this.log("Build succeeded; updating issue.");
                 this.updateSucceedingBuild(issuebuild);        
             }
         }
         // create new succeed -> fail
         else if (issue.getStatusClass().equals("Close") && 
                  buildStatus.isWorseThan(.)) {
             // create new or reopen?
             if (this.alwaysUpdate()) {
                 this.log("Build is not successful; re-opening issue.");
                 this.updateFailingBuild(issuebuild);
             } else {
                 this.log("Build is not successful; opening a new issue.");
                 String description = "The build has failed.  Latest " +
                     "build status: " + build.getResult() + ".  For more " +
                     "info, see " + this.getBuildUrl(build);
                 this.createNewTrackerArtifact(projectIdtrackerId
                                               "Open"descriptionbuild);
             }
         } else if (issue.getStatusClass().equals("Close") &&
                    buildStatus.isBetterOrEqualTo(.)) {
             this.log("Build continues to be successful!");
             if (this.alwaysUpdate()) {
                 this.updateSucceedingBuild(issuebuild);
             }
         } else {
             this.log("Unexpected state:  result is: " + buildStatus + 
                      ".  Issue status " + "class is: " + issue.getStatusClass()
                      + ".");
         }
         this.logoff();
         return true;
     }

    
Log out of the collabnet server.
 
     public void logoff() {
         CNHudsonUtil.logoff(this.);
         this. = null;
     }

    
Given a project title, find the matching projectId. If none is found, return null.

Parameters:
projectName
Returns:
project id corresponding to the name, or null if none is found.
 
     public String getProjectId(String projectName) {
         if (this. == null) {
             this.log("Cannot getProjectId, not logged in!");
             return null;
         }
         return CNHudsonUtil.getProjectId(this.projectName);
     }

    
Given a tracker title and a projectId, find the matching tracker id.

Parameters:
projectId
trackerName
Returns:
the tracker id for the tracker that matches this name, or null if no matching tracker is found.
 
     public String getTrackerId(String projectIdString trackerName) {
         if (this. == null) {
             this.log("Cannot call getTrackerId, not logged in!");
             return null;
         }
         return CNHudsonUtil.getTrackerId(projectIdtrackerName);
     }

    
Return a tracker artifact with the matching title.

Parameters:
trackerId
build the current Hudson build.
Returns:
the artifact soap data object, if one exists which matches the title. Otherwise, null.
 
     public ArtifactSoapDO findTrackerArtifact(String trackerId,
             AbstractBuild<?, ?> buildthrows IOExceptionInterruptedException {
         if (this. == null) {
             this.log("Cannot call findTrackerArtifact, not logged in!");
             return null;
         }
         String title = this.getInterpreted(buildthis.getTitle());
         TrackerApp ta = new TrackerApp(this.);
         ArtifactSoapDO asd = null;
         try {
             asd = ta.findLastTrackerArtifact(trackerIdtitle);
         } catch (RemoteException re) {
             this.log("findTrackerArtifact"re);
             return null;
         }
         return asd;
     }
    
    
Create a new tracker artifact with the given values.

Parameters:
projectId id for project
trackerId id for tracker
status status to set on the new artifact (Open, Closed, etc.).
description description of the new artifact.
Returns:
the newly created ArtifactSoapDO.
 
     public ArtifactSoapDO createNewTrackerArtifact(String projectId
                                                    String trackerId
                                                    String status,
                                                    String description,
                                                    AbstractBuild <?, ?> build)
                                                    throws IOExceptionInterruptedException {
         if (this. == null) {
             this.log("Cannot call createNewTrackerArtifact, not logged in!");
             return null;
         }
         ArtifactSoapDO asd = null;
         String buildLogId = null;
         if (this.attachLog()) {
             buildLogId = this.uploadBuildLog(build);
             if (buildLogId != null) {
                 this.log("Successfully uploaded build log.");
             } else {
                 this.log("Failed to upload build log.");
             }
         }
         // check assign user validity
         String assignTo = this.getValidAssignUser(projectId);
         String title = this.getInterpreted(buildthis.getTitle());
         String releaseId = CNHudsonUtil.getProjectReleaseId(this.
                                                             projectId
                                                             this.getRelease());
         TrackerApp ta = new TrackerApp(this.);
         try {
             asd = ta.createNewTrackerArtifact(trackerIdtitle,
                                               descriptionnullnullstatus,
                                               nullthis., 0, 
                                               assignToreleaseIdnull
                                               build.getLogFile().getName(), 
                                               "text/plain"buildLogId);
             this.log("Created tracker artifact '" + title + "' in tracker '" 
                      + this.getTracker() + "' in project '" + this.getProject()
                      + "' on behalf of '" + this.getUsername() + "' at " 
                      + this.getArtifactUrl(asd) + ".");          
         } catch (RemoteException re) {
             this.log("createNewTrackerArtifact"re);
             return null;
         }
         return asd;
     }
    
    

Parameters:
projectId
Returns:
the assigned user, if that user is a member of the project. Otherwise, null.
 
     private String getValidAssignUser(String projectId) {
         String valid_user = this.;
         if (!CNHudsonUtil.isUserMember(this.this.
                                               projectId)) {
             this.log("User (" + this. + ") is not a member of " +
                      "the project (" + this. + ").  " + "Instead " +
                      "any new issues filed will be assigned to 'None'.");
             valid_user = null;
         }
         return valid_user;
     }
    
    
Update the issue with failing build status.

Parameters:
issue the existing issue.
build the current Hudson build.
 
     public void updateFailingBuild(ArtifactSoapDO issue,
             AbstractBuild<?, ?> buildthrows IOExceptionInterruptedException {
         if (this. == null) {
             this.log("Cannot call updateFailingBuild, not logged in!");
             return;
         }
         String buildLogId = null;
         if (this.attachLog()) {
             buildLogId = this.uploadBuildLog(build);
             if (buildLogId != null) {
                 this.log("Successfully uploaded build log.");
             } else {
                 this.log("Failed to upload build log.");
             }
         }
         String update = "Updated";
         if (!issue.getStatus().equals("Open")) {
             issue.setStatus("Open");
             update = "Updated and reopened";
         }
         String comment = "The build is continuing to fail.  Latest " +
             "build status: " + build.getResult() + ".  For more info, see " + 
             this.getBuildUrl(build);
         String title = this.getInterpreted(buildthis.getTitle());
         TrackerApp ta = new TrackerApp(this.);
         try {
             ta.setArtifactData(issuecomment
                                build.getLogFile().getName(), 
                                "text/plain"buildLogId);
             this.log(update + " tracker artifact '" + title + "' in tracker '" 
                      + this.getTracker() + "' in project '" + this.getProject()
                      + "' on behalf of '" + this.getUsername() + "' at " 
                      + this.getArtifactUrl(issue) + 
                      " with failed status.");
         } catch (RemoteException re) {
             this.log("updateFailingBuild"re);
         } catch (IOException ioe) {
             this.log("updateFailingBuild failed due to IOException:" + 
                      ioe.getMessage());
         }
     }
    
    
Update the issue with a build that's successful, but do not change its status.

Parameters:
issue the existing issue.
build the current Hudson build.
 
     public void updateSucceedingBuild(ArtifactSoapDO issue,
             AbstractBuild<?, ?> buildthrows IOExceptionInterruptedException {
         if (this. == null) {
             this.log("Cannot call updateSucceedingBuild, not logged in!");
             return;
         }
         String buildLogId = null;
         if (this.attachLog()) {
             buildLogId = this.uploadBuildLog(build);
             if (buildLogId != null) {
                 this.log("Successfully uploaded build log.");
             } else {
                 this.log("Failed to upload build log.");
             }
         }
         String comment = "The build is succeeding.  For more info, " +
             "see " + this.getBuildUrl(build);
         String title = this.getInterpreted(buildthis.getTitle());
         TrackerApp ta = new TrackerApp(this.);
         try {
             ta.setArtifactData(issuecommentbuild.getLogFile().getName(), 
                                "text/plain"buildLogId);
             this.log("Updated tracker artifact '" + title + "' in tracker '" 
                      + this.getTracker() + "' in project '" + this.getProject()
                      + "' on behalf of '" + this.getUsername() + "' at " 
                      + this.getArtifactUrl(issue) + 
                      " with successful status.");
         } catch (RemoteException re) {
             this.log("updateSucceedingBuild"re); 
         } catch (IOException ioe) {
             this.log("updateSuccedingBuild failed due to IOException:" + 
                      ioe.getMessage());
         }
     }
    
    
Update the issue with a build that's successful, and close it.

Parameters:
issue the existing issue.
build the current Hudson build.
 
     public void closeSucceedingBuild(ArtifactSoapDO issue,
             AbstractBuild<?, ?> buildthrows IOExceptionInterruptedException {
         if (this. == null) {
             this.log("Cannot call updateSucceedingBuild, not logged in!");
             return;
         }
         String buildLogId = null;
         if (this.attachLog()) {
             buildLogId = this.uploadBuildLog(build);
             if (buildLogId != null) {
                 this.log("Successfully uploaded build log.");
             } else {
                 this.log("Failed to upload build log.");
             }
         }
         String comment = "The build succeeded!  Closing issue.  " +
             "For more info, see " + this.getBuildUrl(build);
         issue.setStatusClass("Close");
         issue.setStatus("Closed");
         String title = this.getInterpreted(buildthis.getTitle());
         TrackerApp ta = new TrackerApp(this.);
         try {
             ta.setArtifactData(issuecomment
                                build.getLogFile().getName(), 
                                "text/plain"buildLogId);
             this.log("Closed tracker artifact '" + title + "' in tracker '" 
                      + this.getTracker() + "' in project '" + this.getProject()
                      + "' on behalf of '" + this.getUsername() + "' at " 
                      + this.getArtifactUrl(issue) + 
                      " with successful status.");
         } catch (RemoteException re) {
             this.log("closeSucceedingBuild"re);
         }
     }
    
    
Returns the absolute URL to the build, if rootUrl has been configured. If not, returns the build number.

Parameters:
build the current Hudson build.
Returns:
the absolute URL for this build, or the a string containing the build number.
 
     private String getBuildUrl(AbstractBuild<?, ?> build) {
         Hudson hudson = Hudson.getInstance();
         String rootUrl = hudson.getRootUrl();
         if (rootUrl == null) {
             return "Hudson Build #" + build.number;
         } else {
             return hudson.getRootUrl() + build.getUrl();
         }
     }    
    
    
Get the artifact's url.

Parameters:
art the artifact.
Returns:
an absolute URL to the artifact.
 
     private String getArtifactUrl(ArtifactSoapDO art) {
         return this.getCollabNetUrl() + "/sf/go/" + art.getId();
     }
    
    
Upload the build log to the collabnet server.

Parameters:
build the current Hudson build.
Returns:
the id associated with the file upload.
 
     private String uploadBuildLog(AbstractBuild <?, ?> build) {
         if (this. == null) {
             this.log("Cannot call updateSucceedingBuild, not logged in!");
             return null;
         }
         String id = null;
         FileStorageApp sfsa = new FileStorageApp(this.);
         try {
             id = sfsa.uploadFile(build.getLogFile());
         } catch (RemoteException re) {
             this.log("uploadBuildLog"re);
         }
         return id;
     }
    
    
Translates a string that may contain build vars like ${BUILD_VAR} to a string with those vars interpreted.

Parameters:
build the Hudson build.
str the string to be interpreted.
Returns:
the interpreted string.
Throws:
IllegalArgumentException if the env var is not found.
 
     private String getInterpreted(AbstractBuild<?, ?> buildString str)
             throws IOExceptionInterruptedException {
         try {
             return CommonUtil.getInterpreted(build.getEnvironment(.), str);
         } catch (IllegalArgumentException iae) {
             this.log(iae.getMessage());
             throw iae;
         }
     }
 
     @Extension
     public static final class DescriptorImpl extends BuildStepDescriptor<Publisher> {
         private static Logger log = Logger.getLogger("CNTrackerDescriptor");
 
         /* use to make sure fields are generated with unique names on html */
         private static int smUniqueIdCounter = 0;

        
Basic constructor.
 
         public DescriptorImpl() {
             super(CNTracker.class);
         }

        

Returns:
a unique integer, used to uniquely identify an instance of this plugin on a page.
 
         public synchronized int getUniqueId() {
             int returnVal = ;
             if (returnVal == (. - 1)) {
                  = 0;
             } else {
                 ++;
             }
             return returnVal;
         }
 
         @Override
        
* Allows this plugin to be used as a promotion task.
 
          public boolean isApplicable(Class<? extends AbstractProjectjobType) {
             return true;
         }
        
        

Returns:
human readable name used in the configuration screen.
 
         @Override
         public String getDisplayName() {
             return "CollabNet Tracker";
         }

        

Returns:
the url for the help files.
 
         public static String getHelpUrl() {
             return "/plugin/collabnet/tracker/";
         }

        

Returns:
the help file for tracker.
 
         @Override
         public String getHelpFile() {
             return getHelpUrl() + "help-main.html";
         }

        

Returns:
true if there is auth data that can be inherited.
 
         public boolean canInheritAuth() {
             return getTeamForgeShareDescriptor().useGlobal();
         }
        
        
Creates a new instance of CNTracker from a submitted form.

Parameters:
req config page parameters.
formData data specific to this section, in json form.
Returns:
new CNTracker instance.
Throws:
FormException
 
         @Override
         public CNTracker newInstance(StaplerRequest reqJSONObject formData
             throws FormException {
             boolean override_auth = false;
             String username = null;
             String password = null;
             String collabneturl = null;
             if (formData.has("override_auth")) {
                 override_auth = true;
                 Object authObject = formData.get("override_auth");
                 if (authObject instanceof JSONObject) {
                     username = (String)((JSONObjectauthObject)
                         .get("username");
                     password = (String)((JSONObjectauthObject)
                         .get("password");
                     collabneturl = (String)((JSONObjectauthObject)
                         .get("collabneturl");
                 } else if (authObject.equals(.)) {
                     username = (StringformData.get("username");
                     password = (StringformData.get("password");
                     collabneturl = (StringformData.get("collabneturl");
                 } else {
                     override_auth = false;
                 }
             } else if (!this.canInheritAuth()){
                 override_auth = true;
                 username = (String)formData.get("username");
                 password = (String)formData.get("password");
                 collabneturl = (String)formData.get("collabneturl");
             }
             return new CNTracker(usernamepasswordcollabneturl,
                                  (String)formData.get("project"),
                                  (String)formData.get("tracker"),
                                  StringUtils.
                                  strip((String)formData.get("title")),
                                  StringUtils.
                                  strip((String)formData.get("assign_user")),
                                  (String)formData.get("priority"),
                                  CommonUtil.getBoolean("attach_log"formData),
                                  CommonUtil.getBoolean("always_update"
                                                        formData),
                                  CommonUtil.getBoolean("close_issue"
                                                        formData),
                                  StringUtils.
                                  strip((String)formData.get("release")), 
                                  override_auth);
         }
        
        
Form validation for the CollabNet URL.

Parameters:
value url
 
         public FormValidation doCollabNetUrlCheck(@QueryParameter String value) {
             return CNFormFieldValidator.soapUrlCheck(value);
         }
        
        
Check that a password is present and allows login.

Parameters:
req StaplerRequest which contains parameters from the config.jelly.
 
         public FormValidation doPasswordCheck(StaplerRequest req) {
             return CNFormFieldValidator.loginCheck(req);
         }
        
        
Form validation for the project field.

Parameters:
req StaplerRequest which contains parameters from the config.jelly.
 
         public FormValidation doProjectCheck(StaplerRequest req) {
             return CNFormFieldValidator.projectCheck(req);
         }
        
        
Form validation for the tracker field.

Parameters:
req StaplerRequest which contains parameters from the config.jelly.
 
         public FormValidation doTrackerCheck(StaplerRequest req) {
             return CNFormFieldValidator.trackerCheck(req);
         }
        
        
Form validation for "assign issue to".

Parameters:
req StaplerRequest which contains parameters from the config.jelly.
 
         public FormValidation doAssignCheck(StaplerRequest req) {
             return CNFormFieldValidator.assignCheck(req);
         }
        
        
Form validation for username.

Parameters:
value
name of field
 
         public FormValidation doRequiredCheck(
                 @QueryParameter String value, @QueryParameter String name) {
             return CNFormFieldValidator.requiredCheck(valuename);
         }
        
        
Form validation for the comment and description.

Parameters:
value
name of field
 
         public FormValidation doRequiredInterpretedCheck(
                 @QueryParameter String value, @QueryParameter String name) {
             return CNFormFieldValidator.requiredInterpretedCheck(valuename);
         }
        
        
Form validation for the release field.

Parameters:
req StaplerRequest which contains parameters from the config.jelly.
 
         public FormValidation doReleaseCheck(StaplerRequest req) {
             return CNFormFieldValidator.releaseCheck(req);
         }

        
Methods for updating editable combo boxes. * /
 

        
Gets a list of projects to choose from and write them as a JSON string into the response data.

Parameters:
req contains parameters from the config.jelly.
rsp http response data.
Throws:
IOException
 
         public void doGetProjects(StaplerRequest reqStaplerResponse rsp
             throws IOException {
             new ComboBoxUpdater.ProjectsUpdater(reqrsp).update();
         }

        
Gets a list of trackers to choose from and write them as a JSON string into the response data.

Parameters:
req contains parameters from the config.jelly.
rsp http response data.
Throws:
IOException
        public void doGetTrackers(StaplerRequest reqStaplerResponse rsp
            throws IOException {
            new ComboBoxUpdater.TrackersUpdater(reqrsp).update();
        }

        
Gets a list of projectUsers to choose from and write them as a JSON string into the response data.

Parameters:
req contains parameters from the config.jelly.
rsp http response data.
Throws:
IOException
        public void doGetProjectUsers(StaplerRequest reqStaplerResponse rsp
            throws IOException {
            new ComboBoxUpdater.UsersUpdater(reqrsp).update();
        }
        
        
Gets a list of releases to choose from and write them as a JSON string into the response data.

Parameters:
req contains parameters from the config.jelly.
rsp http response data.
Throws:
IOException
        public void doGetReleases(StaplerRequest reqStaplerResponse rsp
            throws IOException {
            new ComboBoxUpdater.ReleasesUpdater(reqrsp).update();
        }
    }
New to GrepCode? Check out our FAQ X