Package org.saiku.service.util.exception

Examples of org.saiku.service.util.exception.SaikuServiceException


      } else if (StringUtils.isNotBlank(file)) {
        Response f = repository.getResource(file);
        filecontent = new String((byte[]) f.getEntity());
      }
      if (StringUtils.isBlank(filecontent)) {
        throw new SaikuServiceException(
            "Cannot create new query. Empty file content " + StringUtils.isNotBlank(json) + " or read from file:"
            + file);
      }
      if (thinQueryService.isOldQuery(filecontent)) {
        tq = thinQueryService.convertQuery(filecontent);
      } else {
        ObjectMapper om = new ObjectMapper();
        tq = om.readValue(filecontent, ThinQuery.class);
      }

      if (LOG.isDebugEnabled()) {
        LOG.debug("TRACK\t" + "\t/query/" + queryName + "\tPOST\t tq:" + (tq == null) + " file:" + file);
      }

      if (tq == null) {
        throw new SaikuServiceException("Cannot create blank query (ThinQuery object = null)");
      }
      tq.setName(queryName);

      //SaikuCube cube = tq.getCube();
      //if (StringUtils.isNotBlank(xml)) {
View Full Code Here


        Connection con = null;
        try {
          statement = rs.getStatement();
          con = rs.getStatement().getConnection();
        } catch (Exception e) {
          throw new SaikuServiceException(e);
        } finally {
          try {
            rs.close();
            if (statement != null) {
              statement.close();
View Full Code Here

        try {
          Statement statement = rs.getStatement();
          statement.close();
          rs.close();
        } catch (SQLException e) {
          throw new SaikuServiceException(e);
        } finally {
          rs = null;
        }
      }
    }
View Full Code Here

      return datasourceService.getResourceACL(file, username, roles);

    } catch (Exception e) {
      LOG.error("Error retrieving ACL for file: " + file, e);
    }
    throw new SaikuServiceException("You dont have permission to retrieve ACL for file: " + file);


  }
View Full Code Here

  public byte[] pdf(QueryResult qr, String svg) throws Exception {

    int resultWidth =
        qr != null && qr.getCellset() != null && qr.getCellset().size() > 0 ? qr.getCellset().get(0).length : 0;
    if (resultWidth == 0) {
      throw new SaikuServiceException("Cannot convert empty result to PDF");
    }
    Rectangle size = PageSize.A4.rotate();
    if (resultWidth > 8) {
      size = PageSize.A3.rotate();
    }
View Full Code Here

        }
        sb.append(row + members + "\r\n");
      }
      return sb.toString().getBytes("UTF-8");
    } catch (Throwable e) {
      throw new SaikuServiceException("Error creating csv export for filters"); //$NON-NLS-1$
    }
  }
View Full Code Here

    ByteArrayOutputStream bout = new ByteArrayOutputStream();

    try {
      excelWorkbook.write(bout);
    } catch (IOException e) {
      throw new SaikuServiceException("Error creating excel export for query", e);
    }
    return bout.toByteArray();
  }
View Full Code Here

        }
        output = buf.toString();
        return output.getBytes(SaikuProperties.WEBEXPORTCSVTEXTENCODING); //$NON-NLS-1$
      }
    } catch (Throwable e) {
      throw new SaikuServiceException("Error creating csv export for query"); //$NON-NLS-1$
    }
    return new byte[0];
  }
View Full Code Here

      }
      IBasicFile bf = access.fetchFile(file);

      String doc = IOUtils.toString(bf.getContents());
      if (doc == null) {
        throw new SaikuServiceException("Error retrieving saiku document from solution repository: " + file);
      }
      return Response.ok(doc.getBytes("UTF-8"), MediaType.TEXT_PLAIN).header(
          "content-length",doc.getBytes("UTF-8").length).build();

    }
View Full Code Here

      IUserContentAccess access = contentAccessFactory.getUserContentAccess(null);

      boolean ok = access.saveFile(file, IOUtils.toInputStream(content));
      if (!ok) {
        throw new SaikuServiceException("Failed to write file: " + file);
      }
      return Response.ok().build();
    }
    catch(Exception e){
      log.error("Cannot save file (" + file + ")",e);
View Full Code Here

TOP

Related Classes of org.saiku.service.util.exception.SaikuServiceException

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.