use of org.pentaho.agilebi.modeler.services.impl.GwtModelerServiceImpl in project data-access by pentaho.
the class EmbeddedWizard method showModelEditor.
@Bindable
public void showModelEditor() {
// open up the modeler
final DialogListener<Domain> listener = new DialogListener<Domain>() {
public void onDialogCancel() {
EmbeddedWizard.this.onDialogAccept();
wizardController.resetSelectedDatasource();
}
public void onDialogAccept(final Domain domain) {
EmbeddedWizard.this.onDialogAccept();
wizardController.resetSelectedDatasource();
}
public void onDialogReady() {
}
@Override
public void onDialogError(String errorMessage) {
wizardController.resetSelectedDatasource();
}
};
final String domainId = summary.getDomain().getId();
final EmbeddedWizard wizard = this;
// reload model for synchronize between GWT model and backend model http://jira.pentaho.com/browse/BISERVER-10399
GwtModelerServiceImpl ssd = new GwtModelerServiceImpl();
ssd.loadDomain(domainId, new XulServiceCallback<Domain>() {
@Override
public void error(String arg0, Throwable arg1) {
// js console log
arg1.printStackTrace();
wizardController.resetSelectedDatasource();
MessageHandler.getInstance().closeWaitingDialog();
// user error dialog
MessageHandler.getInstance().showErrorDialog(// $NON-NLS-1$
datasourceMessages.getString("DatasourceEditor.ERROR"), // $NON-NLS-1$ );
datasourceMessages.getString("DatasourceEditor.ERROR_0002_UNABLE_TO_SHOW_DIALOG", arg1.getLocalizedMessage()));
}
@Override
public void success(Domain arg0) {
summary.setDomain(arg0);
final Domain domain = summary.getDomain();
ModelerDialog.getInstance(wizard, new AsyncConstructorListener<ModelerDialog>() {
public void asyncConstructorDone(ModelerDialog dialog) {
dialog.addDialogListener(listener);
MessageHandler.getInstance().closeWaitingDialog();
dialog.showDialog(domain);
}
});
}
});
}
use of org.pentaho.agilebi.modeler.services.impl.GwtModelerServiceImpl in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method onModuleLoad.
public void onModuleLoad() {
datasourceServiceManager = new DatasourceServiceManagerGwtImpl();
datasourceServiceManager.isAdmin(new XulServiceCallback<Boolean>() {
public void error(String message, Throwable error) {
}
public void success(Boolean retVal) {
isAdmin = retVal;
datasourceService = new DSWDatasourceServiceGwtImpl();
modelerService = new GwtModelerServiceImpl();
BogoPojo bogo = new BogoPojo();
modelerService.gwtWorkaround(bogo, new XulServiceCallback<BogoPojo>() {
public void success(BogoPojo retVal) {
}
public void error(String message, Throwable error) {
}
});
// only init the app if the user has permissions
// $NON-NLS-1$
final String url = GWT.getHostPageBaseURL() + "plugin/data-access/api/permissions/hasDataAccess";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
builder.setHeader("accept", "application/json");
builder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
try {
builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
setupStandardNativeHooks(GwtDatasourceEditorEntryPoint.this);
initDashboardButtons(false);
}
public void onResponseReceived(Request request, Response response) {
hasPermissions = new Boolean(response.getText());
setupStandardNativeHooks(GwtDatasourceEditorEntryPoint.this);
if (hasPermissions) {
csvService = (ICsvDatasourceServiceAsync) GWT.create(ICsvDatasourceService.class);
setupPrivilegedNativeHooks(GwtDatasourceEditorEntryPoint.this);
loadOverlay("startup.dataaccess");
}
initDashboardButtons(hasPermissions);
}
});
} catch (RequestException e) {
// TODO Auto-generated catch block
}
}
});
XulServiceCallback<List<IDatabaseType>> callback = new XulServiceCallback<List<IDatabaseType>>() {
public void error(String message, Throwable error) {
error.printStackTrace();
}
public void success(List<IDatabaseType> retVal) {
databaseTypeHelper = new DatabaseTypeHelper(retVal);
databaseConnectionConverter = new DatabaseConnectionConverter(databaseTypeHelper);
}
};
dialectService.getDatabaseTypes(callback);
UIDatasourceServiceManager manager = UIDatasourceServiceManager.getInstance();
manager.registerService(new JdbcDatasourceService());
manager.registerService(new MondrianUIDatasourceService(datasourceServiceManager));
manager.registerService(new MetadataUIDatasourceService(datasourceServiceManager));
manager.registerService(new DSWUIDatasourceService(datasourceServiceManager));
manager.getIds(null);
}
Aggregations