}
final Integer bundleId = tmp;
// we are at an inner node, being asked to get the children of it
if (parentId.endsWith("_versions")) {
BundleVersionCriteria criteria = new BundleVersionCriteria();
criteria.addFilterBundleId(bundleId);
bundleService.findBundleVersionsByCriteria(criteria, new AsyncCallback<PageList<BundleVersion>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
response.setStatus(DSResponse.STATUS_FAILURE);
processResponse(request.getRequestId(), response);
}
public void onSuccess(PageList<BundleVersion> result) {
response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
response.setTotalRows(result.getTotalSize());
processResponse(request.getRequestId(), response);
}
});
} else if (parentId.endsWith("_deployments")) {
BundleDeploymentCriteria criteria = new BundleDeploymentCriteria();
criteria.fetchBundleVersion(true);
criteria.addFilterBundleId(bundleId);
bundleService.findBundleDeploymentsByCriteria(criteria,
new AsyncCallback<PageList<BundleDeployment>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
}
public void onSuccess(PageList<BundleDeployment> result) {
response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
processResponse(request.getRequestId(), response);
}
});
} else if (parentId.endsWith("_destinations")) {
BundleDestinationCriteria criteria = new BundleDestinationCriteria();
criteria.addFilterBundleId(bundleId);
criteria.fetchDeployments(true);
bundleService.findBundleDestinationsByCriteria(criteria,
new AsyncCallback<PageList<BundleDestination>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
}
public void onSuccess(PageList<BundleDestination> result) {
response.setData(buildRecordsForKnownBundle(result, bundleGroupId, bundleId));
processResponse(request.getRequestId(), response);
}
});
} else {
// we are at a child node under a bundle node - its an individual destination or deployment node
BundleCriteria criteria = new BundleCriteria();
criteria.addFilterId(bundleId);
criteria.fetchDestinations(true);
bundleService.findBundlesByCriteria(criteria, new AsyncCallback<PageList<Bundle>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_bundle_tree_loadFailure(), caught);
response.setStatus(DSResponse.STATUS_FAILURE);