final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
final Configuration portletConfig = storedPortlet.getConfiguration();
//populate composite data
//locate resourceGroupRef
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
criteria.addFilterId(context.getGroupId());
criteria.fetchConfigurationUpdates(false);
criteria.fetchExplicitResources(false);
criteria.fetchGroupDefinition(false);
criteria.fetchOperationHistories(false);
// for autoclusters and autogroups we need to add more criteria
if (context.isAutoCluster()) {
criteria.addFilterVisible(false);
} else if (context.isAutoGroup()) {
criteria.addFilterVisible(false);
criteria.addFilterPrivate(true);
}
//locate the resource group
GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
new AsyncCallback<PageList<ResourceGroupComposite>>() {
@Override
public void onFailure(Throwable caught) {
Log.debug("Error retrieving resource group composite for group [" + context.getGroupId() + "]:"
+ caught.getMessage());
currentlyLoading = false;
}
@Override
public void onSuccess(PageList<ResourceGroupComposite> results) {
if (!results.isEmpty()) {
groupComposite = results.get(0);
//instantiate view
PageControl lastFive = new PageControl(0, 5);
GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
criteria.setPageControl(lastFive);
//TODO: spinder: move this up into the pageControl.
criteria.addSortStatus(PageOrdering.DESC);
List<Integer> filterResourceGroupIds = new ArrayList<Integer>();
filterResourceGroupIds.add(context.getGroupId());
criteria.addFilterResourceGroupIds(filterResourceGroupIds);
groupHistoryTable = new GroupConfigurationHistoryCriteriaTable(groupComposite);
} else {
ResourceGroup emptyGroup = new ResourceGroup("");
emptyGroup.setId(-1);