Package it.eng.spagobi.utilities.engines

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


     
      try {
        writeBackToClient(exportFile, null, false, exportFile.getName(), mimetype);
      } 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 {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
        String msg = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), msg, e);
      }
     
    } catch (Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
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 (Exception e) {
      throw new SpagoBIServiceException(SERVICE_NAME, "Exception occurred while saving metadata", e);
    } finally {
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

   
      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(), (IEngineInstance)getAttributeFromSession( EngineConstants.ENGINE_INSTANCE ), t);
    } finally {
View Full Code Here

      Assert.assertNotNull(getEngineInstance(), "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of GeoInstance class");
      Assert.assertNotNull(getEngineInstance(), "It's not possible to execute " + this.getActionName() + " service before having properly created a MapProvider into GeoInstance object");
     
      try {
        maps = getGeoEngineInstance().getMapProvider().getMapNamesByFeature(featureName);
        if(maps == null) throw new SpagoBIEngineServiceException(getActionName(),"The map list returned by the map provider is NULL");
      } catch (Exception e) {
        logger.error("Impossible to get a list of map containing layer [" + featureName + "] ");
        throw new SpagoBIEngineServiceException(getActionName(),"Impossible to get a list of map containing layer [" + featureName + "] ", e);
      }
     
      if(maps.size() == 0) {
        logger.warn("The list of map containing layer [" + featureName + "] is empty");
      }
     
     
      JSONObject responseJSON = new JSONObject();
      JSONArray mapsJSON = new JSONArray();
      for(int i = 0; i < maps.size(); i++) {
        String mapName = (String)maps.get(i);
        JSONObject mapJSON = new JSONObject();
       
        mapJSON.put("id", mapName);
        mapJSON.put("name", mapName);
        mapJSON.put("description", mapName);
       
        List features = getGeoEngineInstance().getMapProvider().getFeatureNamesInMap(mapName);
        JSONArray featuresJSON = new JSONArray();
        for(int j = 0; j < features.size(); j++) {
          String layerName = (String)features.get(j);
          JSONObject featureJSON = new JSONObject();
          featureJSON.put("id", layerName);
          featureJSON.put("name", layerName);
          featureJSON.put("description", layerName);
          featureJSON.put("category", "undefined");
          featuresJSON.put(featureJSON);
        }
       
        JSONObject featureJSON= null;
       
        // grafici
        featureJSON = new JSONObject();
        featureJSON.put("id", "grafici");
        featureJSON.put("name", "grafici");
        featureJSON.put("description", "grafici");
        featureJSON.put("category", "undefined");
        featuresJSON.put(featureJSON);
       
        // valori
        featureJSON = new JSONObject();
        featureJSON.put("id", "valori");
        featureJSON.put("name", "valori");
        featureJSON.put("description", "valori");
        featureJSON.put("category", "undefined");
        featuresJSON.put(featureJSON);
       
        mapJSON.put("features", featuresJSON);
        mapsJSON.put(mapJSON);
       
      }
      responseJSON.put("maps", mapsJSON);
     
      logger.debug( "Generated service response: " + responseJSON.toString() );
     
      try {
        writeBackToClient( new JSONSuccess(responseJSON) );
      } 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 {
      // no resources need to be released
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);
          }
        }
      }
     
       
     
      analysisName = getAttributeAsString(ANALYSIS_NAME);   
      logger.debug(ANALYSIS_NAME + ": " + analysisName);
      analysisDescritpion  = getAttributeAsString(ANALYSIS_DESCRIPTION);
      logger.debug(ANALYSIS_DESCRIPTION + ": " + analysisDescritpion);
      analysisScope  = getAttributeAsString(ANALYSIS_SCOPE);
      logger.debug(ANALYSIS_SCOPE + ": " + analysisScope);
     
     
      Assert.assertNotNull(getEngineInstance(), "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of EngineInstance class");
      Assert.assertTrue(!StringUtilities.isEmpty(analysisName), "Input parameter [" + ANALYSIS_NAME + "] cannot be null or empty in oder to execute " + this.getActionName() + " service");   
      Assert.assertTrue(!StringUtilities.isEmpty(analysisDescritpion), "Input parameter [" + ANALYSIS_DESCRIPTION + "] cannot be null or empty in oder to execute " + this.getActionName() + " service");   
      Assert.assertTrue(!StringUtilities.isEmpty(analysisScope), "Input parameter [" + ANALYSIS_SCOPE + "] cannot be null or empty in oder to execute " + this.getActionName() + " service");   
   
      analysisMetadata = getEngineInstance().getAnalysisMetadata();
      analysisMetadata.setName( analysisName );
      analysisMetadata.setDescription( analysisDescritpion );
   
      if( EngineAnalysisMetadata.PUBLIC_SCOPE.equalsIgnoreCase( analysisScope ) ) {
        analysisMetadata.setScope( EngineAnalysisMetadata.PUBLIC_SCOPE );
      } else if( EngineAnalysisMetadata.PRIVATE_SCOPE.equalsIgnoreCase( analysisScope ) ) {
        analysisMetadata.setScope( EngineAnalysisMetadata.PRIVATE_SCOPE );
      } else {
        Assert.assertUnreachable("Value [" + analysisScope + "] is not valid for the input parameter " + ANALYSIS_SCOPE);
      }
     
     
      result = saveAnalysisState();
     
     
      if(!result.trim().toLowerCase().startsWith("ok")) {
        throw new SpagoBIEngineServiceException(getActionName(), result);
      }
     
      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

     
      try {
        writeBackToClient( new JSONSuccess(responseJSON) );
      } 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

        logger.debug("Error type [" + o.getClass().getName()+ "]");
        if(o instanceof EMFInternalError) {
          EMFInternalError error = (EMFInternalError)o;
          Exception e = error.getNativeException();
          if(e instanceof SpagoBIEngineServiceException) {
            SpagoBIEngineServiceException serviceError = (SpagoBIEngineServiceException)e;
            logError(serviceError);
          } else {
            logger.error("Unespected exception",e);   
          }
        } else {
View Full Code Here

     
      try {
        writeBackToClient( new JSONSuccess(responseJSON) );
      } 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 {
      // no resources need to be released
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.