DriftDefinitionCriteria defCriteria = new DriftDefinitionCriteria();
defCriteria.addFilterId(driftDefId);
defCriteria.fetchConfiguration(true);
defCriteria.fetchTemplate(true);
DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
driftService.findDriftDefinitionsByCriteria(defCriteria, new AsyncCallback<PageList<DriftDefinition>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_load(), caught);
}
public void onSuccess(PageList<DriftDefinition> result) {
DriftDefinition driftDef = result.get(0);
String defName = driftDef.getName();
String title;
if (0 == version) {
String isPinned = String.valueOf(driftDef.isPinned());
title = MSG.view_drift_table_title_initialSnapshot(defName, isPinned);
} else {
title = MSG.view_drift_table_title_snapshot(String.valueOf(version), defName);
}
setTitleString(title);
pinnedToTemplate = driftDef.getTemplate() != null && driftDef.getTemplate().isPinned();
DriftSnapshotView.super.onDraw();
}
});
} else {
DriftDefinitionTemplateCriteria templateCriteria = new DriftDefinitionTemplateCriteria();
templateCriteria.addFilterId(templateId);
templateCriteria.fetchResourceType(true);
DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
driftService.findDriftDefinitionTemplatesByCriteria(templateCriteria,
new AsyncCallback<PageList<DriftDefinitionTemplate>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_drift_failure_load(), caught);
}