*/
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException,
IOException, AuthorizeException
{
BrowseParams params = getUserParams();
BrowseInfo info = getBrowseInfo();
String type = info.getBrowseIndex().getName();
// Build the DRI Body
Division div = body.addDivision("browse-by-" + type, "primary");
div.setHead(getTitleMessage(info));
// Build the internal navigation (jump lists)
addBrowseJumpNavigation(div, info, params);
// Build the sort and display controls
addBrowseControls(div, info, params);
// This div will hold the browsing results
Division results = div.addDivision("browse-by-" + type + "-results", "primary");
// If there are items to browse, add the pagination
int itemsTotal = info.getTotal();
if (itemsTotal > 0)
{
//results.setSimplePagination(itemsTotal, firstItemIndex, lastItemIndex, previousPage, nextPage)
results.setSimplePagination(itemsTotal, browseInfo.getOverallPosition() + 1,
browseInfo.getOverallPosition() + browseInfo.getResultCount(), getPreviousPageURL(
params, info), getNextPageURL(params, info));
// Reference all the browsed items
ReferenceSet referenceSet = results.addReferenceSet("browse-by-" + type,
ReferenceSet.TYPE_SUMMARY_LIST, type, null);
// Are we browsing items, or unique metadata?
if (isItemBrowse(info))
{
// Add the items to the browse results
for (BrowseItem item : (java.util.List<BrowseItem>) info.getResults())
{
referenceSet.addReference(item);
}
}
else // browsing a list of unique metadata entries