Package org.saiku.olap.util.exception

Examples of org.saiku.olap.util.exception.QueryParseException


    if (queryElement != null && queryElement.getName().equals(QUERY)) {

      String cubeName = queryElement.getAttributeValue(CUBE);

      if (!StringUtils.isNotBlank(cubeName)) {
        throw new QueryParseException("Cube for query not defined");
      }
      String connectionName = queryElement.getAttributeValue(CONNECTION);
      String catalogName = queryElement.getAttributeValue(CATALOG);
      String schemaName = queryElement.getAttributeValue(SCHEMA);
      Query tmpQuery = createEmptyQuery("tmp-1234", catalogName, schemaName, cubeName);
View Full Code Here


      String queryName = queryElement.getAttributeValue("name");
      String cubeName = queryElement.getAttributeValue(CUBE);

      if (!StringUtils.isNotBlank(cubeName)) {
        throw new QueryParseException("Cube for query not defined");
      }
      String connectionName = queryElement.getAttributeValue(CONNECTION);
      String catalogName = queryElement.getAttributeValue(CATALOG);
      String schemaName = queryElement.getAttributeValue(SCHEMA);

      try {
        Element qmElement = queryElement.getChild("QueryModel");
        if (qmElement != null) {
          qm = createEmptyQuery(queryName, catalogName, schemaName, cubeName);
          manipulateQuery(qmElement);
          SaikuCube cube =
              new SaikuCube(connectionName, cubeName, qm.getCube().getName(), qm.getCube().getCaption(), catalogName,
                  schemaName);
          IQuery q = new OlapQuery(qm, connection, cube, false);
          setTotals(q, queryElement);
          Properties p = getProperties(queryElement);
          q.setProperties(p);
          return q;
        } else {
          throw new OlapException("Can't find child <QueryModel>");
        }

      } catch (OlapException e) {
        throw new QueryParseException(e.getMessage(), e);
      }


    } else {
      throw new QueryParseException(
          "Cannot parse Query Model: Query node not found and/or more than 1 Query node found");
    }
  }
View Full Code Here

        } else {
          throw new OlapException("Can't find child <MDX>");
        }

      } catch (OlapException e) {
        throw new QueryParseException(e.getMessage(), e);
      }


    } else {
      throw new QueryParseException(
          "Cannot parse Query Model: Query node not found and/or more than 1 Query node found");
    }
  }
View Full Code Here

  }

  @NotNull
  public String createXML() throws QueryParseException {
    if (this.query == null) {
      throw new QueryParseException("Query object can not be null");
    }

    try {
      createDocument();
      createDOMTree();

      XMLOutputter serializer = new XMLOutputter();
      Format format = Format.getPrettyFormat();
      StringWriter st = new StringWriter();
      serializer.setFormat(format);
      serializer.output(dom, st);

      return st.getBuffer().toString();

    } catch (Exception e) {
      throw new QueryParseException(e.getMessage(), e);
    }

  }
View Full Code Here

TOP

Related Classes of org.saiku.olap.util.exception.QueryParseException

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.