ModelContext blogEntriesModelContext = new ModelContext();
blogEntriesModelContext.setDomainModel(app.getDomainModel());
Users users = (Users) app.getEntry("Users");
Blogs allApprovedBlogs = users.getAllApprovedBlogs();
Entries allApprovedEntries = allApprovedBlogs
.getAllApprovedEntries();
if (allApprovedEntries != null) {
Entries selectedEntries = allApprovedEntries.getLastEntries(3);
blogEntriesModelContext.setEntities(selectedEntries);
} else {
blogEntriesModelContext.setEntities(allApprovedEntries);
}
ViewContext blogEntriesViewContext = new ViewContext();