mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-08 05:48:12 +00:00
bump test case version
This commit is contained in:
parent
b7e38626cc
commit
646efb6e54
@ -1,5 +1,6 @@
|
|||||||
package org.hl7.fhir.utilities.i18n;
|
package org.hl7.fhir.utilities.i18n;
|
||||||
|
|
||||||
|
|
||||||
public class RenderingI18nContext extends I18nBase {
|
public class RenderingI18nContext extends I18nBase {
|
||||||
|
|
||||||
public static final String ACTOR_DEF_ACT = "ACTOR_DEF_ACT";
|
public static final String ACTOR_DEF_ACT = "ACTOR_DEF_ACT";
|
||||||
@ -931,6 +932,19 @@ public class RenderingI18nContext extends I18nBase {
|
|||||||
public static final String MATURITY_MATURITY = "MATURITY_MATURITY";
|
public static final String MATURITY_MATURITY = "MATURITY_MATURITY";
|
||||||
public static final String MATURITY_STDS_STATUS = "MATURITY_STDS_STATUS";
|
public static final String MATURITY_STDS_STATUS = "MATURITY_STDS_STATUS";
|
||||||
|
|
||||||
|
public static final String DATA_REND_MORNING = "DATA_REND_MORNING";
|
||||||
|
public static final String DATA_REND_MORNING_EARLY = "DATA_REND_MORNING_EARLY";
|
||||||
|
public static final String DATA_REND_MORNING_LATE = "DATA_REND_MORNING_LATE";
|
||||||
|
public static final String DATA_REND_NOON = "DATA_REND_NOON";
|
||||||
|
public static final String DATA_REND_AFTERNOON = "DATA_REND_AFTERNOON";
|
||||||
|
public static final String DATA_REND_AFTERNOON_EARLY = "";
|
||||||
|
public static final String DATA_REND_AFTERNOON_LATE = "DATA_REND_AFTERNOON_LATE";
|
||||||
|
public static final String DATA_REND_EVENING = "DATA_REND_EVENING";
|
||||||
|
public static final String DATA_REND_EVENING_EARLY = "";
|
||||||
|
public static final String DATA_REND_EVENING_LATE = "DATA_REND_EVENING_LATE";
|
||||||
|
public static final String DATA_REND_NIGHT = "DATA_REND_NIGHT";
|
||||||
|
public static final String DATA_REND_AFTER_SLEEP = "DATA_REND_AFTER_SLEEP";
|
||||||
|
public static final String DATA_REND_IMMEDIATE = "DATA_REND_IMMEDIATE";
|
||||||
|
|
||||||
protected String getMessagesSourceFileName() {
|
protected String getMessagesSourceFileName() {
|
||||||
return "rendering-phrases";
|
return "rendering-phrases";
|
||||||
|
@ -250,6 +250,7 @@ public class HierarchicalTableGenerator {
|
|||||||
private List<Piece> pieces = new ArrayList<HierarchicalTableGenerator.Piece>();
|
private List<Piece> pieces = new ArrayList<HierarchicalTableGenerator.Piece>();
|
||||||
private String cellStyle;
|
private String cellStyle;
|
||||||
protected int span = 1;
|
protected int span = 1;
|
||||||
|
private boolean innerTable; // if you want a multiline left cell, you have to set this to true
|
||||||
private TextAlignment alignment = TextAlignment.LEFT;
|
private TextAlignment alignment = TextAlignment.LEFT;
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ -272,16 +273,18 @@ public class HierarchicalTableGenerator {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Cell addMarkdown(String md) {
|
public Cell addMarkdown(String md) {
|
||||||
|
return addMarkdown(md, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cell addMarkdown(String md, String style) {
|
||||||
if (!Utilities.noString(md)) {
|
if (!Utilities.noString(md)) {
|
||||||
try {
|
try {
|
||||||
Parser parser = Parser.builder().build();
|
Parser parser = Parser.builder().build();
|
||||||
Node document = parser.parse(md);
|
Node document = parser.parse(md);
|
||||||
HtmlRenderer renderer = HtmlRenderer.builder().escapeHtml(true).build();
|
HtmlRenderer renderer = HtmlRenderer.builder().escapeHtml(true).build();
|
||||||
String html = renderer.render(document);
|
String html = renderer.render(document);
|
||||||
pieces.addAll(htmlToParagraphPieces(html, null));
|
pieces.addAll(htmlToParagraphPieces(html, style));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -411,6 +414,16 @@ public class HierarchicalTableGenerator {
|
|||||||
p.addStyle(style);
|
p.addStyle(style);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Cell addCellStyle(String style) {
|
||||||
|
if (cellStyle == null) {
|
||||||
|
cellStyle = style;
|
||||||
|
} else {
|
||||||
|
cellStyle = cellStyle+"; "+style;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void addToHint(String text) {
|
public void addToHint(String text) {
|
||||||
for (Piece p : pieces)
|
for (Piece p : pieces)
|
||||||
p.addToHint(text);
|
p.addToHint(text);
|
||||||
@ -472,6 +485,25 @@ public class HierarchicalTableGenerator {
|
|||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
public Piece addImg(String icon, String hint, String link) {
|
||||||
|
Piece p = new Piece("img");
|
||||||
|
p.attr("src", icon);
|
||||||
|
p.hint = hint;
|
||||||
|
p.reference = link;
|
||||||
|
pieces.add(p);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
public void addXhtml(XhtmlNode div) {
|
||||||
|
Piece p = new Piece(null);
|
||||||
|
pieces.add(p);
|
||||||
|
p.children = div.childNodes;
|
||||||
|
}
|
||||||
|
public boolean isInnerTable() {
|
||||||
|
return innerTable;
|
||||||
|
}
|
||||||
|
public void setInnerTable(boolean innerTable) {
|
||||||
|
this.innerTable = innerTable;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,6 +537,8 @@ public class HierarchicalTableGenerator {
|
|||||||
private int lineColor;
|
private int lineColor;
|
||||||
private String id;
|
private String id;
|
||||||
private String opacity;
|
private String opacity;
|
||||||
|
private String topLine;
|
||||||
|
private boolean partnerRow;
|
||||||
|
|
||||||
public List<Row> getSubRows() {
|
public List<Row> getSubRows() {
|
||||||
return subRows;
|
return subRows;
|
||||||
@ -561,6 +595,13 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
public String getTopLine() {
|
||||||
|
return topLine;
|
||||||
|
}
|
||||||
|
public void setTopLine(String topLine) {
|
||||||
|
this.topLine = topLine;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TableModel {
|
public class TableModel {
|
||||||
@ -571,6 +612,8 @@ public class HierarchicalTableGenerator {
|
|||||||
private String docoRef;
|
private String docoRef;
|
||||||
private String docoImg;
|
private String docoImg;
|
||||||
private boolean alternating;
|
private boolean alternating;
|
||||||
|
private boolean showHeadings = true;
|
||||||
|
private boolean border = false;
|
||||||
|
|
||||||
public TableModel(String id, boolean active) {
|
public TableModel(String id, boolean active) {
|
||||||
super();
|
super();
|
||||||
@ -611,6 +654,18 @@ public class HierarchicalTableGenerator {
|
|||||||
public void setAlternating(boolean alternating) {
|
public void setAlternating(boolean alternating) {
|
||||||
this.alternating = alternating;
|
this.alternating = alternating;
|
||||||
}
|
}
|
||||||
|
public boolean isShowHeadings() {
|
||||||
|
return showHeadings;
|
||||||
|
}
|
||||||
|
public void setShowHeadings(boolean showHeadings) {
|
||||||
|
this.showHeadings = showHeadings;
|
||||||
|
}
|
||||||
|
public boolean isBorder() {
|
||||||
|
return border;
|
||||||
|
}
|
||||||
|
public void setBorder(boolean border) {
|
||||||
|
this.border = border;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -630,6 +685,7 @@ public class HierarchicalTableGenerator {
|
|||||||
private TableGenerationMode mode;
|
private TableGenerationMode mode;
|
||||||
private RenderingI18nContext i18n;
|
private RenderingI18nContext i18n;
|
||||||
private String uniqueLocalPrefix;
|
private String uniqueLocalPrefix;
|
||||||
|
private boolean treelines = true;
|
||||||
|
|
||||||
public HierarchicalTableGenerator(RenderingI18nContext i18n) {
|
public HierarchicalTableGenerator(RenderingI18nContext i18n) {
|
||||||
super();
|
super();
|
||||||
@ -724,6 +780,7 @@ public class HierarchicalTableGenerator {
|
|||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public TableModel initComparisonTable(String prefix, String id) throws IOException {
|
public TableModel initComparisonTable(String prefix, String id) throws IOException {
|
||||||
TableModel model = new TableModel(id, true);
|
TableModel model = new TableModel(id, true);
|
||||||
|
|
||||||
@ -762,12 +819,18 @@ public class HierarchicalTableGenerator {
|
|||||||
public XhtmlNode generate(TableModel model, String imagePath, int border, Set<String> outputTracker) throws IOException, FHIRException {
|
public XhtmlNode generate(TableModel model, String imagePath, int border, Set<String> outputTracker) throws IOException, FHIRException {
|
||||||
checkModel(model);
|
checkModel(model);
|
||||||
XhtmlNode table = new XhtmlNode(NodeType.Element, "table").setAttribute("border", Integer.toString(border)).setAttribute("cellspacing", "0").setAttribute("cellpadding", "0");
|
XhtmlNode table = new XhtmlNode(NodeType.Element, "table").setAttribute("border", Integer.toString(border)).setAttribute("cellspacing", "0").setAttribute("cellpadding", "0");
|
||||||
|
table.setAttribute("fhir", "generated-heirarchy");
|
||||||
if (model.isActive()) {
|
if (model.isActive()) {
|
||||||
table.setAttribute("id", model.getId());
|
table.setAttribute("id", model.getId());
|
||||||
}
|
}
|
||||||
|
if (model.isBorder()) {
|
||||||
|
table.setAttribute("style", "border: 2px black solid; font-size: 11px; font-family: verdana; vertical-align: top;");
|
||||||
|
} else {
|
||||||
table.setAttribute("style", "border: " + border + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;");
|
table.setAttribute("style", "border: " + border + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;");
|
||||||
|
}
|
||||||
|
if (model.isShowHeadings()) {
|
||||||
XhtmlNode tr = table.addTag("tr");
|
XhtmlNode tr = table.addTag("tr");
|
||||||
|
tr.setAttribute("fhir", "generated-heirarchy");
|
||||||
tr.setAttribute("style", "border: " + Integer.toString(1 + border) + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top");
|
tr.setAttribute("style", "border: " + Integer.toString(1 + border) + "px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top");
|
||||||
XhtmlNode tc = null;
|
XhtmlNode tc = null;
|
||||||
for (Title t : model.getTitles()) {
|
for (Title t : model.getTitles()) {
|
||||||
@ -786,14 +849,15 @@ public class HierarchicalTableGenerator {
|
|||||||
img.setAttribute("onLoad", "fhirTableInit(this)");
|
img.setAttribute("onLoad", "fhirTableInit(this)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Counter counter = new Counter();
|
Counter counter = new Counter();
|
||||||
for (Row r : model.getRows()) {
|
for (Row r : model.getRows()) {
|
||||||
renderRow(table, r, 0, new ArrayList<Integer>(), imagePath, border, outputTracker, counter, model);
|
renderRow(table, r, 0, new ArrayList<Integer>(), imagePath, border, outputTracker, counter, model);
|
||||||
}
|
}
|
||||||
if (model.getDocoRef() != null) {
|
if (model.getDocoRef() != null) {
|
||||||
tr = table.addTag("tr");
|
XhtmlNode tr = table.addTag("tr");
|
||||||
tc = tr.addTag("td");
|
tr.setAttribute("fhir", "generated-heirarchy");
|
||||||
|
XhtmlNode tc = tr.addTag("td");
|
||||||
tc.setAttribute("class", "hierarchy");
|
tc.setAttribute("class", "hierarchy");
|
||||||
tc.setAttribute("colspan", Integer.toString(model.getTitles().size()));
|
tc.setAttribute("colspan", Integer.toString(model.getTitles().size()));
|
||||||
tc.addTag("br");
|
tc.addTag("br");
|
||||||
@ -807,15 +871,21 @@ public class HierarchicalTableGenerator {
|
|||||||
|
|
||||||
|
|
||||||
private void renderRow(XhtmlNode table, Row r, int indent, List<Integer> indents, String imagePath, int border, Set<String> outputTracker, Counter counter, TableModel model) throws IOException {
|
private void renderRow(XhtmlNode table, Row r, int indent, List<Integer> indents, String imagePath, int border, Set<String> outputTracker, Counter counter, TableModel model) throws IOException {
|
||||||
|
if (!r.partnerRow) {
|
||||||
counter.row();
|
counter.row();
|
||||||
|
}
|
||||||
XhtmlNode tr = table.addTag("tr");
|
XhtmlNode tr = table.addTag("tr");
|
||||||
|
tr.setAttribute("fhir", "generated-heirarchy");
|
||||||
|
|
||||||
String color = "white";
|
String color = "white";
|
||||||
if (r.getColor() != null)
|
if (r.getColor() != null)
|
||||||
color = r.getColor();
|
color = r.getColor();
|
||||||
else if (model.isAlternating() && counter.isOdd())
|
else if (model.isAlternating() && counter.isOdd())
|
||||||
color = BACKGROUND_ALT_COLOR;
|
color = BACKGROUND_ALT_COLOR;
|
||||||
|
|
||||||
tr.setAttribute("style", "border: " + border + "px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: "+color+(r.getOpacity() == null ? "" : "; opacity: "+r.getOpacity()));
|
String lineStyle = r.getTopLine() == null ? "" : "; border-top: 1px solid "+r.getTopLine();
|
||||||
|
|
||||||
|
tr.setAttribute("style", "border: " + border + "px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: "+color+(r.getOpacity() == null ? "" : "; opacity: "+r.getOpacity())+lineStyle);
|
||||||
if (model.isActive()) {
|
if (model.isActive()) {
|
||||||
tr.setAttribute("id", r.getId());
|
tr.setAttribute("id", r.getId());
|
||||||
}
|
}
|
||||||
@ -849,25 +919,33 @@ public class HierarchicalTableGenerator {
|
|||||||
if (c.getId() != null) {
|
if (c.getId() != null) {
|
||||||
tc.setAttribute("id", c.getId());
|
tc.setAttribute("id", c.getId());
|
||||||
}
|
}
|
||||||
|
String lineStyle = row != null && row.getTopLine() == null ? "" : "; padding-top: 3px; padding-bottom: 3px";
|
||||||
|
|
||||||
|
XhtmlNode itc = tc;
|
||||||
|
XhtmlNode itr = null;
|
||||||
|
if (c.innerTable) {
|
||||||
|
itr = tc.table("none").tr();
|
||||||
|
itc = itr.td();
|
||||||
|
}
|
||||||
|
|
||||||
if (indents != null) {
|
if (indents != null) {
|
||||||
tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_spacer.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
itc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_spacer.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
tc.setAttribute("style", "vertical-align: top; text-align : left; "+(c.cellStyle != null && c.cellStyle.contains("background-color") ? "" : "background-color: "+color+"; ")+"border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url("+imagePath+checkExists(indents, hasChildren, lineColor, outputTracker)+")"+(c.cellStyle != null ? ";"+c.cellStyle : ""));
|
tc.setAttribute("style", "vertical-align: top; text-align : left; "+(c.cellStyle != null && c.cellStyle.contains("background-color") ? "" : "background-color: "+color+"; ")+"border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap"+(treelines ? "; background-image: url("+imagePath+checkExists(indents, hasChildren, lineColor, outputTracker)+")" : "")+(c.cellStyle != null ? ";"+c.cellStyle : "")+lineStyle);
|
||||||
for (int i = 0; i < indents.size()-1; i++) {
|
for (int i = 0; i < indents.size()-1; i++) {
|
||||||
switch (indents.get(i)) {
|
switch (indents.get(i)) {
|
||||||
case NEW_REGULAR:
|
case NEW_REGULAR:
|
||||||
case NEW_SLICER:
|
case NEW_SLICER:
|
||||||
case NEW_SLICE:
|
case NEW_SLICE:
|
||||||
tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_blank.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
itc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_blank.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
break;
|
break;
|
||||||
case CONTINUE_REGULAR:
|
case CONTINUE_REGULAR:
|
||||||
tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
itc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
break;
|
break;
|
||||||
case CONTINUE_SLICER:
|
case CONTINUE_SLICER:
|
||||||
tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline_slicer.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
itc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline_slicer.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
break;
|
break;
|
||||||
case CONTINUE_SLICE:
|
case CONTINUE_SLICE:
|
||||||
tc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline_slice.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
itc.addTag("img").setAttribute("src", srcFor(imagePath, "tbl_vline_slice.png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error("Unrecognized indent level: " + indents.get(i));
|
throw new Error("Unrecognized indent level: " + indents.get(i));
|
||||||
@ -875,7 +953,7 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
if (!indents.isEmpty()) {
|
if (!indents.isEmpty()) {
|
||||||
String sfx = table.isActive() && hasChildren ? "-open" : "";
|
String sfx = table.isActive() && hasChildren ? "-open" : "";
|
||||||
XhtmlNode img = tc.addTag("img");
|
XhtmlNode img = itc.addTag("img");
|
||||||
switch (indents.get(indents.size()-1)) {
|
switch (indents.get(indents.size()-1)) {
|
||||||
case NEW_REGULAR:
|
case NEW_REGULAR:
|
||||||
img.setAttribute("src", srcFor(imagePath, "tbl_vjoin_end"+sfx+".png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
img.setAttribute("src", srcFor(imagePath, "tbl_vjoin_end"+sfx+".png")).setAttribute("style", "background-color: inherit").setAttribute("class", "hierarchy").setAttribute("alt", ".");
|
||||||
@ -903,17 +981,21 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
tc.setAttribute("style", "vertical-align: top; text-align : left; "+(c.cellStyle != null && c.cellStyle.contains("background-color") ? "" : "background-color: "+color+"; ")+"border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px"+(c.cellStyle != null ? ";"+c.cellStyle : ""));
|
tc.setAttribute("style", "vertical-align: top; text-align : left; "+(c.cellStyle != null && c.cellStyle.contains("background-color") ? "" : "background-color: "+color+"; ")+"border: "+ border +"px #F0F0F0 solid; padding:0px 4px 0px 4px"+(c.cellStyle != null ? ";"+c.cellStyle : "")+lineStyle);
|
||||||
|
}
|
||||||
|
if (c.innerTable) {
|
||||||
|
itc = itr.td();
|
||||||
|
}
|
||||||
if (!Utilities.noString(icon)) {
|
if (!Utilities.noString(icon)) {
|
||||||
XhtmlNode img = tc.addTag("img").setAttribute("alt", "icon").setAttribute("src", srcFor(imagePath, icon)).setAttribute("class", "hierarchy").setAttribute("style", "background-color: "+color+"; background-color: inherit").setAttribute("alt", ".");
|
XhtmlNode img = itc.addTag("img").setAttribute("alt", "icon").setAttribute("src", srcFor(imagePath, icon)).setAttribute("class", "hierarchy").setAttribute("style", "background-color: "+color+"; background-color: inherit").setAttribute("alt", ".");
|
||||||
if (hint != null)
|
if (hint != null)
|
||||||
img.setAttribute("title", hint);
|
img.setAttribute("title", hint);
|
||||||
tc.addText(" ");
|
itc.addText(" ");
|
||||||
}
|
}
|
||||||
for (Piece p : c.pieces) {
|
for (Piece p : c.pieces) {
|
||||||
if (!Utilities.noString(p.getTag())) {
|
if (!Utilities.noString(p.getTag())) {
|
||||||
XhtmlNode tag = tc.addTag(p.getTag());
|
XhtmlNode tag = itc.addTag(p.getTag());
|
||||||
if (p.attributes != null)
|
if (p.attributes != null)
|
||||||
for (String n : p.attributes.keySet())
|
for (String n : p.attributes.keySet())
|
||||||
tag.setAttribute(n, p.attributes.get(n));
|
tag.setAttribute(n, p.attributes.get(n));
|
||||||
@ -924,7 +1006,7 @@ public class HierarchicalTableGenerator {
|
|||||||
tag.addChildNodes(p.getChildren());
|
tag.addChildNodes(p.getChildren());
|
||||||
}
|
}
|
||||||
} else if (!Utilities.noString(p.getReference())) {
|
} else if (!Utilities.noString(p.getReference())) {
|
||||||
XhtmlNode a = addStyle(tc.addTag("a"), p);
|
XhtmlNode a = addStyle(itc.addTag("a"), p);
|
||||||
a.setAttribute("href", prefixLocalHref(p.getReference()));
|
a.setAttribute("href", prefixLocalHref(p.getReference()));
|
||||||
if (mode == TableGenerationMode.XHTML && suppressExternals) {
|
if (mode == TableGenerationMode.XHTML && suppressExternals) {
|
||||||
a.setAttribute("no-external", "true");
|
a.setAttribute("no-external", "true");
|
||||||
@ -943,25 +1025,25 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p.hasChildren()) {
|
if (p.hasChildren()) {
|
||||||
tc.addChildNodes(p.getChildren());
|
itc.addChildNodes(p.getChildren());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Utilities.noString(p.getHint())) {
|
if (!Utilities.noString(p.getHint())) {
|
||||||
XhtmlNode s = addStyle(tc.addTag("span"), p);
|
XhtmlNode s = addStyle(itc.addTag("span"), p);
|
||||||
s.setAttribute("title", p.getHint());
|
s.setAttribute("title", p.getHint());
|
||||||
s.addText(p.getText());
|
s.addText(p.getText());
|
||||||
} else if (p.getStyle() != null) {
|
} else if (p.getStyle() != null) {
|
||||||
XhtmlNode s = addStyle(tc.addTag("span"), p);
|
XhtmlNode s = addStyle(itc.addTag("span"), p);
|
||||||
s.addText(p.getText());
|
s.addText(p.getText());
|
||||||
} else {
|
} else {
|
||||||
tc.addText(p.getText());
|
itc.addText(p.getText());
|
||||||
}
|
}
|
||||||
if (p.hasChildren()) {
|
if (p.hasChildren()) {
|
||||||
tc.addChildNodes(p.getChildren());
|
itc.addChildNodes(p.getChildren());
|
||||||
}
|
}
|
||||||
if (p.getTagImg() != null) {
|
if (p.getTagImg() != null) {
|
||||||
tc.tx(" ");
|
itc.tx(" ");
|
||||||
tc.img(p.getTagImg(), null);
|
itc.img(p.getTagImg(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -983,6 +1065,15 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String srcFor(String corePrefix, String filename) throws IOException {
|
private String srcFor(String corePrefix, String filename) throws IOException {
|
||||||
|
if (!treelines && filename.startsWith("tbl")) {
|
||||||
|
if (filename.contains("-open")) {
|
||||||
|
filename = "tbl-open.png";
|
||||||
|
} else if (filename.contains("-closed")) {
|
||||||
|
filename = "tbl-closed.png";
|
||||||
|
} else {
|
||||||
|
filename = "tbl_blank.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
if (inLineGraphics) {
|
if (inLineGraphics) {
|
||||||
if (files.containsKey(filename))
|
if (files.containsKey(filename))
|
||||||
return files.get(filename);
|
return files.get(filename);
|
||||||
@ -995,11 +1086,12 @@ public class HierarchicalTableGenerator {
|
|||||||
else
|
else
|
||||||
bytes = FileUtils.readFileToByteArray(file);
|
bytes = FileUtils.readFileToByteArray(file);
|
||||||
b.append(new String(Base64.encodeBase64(bytes)));
|
b.append(new String(Base64.encodeBase64(bytes)));
|
||||||
// files.put(filename, b.toString());
|
// files.put(filename, b.toString());
|
||||||
return b.toString();
|
return b.toString();
|
||||||
} else
|
} else {
|
||||||
return corePrefix+filename;
|
return corePrefix+filename;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String help16AsData() throws IOException {
|
public static String help16AsData() throws IOException {
|
||||||
ClassLoader classLoader = HierarchicalTableGenerator.class.getClassLoader();
|
ClassLoader classLoader = HierarchicalTableGenerator.class.getClassLoader();
|
||||||
@ -1072,7 +1164,7 @@ public class HierarchicalTableGenerator {
|
|||||||
b.append(new String(encodeBase64));
|
b.append(new String(encodeBase64));
|
||||||
files.put(filename, b.toString());
|
files.put(filename, b.toString());
|
||||||
return b.toString();
|
return b.toString();
|
||||||
} else {
|
} else if (treelines) {
|
||||||
b.append("tbl_bck");
|
b.append("tbl_bck");
|
||||||
for (Integer i : indents)
|
for (Integer i : indents)
|
||||||
b.append(Integer.toString(i));
|
b.append(Integer.toString(i));
|
||||||
@ -1098,6 +1190,8 @@ public class HierarchicalTableGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b.toString();
|
return b.toString();
|
||||||
|
} else {
|
||||||
|
return "tbl_bck0.png";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,4 +1272,12 @@ public class HierarchicalTableGenerator {
|
|||||||
return "#"+uniqueLocalPrefix+"-"+url.substring(1);
|
return "#"+uniqueLocalPrefix+"-"+url.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTreelines() {
|
||||||
|
return treelines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTreelines(boolean treelines) {
|
||||||
|
this.treelines = treelines;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
2
pom.xml
2
pom.xml
@ -23,7 +23,7 @@
|
|||||||
<commons_io_version>2.17.0</commons_io_version>
|
<commons_io_version>2.17.0</commons_io_version>
|
||||||
<guava_version>32.0.1-jre</guava_version>
|
<guava_version>32.0.1-jre</guava_version>
|
||||||
<hapi_fhir_version>6.4.1</hapi_fhir_version>
|
<hapi_fhir_version>6.4.1</hapi_fhir_version>
|
||||||
<validator_test_case_version>1.7.2</validator_test_case_version>
|
<validator_test_case_version>1.7.3-SNAPSHOT</validator_test_case_version>
|
||||||
<jackson_version>2.17.0</jackson_version>
|
<jackson_version>2.17.0</jackson_version>
|
||||||
<junit_jupiter_version>5.9.2</junit_jupiter_version>
|
<junit_jupiter_version>5.9.2</junit_jupiter_version>
|
||||||
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user