addTermFacetToTable(bitstreamsFacet, division, "Bitstream", "Top Downloads for " + getLastMonthString());
// Convert Elastic Search data to a common DataTermsFacet object, and stuff in DRI/HTML of page.
TermsFacet topBitstreamsFacet = resp.getFacets().facet(TermsFacet.class, "top_bitstreams_lastmonth");
List<? extends TermsFacet.Entry> termsFacetEntries = topBitstreamsFacet.getEntries();
DataTermsFacet termsFacet = new DataTermsFacet();
for(TermsFacet.Entry entry : termsFacetEntries) {
termsFacet.addTermFacet(new DataTermsFacet.TermsFacet(entry.getTerm().string(), entry.getCount()));
}
division.addHidden("jsonTopDownloads").setValue(termsFacet.toJson());
}