Package org.saiku.olap.util.exception

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


      if (qaxis != null) {
        QueryDimension dim = query.getDimension(dimension);
        if (dim != null) {
          return ObjectUtil.convertDimensionSelection(dim, query);
        } else {
          throw new SaikuOlapException("Cannot find dimension with name:" + dimension);
        }
      } else {
        throw new SaikuOlapException("Cannot find axis with name:" + axis);
      }
    } catch (SaikuOlapException e) {
      throw new SaikuServiceException("Cannot get dimension selections", e);
    }
  }
View Full Code Here


      }

      return null;
    }

    throw new SaikuOlapException("Cannot find connection: (" + name + ")");
  }
View Full Code Here

  @Test(expected = SaikuOlapException.class)
  public SaikuConnection getInvalidDatasource(String nonexistant) throws SaikuOlapException {
    try {
      return olapMetaExplorer.getConnection(nonexistant);
    } catch (SaikuOlapException e) {
      throw new SaikuOlapException("Olap Exception");
    }
  }
View Full Code Here

  @Step
  public SaikuConnection getDatasource(String nonexistant) throws SaikuOlapException {
    try {
      return olapMetaExplorer.getConnection(nonexistant);
    } catch (SaikuOlapException e) {
      throw new SaikuOlapException("Olap Exception");
    }
  }
View Full Code Here

    if ("UNUSED".equals(name)) {
      return getUnusedAxis();
    }
    Standard standardAxis = Standard.valueOf(name);
    if (standardAxis == null) {
      throw new SaikuOlapException("Axis (" + name + ") not found for query (" + query.getName() + ")");
    }

    Axis queryAxis = Axis.Factory.forOrdinal(standardAxis.axisOrdinal());
    return query.getAxis(queryAxis);
  }
View Full Code Here

          }
          Collections.sort(schemas);
          catalogs.add(new SaikuCatalog(cat.getName(), schemas));
        }
      } catch (OlapException e) {
        throw new SaikuOlapException("Error getting objects of connection (" + connectionName + ")", e);
      }
      Collections.sort(catalogs);
      connection = new SaikuConnection(connectionName, catalogs);
      return connection;
    }
    throw new SaikuOlapException("Cannot find connection: (" + connectionName + ")");
  }
View Full Code Here

            }
          }
        }
      }
    } catch (Exception e) {
      throw new SaikuOlapException("Cannot get native cube for ( " + cube + " )", e);
    }
    throw new SaikuOlapException("Cannot get native cube for ( " + cube + " )");
  }
View Full Code Here

      OlapConnection con = connections.getOlapConnection(name);
      if (con != null) {
        return con;
      }
    } catch (Exception e) {
      throw new SaikuOlapException("Cannot get native connection for ( " + name + " )", e);
    }
    return null;
  }
View Full Code Here

    }
    if (h != null) {
      try {
        members = ObjectUtil.convertMembers(h.getRootMembers());
      } catch (OlapException e) {
        throw new SaikuOlapException("Cannot retrieve root members of hierarchy: " + hierarchyName, e);
      }
    }

    return members;
  }
View Full Code Here

              break;
            }
          }
        }
        if (l == null) {
          throw new SaikuOlapException(
              "Cannot find level " + level + " in hierarchy " + hierarchy + " of cube " + cube.getName());
        }
        if (isMondrian(nativeCube)) {
          if (SaikuMondrianHelper.hasAnnotation(l, MondrianDictionary.SQLMEMBERLOOKUP)) {
            if (search) {
              ResultSet rs =
                  SaikuMondrianHelper.getSQLMemberLookup(con, MondrianDictionary.SQLMEMBERLOOKUP, l, searchString);
              simpleMembers = ObjectUtil.convert2simple(rs);
              LOG.debug("Found " + simpleMembers.size() + " members using SQL lookup for level " + level);
              return simpleMembers;
            } else {
              return new ArrayList<SimpleCubeElement>();
            }
          }

        }
        if (search || searchLimit > 0) {
          List<Member> foundMembers = new ArrayList<Member>();
          for (Member m : l.getMembers()) {
            if (search) {
              if (m.getName().toLowerCase().contains(searchString) || m.getCaption().toLowerCase()
                                                                       .contains(searchString)) {
                foundMembers.add(m);
                found++;
              }
            } else {
              foundMembers.add(m);
              found++;
            }
            if (searchLimit > 0 && found >= searchLimit) {
              break;
            }
          }
          simpleMembers = ObjectUtil.convert2Simple(foundMembers);
        } else {
          simpleMembers = ObjectUtil.convert2Simple(l.getMembers());
        }
        return simpleMembers;
      }
    } catch (Exception e) {
      throw new SaikuOlapException("Cannot get all members", e);
    }

    return new ArrayList<SimpleCubeElement>();

  }
View Full Code Here

TOP

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

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.