// get our configuration
String source = ConfigurationManager.getProperty("recent.submissions.sort-option");
String count = ConfigurationManager.getProperty("recent.submissions.count");
// prep our engine and scope
BrowseEngine be = new BrowseEngine(context);
BrowserScope bs = new BrowserScope(context);
BrowseIndex bi = BrowseIndex.getItemBrowseIndex();
// fill in the scope with the relevant gubbins
bs.setBrowseIndex(bi);
bs.setOrder(SortOption.DESCENDING);
bs.setResultsPerPage(Integer.parseInt(count));
if (dso != null)
{
bs.setBrowseContainer(dso);
}
for (SortOption so : SortOption.getSortOptions())
{
if (so.getName().equals(source))
{
bs.setSortBy(so.getNumber());
}
}
BrowseInfo results = be.browseMini(bs);
Item[] items = results.getItemResults(context);
RecentSubmissions rs = new RecentSubmissions(items);