Package org.pentaho.aggdes.ui.ext.impl

Examples of org.pentaho.aggdes.ui.ext.impl.MondrianFileSchemaModel


   
    XulFileDialog fc = (XulFileDialog) document.createElement(ELEM_ID_FILEDIALOG);
    fc.setModalParent(((XulDialog)document.getElementById(ELEM_ID_EXPORT_DIALOG)).getRootObject());


    MondrianFileSchemaModel schemaModel = (MondrianFileSchemaModel) connectionModel.getSelectedSchemaModel();

    RETURN_CODE retVal = fc.showSaveDialog(new File(schemaModel.getMondrianSchemaFilename()));

    File selectedFile = null;
    if (retVal == RETURN_CODE.OK) {
      selectedFile = (File) fc.getFile();
      if (logger.isDebugEnabled()) {
        logger.debug("Selected Save file: " + selectedFile.getAbsolutePath());
      }

      StringBuilder data = new StringBuilder();

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

      try {
        data.append(outputService.getFullArtifact(outputs, SchemaGenerator.class));
      } catch (OutputValidationException e1) {
        if (logger.isErrorEnabled()) {
          logger.error("an exception occurred", e1);
        }
        return null;
      }

      try {
        FileUtils.writeStringToFile(selectedFile, data.toString());
        schemaModel.setMondrianSchemaFilename(selectedFile.getCanonicalPath());
        connectionModel.setSchemaUpToDate(true);
        return selectedFile;
      } catch (IOException e) {
        if (logger.isErrorEnabled()) {
          logger.error("an exception occurred", e);
View Full Code Here

TOP

Related Classes of org.pentaho.aggdes.ui.ext.impl.MondrianFileSchemaModel

Copyright © 2018 www.massapicom. 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.