Package it.eng.spagobi.utilities.service

Examples of it.eng.spagobi.utilities.service.JSONFailure


          if(e instanceof SpagoBIEngineServiceException) {
            SpagoBIEngineServiceException serviceError = (SpagoBIEngineServiceException)e;
            logError(serviceError);
           
            try {
              writeBackToClient( new JSONFailure( serviceError ) );
            } catch (IOException ioe) {
              String message = "Impossible to write back the responce to the client";
              throw new SpagoBIEngineServiceException(getActionName(), message, e);
            } catch (JSONException je) {
              String message = "Error while serializing error into JSON object";
View Full Code Here


        for(int i = 0; i < uresolvedReferenceErrors.size(); i++) {
          String error = (String)uresolvedReferenceErrors.get(i);
          msg += "\n" + error + "; ";
        }
        validationException =  new SpagoBIEngineServiceException(getActionName(), msg);
        jsonResponse = new JSONFailure(validationException);
      } else
        scriptManager = new ScriptEngineManager();
        groovyScriptEngine = scriptManager.getEngineByName("groovy");
       
        // bindings ...
        groovyScriptEngine.put("attributes", attributes);
        groovyScriptEngine.put("parameters", parameters);
        groovyScriptEngine.put("qFields", qFields);
        groovyScriptEngine.put("dmFields", dmFields);
        groovyScriptEngine.put("fields", qFields);
       
        Object calculatedValue = null;
        try {
          calculatedValue = groovyScriptEngine.eval(expression);
          jsonResponse = new JSONAcknowledge();
        } catch (ScriptException e) {
          SpagoBIEngineServiceException validationException;
          Throwable t = e;
          String msg = t.getMessage();
          while( (msg = t.getMessage()) == null && t.getCause()!= null) t = t.getCause();
          if(msg == null) msg = e.toString();
          //msg = "Syntatic error at line:" + e.getLineNumber() + ", column:" + e.getColumnNumber() + ". Error details: " + msg;
          validationException = new SpagoBIEngineServiceException(getActionName(), msg, e);
          jsonResponse = new JSONFailure(validationException);
          //logger.error("validation error", e);
       
      }
     
      try {
View Full Code Here

      Assert.assertNotNull(records, "Parameter [" + RECORDS + "] cannot be null in oder to execute " + this.getActionName() + " service");

      // if no records are selected, send a message to the client
      if (records.length() == 0) {
        try {
          writeBackToClient( new JSONFailure(new SpagoBIEngineServiceException(getActionName(), "No records selected!!")) );
          return;
        } catch (IOException e) {
          String message = "Impossible to write back the responce to the client";
          throw new SpagoBIEngineServiceException(getActionName(), message, e);
        }
View Full Code Here

 
  protected void writeErrorsBackToClient() {
    logger.debug("IN");
    Collection<EMFAbstractError> errors = getErrorHandler().getErrors();
    try {
      writeBackToClient( new JSONFailure(errors) );
    } catch (Throwable t) {
      logger.error(t);
      throw new CannotWriteErrorsToClientException(SERVICE_NAME, "Cannot write errors to client", t);
    }
    logger.debug("OUT");
View Full Code Here

          if(e instanceof SpagoBIEngineServiceException) {
            SpagoBIEngineServiceException serviceError = (SpagoBIEngineServiceException)e;
            logError(serviceError);
           
            try {
              writeBackToClient( new JSONFailure( serviceError ) );
            } catch (IOException ioe) {
              String message = "Impossible to write back the responce to the client";
              throw new SpagoBIEngineServiceException(getActionName(), message, e);
            } catch (JSONException je) {
              String message = "Error while serializing error into JSON object";
View Full Code Here

     
    } catch (Throwable t) {
      // TODO set up spago's trap mechanism and move this error handling code to a specialized action
      String message = "Impossible to write back the responce to the client";
      logger.error(message, t);
      writeBackToClient( new JSONFailure( new SpagoBIEngineServiceException(getActionName(), message, t) ) );
      //throw new SpagoBIException("An unexpected error occured while executing " + getActionName(), t);
    } finally {
      logger.debug("OUT");
    }
  }
View Full Code Here

          if(e instanceof SpagoBIEngineServiceException) {
            SpagoBIEngineServiceException serviceError = (SpagoBIEngineServiceException)e;
            logError(serviceError);
           
            try {
              writeBackToClient( new JSONFailure( serviceError ) );
            } catch (IOException ioe) {
              String message = "Impossible to write back the responce to the client";
              throw new SpagoBIEngineServiceException(getActionName(), message, e);
            } catch (JSONException je) {
              String message = "Error while serializing error into JSON object";
View Full Code Here

      }
    }
    catch (Exception e) {
      logger.error("Error in stopping the work");
      try {
        writeBackToClient( new JSONFailure( e) );
      } catch (IOException e1) {
        logger.error("Error in stopping the work and in writing back to client",e);
        throw new SpagoBIEngineServiceException(getActionName(), "Error in stopping the work and in writing back to client", e1);
      } catch (JSONException e1) {
        logger.error("Error in stopping the work and in writing back to client",e);
View Full Code Here

    catch (Exception e) {

      logger.error("Error in starting the work");
      if(actionMode){
        try {
          writeBackToClient( new JSONFailure( e) );
        } catch (IOException e1) {
          logger.error("Error in starting the work and in writing back to client",e);
          throw new SpagoBIEngineServiceException(getActionName(), "Error in starting the work and in writing back to client", e1);
        } catch (JSONException e1) {
          logger.error("Error in starting the work and in writing back to client",e);
View Full Code Here

    }
    catch (Exception e) {
      logger.error("Error in reading work status");
      try {
        writeBackToClient( new JSONFailure( e) );
      } catch (IOException e1) {
        logger.error("Error in reading work status and in writing back to client",e);
        throw new SpagoBIEngineServiceException(getActionName(), "Error in reading work status and in writing back to client", e1);
      } catch (JSONException e1) {
        logger.error("Error in reading work status and in writing back to client",e);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.service.JSONFailure

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.