use of com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel in project gocd by gocd.
the class JobController method getModelAndView.
private ModelAndView getModelAndView(JobInstance jobDetail) throws Exception {
final JobDetailPresentationModel presenter = presenter(jobDetail);
Map data = new HashMap();
data.put("presenter", presenter);
data.put("l", localizer);
data.put("isEditableViaUI", goConfigService.isPipelineEditableViaUI(jobDetail.getPipelineName()));
return new ModelAndView("build_detail/build_detail_page", data);
}
use of com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel in project gocd by gocd.
the class JobController method presenter.
private JobDetailPresentationModel presenter(JobInstance current) {
String pipelineName = current.getIdentifier().getPipelineName();
String stageName = current.getIdentifier().getStageName();
JobInstances recent25 = jobInstanceService.latestCompletedJobs(pipelineName, stageName, current.getName());
AgentConfig agentConfig = goConfigService.agentByUuid(current.getAgentUuid());
Pipeline pipelineWithOneBuild = pipelineService.wrapBuildDetails(current);
Tabs customizedTabs = goConfigService.getCustomizedTabs(pipelineWithOneBuild.getName(), pipelineWithOneBuild.getFirstStage().getName(), current.getName());
TrackingTool trackingTool = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineWithOneBuild.getName())).trackingTool();
Properties properties = propertiesService.getPropertiesForJob(current.getId());
Stage stage = stageService.getStageByBuild(current);
return new JobDetailPresentationModel(current, recent25, agentConfig, pipelineWithOneBuild, customizedTabs, trackingTool, artifactService, properties, stage);
}
use of com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel in project gocd by gocd.
the class BuildDetailPageVelocityTemplateTest method createJobDetailModel.
private HashMap<String, Object> createJobDetailModel() {
GitMaterialConfig gitMaterialConfig = gitMaterialConfig();
MaterialRevisions materialRevisions = new MaterialRevisions();
materialRevisions.addRevision(gitMaterial(gitMaterialConfig.getUrl(), gitMaterialConfig.getSubmoduleFolder(), gitMaterialConfig.getBranch()), new Modification("Ernest Hemingway <oldman@sea.com>", "comment", "email", new Date(), "12", ""));
Pipeline pipeline = schedule(pipelineConfig("pipeline", new MaterialConfigs(gitMaterialConfig)), createWithModifications(materialRevisions, ""));
JobDetailPresentationModel model = new JobDetailPresentationModel(building("job"), new JobInstances(), null, pipeline, null, createTrackingTool(new HashMap()), mock(ArtifactsService.class), null, StageMother.custom("stage"));
HashMap<String, Object> data = new HashMap<>();
data.put("presenter", model);
return data;
}
Aggregations