|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.actions.manual.ManualTriggerAction
@Extension public class ManualTriggerAction
RootAction for manually triggering a "Gerrit-build".
Nested Class Summary | |
---|---|
static class |
ManualTriggerAction.Approval
Represents a "vote"-type or Approval of a change in the JSON structure. |
static class |
ManualTriggerAction.HighLow
A tuple of a high and a low number. |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary | |
---|---|
static int |
EXPECTED_NR_OF_PARTS_IN_A_GENERATED_ID
The expected number of parts separated by _ in a generated id. |
static String |
ID_SEPARATOR
The char that separates the different id components in a search-result-row. |
Constructor Summary | |
---|---|
ManualTriggerAction()
|
Method Summary | |
---|---|
void |
doBuild(String selectedIds,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Builds the selected patch-set(s). |
void |
doGerritSearch(String queryString,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Does a search. |
String |
generateTheId(net.sf.json.JSONObject change,
net.sf.json.JSONObject patch)
Generates a "unique" id for the change and/or patch. |
ManualTriggerAction.HighLow |
getCodeReview(net.sf.json.JSONObject res)
Finds the highest and lowest code review vote for the provided patch set. |
String |
getDisplayName()
|
String |
getGerritUrl(net.sf.json.JSONObject change)
Generates the URL to the provided change in Gerrit. |
String |
getGerritUrl(PatchsetCreated event)
Generates the URL to the provided change in Gerrit. |
String |
getIconFileName()
|
String |
getJsUrl(String jsName)
Gets the full path to the provided javascript file. |
List<hudson.model.ParameterValue> |
getParametersForPatchSet(net.sf.json.JSONObject jsonChange,
net.sf.json.JSONObject jsonPatchSet)
Creates a list of the parameters as they would be in a scheduled build. |
hudson.security.Permission |
getRequiredPermission()
Serves the permission required to perform this action. |
String |
getUrlName()
|
ManualTriggerAction.HighLow |
getVerified(net.sf.json.JSONObject res)
Finds the lowest and highest verified vote for the provided patch set. |
boolean |
hasUrl(hudson.model.ParameterValue parameterValue)
Tells if the given parameter should have a URL or not. |
boolean |
isEnabled()
If this page/link is enabled or not. |
String |
toReadableHtml(String subject)
Cuts the string to a max length of MAX_SUBJECT_STR_LENGTH and escapes unsafe HTML characters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EXPECTED_NR_OF_PARTS_IN_A_GENERATED_ID
generateTheId(net.sf.json.JSONObject, net.sf.json.JSONObject)
,
Constant Field Valuespublic static final String ID_SEPARATOR
Constructor Detail |
---|
public ManualTriggerAction()
Method Detail |
---|
public String getIconFileName()
getIconFileName
in interface hudson.model.Action
public String getDisplayName()
getDisplayName
in interface hudson.model.Action
getDisplayName
in interface hudson.model.ModelObject
public String getUrlName()
getUrlName
in interface hudson.model.Action
public boolean isEnabled()
IGerritHudsonTriggerConfig.isEnableManualTrigger()
public hudson.security.Permission getRequiredPermission()
public String getJsUrl(String jsName)
jsName
- the javascript filename.
public ManualTriggerAction.HighLow getCodeReview(net.sf.json.JSONObject res)
res
- the patch set.
public ManualTriggerAction.HighLow getVerified(net.sf.json.JSONObject res)
res
- the patch-set.
public String toReadableHtml(String subject)
MAX_SUBJECT_STR_LENGTH
and escapes unsafe HTML characters.
subject
- the string to fix if needed.
Util.escape(String)
public void doGerritSearch(@QueryParameter(value="queryString") String queryString, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws IOException
queryString
- the query to send to Gerrit.request
- the request.response
- the response.
IOException
- if the unfortunate happens.public void doBuild(@QueryParameter(value="selectedIds") String selectedIds, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws IOException
selectedIds
- the selected rows in the form's search-result separated by "[]".request
- the request.response
- the response.
IOException
- if the unfortunate happens.public String generateTheId(net.sf.json.JSONObject change, net.sf.json.JSONObject patch)
change
- the change.patch
- the patch-set in the change.
public String getGerritUrl(PatchsetCreated event)
event
- the event who's change to link to.
public List<hudson.model.ParameterValue> getParametersForPatchSet(net.sf.json.JSONObject jsonChange, net.sf.json.JSONObject jsonPatchSet)
jsonChange
- the JSON data for the change.jsonPatchSet
- the JSON data for the patch-set.
public boolean hasUrl(hudson.model.ParameterValue parameterValue)
GerritTriggerParameters.GERRIT_CHANGE_URL
.
parameterValue
- the parameter.
public String getGerritUrl(net.sf.json.JSONObject change)
change
- the change to link to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |