private void addCountsToResult(TestSummary testSummary, Element resultElement) { Element counts = testResultsDocument.createElement("counts"); resultElement.appendChild(counts); XmlUtil.addTextNode(testResultsDocument, counts, "right", Integer.toString(testSummary.right)); XmlUtil.addTextNode(testResultsDocument, counts, "wrong", Integer.toString(testSummary.wrong)); XmlUtil.addTextNode( testResultsDocument, counts, "ignores", Integer.toString(testSummary.ignores)); XmlUtil.addTextNode( testResultsDocument, counts, "exceptions", Integer.toString(testSummary.exceptions)); }
public void addItem(RecentChangesPageEntry line) throws Exception { Map<String, String> itemProperties = line.getItemProperties(); Element itemElement = document.createElement("item"); makeNodes(itemElement, itemProperties); linkPrefixBuilder.buildLink(itemElement, itemProperties.get("path")); String description = makeDescription(itemProperties); XmlUtil.addTextNode(itemElement, "description", description); channelElement.appendChild(itemElement); }
protected void startHtml() throws Exception { if (response.isXmlFormat()) { testResultsDocument = XmlUtil.newDocument(); testResultsElement = testResultsDocument.createElement("testResults"); testResultsDocument.appendChild(testResultsElement); XmlUtil.addTextNode(testResultsDocument, testResultsElement, "rootPath", page.getName()); } else { buildHtml(); addToResponse(formatter.head()); } }
protected void addTestResultsToXmlDocument(TestSummary testSummary, String pageName) throws Exception { Element resultElement = testResultsDocument.createElement("result"); testResultsElement.appendChild(resultElement); addCountsToResult(testSummary, resultElement); XmlUtil.addCdataNode(testResultsDocument, resultElement, "content", outputBuffer.toString()); outputBuffer = null; XmlUtil.addTextNode(testResultsDocument, resultElement, "relativePageName", pageName); }
private Document buildDocumentWithRssHeader() throws Exception { Document rssDocument = XmlUtil.newDocument(); Element rssDocumentElement = rssDocument.createElement("rss"); rssDocument.appendChild(rssDocumentElement); channelElement = rssDocument.createElement("channel"); rssDocumentElement.setAttribute("version", "2.0"); rssDocumentElement.appendChild(channelElement); XmlUtil.addTextNode(channelElement, "title", "FitNesse:"); return rssDocument; }
public void buildLink(Element itemElement, String pageName) throws Exception { String prefix = getRssLinkPrefix(); String link = prefix + pageName; XmlUtil.addTextNode(itemElement, "link", link); }
private static void makeNodes(Element itemElement, Map<String, String> itemProperties) { XmlUtil.addTextNode(itemElement, "title", itemProperties.get("path")); XmlUtil.addTextNode(itemElement, "author", itemProperties.get("author")); XmlUtil.addTextNode(itemElement, "pubDate", itemProperties.get("pubDate")); }