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);
}
Aggregations