use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class AnalysisImportDialogController method setRelationalConnections.
@Bindable
public void setRelationalConnections(List<IDatabaseConnection> connections) {
List<String> names = new ArrayList<String>();
for (IDatabaseConnection conn : connections) {
names.add(conn.getName());
}
firePropertyChange("connectionNames", null, names);
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class AnalysisImportDialogController method overwriteFileDialog.
@Bindable
public void overwriteFileDialog(int code) {
if (code != PUBLISH_SCHEMA_CATALOG_EXISTS_ERROR && code != PUBLISH_SCHEMA_EXISTS_ERROR) {
return;
}
String msg = messages.getString("Mondrian.OVERWRITE_EXISTING_SCHEMA");
if (PUBLISH_SCHEMA_CATALOG_EXISTS_ERROR == code) {
msg = messages.getString("Mondrian.OVERWRITE_EXISTING_CATALOG");
}
XulConfirmBox confirm = null;
try {
confirm = (XulConfirmBox) document.createElement("confirmbox");
} catch (XulException e) {
Window.alert(e.getMessage());
}
confirm.setTitle("Confirmation");
confirm.setMessage(msg);
confirm.setAcceptLabel("Ok");
confirm.setCancelLabel("Cancel");
confirm.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (status == XulDialogCallback.Status.ACCEPT) {
overwrite = true;
removeHiddenPanels();
buildAndSetParameters();
formPanel.submit();
}
}
public void onError(XulComponent component, Throwable err) {
return;
}
});
confirm.open();
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class ModelerDialog method onAccept.
@Bindable
public void onAccept() {
enableWaitCursor(true);
try {
model.getWorkspaceHelper().populateDomain(model);
} catch (ModelerException e) {
e.printStackTrace();
showErrorDialog(messages.getString("ModelEditor.ERROR"), messages.getString("ModelEditor.ERROR_0001_SAVING_MODELS"));
}
boolean doOlap = true;
LogicalModel lModel = model.getLogicalModel(ModelerPerspective.ANALYSIS);
if (lModel == null) {
lModel = model.getLogicalModel(ModelerPerspective.REPORTING);
}
if (lModel.getProperty("MondrianCatalogRef") == null && (lModel.getProperty("DUAL_MODELING_SCHEMA") == null || "false".equals(lModel.getProperty("DUAL_MODELING_SCHEMA")))) {
doOlap = false;
}
service.serializeModels(model.getDomain(), model.getModelName(), doOlap, new XulServiceCallback<String>() {
public void success(String retVal) {
enableWaitCursor(false);
hideDialog();
model.getDomain().setId(retVal);
ModelerDialog.this.listener.onDialogAccept(model.getDomain());
}
public void error(String message, Throwable error) {
enableWaitCursor(false);
showErrorDialog(messages.getString("ModelEditor.ERROR"), messages.getString("ModelEditor.ERROR_0001_SAVING_MODELS"));
}
});
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class DatasourceAdminDialogController method export.
@Bindable
public void export() {
IDatasourceInfo dsInfo = datasourceAdminDialogModel.getSelectedDatasource();
if (dsInfo == null) {
showErrorDialog("datasourceAdminErrorDialog.SELECT_DATASOURCE", "datasourceAdminErrorDialog.SELECT_DATASOURCE_EXPORT");
return;
}
if (JdbcDatasourceService.TYPE.equals(dsInfo.getType())) {
showErrorDialog("datasourceAdminErrorDialog.CANNOT_EXPORT_HEADER", "datasourceAdminErrorDialog.CANNOT_EXPORT_TEXT");
return;
}
manager.exportDatasource(dsInfo);
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class DatasourceAdminDialogController method edit.
@Bindable
public void edit() {
IDatasourceInfo dsInfo = datasourceAdminDialogModel.getSelectedDatasource();
if (dsInfo == null) {
showErrorDialog("datasourceAdminErrorDialog.SELECT_DATASOURCE", "datasourceAdminErrorDialog.SELECT_DATASOURCE_EDIT");
return;
}
String type = dsInfo.getType();
final String dsId = dsInfo.getId();
if (DSWUIDatasourceService.TYPE.equals(type)) {
dswService.getLogicalModels(dsId, new XulServiceCallback<List<LogicalModelSummary>>() {
@Override
public void success(List<LogicalModelSummary> retVal) {
for (LogicalModelSummary logicalModelSummary : retVal) {
if (!dsId.equals(logicalModelSummary.getDomainId())) {
continue;
}
entryPoint.showWizardEdit(logicalModelSummary.getDomainId(), logicalModelSummary.getModelId(), false, new DialogListener<Domain>() {
@Override
public void onDialogAccept(Domain returnValue) {
// TODO Auto-generated method stub
}
@Override
public void onDialogCancel() {
// TODO Auto-generated method stub
}
@Override
public void onDialogReady() {
// TODO Auto-generated method stub
}
@Override
public void onDialogError(String errorMessage) {
// TODO Auto-generated method stub
}
});
}
}
@Override
public void error(String message, Throwable error) {
// TODO Auto-generated method stub
}
});
} else if (JdbcDatasourceService.TYPE.equals(type)) {
entryPoint.showEditDatabaseDialog(adminDatasourceListener, dsId);
} else if (MondrianUIDatasourceService.TYPE.equals(type)) {
IDatasourceInfo datasourceInfo = datasourceAdminDialogModel.getSelectedDatasource();
entryPoint.showEditAnalysisDialog(adminDatasourceListener, datasourceInfo);
} else if (MetadataUIDatasourceService.TYPE.equals(type)) {
showErrorDialog("datasourceAdminErrorDialog.CANNOT_EDIT_HEADER", "datasourceAdminErrorDialog.CANNOT_EDIT_TEXT");
return;
}
}
Aggregations