Package org.pentaho.aggdes

Examples of org.pentaho.aggdes.AggDesignerException


          if (c == -1) {
            String versionInfo = writer.toString();
            XStream xstream = new XStream(new DomDriver());
            String serializationVersion = (String)xstream.fromXML(versionInfo);
            if (!serializationVersion.equals(SERIALIZATION_VERSION)) {
              throw new AggDesignerException(Messages.getString("SerializationService.UnrecognizedVersion", SERIALIZATION_VERSION, serializationVersion));
            }
            c++;
          } else {
            xmlElements[c++] = writer.toString();
          }
        }
      }
      return xmlElements;
    } catch (IOException e) {
      e.printStackTrace();
     // replace with aggdes exception
      throw new RuntimeException("Failed to parse Workspace");
    } catch (Exception e) {
      if (e instanceof AggDesignerException) {
        AggDesignerException ex = (AggDesignerException)e;
        throw ex;
      } else {
        e.printStackTrace();
        throw new RuntimeException("Failed to parse Workspace");
      }
View Full Code Here


  public void connect() {

    final XulDialog waitDialog = (XulDialog) document.getElementById(ANON_WAIT_DIALOG);
    try {
      if (selectedSchemaProvider == null) {
        throw new AggDesignerException(Messages.getString("select_olap_model"));
      }

      workspace.setApplicationUnlocked(false);

      new Thread() {
        @Override
        public void run() {
          try {
            while (waitDialog.isHidden()) {
              Thread.sleep(300);
            }
            ConnectionController.this.schema = selectedSchemaProvider.loadSchema(connectionModel.getCubeName());
          } catch (Exception e) {
            //consume, schema will be null which is checked outside of this thread
            logger.error("Error loading schema: ", e);
          } finally {
            waitDialog.hide();
          }
        }
      }.start();

      waitDialog.show();
      if (schema == null) {
        throw new AggDesignerException("Error loading Schema");
      }
      connectionModel.setSchema(schema);
      outputService.init(schema);
      connectionModel.setSchemaUpToDate(true);
View Full Code Here

        logger.debug("apply is running in separate thread");
        try {
          setSelectedSchemaProvider();
          if (selectedSchemaProvider == null) {
            throw new AggDesignerException(Messages.getString("select_olap_model"));
          }
          cubeNames = selectedSchemaProvider.getCubeNames();

        } catch (AggDesignerException e) {
          logger.error("Error loading OLAP schema", e);
View Full Code Here

      parameterValues.put(mondrianSchemaLoader.getParameters().get(1), cubeName);

      Schema newSchema = mondrianSchemaLoader.createSchema(parameterValues);
      return newSchema;
    } catch(KettleDatabaseException e){
      throw new AggDesignerException("Error loading Schema from Mondrian file",e);
    }
  }
View Full Code Here

      cubeNames = new ArrayList<String>();
      cubeNames.add(Messages.getString("select_cube"));
     
      String fileName = getMondrianSchemaFilename();
      if(StringUtils.isEmpty(fileName)){
        throw new AggDesignerException(Messages.getString("mondrian_file_null"));
      }
     
      File mondrianSchema = new File(getMondrianSchemaFilename());
      if (mondrianSchema != null && mondrianSchema.exists() && mondrianSchema.isFile()) {
        FileReader schemaReader = new FileReader(mondrianSchema);
        final DOMWrapper def = xmlParser.parse(schemaReader);
        MondrianDef.Schema tSchema = new MondrianDef.Schema(def);

        for (MondrianDef.Cube cube : tSchema.cubes) {
          logger.debug("cube: " + cube.name);
          cubeNames.add(cube.name);
        }
        connectionModel.setSchemaName(tSchema.name);
      } else {
        throw new AggDesignerException("Error loading Mondrian Schema.");
      }
    } catch (FileNotFoundException e) {
      throw new AggDesignerException("Schema source not found.", e);
    } catch (XOMException e) {
      throw new AggDesignerException("Error parsing schema source.", e);
    }
    return cubeNames;
  }
View Full Code Here

        setMondrianSchemaFilename(((File)fc.getFile()).getAbsolutePath());
       
      }
    } catch (Exception e) {
      logger.error("Error showing file chooser", e);
      throw new AggDesignerException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.aggdes.AggDesignerException

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.