Package org.saiku.olap.query

Examples of org.saiku.olap.query.IQuery


    }
  }


  public void resetQuery(String queryName) {
    IQuery query = getIQuery(queryName);
    query.resetQuery();
  }
View Full Code Here


    IQuery query = getIQuery(queryName);
    query.resetQuery();
  }

  public void setNonEmpty(String queryName, String axisName, boolean bool) {
    IQuery query = getIQuery(queryName);
    QueryAxis newAxis = query.getAxis(Axis.Standard.valueOf(axisName));
    newAxis.setNonEmpty(bool);
  }
View Full Code Here

    QueryAxis newAxis = query.getAxis(Axis.Standard.valueOf(axisName));
    newAxis.setNonEmpty(bool);
  }

  public Properties setProperties(String queryName, Properties props) {
    IQuery query = getIQuery(queryName);
    query.setProperties(props);
    return getProperties(queryName);
  }
View Full Code Here

    return getProperties(queryName);
  }


  public Properties getProperties(String queryName) {
    IQuery query = getIQuery(queryName);
    Properties props = query.getProperties();
    return props;
  }
View Full Code Here

  public String getMDXQuery(String queryName) {
    return getIQuery(queryName).getMdx();
  }

  public String getQueryXml(String queryName) {
    IQuery query = getIQuery(queryName);
    return query.toXml();
  }
View Full Code Here

    return getExport(queryName, type, new FlattenedCellSetFormatter());
  }

  byte[] getExport(String queryName, @Nullable String type, ICellSetFormatter formatter) {
    if (type != null) {
      IQuery query = getIQuery(queryName);
      CellSet rs = query.getCellset();
      List<SaikuDimensionSelection> filters = new ArrayList<SaikuDimensionSelection>();

      if (query.getType().equals(QueryType.QM)) {
        filters = getAxisSelection(queryName, "FILTER");
      }
      if (type.toLowerCase().equals("xls")) {
        // TODO - added null parameter for filters - not used anymore
        return ExcelExporter.exportExcel(rs, formatter, null);
View Full Code Here

    }
    return new byte[0];
  }

  public void qm2mdx(String queryName) {
    IQuery query = getIQuery(queryName);
    OlapConnection con = olapDiscoverService.getNativeConnection(query.getSaikuCube().getConnection());
    MdxQuery mdx = new MdxQuery(con, query.getSaikuCube(), query.getName(), getMDXQuery(queryName));
    putIQuery(queryName, mdx);
    query = null;
  }
View Full Code Here

    try {
      Cube cub = olapDiscoverService.getNativeCube(cube);
      OlapConnection con = olapDiscoverService.getNativeConnection(cube.getConnection());

      if (cub != null) {
        IQuery query = new OlapQuery(new Query(queryName, cub), con, cube);
        putIQuery(queryName, query);
        return ObjectUtil.convert(query);
      }
    } catch (Exception e) {
      LOG.error("Cannot create new query for cube :" + cube, e);
View Full Code Here

  public SaikuQuery createNewOlapQuery(@Nullable String name, @NotNull String xml) {
    try {
      QueryDeserializer qd = new QueryDeserializer();
      SaikuCube scube = qd.getFakeCube(xml);
      OlapConnection con = olapDiscoverService.getNativeConnection(scube.getConnection());
      IQuery query = qd.unparse(xml, con);
      // TODO - this is not good! could lead to duplicate queries
      if (name == null) {
        name = UUID.randomUUID().toString();
        putIQuery(name, query);
      } else {
View Full Code Here

  }


  void closeQuery(String queryName) {
    try {
      IQuery q = getIQuery(queryName);
      q.cancel();
      removeIQuery(queryName);
    } catch (Exception e) {
      throw new SaikuServiceException("Error closing query: " + queryName, e);
    }
  }
View Full Code Here

TOP

Related Classes of org.saiku.olap.query.IQuery

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.