use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class MessageHandler method closeSuccessDetailsDialog.
@Bindable
public void closeSuccessDetailsDialog() {
XulDialog detailedSuccessDialog = (XulDialog) document.getElementById("successDetailsDialog");
detailedSuccessDialog.hide();
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class WizardConnectionController method handleDialogAccept.
@Bindable
public void handleDialogAccept() {
// first, test the connection
RequestBuilder testConnectionBuilder = new RequestBuilder(RequestBuilder.PUT, ConnectionController.getServiceURL("test"));
testConnectionBuilder.setHeader("Content-Type", "application/json");
try {
// AutoBean<IDatabaseConnection> bean = AutoBeanUtils.getAutoBean(currentConnection);
AutoBean<IDatabaseConnection> bean = createIDatabaseConnectionBean(currentConnection);
testConnectionBuilder.sendRequest(AutoBeanCodex.encode(bean).getPayload(), new RequestCallback() {
@Override
public void onError(Request request, Throwable exception) {
saveConnectionConfirmationDialog.show();
}
@Override
public void onResponseReceived(Request request, Response response) {
try {
if (response.getStatusCode() == Response.SC_OK) {
// test is ok, now check if we are renaming
renameCheck();
} else {
// confirm if we should continu saving this invalid connection.
saveConnectionConfirmationDialog.show();
}
} catch (Exception e) {
displayErrorMessage(e);
}
}
});
} catch (RequestException e) {
displayErrorMessage(e);
}
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class WizardConnectionController method addConnection.
@Bindable
public void addConnection() {
RequestBuilder addConnectionBuilder = new RequestBuilder(RequestBuilder.POST, ConnectionController.getServiceURL("add"));
addConnectionBuilder.setHeader("Content-Type", "application/json");
try {
// AutoBean<IDatabaseConnection> bean = AutoBeanUtils.getAutoBean(currentConnection);
AutoBean<IDatabaseConnection> bean = createIDatabaseConnectionBean(currentConnection);
addConnectionBuilder.sendRequest(AutoBeanCodex.encode(bean).getPayload(), new RequestCallback() {
@Override
public void onError(Request request, Throwable exception) {
displayErrorMessage(exception);
}
@Override
public void onResponseReceived(Request request, Response response) {
try {
if (response.getStatusCode() == Response.SC_OK) {
IDatabaseConnection conn = AutobeanUtilities.connectionBeanToImpl(currentConnection);
datasourceModel.getGuiStateModel().addConnection(conn);
datasourceModel.setSelectedRelationalConnection(conn);
} else {
openErrorDialog(MessageHandler.getString("ERROR"), // $NON-NLS-1$
MessageHandler.getString(// $NON-NLS-1$
"ConnectionController.ERROR_0001_UNABLE_TO_ADD_CONNECTION"));
}
} catch (Exception e) {
displayErrorMessage(e);
}
}
});
} catch (RequestException e) {
displayErrorMessage(e);
}
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class WizardConnectionController method showEditConnectionDialog.
@Bindable
public void showEditConnectionDialog() {
datasourceModel.setEditing(true);
if (databaseDialog != null) {
IDatabaseConnection connection = datasourceModel.getSelectedRelationalConnection();
previousConnectionName = connection.getName();
existingConnectionName = previousConnectionName;
DatabaseConnection editConnection = new DatabaseConnection();
copyDatabaseConnectionProperties(connection, editConnection);
databaseDialog.setDatabaseConnection(editConnection);
databaseDialog.show();
} else {
databaseDialog = new GwtDatabaseDialog(databaseTypeHelper, GWT.getModuleBaseURL() + "dataaccess-databasedialog.xul", // $NON-NLS-1$
connectionSetter);
}
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class WizardConnectionController method toggleDetails.
@Bindable
public void toggleDetails() {
// $NON-NLS-1$
XulHbox details = (XulHbox) document.getElementById("details_hider");
details.setVisible(!details.isVisible());
}
Aggregations