本文整理匯總了Java中org.kohsuke.stapler.StaplerRequest.getParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java StaplerRequest.getParameter方法的具體用法?Java StaplerRequest.getParameter怎麽用?Java StaplerRequest.getParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kohsuke.stapler.StaplerRequest
的用法示例。
在下文中一共展示了StaplerRequest.getParameter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newInstance
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public TelegramNotifier newInstance(StaplerRequest sr, JSONObject json) {
String token = sr.getParameter("telegramToken");
String chatId = sr.getParameter("telegramChatId");
boolean startNotification = "true".equals(sr.getParameter("telegramStartNotification"));
boolean notifySuccess = "true".equals(sr.getParameter("telegramNotifySuccess"));
boolean notifyAborted = "true".equals(sr.getParameter("telegramNotifyAborted"));
boolean notifyNotBuilt = "true".equals(sr.getParameter("telegramNotifyNotBuilt"));
boolean notifyUnstable = "true".equals(sr.getParameter("telegramNotifyUnstable"));
boolean notifyFailure = "true".equals(sr.getParameter("telegramNotifyFailure"));
boolean notifyBackToNormal = "true".equals(sr.getParameter("telegramNotifyBackToNormal"));
boolean notifyRepeatedFailure = "true".equals(sr.getParameter("telegramNotifyRepeatedFailure"));
boolean includeTestSummary = "true".equals(sr.getParameter("includeTestSummary"));
boolean includeFailedTests = "true".equals(sr.getParameter("includeFailedTests"));
CommitInfoChoice commitInfoChoice = CommitInfoChoice.forDisplayName(sr.getParameter("telegramCommitInfoChoice"));
boolean includeCustomMessage = "on".equals(sr.getParameter("includeCustomMessage"));
String customMessage = sr.getParameter("customMessage");
return new TelegramNotifier(token, chatId, buildServerUrl, sendAs, startNotification, notifyAborted,
notifyFailure, notifyNotBuilt, notifySuccess, notifyUnstable, notifyBackToNormal, notifyRepeatedFailure,
includeTestSummary,includeFailedTests, commitInfoChoice, includeCustomMessage, customMessage);
}
示例2: configure
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData) throws FormException {
token = sr.getParameter("telegramToken");
chatId = sr.getParameter("telegramChatId");
buildServerUrl = sr.getParameter("telegramBuildServerUrl");
sendAs = sr.getParameter("telegramSendAs");
if(buildServerUrl == null || buildServerUrl.equals("")) {
JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
buildServerUrl = jenkinsConfig.getUrl();
}
if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
buildServerUrl = buildServerUrl + "/";
}
save();
return super.configure(sr, formData);
}
示例3: lookupProvider
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
DisplayURLProvider lookupProvider(StaplerRequest req) {
final String providerName = req.getParameter("provider");
if(providerName != null && !providerName.isEmpty()) {
Iterable<DisplayURLProvider> providers = DisplayURLProvider.all();
Iterable<DisplayURLProvider> filtered = Iterables.filter(providers, new Predicate<DisplayURLProvider>() {
@Override
public boolean apply(@Nullable DisplayURLProvider displayURLProvider) {
if(displayURLProvider == null) {
return false;
}
return displayURLProvider.getName().equals(providerName);
}
});
DisplayURLProvider provider = Iterables.getFirst(filtered, null);
if(provider != null) {
return provider;
}
}
return lookupProvider();
}
示例4: newInstance
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public MattermostNotifier newInstance(StaplerRequest sr, JSONObject json) {
if (sr == null) {
return null;
}
String endpoint = sr.getParameter("mattermostEndpoint");
String room = sr.getParameter("mattermostRoom");
String icon = sr.getParameter("mattermostIcon");
boolean startNotification = "true".equals(sr.getParameter("mattermostStartNotification"));
boolean notifySuccess = "true".equals(sr.getParameter("mattermostNotifySuccess"));
boolean notifyAborted = "true".equals(sr.getParameter("mattermostNotifyAborted"));
boolean notifyNotBuilt = "true".equals(sr.getParameter("mattermostNotifyNotBuilt"));
boolean notifyUnstable = "true".equals(sr.getParameter("mattermostNotifyUnstable"));
boolean notifyFailure = "true".equals(sr.getParameter("mattermostNotifyFailure"));
boolean notifyBackToNormal = "true".equals(sr.getParameter("mattermostNotifyBackToNormal"));
boolean notifyRepeatedFailure = "true".equals(sr.getParameter("mattermostNotifyRepeatedFailure"));
boolean includeTestSummary = "true".equals(sr.getParameter("includeTestSummary"));
CommitInfoChoice commitInfoChoice = CommitInfoChoice.forDisplayName(sr.getParameter("slackCommitInfoChoice"));
boolean includeCustomAttachmentMessage = "on".equals(sr.getParameter("includeCustomAttachmentMessage"));
String customAttachmentMessage = sr.getParameter("mattermostCustomAttachmentMessage");
boolean includeCustomMessage = "on".equals(sr.getParameter("includeCustomMessage"));
String customMessage = sr.getParameter("mattermostCustomMessage");
return new MattermostNotifier(endpoint, room, icon, buildServerUrl, sendAs, startNotification, notifyAborted,
notifyFailure, notifyNotBuilt, notifySuccess, notifyUnstable, notifyBackToNormal, notifyRepeatedFailure,
includeTestSummary, commitInfoChoice, includeCustomAttachmentMessage, customAttachmentMessage, includeCustomMessage, customMessage);
}
示例5: configure
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData) throws FormException {
endpoint = sr.getParameter("mattermostEndpoint");
room = sr.getParameter("mattermostRoom");
icon = sr.getParameter("mattermostIcon");
buildServerUrl = sr.getParameter("mattermostBuildServerUrl");
sendAs = sr.getParameter("mattermostSendAs");
if (buildServerUrl == null || buildServerUrl.equals("")) {
JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
buildServerUrl = jenkinsConfig.getUrl();
}
if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
buildServerUrl = buildServerUrl + "/";
}
save();
return super.configure(sr, formData);
}
示例6: newInstance
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public SCM newInstance(final StaplerRequest req,
final JSONObject formData) throws FormException {
return new AWSCodePipelineSCM(
req.getParameter("name"),
req.getParameter("clearWorkspace") != null,
req.getParameter("region"),
req.getParameter("awsAccessKey"),
req.getParameter("awsSecretKey"),
req.getParameter("proxyHost"),
req.getParameter("proxyPort"),
req.getParameter("category"),
req.getParameter("provider"),
req.getParameter("version"),
new AWSClientFactory());
}
示例7: configure
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public boolean configure(StaplerRequest sr, JSONObject formData)
throws Descriptor.FormException {
mirrorGateAPIUrl = sr.getParameter("mirrorGateAPIUrl");
mirrorgateCredentialsId = sr.getParameter("_.mirrorgateCredentialsId");
extraURLs = sr.getParameter("extraURLs");
save();
return super.configure(sr, formData);
}
示例8: setUseDescr
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
private void setUseDescr(StaplerRequest req) {
String u = req.getParameter("usedescr");
if (u == null) {
urlUseDescr = null;
} else {
urlUseDescr = "on".equalsIgnoreCase(u)
|| "true".equalsIgnoreCase(u);
}
}
示例9: setNumBuilds
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Sets the number of builds to plotpipeline from the "numbuilds" parameter in the
* given StaplerRequest. If the parameter doesn't exist or isn't an integer
* then a default is used.
*/
private void setNumBuilds(StaplerRequest req) {
urlNumBuilds = req.getParameter("numbuilds");
if (urlNumBuilds != null) {
try {
// simply try and parse the string to see if it's a valid
// number, throw away the result.
Integer.parseInt(urlNumBuilds);
} catch (NumberFormatException nfe) {
urlNumBuilds = null;
}
}
}
示例10: setRightBuildNum
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Sets the right-most build number shown on the plotpipeline from the
* "rightbuildnum" parameter in the given StaplerRequest. If the parameter
* doesn't exist or isn't an integer then a default is used.
*/
private void setRightBuildNum(StaplerRequest req) {
String build = req.getParameter("rightbuildnum");
if (StringUtils.isBlank(build)) {
rightBuildNum = Integer.MAX_VALUE;
} else {
try {
rightBuildNum = Integer.parseInt(build);
} catch (NumberFormatException nfe) {
LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
rightBuildNum = Integer.MAX_VALUE;
}
}
}
示例11: setWidth
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Sets the plotpipeline width from the "width" parameter in the given
* StaplerRequest. If the parameter doesn't exist or isn't an integer then a
* default is used.
*/
private void setWidth(StaplerRequest req) {
String w = req.getParameter("width");
if (w == null) {
width = DEFAULT_WIDTH;
} else {
try {
width = Integer.parseInt(w);
} catch (NumberFormatException nfe) {
LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
width = DEFAULT_WIDTH;
}
}
}
示例12: setHeight
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
* Sets the plotpipeline height from the "height" parameter in the given
* StaplerRequest. If the parameter doesn't exist or isn't an integer then a
* default is used.
*/
private void setHeight(StaplerRequest req) {
String h = req.getParameter("height");
if (h == null) {
height = DEFAULT_HEIGHT;
} else {
try {
height = Integer.parseInt(h);
} catch (NumberFormatException nfe) {
LOGGER.log(Level.SEVERE, "Exception converting to integer", nfe);
height = DEFAULT_HEIGHT;
}
}
}
示例13: doGetPlot
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doGetPlot(StaplerRequest req, StaplerResponse rsp) {
String i = req.getParameter("index");
Plot plot = getPlot(i);
try {
plot.plotGraph(req, rsp);
} catch (IOException ioe) {
LOGGER.log(Level.SEVERE, "Exception plotting graph", ioe);
}
}
示例14: doGetPlotMap
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doGetPlotMap(StaplerRequest req, StaplerResponse rsp) {
String i = req.getParameter("index");
Plot plot = getPlot(i);
try {
plot.plotGraphMap(req, rsp);
} catch (IOException ioe) {
LOGGER.log(Level.SEVERE, "Exception plotting graph", ioe);
}
}
示例15: newInstance
import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@Override
public SlackUploader newInstance(StaplerRequest req, JSONObject formData) throws FormException {
String channel = req.getParameter("channel");
String token = req.getParameter("token");
String filePath = req.getParameter("filePath");
return new SlackUploader(channel, token, filePath);
}