Package it.eng.spagobi.utilities.exceptions

Examples of it.eng.spagobi.utilities.exceptions.SpagoBIRuntimeException


        boolean datamartExists = false;
        File datamartsDir = QbeEngineConfig.getInstance().getQbeDataMartDir();
        File datamartDir = new File(datamartsDir, datamartName);
        datamartExists = datamartDir.exists() && datamartDir.isDirectory();
        if (!datamartExists) {
          throw new SpagoBIRuntimeException("Datamart " + datamartName + " not found!");
        }
      } finally {
        logger.debug("OUT");
      }
  }
View Full Code Here


        logger.debug("Output dir [" + OUTPUT_FILE_DIR + "] does not exist");
        logger.debug("Creating output dir [" + OUTPUT_FILE_DIR + "] ...");
        if(outputDir.mkdirs()) {
          logger.debug("Output dir [" + OUTPUT_FILE_DIR + "] succesfully created");
        } else {
          throw new SpagoBIRuntimeException("Impossible to create outputd dir [" + OUTPUT_FILE_DIR + "]");
        }
      } else {
        if(!outputDir.isDirectory()) {
          throw new SpagoBIRuntimeException("Outputd dir [" + OUTPUT_FILE_DIR + "] i not a valid directory");
        }
      }
     
      if(outputFile.exists()) {
        logger.debug("Output file [" + outputFile.getName() + "] alredy exists. It wil be overwritten");
      }
     
     
      try {
        out = new BufferedOutputStream(new FileOutputStream(outputFile));
      } catch (FileNotFoundException e) {
        throw new SpagoBIRuntimeException("Impossible to open a byte stream to file [" + outputFile.getName() + "]", e);
      }
      Assert.assertNotNull(out, "Output stream cannot be null");
     
      try {
        out.write(content);
      } catch (IOException e) {
        throw new SpagoBIRuntimeException("Impossible to write on file [" + outputFile.getName() + "]", e);
      }
    } catch(Throwable t) {
      throw new SpagoBIRuntimeException("An unpredicted error occurs while saving document to file [" + outputFile.getName() + "]", t);
    } finally {
      if(out != null) {
        try {
          out.flush();
          out.close();
        } catch (IOException e) {
          throw new SpagoBIRuntimeException("Impossible to properly close file [" + outputFile.getName() + "]", e);
        }
       
      }
      logger.debug("OUT");
    }
View Full Code Here

    }
    logger.debug("OUT: returning " + toReturn);
    if(toReturn.size()>0){
      return toReturn.get(0);
    }else
      throw new SpagoBIRuntimeException("No grant found with id "+grantId);
  }
View Full Code Here

  }

  public void insertOrganizationalUnit(OrganizationalUnit ou) {
    logger.debug("IN: ou = " + ou);
    if (ou.getLabel().contains(Tree.NODES_PATH_SEPARATOR))
      throw new SpagoBIRuntimeException("OrganizationalUnit label cannot contain " + Tree.NODES_PATH_SEPARATOR + " character");
    logger.debug("IN");
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
View Full Code Here

  }
 
  public void modifyOrganizationalUnit(OrganizationalUnit ou) {
    logger.debug("IN: ou = " + ou);
    if (ou.getLabel().contains(Tree.NODES_PATH_SEPARATOR))
      throw new SpagoBIRuntimeException("OrganizationalUnit label cannot contain " + Tree.NODES_PATH_SEPARATOR + " character");
    logger.debug("IN");
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
View Full Code Here

    } else if (typeFilter
        .equalsIgnoreCase(SpagoBIConstants.GREATER_OR_EQUAL_FILTER)) {
      return getSQLValue(fatherPar, firstValue);
    } else {
      logger.error("Filter operator not supported: [" + typeFilter + "]");
      throw new SpagoBIRuntimeException("Filter operator not supported: [" + typeFilter + "]");
    }
  }
View Full Code Here

      String dialect = getDataSourceDialect();
      String toReturn = composeStringToDt(dialect, value);
      return toReturn;
    } else {
      logger.error("Parameter type not supported: [" + parameterType + "]");
      throw new SpagoBIRuntimeException("Parameter type not supported: [" + parameterType + "]");
    }
  }
View Full Code Here

      } else if (databaseDialect.equalsIgnoreCase(DIALECT_POSTGRES)) {
        ALIAS_DELIMITER = "\"";
      } else if (databaseDialect.equalsIgnoreCase(DIALECT_SQLSERVER)) {
        ALIAS_DELIMITER = ""; // TODO check it!!!!
      } else {
        throw new SpagoBIRuntimeException("Cannot determine alias delimiter since the database dialect is not set!!");
      }
    }
  }
View Full Code Here

    } else if (typeFilter
        .equalsIgnoreCase(SpagoBIConstants.GREATER_OR_EQUAL_FILTER)) {
      return ">=";
    } else {
      logger.error("Filter operator not supported: [" + typeFilter + "]");
      throw new SpagoBIRuntimeException("Filter operator not supported: [" + typeFilter + "]");
    }
  }
View Full Code Here

      DateFormat userDataFormat = new SimpleDateFormat(userDateFormatPattern);   
      try{
        operandValueToBoundDate = userDataFormat.parse(operandValueToBound);
      } catch (ParseException e) {
        logger.error("Error parsing the date "+operandValueToBound);
        throw new SpagoBIRuntimeException("Error parsing the date "+operandValueToBound+". Check the format, it should be "+userDateFormatPattern);
      }
     
      boundedValue = composeStringToDt(dbDialect, operandValueToBoundDate);
    }
   
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.exceptions.SpagoBIRuntimeException

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.