Search in sources :

Example 1 with JobDetailPresentationModel

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);
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) JobDetailPresentationModel(com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel)

Example 2 with JobDetailPresentationModel

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);
}
Also used : AgentConfig(com.thoughtworks.go.config.AgentConfig) Tabs(com.thoughtworks.go.config.Tabs) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) JobDetailPresentationModel(com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel) Properties(com.thoughtworks.go.domain.Properties) TrackingTool(com.thoughtworks.go.config.TrackingTool) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 3 with JobDetailPresentationModel

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;
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) ArtifactsService(com.thoughtworks.go.server.service.ArtifactsService) HashMap(java.util.HashMap) MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) JobDetailPresentationModel(com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel) Matchers.containsString(org.hamcrest.Matchers.containsString) Date(java.util.Date) Pipeline(com.thoughtworks.go.domain.Pipeline) JobInstances(com.thoughtworks.go.domain.JobInstances) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig)

Aggregations

JobDetailPresentationModel (com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel)3 AgentConfig (com.thoughtworks.go.config.AgentConfig)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 Tabs (com.thoughtworks.go.config.Tabs)1 TrackingTool (com.thoughtworks.go.config.TrackingTool)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)1 JobInstances (com.thoughtworks.go.domain.JobInstances)1 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)1 Pipeline (com.thoughtworks.go.domain.Pipeline)1 Properties (com.thoughtworks.go.domain.Properties)1 Modification (com.thoughtworks.go.domain.materials.Modification)1 ArtifactsService (com.thoughtworks.go.server.service.ArtifactsService)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1