Search in sources :

Example 1 with Placeholder

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;
}
Also used : Table(com.epam.pipeline.manager.pipeline.documents.templates.structure.Table) TableRow(com.epam.pipeline.manager.pipeline.documents.templates.structure.TableRow) GitRepositoryEntry(com.epam.pipeline.entity.git.GitRepositoryEntry) Placeholder(com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder)

Example 2 with Placeholder

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;
}
Also used : Table(com.epam.pipeline.manager.pipeline.documents.templates.structure.Table) TableRow(com.epam.pipeline.manager.pipeline.documents.templates.structure.TableRow) Placeholder(com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder)

Example 3 with Placeholder

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;
}
Also used : Table(com.epam.pipeline.manager.pipeline.documents.templates.structure.Table) HashMap(java.util.HashMap) TableRow(com.epam.pipeline.manager.pipeline.documents.templates.structure.TableRow) ArrayList(java.util.ArrayList) List(java.util.List) Tool(com.epam.pipeline.entity.pipeline.Tool) Placeholder(com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder)

Aggregations

Placeholder (com.epam.pipeline.manager.pipeline.documents.templates.processors.base.Placeholder)3 Table (com.epam.pipeline.manager.pipeline.documents.templates.structure.Table)3 TableRow (com.epam.pipeline.manager.pipeline.documents.templates.structure.TableRow)3 GitRepositoryEntry (com.epam.pipeline.entity.git.GitRepositoryEntry)1 Tool (com.epam.pipeline.entity.pipeline.Tool)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1