update with work status (not synchronized with my prev. version here)
This commit is contained in:
@@ -8,22 +8,26 @@ import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter;
|
||||
|
||||
import de.lcag.common.AbstractTable.ListColumn;
|
||||
import de.lcag.common.HashTable;
|
||||
import de.lcag.common.Table.TableColumn;
|
||||
import routines.LcagFileTools;
|
||||
import routines.LcagLogger;
|
||||
|
||||
public class CommentExtractor {
|
||||
private static final String BUGFIX_COMMAND = "BUGFIX_"; // Fix of a Agile Defect in Trackspace
|
||||
private static final String STORY_COMMAND = "BUGFIX_"; // User Story in Trackspace to implement
|
||||
private static final String HOW_TO_COMMAND = "HOWTO_";
|
||||
private static final String DOCUMENT_FLOW_COMMAND = "FLOW_";
|
||||
private static final String TODO_COMMAND = "TODO_";
|
||||
|
||||
private static final String[] COMMAD_LIST = new String[] { HOW_TO_COMMAND, DOCUMENT_FLOW_COMMAND, TODO_COMMAND };
|
||||
private static final String[] COMMAD_LIST = new String[] { HOW_TO_COMMAND, DOCUMENT_FLOW_COMMAND, TODO_COMMAND,
|
||||
BUGFIX_COMMAND, STORY_COMMAND };
|
||||
|
||||
private static final String COL_TYPE = "Type";
|
||||
private static final String COL_ID = "Id";
|
||||
@@ -73,7 +77,7 @@ public class CommentExtractor {
|
||||
try {
|
||||
extractCodeExamples(rootDirPath);
|
||||
|
||||
ListColumn sortedResults = resultTable.sort(COL_ID, COL_STEP);
|
||||
TableColumn sortedResults = resultTable.sort(COL_ID, COL_STEP);
|
||||
|
||||
String txt = resultTable.asCSV(sortedResults);
|
||||
String fileName = DOC_FILE + ".csv";
|
||||
@@ -87,11 +91,13 @@ public class CommentExtractor {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeHtmlFile(ListColumn sortedResults) throws IOException {
|
||||
private static void writeHtmlFile(TableColumn sortedResults) throws IOException {
|
||||
String fileName = DOC_FILE + ".html";
|
||||
|
||||
for (int i = 0; i < resultTable.lenght(); i++) {
|
||||
int lineNo = (int) resultTable.getCellValue(i, COL_LINE_NO);
|
||||
|
||||
String colId = (String) resultTable.getCellValue(i, COL_ID);
|
||||
String filePath = (String) resultTable.getCellValue(i, COL_FILE);
|
||||
String gitURL = String.format(CODE_BASE_GITHUB_DIR, filePath, gitBranchName, lineNo, lineNo + 1);
|
||||
String lineNoURL = String.format("<html><a href=\"%s\">%d</a></html>", gitURL, lineNo);
|
||||
@@ -111,6 +117,16 @@ public class CommentExtractor {
|
||||
if (kind.equals("Title")) {
|
||||
String disc = String.format("<html><b>%s</b></html>", (String) resultTable.getCellValue(i, COL_DESC));
|
||||
resultTable.setCellValue(i, COL_DESC, disc);
|
||||
|
||||
// For BUGFIX or STORY: Add link into trackspace:
|
||||
String digits = colId.replaceAll(".*[BS](\\d+).*", "$1"); // Extract digits after 'B'
|
||||
|
||||
if (!Objects.equals(colId, digits)) {
|
||||
String htmlLink = "<html><a href=\"https://trackspace.lhsystems.com/browse/MDMGMT-" + digits
|
||||
+ "\" target=\"_blank\">" + colId + "</a></html>";
|
||||
|
||||
resultTable.setCellValue(i, COL_ID, htmlLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user