Examples of XulDialog


Examples of org.pentaho.ui.xul.containers.XulDialog

    XulDialog dialog = (XulDialog) document.getElementById(ELEM_ID_EXPORT_DIALOG);
    dialog.show();
  }

  public void closeDialog() {
    XulDialog dialog = (XulDialog) document.getElementById(ELEM_ID_EXPORT_DIALOG);
    dialog.hide();
    updateAggDetails();
  }
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

      }
    }
  }

  public void showPreview() throws XulException {
    XulDialog previewDialog = (XulDialog) document.getElementById(ELEM_ID_PREVIEW_DIALOG);

    StringBuilder ddlBuf = new StringBuilder();
    List<UIAggregate> aggList = getEnabledAggs();
    XulTextbox ddlField = (XulTextbox) document.getElementById(ELEM_ID_DDL_FIELD);

    List<Output> outputs = new ArrayList<Output>();
    for (UIAggregate agg : aggList) {
      outputs.add(agg.getOutput());
    }

    if (outputs.size() > 0) {
      try {
        ddlBuf.append(outputService.getFullArtifact(outputs, CreateScriptGenerator.class));
      } catch (OutputValidationException e) {
        e.printStackTrace();
        // TODO mlowery show an error dialog before returning
        return;
      }

      ddlField.setValue(ddlBuf.toString());
    } else {
      ddlField.setValue(EMPTY_STRING);
    }

    StringBuilder dmlBuf = new StringBuilder();
    XulTextbox dmlField = (XulTextbox) document.getElementById(ELEM_ID_DML_FIELD);
    if (document.getElementById("dml_tabpanel") != null) {

      try {
        dmlBuf.append(outputService.getFullArtifact(outputs, PopulateScriptGenerator.class));
      } catch (OutputValidationException e) {
        e.printStackTrace();
        // TODO mlowery show an error dialog before returning
        return;
      }

      dmlField.setValue(dmlBuf.toString());
    }

    StringBuilder schemaBuf = new StringBuilder();
    XulTextbox multiDimSchemaField = (XulTextbox) document.getElementById("multiDimSchemaField");

    if (multiDimSchemaField != null) {
      outputs = new ArrayList<Output>();
      for (UIAggregate agg : aggList) {
        outputs.add(agg.getOutput());
      }

      try {
        schemaBuf.append(outputService.getFullArtifact(outputs, SchemaGenerator.class));
      } catch (OutputValidationException e) {
        e.printStackTrace();
        return;
      }

      multiDimSchemaField.setValue(schemaBuf.toString());
    }
    previewDialog.show();
  }
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

    }
    previewDialog.show();
  }

  public void hideRelationalPreview() {
    XulDialog previewDialog = (XulDialog) document.getElementById(ELEM_ID_PREVIEW_DIALOG);
    previewDialog.hide();
  }
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

  public void startExecuteDdl() {
    if (logger.isDebugEnabled()) {
      logger.debug("enter startExecuteDdlDml");
    }

    XulDialog dialog = (XulDialog) document.getElementById(ELEM_ID_EXEC_PROGRESS_DIALOG);
    Assert.notNull(dialog, "could not find element with id '" + ELEM_ID_EXEC_PROGRESS_DIALOG + "'");

    final ExecutorCallback cb = new ExecutorCallback() {
      public void executionComplete(Exception e) {
        ExportHandler.this.done(e);
        if (ddlExecCallbackService != null && ddlExecCallbackService.getDdlCallbacks() != null) {
            for (DDLExecutionCompleteCallback callback : ddlExecCallbackService.getDdlCallbacks()) {
                callback.executionComplete(getEnabledAggs(), e);
            }
        }
      }
    };

    new Thread() {

      @Override
      public void run() {
        if (logger.isDebugEnabled()) {
          logger.debug("enter run");
        }

        List<String> sqls = ExportHandler.this.getOutput(true, false);

        ExportHandler.this.ddlDmlExecutor.execute(sqls.toArray(new String[0]), cb);

        if (logger.isDebugEnabled()) {
          logger.debug("exit run");
        }

      }

    }.start();

    dialog.show();
    if (logger.isDebugEnabled()) {
      logger.debug("exit startExecuteDdlDml");
    }
  }
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

  public void startExecuteDml() {
    if (logger.isDebugEnabled()) {
      logger.debug("enter startExecuteDdlDml");
    }

    XulDialog dialog = (XulDialog) document.getElementById(ELEM_ID_EXEC_PROGRESS_DIALOG);
    Assert.notNull(dialog, "could not find element with id '" + ELEM_ID_EXEC_PROGRESS_DIALOG + "'");

    final ExecutorCallback cb = new ExecutorCallback() {
      public void executionComplete(Exception e) {
        ExportHandler.this.done(e);
      }
    };

    new Thread() {

      @Override
      public void run() {
        if (logger.isDebugEnabled()) {
          logger.debug("enter run");
        }

        List<String> sqls = ExportHandler.this.getOutput(false, true);

        ExportHandler.this.ddlDmlExecutor.execute(sqls.toArray(new String[0]), cb);

        if (logger.isDebugEnabled()) {
          logger.debug("exit run");
        }

      }

    }.start();

    dialog.show();
    if (logger.isDebugEnabled()) {
      logger.debug("exit startExecuteDdlDml");
    }
  }
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

  public void done(Exception e) {
    if (logger.isDebugEnabled()) {
      logger.debug("enter executeDdlDmlDone");
    }
    XulDialog dialog = (XulDialog) document.getElementById(ELEM_ID_EXEC_PROGRESS_DIALOG);
    Assert.notNull(dialog, "could not find element with id '" + ELEM_ID_EXEC_PROGRESS_DIALOG + "'");

    dialog.hide();

    if (null != e) {
      XulMessageBox msgBox;
      try {
        msgBox = (XulMessageBox) document.createElement(ELEM_ID_MESSAGEBOX);
View Full Code Here

Examples of org.pentaho.ui.xul.containers.XulDialog

  }
 
  public abstract String getMondrianSchemaFilename() throws AggDesignerException;
 
  public boolean doValidation(final String cubeName) {
    final XulDialog dialog = (XulDialog) document.getElementById("validationProgressDialog");
    Assert.notNull(dialog, "could not find element with id '" + "validationProgressDialog" + "'");
    final List<ValidationMessage> validationMessages = new Vector<ValidationMessage>();
    new Thread() {

      @Override
      public void run() {
        try {
          while (dialog.isHidden()) {
            sleep(500);
          }
         
          DatabaseMeta dbMeta = connectionModel.getDatabaseMeta();
          final String mondrianConnectionUrl = MessageFormat.format(
              "Provider={0};Jdbc={1};JdbcUser={2};JdbcPassword={3};Catalog={4};JdbcDrivers={5}", "Mondrian", dbMeta.getURL(), dbMeta
                  .getUsername(), dbMeta.getPassword(), "file:" + getMondrianSchemaFilename(),
                  dbMeta.getDriverClass());
          Map<Parameter, Object> parameterValues = new HashMap<Parameter, Object>();

          parameterValues.put(mondrianSchemaLoader.getParameters().get(0), mondrianConnectionUrl);
          parameterValues.put(mondrianSchemaLoader.getParameters().get(1), cubeName);
         
          StringBuilder validatorClassString = new StringBuilder();
          for (String validatorClass : validatorList) {
            if (validatorClassString.length() > 0) {
              validatorClassString.append(","); //$NON-NLS-1$
            }
            validatorClassString.append(validatorClass);
          }
         
          parameterValues.put(mondrianSchemaLoader.getParameters().get(2), validatorClassString.toString());
          List<ValidationMessage> messages = mondrianSchemaLoader.validateSchema(parameterValues);
          XulDialog dialog = (XulDialog) document.getElementById("validationProgressDialog");
          Assert.notNull(dialog, "could not find element with id '" + "validationProgressDialog" + "'");
          validationMessages.addAll(messages);
          dialog.hide();
         
        } catch (Exception e) {
          if (logger.isErrorEnabled()) {
            logger.error("an exception occurred", e);
          }
          dialog.hide();
        }

      }

    }.start();
    dialog.show();

    // dialog.hide() in validationDone unblocks the above hide
   
    final XulDialog validationDialog1 = (XulDialog) document.getElementById("validationDialog1");
    final XulTextbox textbox = (XulTextbox) document.getElementById("validationMessages");
    textbox.setValue(ValidationHelper.messagesToString(validationMessages));
    validationDialog1.show();
    // reset
    boolean hasErrors = ValidationHelper.hasErrors(validationMessages);
    return hasErrors;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.