Package it.eng.spagobi.utilities.engines

Examples of it.eng.spagobi.utilities.engines.SpagoBIEngineServiceException


      String fileName = SpagoBIUtilities.getRelativeFileNames(uploaded.getName());
      File imagesDir = QbeEngineConfig.getInstance().getWorksheetImagesDir();
      File saveTo = new File(imagesDir, fileName);
      uploaded.write(saveTo);
    } catch (Throwable t) {
      throw new SpagoBIEngineServiceException(getActionName(), "Error while saving file into server", t);
    } finally {
      logger.debug("OUT");
    }
  }
View Full Code Here


        Assert.assertUnreachable("Value [" + queryScope + "] is not valid for the input parameter " + QbeEngineStaticVariables.CATALOGUE_SCOPE);
      }
     
      String result = saveAnalysisState();
      if(!result.trim().toLowerCase().startsWith("ok")) {
        throw new SpagoBIEngineServiceException(getActionName(), result);
      }
     
      try {
        String newSubobjectId = result.substring(5);
        JSONSuccess success = new JSONSuccess(newSubobjectId);
        writeBackToClient( success );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
View Full Code Here

      Collection errors = errorHandler.getErrors();
      Iterator it = errors.iterator();
      while (it.hasNext()) {
        EMFAbstractError error = (EMFAbstractError) it.next();
        if (error.getSeverity().equals(EMFErrorSeverity.ERROR)) {
          throw new SpagoBIEngineServiceException(getActionName(), error.getMessage(), null);
        }
      }
    }
  }
View Full Code Here

     
      try {
        writeBackToClient( new JSONSuccess(queryJSON) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
      logger.debug("OUT");
View Full Code Here

     
      try {
        writeBackToClient( new JSONSuccess(gridDataFeed) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      errorHitsMonitor = MonitorFactory.start("QbeEngine.errorHits");
      errorHitsMonitor.stop();
View Full Code Here

     
      dataStore = dataSet.getDataStore();
      Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
    } catch (Exception e) {
      logger.debug("Query execution aborted because of an internal exceptian");
      SpagoBIEngineServiceException exception;
      String message;
     
      message = "An error occurred in " + getActionName() + " service while executing query: [" +  statement.getQueryString() + "]";       
      exception = new SpagoBIEngineServiceException(getActionName(), message, e);
      exception.addHint("Check if the query is properly formed: [" + statement.getQueryString() + "]");
      exception.addHint("Check connection configuration");
      exception.addHint("Check the qbe jar file");
     
      throw exception;
    }
    logger.debug("Query executed succesfully");
    return dataStore;
View Full Code Here

     
      try {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
View Full Code Here

       
        try {         
          queryJSON = serializeQuery(query);
          nodeJSON = createNode(queryJSON);
        } catch (Throwable e) {
          throw new SpagoBIEngineServiceException(getActionName(), "An error occurred while serializig query wiyh id equals to [" + query.getId() +"]", e);
        }
       
        result.put(nodeJSON);
      }
     
      try {
        writeBackToClient( new JSONSuccess(result) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
View Full Code Here

        String scope = getAttributeAsString(SCOPE);
        JSONObject formState = getAttributeAsJSONObject(FORMSTATE);
       
        String result = saveAnalysisState(formState, scope, name, description);
        if(!result.trim().toLowerCase().startsWith("ok")) {
          throw new SpagoBIEngineServiceException(getActionName(), result);
        }
       
        try {
          String newSubobjectId = result.substring(5);
          JSONSuccess success = new JSONSuccess(newSubobjectId);
          writeBackToClient( success );
        } catch (IOException e) {
          String message = "Impossible to write back the responce to the client";
          throw new SpagoBIEngineServiceException(getActionName(), message, e);
        }
       
      }
    }catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
View Full Code Here

      } else {
        QbeEngineInstance engineInstance = this.getEngineInstance();
        QueryCatalogue queryCatalogue = engineInstance.getQueryCatalogue();
        query = queryCatalogue.getQuery(lookupQuery);
        if(query == null) {
          throw new SpagoBIEngineServiceException(getActionName(), "Impossible to retrive custom query [" + lookupQuery + "] from catalogue");
        }
       
      }
     
      statement = getDataSource().createStatement( query );
     
      statement.setParameters( getEnv() );
     
      String jpaQueryStr = statement.getQueryString();
      //String sqlQuery = statement.getSqlQueryString();
      logger.debug("Executable query (HQL/JPQL): [" +  jpaQueryStr+ "]");
      //logger.debug("Executable query (SQL): [" + sqlQuery + "]");
     
      try {
        logger.debug("Executing query ...");
        dataSet = QbeDatasetFactory.createDataSet(statement);
        dataSet.setAbortOnOverflow(true);
       
        Map userAttributes = new HashMap();
        UserProfile profile = (UserProfile)this.getEnv().get(EngineConstants.ENV_USER_PROFILE);
        Iterator it = profile.getUserAttributeNames().iterator();
        while(it.hasNext()) {
          String attributeName = (String)it.next();
          Object attributeValue = profile.getUserAttribute(attributeName);
          userAttributes.put(attributeName, attributeValue);
        }
        dataSet.addBinding("attributes", userAttributes);
        dataSet.addBinding("parameters", this.getEnv());
        dataSet.loadData();
       
        dataStore = dataSet.getDataStore();
        Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
      } catch (Exception e) {
        logger.debug("Query execution aborted because of an internal exceptian");
        SpagoBIEngineServiceException exception;
        String message;
       
        message = "An error occurred in " + getActionName() + " service while executing query: [" +  statement.getQueryString() + "]";       
        exception = new SpagoBIEngineServiceException(getActionName(), message, e);
        exception.addHint("Check if the query is properly formed: [" + statement.getQueryString() + "]");
        exception.addHint("Check connection configuration");
        exception.addHint("Check the qbe jar file");
       
        throw exception;
      }
      logger.debug("Query executed succesfully");
     
      resultNumber = (Integer)dataStore.getMetaData().getProperty("resultNumber");
      Assert.assertNotNull(resultNumber, "property [resultNumber] of the dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
      logger.debug("Total records: " + resultNumber);     
     
      dataSetWriter = new JSONDataWriter();
      gridDataFeed = (JSONObject)dataSetWriter.write(dataStore);
     
      try {
        writeBackToClient( new JSONSuccess(gridDataFeed) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      errorHitsMonitor = MonitorFactory.start("QbeEngine.errorHits");
      errorHitsMonitor.stop();
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.engines.SpagoBIEngineServiceException

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.