// request the data to get the counts
// We need the counts for both of the lists, but at most one list will perform an initial data load, we need to
// force the load. (Only the list which is visible will load; if the tab is inactive then there are zero
// visible lists.)
FlaggedActivityModel.getInstance().fetch(new GetFlaggedActivitiesRequest(0, 1), false);
PendingGroupsModel.getInstance().fetch(new GetPendingGroupsRequest(0, 1), false);
// wire up events to refresh the list when something is removed
eventBus.addObserver(UpdatedActivityFlagResponseEvent.class, new Observer<UpdatedActivityFlagResponseEvent>()
{
public void update(final UpdatedActivityFlagResponseEvent ev)
{
eventBus.notifyObservers(new ShowNotificationEvent(new Notification(
"The flagged activity has been allowed")));
adminTabContent.reload();
}
});
eventBus.addObserver(UpdatedReviewPendingGroupResponseEvent.class,
new Observer<UpdatedReviewPendingGroupResponseEvent>()
{
public void update(final UpdatedReviewPendingGroupResponseEvent ev)
{
adminTabContent.reload();
}
});
eventBus.addObserver(DeletedActivityResponseEvent.class, new Observer<DeletedActivityResponseEvent>()
{
public void update(final DeletedActivityResponseEvent ev)
{
adminTabContent.reload();
}
});
// prepare the StaticResourceBundle.INSTANCE.coreCss().filters()
// flagged content StaticResourceBundle.INSTANCE.coreCss().filter()
StreamMessageItemRenderer flaggedRenderer = new StreamMessageItemRenderer(ShowRecipient.YES);
flaggedRenderer.setShowManageFlagged(true);
flaggedRenderer.setShowComment(true);
BaseActivityLinkBuilder activityLinkBuilder = new InContextActivityLinkBuilder();
activityLinkBuilder.addExtraParameter("manageFlagged", "true");
flaggedRenderer.setActivityLinkBuilder(activityLinkBuilder);
adminTabContent.addSet(flaggedActivitiesFilterName, FlaggedActivityModel.getInstance(), flaggedRenderer,
new GetFlaggedActivitiesRequest(0, 0));
// pending groups StaticResourceBundle.INSTANCE.coreCss().filter()
adminTabContent.addSet(pendingGroupsFilterName, PendingGroupsModel.getInstance(), new PendingGroupRenderer(),
new GetPendingGroupsRequest(0, 0));
return adminTabContent;
}