Search in sources :

Example 56 with Bindable

use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.

the class DatasourceAdminDialogController method launchNewUI.

@Bindable
public void launchNewUI(String datasourceType) {
    IUIDatasourceAdminService service = manager.getService(datasourceType);
    String newUI = service.getNewUI();
    if (newUI != null && newUI.length() > 0) {
        if (newUI.indexOf("builtin:") >= 0) {
            if (service.getType().equals(JdbcDatasourceService.TYPE)) {
                entryPoint.showDatabaseDialog(adminDatasourceListener);
            } else if (service.getType().equals(MondrianUIDatasourceService.TYPE)) {
                entryPoint.showAnalysisImportDialog(adminDatasourceListener);
            } else if (service.getType().equals(MetadataUIDatasourceService.TYPE)) {
                entryPoint.showMetadataImportDialog(adminDatasourceListener);
            } else if (service.getType().equals(DSWUIDatasourceService.TYPE)) {
                entryPoint.showWizard(true, adminDatasourceListener);
            }
        } else if (newUI.indexOf("javascript:") >= 0) {
            String script = newUI.substring(newUI.indexOf(":") + 1);
            executeJavaScript(script);
        }
    }
}
Also used : IUIDatasourceAdminService(org.pentaho.platform.dataaccess.datasource.ui.service.IUIDatasourceAdminService) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 57 with Bindable

use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.

the class DatasourceAdminDialogController method remove.

@Bindable
public void remove() {
    IDatasourceInfo dsInfo = datasourceAdminDialogModel.getSelectedDatasource();
    if (dsInfo == null) {
        showErrorDialog("datasourceAdminErrorDialog.SELECT_DATASOURCE", "datasourceAdminErrorDialog.SELECT_DATASOURCE_DELETE");
        return;
    }
    if (messageBundle != null) {
        XulLabel removeDatasourceConfirmationDialogLabel = (XulLabel) removeDatasourceConfirmationDialog.getElementById("removeDatasourceConfirmationDialogLabel");
        removeDatasourceConfirmationDialogLabel.setValue(messageBundle.getString(REMOVE_DS_MSG_ID, dsInfo.getName()));
    }
    removeDatasourceConfirmationDialog.show();
}
Also used : XulLabel(org.pentaho.ui.xul.components.XulLabel) IDatasourceInfo(org.pentaho.platform.dataaccess.datasource.IDatasourceInfo) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 58 with Bindable

use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.

the class DatasourceAdminDialogController method removeDatasourceAccept.

@Bindable
public void removeDatasourceAccept() {
    final IDatasourceInfo dsInfo = datasourceAdminDialogModel.getSelectedDatasource();
    manager.remove(dsInfo, new XulServiceCallback<Boolean>() {

        @Override
        public void success(Boolean isOk) {
            if (isOk) {
                refreshDatasourceList();
                editDatasourceMenuItem.setDisabled(true);
            } else {
                Window.alert(messageBundle.getString("datasourceAdminDialogController.COULD_NOT_REMOVE") + ": " + dsInfo.getId());
            }
        }

        @Override
        public void error(String message, Throwable error) {
            Window.alert(messageBundle.getString("datasourceAdminDialogController.ERROR_REMOVING") + ": " + dsInfo.getId() + "." + messageBundle.getString("ERROR") + "=" + error.getLocalizedMessage());
        }
    });
    removeDatasourceConfirmationDialog.hide();
}
Also used : IDatasourceInfo(org.pentaho.platform.dataaccess.datasource.IDatasourceInfo) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 59 with Bindable

use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.

the class StageDataStep method deselectAll.

@Bindable
public void deselectAll() {
    // $NON-NLS-1$
    XulTree tree = (XulTree) document.getElementById("csvModelDataTable");
    for (XulComponent component : tree.getRootChildren().getChildNodes()) {
        XulTreeItem item = (XulTreeItem) component;
        for (XulComponent childComp : item.getChildNodes()) {
            XulTreeRow row = (XulTreeRow) childComp;
            XulTreeCell cell = row.getCell(0);
            cell.setValue(false);
        }
    }
    datasourceModel.getModelInfo().validate();
}
Also used : XulTreeItem(org.pentaho.ui.xul.containers.XulTreeItem) XulTreeCell(org.pentaho.ui.xul.components.XulTreeCell) XulTree(org.pentaho.ui.xul.containers.XulTree) XulTreeRow(org.pentaho.ui.xul.containers.XulTreeRow) XulComponent(org.pentaho.ui.xul.XulComponent) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 60 with Bindable

use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.

the class StageDataStep method selectAll.

@Bindable
public void selectAll() {
    // $NON-NLS-1$
    XulTree tree = (XulTree) document.getElementById("csvModelDataTable");
    for (XulComponent component : tree.getRootChildren().getChildNodes()) {
        XulTreeItem item = (XulTreeItem) component;
        for (XulComponent childComp : item.getChildNodes()) {
            XulTreeRow row = (XulTreeRow) childComp;
            XulTreeCell cell = row.getCell(0);
            cell.setValue(true);
        }
    }
    datasourceModel.getModelInfo().validate();
}
Also used : XulTreeItem(org.pentaho.ui.xul.containers.XulTreeItem) XulTreeCell(org.pentaho.ui.xul.components.XulTreeCell) XulTree(org.pentaho.ui.xul.containers.XulTree) XulTreeRow(org.pentaho.ui.xul.containers.XulTreeRow) XulComponent(org.pentaho.ui.xul.XulComponent) 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