Search in sources :

Example 51 with Bindable

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);
}
Also used : ArrayList(java.util.ArrayList) IDatabaseConnection(org.pentaho.database.model.IDatabaseConnection) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 52 with Bindable

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();
}
Also used : XulException(org.pentaho.ui.xul.XulException) XulConfirmBox(org.pentaho.ui.xul.components.XulConfirmBox) XulComponent(org.pentaho.ui.xul.XulComponent) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 53 with Bindable

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"));
        }
    });
}
Also used : ModelerException(org.pentaho.agilebi.modeler.ModelerException) LogicalModel(org.pentaho.metadata.model.LogicalModel) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 54 with Bindable

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);
}
Also used : IDatasourceInfo(org.pentaho.platform.dataaccess.datasource.IDatasourceInfo) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 55 with Bindable

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;
    }
}
Also used : LogicalModelSummary(org.pentaho.platform.dataaccess.datasource.beans.LogicalModelSummary) List(java.util.List) Domain(org.pentaho.metadata.model.Domain) IDatasourceInfo(org.pentaho.platform.dataaccess.datasource.IDatasourceInfo) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Aggregations

Bindable (org.pentaho.ui.xul.stereotype.Bindable)71 Request (com.google.gwt.http.client.Request)15 RequestBuilder (com.google.gwt.http.client.RequestBuilder)15 RequestCallback (com.google.gwt.http.client.RequestCallback)15 RequestException (com.google.gwt.http.client.RequestException)15 Response (com.google.gwt.http.client.Response)15 IDatabaseConnection (org.pentaho.database.model.IDatabaseConnection)15 ArrayList (java.util.ArrayList)10 List (java.util.List)7 OpenFileCommand (org.pentaho.mantle.client.commands.OpenFileCommand)5 IDatasourceInfo (org.pentaho.platform.dataaccess.datasource.IDatasourceInfo)5 XulHbox (org.pentaho.ui.xul.containers.XulHbox)4 SaveCommand (org.pentaho.mantle.client.commands.SaveCommand)3 XulComponent (org.pentaho.ui.xul.XulComponent)3 XulException (org.pentaho.ui.xul.XulException)3 XulLabel (org.pentaho.ui.xul.components.XulLabel)3 IDatabaseType (org.pentaho.database.model.IDatabaseType)2 DatabaseTypeHelper (org.pentaho.database.util.DatabaseTypeHelper)2 FilePropertiesCommand (org.pentaho.mantle.client.commands.FilePropertiesCommand)2 NewDropdownCommand (org.pentaho.mantle.client.commands.NewDropdownCommand)2