use of org.pentaho.platform.dataaccess.datasource.ui.importing.MetadataImportDialogModel in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showMetadataImportDialog.
private void showMetadataImportDialog(final JavaScriptObject callback) {
final DialogListener<MetadataImportDialogModel> listener = new DialogListener<MetadataImportDialogModel>() {
public void onDialogCancel() {
}
public void onDialogAccept(final MetadataImportDialogModel importDialogModel) {
MetadataDatasourceServiceGwtImpl service = new MetadataDatasourceServiceGwtImpl();
service.importMetadataDatasource(importDialogModel.getDomainId(), importDialogModel.getUploadedFile(), importDialogModel.getLocalizedBundleEntries(), new XulServiceCallback<String>() {
@Override
public void success(String retVal) {
notifyDialogCallbackSuccess(callback, retVal);
}
@Override
public void error(String message, Throwable error) {
notifyDialogCallbackError(callback, message);
}
});
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
// TODO Auto-generated method stub
}
};
showMetadataImportDialog(listener);
}
use of org.pentaho.platform.dataaccess.datasource.ui.importing.MetadataImportDialogModel in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showMetadataImportDialog.
public void showMetadataImportDialog(final DialogListener listener) {
final DialogListener<MetadataImportDialogModel> importDialoglistener = new DialogListener<MetadataImportDialogModel>() {
public void onDialogCancel() {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel analysisDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
analysisDataFormPanel.removeFromParent();
RootPanel.get().add(analysisDataFormPanel);
}
public void onDialogAccept(final MetadataImportDialogModel importDialogModel) {
final MetadataImportDialogController controller = importDialog.getMetadataImportDialogController();
final FormPanel metaDataFormPanel = controller.getFormPanel();
controller.removeHiddenPanels();
controller.buildAndSetParameters();
metaDataFormPanel.removeFromParent();
RootPanel.get().add(metaDataFormPanel);
controller.setImportCompleteCallback(new MetadataImportDialogController.ImportCompleteCallback() {
@Override
public void onImportSuccess() {
listener.onDialogAccept(null);
}
@Override
public void onImportCancel() {
listener.onDialogCancel();
}
});
metaDataFormPanel.submit();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
listener.onDialogError(errorMessage);
}
};
final AsyncConstructorListener<GwtImportDialog> constructorListener = new AsyncConstructorListener<GwtImportDialog>() {
public void asyncConstructorDone(GwtImportDialog dialog) {
dialog.showMetadataImportDialog(importDialoglistener);
}
};
if (importDialog == null) {
importDialog = new GwtImportDialog(constructorListener);
} else {
importDialog.showMetadataImportDialog(importDialoglistener);
}
}
Aggregations