示例#1
0
  @Override
  public DataFactory getDataFactory()
      throws UnknownConnectionException, InvalidConnectionException {

    logger.debug("Creating BandedMDXDataFactory");

    final MondrianConnection connection =
        (MondrianConnection) getCdaSettings().getConnection(getConnectionId());
    final MondrianConnectionInfo mondrianConnectionInfo = connection.getConnectionInfo();

    final AbstractNamedMDXDataFactory mdxDataFactory = createDataFactory();
    IDataAccessUtils dataAccessUtils = CdaEngine.getEnvironment().getDataAccessUtils();
    dataAccessUtils.setMdxDataFactoryBaseConnectionProperties(connection, mdxDataFactory);

    mdxDataFactory.setDataSourceProvider(connection.getInitializedDataSourceProvider());
    mdxDataFactory.setJdbcPassword(mondrianConnectionInfo.getPass());
    mdxDataFactory.setJdbcUser(mondrianConnectionInfo.getUser());
    mdxDataFactory.setRole(mondrianConnectionInfo.getMondrianRole());
    mdxDataFactory.setRoleField(mondrianConnectionInfo.getRoleField());
    mdxDataFactory.setJdbcPasswordField(mondrianConnectionInfo.getPasswordField());
    mdxDataFactory.setJdbcUserField(mondrianConnectionInfo.getUserField());

    ICubeFileProviderSetter cubeFileProviderSetter =
        CdaEngine.getEnvironment().getCubeFileProviderSetter();
    cubeFileProviderSetter.setCubeFileProvider(mdxDataFactory, mondrianConnectionInfo.getCatalog());

    // using deprecated method for 3.10 support
    mdxDataFactory.setQuery("query", getQuery());

    return mdxDataFactory;
  }
示例#2
0
  @Override
  public DataFactory getDataFactory()
      throws UnknownConnectionException, InvalidConnectionException {

    logger.debug("Creating BandedMDXDataFactory");

    final MondrianConnection connection =
        (MondrianConnection) getCdaSettings().getConnection(getConnectionId());
    final MondrianConnectionInfo mondrianConnectionInfo = connection.getConnectionInfo();

    final AbstractNamedMDXDataFactory mdxDataFactory = createDataFactory();
    mdxDataFactory.setDataSourceProvider(connection.getInitializedDataSourceProvider());
    mdxDataFactory.setJdbcPassword(mondrianConnectionInfo.getPass());
    mdxDataFactory.setJdbcUser(mondrianConnectionInfo.getUser());
    mdxDataFactory.setRole(mondrianConnectionInfo.getMondrianRole());
    mdxDataFactory.setRoleField(mondrianConnectionInfo.getRoleField());
    mdxDataFactory.setJdbcPasswordField(mondrianConnectionInfo.getPasswordField());
    mdxDataFactory.setJdbcUserField(mondrianConnectionInfo.getUserField());

    if (CdaEngine.getInstance().isStandalone()) {
      mdxDataFactory.setCubeFileProvider(
          new DefaultCubeFileProvider(mondrianConnectionInfo.getCatalog()));
    } else {
      mdxDataFactory.setCubeFileProvider(
          new PentahoCubeFileProvider(mondrianConnectionInfo.getCatalog()));
      try {
        mdxDataFactory.setMondrianConnectionProvider(
            (MondrianConnectionProvider)
                PentahoSystem.getObjectFactory()
                    .get(
                        PentahoMondrianConnectionProvider.class,
                        "MondrianConnectionProvider",
                        null));
      } catch (ObjectFactoryException e) { // couldn't get object
        mdxDataFactory.setMondrianConnectionProvider(new PentahoMondrianConnectionProvider());
      }
    }

    // using deprecated method for 3.10 support
    mdxDataFactory.setQuery("query", getQuery());

    return mdxDataFactory;
  }