Search in sources :

Example 1 with MaterialXmlRepresenter

use of com.thoughtworks.go.server.domain.xml.materials.MaterialXmlRepresenter in project gocd by gocd.

the class FeedService method materialXml.

public Document materialXml(Username username, String pipelineName, Integer pipelineCounter, String fingerprint, String baseUrl) {
    PipelineInstanceModel model = pipelineHistoryService.load(pipelineName, pipelineCounter, username);
    MaterialRevision revision = model.getLatestRevisions().findRevisionForPipelineUniqueFingerprint(fingerprint);
    if (revision == null) {
        throw new RecordNotFoundException(String.format("Material with pipeline unique fingerprint '%s' was not found for pipeline run(%s/%s)!", fingerprint, pipelineName, pipelineCounter));
    }
    MaterialXmlRepresenter materialXmlRepresenter = MaterialXmlRepresenter.representerFor(pipelineName, pipelineCounter, revision);
    return xmlApiService.write(materialXmlRepresenter, baseUrl);
}
Also used : MaterialXmlRepresenter(com.thoughtworks.go.server.domain.xml.materials.MaterialXmlRepresenter) RecordNotFoundException(com.thoughtworks.go.config.exceptions.RecordNotFoundException) PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel)

Aggregations

RecordNotFoundException (com.thoughtworks.go.config.exceptions.RecordNotFoundException)1 PipelineInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel)1 MaterialXmlRepresenter (com.thoughtworks.go.server.domain.xml.materials.MaterialXmlRepresenter)1