use of com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder in project cloud-pipeline by epam.
the class PipelineDocumentTemplate method getCustomScriptsTable.
@Placeholder(regex = "Analytical Pipeline Custom Scripts", processor = TableTemplateProcessor.class)
public Table getCustomScriptsTable() {
Table table = new Table();
table.setContainsHeaderRow(true);
table.addColumn("Custom script");
table.addColumn("Version");
for (GitRepositoryEntry customScript : this.customScripts) {
TableRow row = table.addRow(customScript.getName());
table.setData(row.getIndex(), 0, customScript.getName());
table.setData(row.getIndex(), 1, "");
}
return table;
}
use of com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder in project cloud-pipeline by epam.
the class PipelineDocumentTemplate method getFilesGeneratedDuringPipelineProcessingTable.
@Placeholder(regex = "Files generated during pipeline processing", processor = TableTemplateProcessor.class)
public Table getFilesGeneratedDuringPipelineProcessingTable() {
Table table = new Table();
table.setContainsHeaderRow(true);
table.addColumn("File Name");
table.addColumn("Storage Fate");
for (Pair<String, String> generatedFile : this.filesGeneratedDuringPipelineProcessing) {
TableRow row = table.addRow(generatedFile.getKey());
table.setData(row.getIndex(), 0, generatedFile.getKey());
table.setData(row.getIndex(), 1, generatedFile.getValue());
}
return table;
}
use of com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder in project cloud-pipeline by epam.
the class PipelineDocumentTemplate method getOpenSourceAlgorithmsAndSoftwareTable.
@Placeholder(regex = "Open Source Algorithms and Software", processor = TableTemplateProcessor.class)
public Table getOpenSourceAlgorithmsAndSoftwareTable() {
Table table = new Table();
table.setContainsHeaderRow(true);
table.addColumn("Algorithm or Software");
table.addColumn("Version");
Map<String, List<String>> toolsVersions = new HashMap<>();
for (Tool tool : this.openSourceSoftware) {
String[] parts = tool.getImage().split("-");
String toolName = tool.getImage();
String toolVersion = null;
if (parts.length >= 2) {
toolName = parts[0].trim();
toolVersion = parts[1].trim();
}
if (!toolsVersions.containsKey(toolName)) {
toolsVersions.put(toolName, new ArrayList<>());
}
List<String> versions = toolsVersions.get(toolName);
if (toolVersion != null && !toolVersion.equals("") && versions.indexOf(toolVersion) == -1) {
versions.add(toolVersion);
toolsVersions.put(toolName, versions);
}
}
for (String tool : toolsVersions.keySet()) {
List<String> versions = toolsVersions.get(tool);
String versionsStr = String.join(", ", versions);
TableRow row = table.addRow(tool);
table.setData(row.getIndex(), 0, tool);
table.setData(row.getIndex(), 1, versionsStr);
}
return table;
}
Aggregations