當前位置: 首頁>>代碼示例>>Java>>正文


Java StaplerRequest.getSubmittedForm方法代碼示例

本文整理匯總了Java中org.kohsuke.stapler.StaplerRequest.getSubmittedForm方法的典型用法代碼示例。如果您正苦於以下問題:Java StaplerRequest.getSubmittedForm方法的具體用法?Java StaplerRequest.getSubmittedForm怎麽用?Java StaplerRequest.getSubmittedForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kohsuke.stapler.StaplerRequest的用法示例。


在下文中一共展示了StaplerRequest.getSubmittedForm方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doParamsSubmit

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doParamsSubmit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
    List<BuildTargetParameter> buildTargetParams;
    TargetParameterBuildAction paramAction;
    JSONObject jsonObject;
    TargetBuildParameterUtil buildParamUtil = new TargetBuildParameterUtil();
    jsonObject = req.getSubmittedForm();
    buildTargetParams = buildParamUtil.parse(jsonObject);
    if (buildTargetParams == null) {
        rsp.sendRedirect(400, "Invalid Parameters - All Fields must be filed");
        return;
    } else {
        paramAction = new TargetParameterBuildAction();
        paramAction.setBaseBranch(jsonObject.getString("baseBranch"));
        paramAction.setParameters(buildTargetParams);
        Hudson.getInstance().getQueue().schedule2(project, 0, paramAction, new CauseAction(new Cause.UserIdCause()));
    }
    rsp.sendRedirect("../");
}
 
開發者ID:maidsafe-archive,項目名稱:CI-Jenkins-Plugin,代碼行數:19,代碼來源:GitHubTargetParameterAction.java

示例2: doProjectsSubmit

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
public void doProjectsSubmit(StaplerRequest req, StaplerResponse rsp)
		throws UnsupportedEncodingException, ServletException,
		FormException, IOException {
	Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

	req.setCharacterEncoding("UTF-8");
	JSONObject json = req.getSubmittedForm();
	AuthorizationStrategy strategy = this.newInstance(req, json);
	Jenkins.getInstance().setAuthorizationStrategy(strategy);
	Jenkins.getInstance().save();
}
 
開發者ID:jenkinsci,項目名稱:ssh2easy-plugin,代碼行數:12,代碼來源:CloudCIAuthorizationStrategy.java

示例3: submit

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
/**
 * Used to persist the configuration form upon submission.
 * 
 * @since 1.0
 */
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp)
		throws IOException, ServletException, FormException {
	super.submit(req, rsp);
	JSONObject json = req.getSubmittedForm();
	String key = "preTestConfig";
	JSONObject viewObject;

	if (json.has(key)) {
		viewObject = json.getJSONObject(key);
		if (viewObject != null) {
			key = "testCaseList";
			if (viewObject.has(key)) {
				this.testCaseList = viewObject.getString(key);
			}
			key = "testTargetScript";
			if (viewObject.has(key)) {
				this.testTargetScript = viewObject.getString(key);
			}
			key = "testListIsRelOrAbs";
			if (viewObject.has(key)) {
				this.testListIsRelOrAbs = viewObject.getString(key);
			}
			key = "targetScrIsRelOrAbs";
			if (viewObject.has(key)) {
				this.targetScrIsRelOrAbs = viewObject.getString(key);
			}
			key = "slaveTestEnv";
			if (viewObject.has(key)) {
				this.slaveTestEnv = viewObject.getString(key);
			}
			key = "statisticsFile";
			if (viewObject.has(key)) {
				this.statisticsFile = viewObject.getString(key);
			}
		}
	}
}
 
開發者ID:bombardier-transportation,項目名稱:distributed-test-job,代碼行數:44,代碼來源:DTJob.java

示例4: doAssignSubmit

import org.kohsuke.stapler.StaplerRequest; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void doAssignSubmit(StaplerRequest req, StaplerResponse rsp)
		throws UnsupportedEncodingException, ServletException,
		FormException, IOException {
	Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

	req.setCharacterEncoding("UTF-8");
	JSONObject json = req.getSubmittedForm();
	AuthorizationStrategy oldStrategy = Jenkins.getInstance()
			.getAuthorizationStrategy();

	if (json.has(AclType.GLOBAL.getType())
			&& json.has(AclType.PROJECT.getType())
			&& oldStrategy instanceof CloudCIAuthorizationStrategy) {
		CloudCIAuthorizationStrategy strategy = (CloudCIAuthorizationStrategy) oldStrategy;
		Map<AclType, CloudProject> maps = strategy
				.getCloudProjectMaps();

		for (Map.Entry<AclType, CloudProject> map : maps.entrySet()) {
			CloudProject roleMap = map.getValue();
			roleMap.clearAllProjectMembers();
			JSONObject projects = json.getJSONObject(map.getKey()
					.getType());
			Set<Map.Entry<String, JSONObject>> projectDataSet = (Set<Map.Entry<String, JSONObject>>) projects
					.getJSONObject("data").entrySet();
			for (Map.Entry<String, JSONObject> r : projectDataSet) {
				String sid = r.getKey();
				for (Map.Entry<String, Boolean> e : (Set<Map.Entry<String, Boolean>>) r
						.getValue().entrySet()) {
					if (e.getValue()) {
						Project role = roleMap.getProject(e.getKey());
						if (role != null && sid != null
								&& !sid.equals("")) {
							roleMap.addProjectMember(role, sid);
						}
					}
				}
			}
		}
		Jenkins.getInstance().save();
	}
}
 
開發者ID:jenkinsci,項目名稱:ssh2easy-plugin,代碼行數:43,代碼來源:CloudCIAuthorizationStrategy.java


注:本文中的org.kohsuke.stapler.StaplerRequest.getSubmittedForm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。