Package org.jenkinsci.plugins.p4
Class PerforceScm.DescriptorImpl
- java.lang.Object
-
- hudson.model.Descriptor<SCM>
-
- hudson.scm.SCMDescriptor<PerforceScm>
-
- org.jenkinsci.plugins.p4.PerforceScm.DescriptorImpl
-
- Enclosing class:
- PerforceScm
@Extension @Symbol("perforce") public static class PerforceScm.DescriptorImpl extends SCMDescriptor<PerforceScm>
The relationship of Descriptor and SCM (the describable) is akin to class and object. What this means is that the descriptor is used to create instances of the describable. Usually the Descriptor is an internal class in the SCM class named DescriptorImpl. The Descriptor should also contain the global configuration options as fields, just like the SCM class contains the configurations options for a job.- Author:
- pallen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.scm.SCMDescriptor
repositoryBrowser
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description DescriptorImpl()
public no-argument constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
The configure method is invoked when the global configuration page is submitted.FormValidation
doCheckCredential(Item project, String value)
Credentials list, a Jelly config method for a build job.ListBoxModel
doFillCredentialItems(Item project, String credential)
Credentials list, a Jelly config method for a build job.String
getClientName()
String
getCredential()
String
getDepotPath()
String
getDisplayName()
Returns the name of the SCM, this is the name that will show up next to CVS and Subversion when configuring a job.long
getHeadLimit()
int
getMaxChanges()
int
getMaxFiles()
boolean
isApplicable(Job project)
boolean
isAutoSave()
boolean
isAutoSubmitOnChange()
boolean
isDeleteClient()
boolean
isDeleteFiles()
boolean
isHideMessages()
boolean
isHideTicket()
boolean
isLastSuccess()
SCM
newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
void
setLastSuccess(boolean lastSuccess)
-
Methods inherited from class hudson.scm.SCMDescriptor
getBrowserDescriptors, getGeneration, incrementGeneration, isApplicable, isBrowserReusable, load
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
isAutoSave
public boolean isAutoSave()
-
getCredential
public String getCredential()
-
getClientName
public String getClientName()
-
getDepotPath
public String getDepotPath()
-
isAutoSubmitOnChange
public boolean isAutoSubmitOnChange()
-
isDeleteClient
public boolean isDeleteClient()
-
isDeleteFiles
public boolean isDeleteFiles()
-
isHideTicket
public boolean isHideTicket()
-
isHideMessages
public boolean isHideMessages()
-
getMaxFiles
public int getMaxFiles()
-
getMaxChanges
public int getMaxChanges()
-
getHeadLimit
public long getHeadLimit()
-
isLastSuccess
public boolean isLastSuccess()
-
setLastSuccess
public void setLastSuccess(boolean lastSuccess)
-
getDisplayName
public String getDisplayName()
Returns the name of the SCM, this is the name that will show up next to CVS and Subversion when configuring a job.- Overrides:
getDisplayName
in classDescriptor<SCM>
-
isApplicable
public boolean isApplicable(Job project)
- Overrides:
isApplicable
in classSCMDescriptor<PerforceScm>
-
newInstance
public SCM newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) throws Descriptor.FormException
- Overrides:
newInstance
in classDescriptor<SCM>
- Throws:
Descriptor.FormException
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
The configure method is invoked when the global configuration page is submitted. In the method the data in the web form should be copied to the Descriptor's fields. To persist the fields to the global configuration XML file, the save() method must be called. Data is defined in the global.jelly page.- Overrides:
configure
in classDescriptor<SCM>
- Throws:
Descriptor.FormException
-
doFillCredentialItems
public ListBoxModel doFillCredentialItems(@AncestorInPath Item project, @QueryParameter String credential)
Credentials list, a Jelly config method for a build job.- Parameters:
project
- Jenkins project itemcredential
- Perforce credential ID- Returns:
- A list of Perforce credential items to populate the jelly Select list.
-
doCheckCredential
public FormValidation doCheckCredential(@AncestorInPath Item project, @QueryParameter String value)
Credentials list, a Jelly config method for a build job.- Parameters:
project
- Jenkins project itemvalue
- credential user input value- Returns:
- A list of Perforce credential items to populate the jelly Select list.
-
-