criteria.fetchConfiguration(true);
criteria.fetchResourceDeployments(true);
criteria.fetchDestination(true);
criteria.fetchTags(true);
final BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService();
bundleService.findBundleDeploymentsByCriteria(criteria, new AsyncCallback<PageList<BundleDeployment>>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(MSG.view_bundle_deploy_loadFailure(), caught);
}
@Override
public void onSuccess(PageList<BundleDeployment> result) {
final BundleDeployment deployment = result.get(0);
BundleCriteria bundleCriteria = new BundleCriteria();
bundleCriteria.addFilterId(deployment.getBundleVersion().getBundle().getId());
bundleService.findBundlesByCriteria(bundleCriteria, new AsyncCallback<PageList<Bundle>>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(MSG.view_bundle_deploy_loadBundleFailure(), caught);
}
@Override
public void onSuccess(PageList<Bundle> result) {
final Bundle bundle = result.get(0);
deployment.getBundleVersion().setBundle(bundle);
BundleResourceDeploymentCriteria criteria = new BundleResourceDeploymentCriteria();
criteria.addFilterBundleDeploymentId(deployment.getId());
criteria.fetchResource(true);
criteria.fetchBundleDeployment(true);
bundleService.findBundleResourceDeploymentsByCriteria(criteria,
new AsyncCallback<PageList<BundleResourceDeployment>>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(MSG.view_bundle_deploy_loadFailure(), caught);
}