com.unitedinternet.jenkins.plugins.jobtemplates
Class JobTemplates

java.lang.Object
  extended by com.unitedinternet.jenkins.plugins.jobtemplates.JobTemplates
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.ModelObject, hudson.model.RootAction

@Extension
public class JobTemplates
extends Object
implements hudson.model.RootAction

Author:
Kathi Stutz

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
JobTemplates()
          Set the Hudson instance.
 
Method Summary
 void doCreateJob(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Creates a new job by copying the config of the template job.
 String getDisplayName()
           
 String getIconFileName()
          Return the icon path if user has 'Create' permission.
 hudson.model.Hudson getJenkins()
           
 ArrayList<hudson.model.Item> getTemplates()
          Returns the available job templates.
 String getUrlName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobTemplates

public JobTemplates()
Set the Hudson instance.

Method Detail

getJenkins

public final hudson.model.Hudson getJenkins()
Returns:
Jenkins instance

getIconFileName

public final String getIconFileName()
Return the icon path if user has 'Create' permission.

Specified by:
getIconFileName in interface hudson.model.Action
Returns:
Path to the icon

getDisplayName

public final String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject
Returns:
Display name as String.

getUrlName

public final String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action
Returns:
URL name as String.

getTemplates

public ArrayList<hudson.model.Item> getTemplates()
Returns the available job templates. (i.e. all jobs with names starting with 'Template_')

Returns:
ArrayList of template jobs

doCreateJob

public final void doCreateJob(org.kohsuke.stapler.StaplerRequest req,
                              org.kohsuke.stapler.StaplerResponse rsp)
                       throws IOException
Creates a new job by copying the config of the template job.

Parameters:
req - The StaplerRequest
rsp - TheStaplerResponse
Throws:
IOException - Thrown when job creation goes wrong


Copyright © 2004-2013. All Rights Reserved.