public String makelink() { if (link == null) return predicate; else return "<a href=\""+link+"\">"+Utilities.escapeXml(predicate)+"</a>"; }
private String genPCLink(String leftName, String leftLink) { return "<a href=\""+leftLink+"\">"+Utilities.escapeXml(leftName)+"</a>"; }
public String getHtml() { return html == null ? Utilities.escapeXml(message) : html; }
public String toXML() { return "<message source=\"" + source + "\" line=\"" + line + "\" col=\"" + col + "\" location=\"" + Utilities.escapeXml(location) + "\" type=\"" + type + "\" level=\"" + level + "\" display=\"" + Utilities.escapeXml(getDisplay()) + "\" ><plain>" + Utilities.escapeXml(message) + "</plain><html>" + html + "</html></message>"; }
@Override public void logResponse(String outcome, List<String> headers, byte[] body) { if (file == null) return; file.println("<pre>"); file.println(outcome); for (String s : headers) file.println(Utilities.escapeXml(s)); if (body != null) { file.println(""); try { file.println(Utilities.escapeXml(new String(body, "UTF-8"))); } catch (UnsupportedEncodingException e) { } } file.println("</pre>"); }
@Override protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean b, String msg) { String rn = path.contains(".") ? path.substring(0, path.indexOf(".")) : path; return super.rule(errors, type, path, b, msg, "<a href=\""+(rn.toLowerCase())+".html\">"+rn+"</a>: "+Utilities.escapeXml(msg)); }
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean b, String msg) { String rn = path.contains(".") ? path.substring(0, path.indexOf(".")) : path; return super.rule(errors, type, path, b, msg, "<a href=\""+(rn.toLowerCase())+".html\">"+rn+"</a>: "+Utilities.escapeXml(msg)); }
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean b, String msg) { String rn = path.contains(".") ? path.substring(0, path.indexOf(".")) : path; return super.rule(errors, type, path, b, msg, "<a href=\""+(rn.toLowerCase())+".html\">"+rn+"</a>: "+Utilities.escapeXml(msg)); }
public ValidationMessage(Source source, IssueType type, int line, int col, String path, String message, IssueSeverity level) { super(); this.line = line; this.col = col; this.location = path; this.message = message; this.html = Utilities.escapeXml(message); this.level = level; this.source = source; this.type = type; if (level == IssueSeverity.NULL) determineLevel(path); if (type == null) throw new Error("A type must be provided"); }
@Override public void logRequest(String method, String url, List<String> headers, byte[] body) { if (file == null) return; id++; lastId = Integer.toString(id); file.println("<hr/><a name=\"l"+lastId+"\"> </a>"); file.println("<pre>"); file.println(method+" "+url+" HTTP/1.0"); for (String s : headers) file.println(Utilities.escapeXml(s)); if (body != null) { file.println(""); try { file.println(Utilities.escapeXml(new String(body, "UTF-8"))); } catch (UnsupportedEncodingException e) { } } file.println("</pre>"); }
private String mergeText(ElementDefinition ed, ProfileComparison outcome, String path, String name, String left, String right) { if (left == null && right == null) return null; if (left == null) return right; if (right == null) return left; if (left.equalsIgnoreCase(right)) return left; if (path != null) { outcome.messages.add(new ValidationMessage(Source.ProfileComparer, ValidationMessage.IssueType.INFORMATIONAL, path, "Elements differ in definition for "+name+":\r\n \""+left+"\"\r\n \""+right+"\"", "Elements differ in definition for "+name+":<br/>\""+Utilities.escapeXml(left)+"\"<br/>\""+Utilities.escapeXml(right)+"\"", ValidationMessage.IssueSeverity.INFORMATION)); status(ed, ProfileUtilities.STATUS_HINT); } return "left: "+left+"; right: "+right; }
protected String processCommand(String command, String[] com) throws Exception { if (com[0].equals("title")) return title; else if (com[0].equals("xtitle")) return Utilities.escapeXml(title); else if (com[0].equals("level")) return genlevel(); else if (com[0].equals("settitle")) { title = command.substring(9).replace("{", "<%").replace("}", "%>"); return ""; } else throw new FHIRException("Unknown command "+com[0]); }
public ValidationMessage(Source source, IssueType type, String path, String message, IssueSeverity level) { super(); this.line = -1; this.col = -1; this.location = path; if (message == null) throw new Error("message is null"); this.message = message; this.html = Utilities.escapeXml(message); this.level = level; this.source = source; this.type = type; if (level == IssueSeverity.NULL) determineLevel(path); if (type == null) throw new Error("A type must be provided"); }
private static String renderDEUnits(Type units) { if (units == null || units.isEmpty()) return ""; if (units instanceof CodeableConcept) return renderCodeable((CodeableConcept) units); else return "<a href=\""+Utilities.escapeXml(((Reference) units).getReference())+"\">"+Utilities.escapeXml(((Reference) units).getReference())+"</a>"; }
public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException { Narrative n = new Narrative(); n.setStatus(status); n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>")); return n; }
private static String renderCodeable(CodeableConcept units) { if (units == null || units.isEmpty()) return ""; String v = renderCoding(units.getCoding()); if (units.hasText()) v = v + " " +Utilities.escapeXml(units.getText()); return v; }
public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException { Narrative n = new Narrative(); n.setStatus(status); try { n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>")); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e.getMessage(), e); } return n; }
public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException { Narrative n = new Narrative(); n.setStatus(status); try { n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>")); } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e.getMessage(), e); } return n; }
public void generate(StructureDefinition entry, Map<String, StructureDefinition> library) throws Exception { processedLibs.clear(); this.library = library; checkLib(entry); String ns = getNs(entry); String lang = start(entry, ns); w(" <xs:element name=\""+tail(entry.getType())+"\" type=\"lm:"+tail(entry.getType())+"\""); if (annotations) { ln(">"); ln(" <xs:annotation>"); ln(" <xs:documentation xml:lang=\""+lang+"\">"+Utilities.escapeXml(entry.getDescription())+"</xs:documentation>"); ln(" </xs:annotation>"); ln(" </xs:element>"); } else ln("/>"); produceType(entry, entry.getSnapshot().getElement().get(0), tail(entry.getType()), getQN(entry, entry.getBaseDefinition()), lang); while (!queue.isEmpty()) { ElementToGenerate q = queue.poll(); produceType(q.sd, q.ed, q.tname, getQN(q.sd, q.ed, "http://hl7.org/fhir/StructureDefinition/Element", false), lang); } while (!queueLib.isEmpty()) { generateInner(queueLib.poll()); } close(); }