head.addElement("protocol").addElement("version").addText("1.0");
head.addElement("server").addElement("name").addText(request.getServerName());
}
private void getOverallStats(Element root) {
ReputationMetricManager reputationMetricManager = CollabReviewSingleton.get().getReputationMetricManager();
Element scores = root.addElement("totals");
Collection<String> contributors = reputationMetricManager.listAllContributors();
if (!reputationMetricManager.isUptodate()) {
root.element("head").addElement("warning").addAttribute("info", "out-of-date").addText("Some of the metric results were cached and are possibly out of date.");
}
for (String authorName : contributors) {
Element element = scores.addElement("contributor");
element.addAttribute("name", authorName);
for (ReputationMetric reputationMetric : reputationMetricManager.listReputationMetrics()) {
Float score = reputationMetric.getAuthorScore(authorName);
if (score == null) {
score = 0f;
}
Element scoreElement = element.addElement("score");