List<DisplayableArticle> displayArticles = (List<DisplayableArticle>)req.getAttribute("articleList");
List<DisplayableApplicationType> gameStyles = new ArrayList<DisplayableApplicationType>();
Blog gameBlog = blogMgr.getBlog("mgblgameinstances", mgblGroup);
for (DisplayableArticle a : displayArticles) {
Article blogArticle = blogMgr.getArticle(a.getId());
DisplayableApplicationType entry = new DisplayableApplicationType(blogArticle);
Label label = blogMgr.getLabel(gameBlog, blogArticle.getTitle());
Collection<Article> gameList = label != null ? blogMgr.getArchivedArticles(gameBlog, label) : null;
entry.setGameCount(gameList != null ? gameList.size() : 0);
gameStyles.add(entry);
}
Collections.sort(gameStyles, new Comparator<DisplayableApplicationType>() {
public int compare(DisplayableApplicationType o1, DisplayableApplicationType o2) {
return o1.getTitle().compareToIgnoreCase(o2.getTitle());