Search in sources :

Example 1 with PipelineViewModel

use of com.thoughtworks.go.server.presentation.models.PipelineViewModel in project gocd by gocd.

the class MyGoController method getPipelineModelsSortedByNameFor.

private List<PipelineViewModel> getPipelineModelsSortedByNameFor(List<PipelineConfigs> groups) {
    List<PipelineViewModel> pipelineModels = new ArrayList<>();
    List<PipelineViewModel.StageViewModel> anyPipelineStageModels = new ArrayList<>();
    anyPipelineStageModels.add(new PipelineViewModel.StageViewModel(GoConstants.ANY_STAGE));
    pipelineModels.add(new PipelineViewModel(GoConstants.ANY_PIPELINE, anyPipelineStageModels));
    for (PipelineConfigs group : groups) {
        for (PipelineConfig pipelineConfig : group) {
            pipelineModels.add(new PipelineViewModel(CaseInsensitiveString.str(pipelineConfig.name()), getStagesModelsFor(pipelineConfig)));
        }
    }
    Collections.sort(pipelineModels);
    return pipelineModels;
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) PipelineViewModel(com.thoughtworks.go.server.presentation.models.PipelineViewModel) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs)

Aggregations

PipelineConfig (com.thoughtworks.go.config.PipelineConfig)1 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)1 PipelineViewModel (com.thoughtworks.go.server.presentation.models.PipelineViewModel)1