Package it.eng.spagobi.utilities.exceptions

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


      try {
        // load parameter use ...
        IParameterUseDAO parusedao = DAOFactory.getParameterUseDAO();
        biParameterExecModality = parusedao.loadByParameterIdandRole(biparam.getParID(), executionInstance.getExecutionRole());
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to find any valid execution modality for parameter [" + id + "] and role [" + executionInstance.getExecutionRole() + "]", e);
      }
     
      Assert.assertNotNull(biParameterExecModality, "Impossible to find any valid execution modality for parameter [" + id + "] and role [" + executionInstance.getExecutionRole() + "]" );
     
      parameterUseId = biParameterExecModality.getUseID();
     
      List biParameterExecDependencies;
      try {
        IObjParuseDAO objParuseDAO = DAOFactory.getObjParuseDAO();
        biParameterExecDependencies = objParuseDAO.loadObjParuse(biparam.getId(), biParameterExecModality.getUseID());
      } catch (EMFUserError e) {
        throw new SpagoBIServiceException("An error occurred while loading parameter dependecies for parameter [" + id + "]", e);
      }
     
      dependencies = new ArrayList();
      it = biParameterExecDependencies.iterator();
      while (it.hasNext()){
        ObjParuse dependency = (ObjParuse)it.next();
        Integer objParFatherId = dependency.getObjParFatherId();
        try {         
          BIObjectParameter objParFather = DAOFactory.getBIObjectParameterDAO().loadForDetailByObjParId(objParFatherId);
          dependencies.add(objParFather.getParameterUrlName());
        } catch (EMFUserError e) {
          throw new SpagoBIServiceException("An error occurred while loading parameter [" + objParFatherId + "]", e);
        }
      }
     
      if("COMBOBOX".equalsIgnoreCase(selectionType)) { // load values only if it is not a lookup
        List lovs = getLOV( biparam, biParameterExecDependencies, executionInstance);
View Full Code Here


        String lovProv = lov.getLovProvider();
        lovProvDet = LovDetailFactory.getLovFromXML(lovProv);
       
        value = (String) lovSB.getAttribute( lovProvDet.getValueColumnName() );
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to get parameter's value", e);
      }
     
      return value;
    }
View Full Code Here

       
        // get all the rows of the result
        LovResultHandler lovResultHandler = new LovResultHandler(lovResult);   
        rows = lovResultHandler.getRows();
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to get parameter's values", e);
      }
     
      return rows;
    }
View Full Code Here

      results.put("message", message);
      results.put("results", emptyListJSON);
      results.put("totalCount", emptyListJSON.length());
      writeBackToClient( new JSONSuccess( results ) );
    } catch (IOException e) {
      throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to write back the responce to the client", e);
    } catch (JSONException e) {
      throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects into a JSON object", e);
    }
  }
View Full Code Here

        ObjNote objnote = null;
        try {
          objnote = DAOFactory.getObjNoteDAO().getExecutionNotesByOwner(obj.getId(), execIdentifier, owner);
        } catch (Exception e) {
          logger.error("Cannot load notes for document [id: " + obj.getId() + ", label: " + obj.getLabel() + ", name: " + obj.getName() + "]", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Cannot erase notes", e);
        }
       
        DAOFactory.getObjNoteDAO().eraseNotesByOwner(obj.getId(), execIdentifier, owner);
     
        logger.debug("Notes deleted");
        resultStr = "ok";
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Error while deleting notes", e);
      }

      try {
        JSONObject results = new JSONObject();
        results.put("result", "OK");
        writeBackToClient( new JSONSuccess( results ) );
      } catch (IOException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to write back the responce to the client", e);
      } catch (JSONException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects into a JSON object", e);
      }

    } finally {
      logger.debug("OUT");
    }
View Full Code Here

        String parameterValue;
        try {
          parameterValue = viewpointJSON.getString( parameterName );
        } catch (JSONException e) {
          logger.error("Impossible read value for the parameter [" + parameterName + "] into viewpoint's content", e);
          throw new SpagoBIServiceException(SERVICE_NAME, "Impossible read value for the parameter [" + parameterName + "] into viewpoint's content", e);
        }
       
        // defines the string of parameters to save into db
        if(!StringUtilities.isEmpty(parameterValue)) {
          viewpointString += parameterName + "%3D" + parameterValue + "%26";
        }
      }
     
      if (viewpointString.endsWith("%26")) {
        viewpointString = viewpointString.substring(0, viewpointString.length() - 3);
      }
     
      logger.debug("Viewpoint's content will be saved on database as: [" + viewpointString + "]");
     
      try {
        viewpointDAO = DAOFactory.getViewpointDAO();
        viewpoint = viewpointDAO.loadViewpointByNameAndBIObjectId(viewpointName, biobjectId);
        if (viewpoint != null) throw new SpagoBIServiceException(SERVICE_NAME, "A viewpoint with the name [" + viewpointName + "] alredy exist");
        //Assert.assertTrue(viewpoint == null, "A viewpoint with the name [" + viewpointName + "] alredy exist");
      } catch (EMFUserError e) {
        logger.error("Impossible to check if a viewpoint with name [" + viewpointName + "] already exists", e);
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to check if a viewpoint with name [" + viewpointName + "] already exists", e);
     
     
      try {
        viewpointDAO = DAOFactory.getViewpointDAO();
        viewpointDAO.setUserProfile(userProfile);
        viewpoint = new Viewpoint();
        viewpoint.setBiobjId( biobjectId );
        viewpoint.setVpName( viewpointName );
        viewpoint.setVpOwner( viewpointOwner );
        viewpoint.setVpDesc( viewpointDescription );
        viewpoint.setVpScope( viewpointScope );
        viewpoint.setVpValueParams( viewpointString );
        viewpoint.setVpCreationDate(new Timestamp(System.currentTimeMillis()));
        viewpointDAO.insertViewpoint(viewpoint);
      } catch (EMFUserError e) {
        logger.error("Impossible to save viewpoint [" + viewpointName + "]", e);
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to check if a viewpoint with name [" + viewpointName + "] already exists", e);
      }
       
      try {
        JSONObject results = (JSONObject) SerializerFactory.getSerializer("application/json").serialize( viewpoint,null );
        writeBackToClient( new JSONSuccess( results ) );
      } catch (IOException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to write back the responce to the client", e);
      } catch (SerializationException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects", e);
      }
     
    } finally {
      logger.debug("OUT");
    }
View Full Code Here

      try {
        IRememberMeDAO dao=DAOFactory.getRememberMeDAO();
        dao.setUserProfile(profile);
        inserted = dao.saveRememberMe(name, description, obj.getId(), subobjectId, profile.getUserId().toString(), parameters);
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Cannot save remember me", e);
      }
      if (inserted) {
        message = "ok";
      } else {
        message = "alreadyExisting";
      }
     
      try {
        JSONObject result = new JSONObject();
        result.put("result", message);
        writeBackToClient( new JSONSuccess( result ) );
      } catch (IOException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to write back the responce to the client", e);
      } catch (JSONException e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects into a JSON object", e);
      }
    } finally {
      logger.debug("OUT");
    }
  }
View Full Code Here

          values.add(o.toString());
        }
      }
    } catch (JSONException e) {
      logger.error("Cannot get " + nameUrl + " values from JSON object", e);
      throw new SpagoBIServiceException("Cannot retrieve values for biparameter " + biparam.getLabel(), e);
    }

    if (values.size() > 0) {
      logger.debug("Updating values of biparameter " + biparam.getLabel() + " to " + values.toString());
      biparam.setParameterValues(values);
View Full Code Here

  }

  public String getSnapshotUrl() {
    logger.debug("IN");
    if (this.snapshot == null) {
      throw new SpagoBIServiceException("", "no snapshot set");
    }
    StringBuffer buffer = new StringBuffer();
    buffer.append(GeneralUtilities.getSpagoBIProfileBaseUrl(this.userProfile.getUserUniqueIdentifier().toString()));
    buffer.append("&ACTION_NAME=GET_SNAPSHOT_CONTENT");
    buffer.append("&" + SpagoBIConstants.SNAPSHOT_ID + "=" + snapshot.getId());
View Full Code Here

  }

  public String getSubObjectUrl(Locale locale) {
    logger.debug("IN");
    if (this.subObject == null) {
      throw new SpagoBIServiceException("", "no subobject set");
    }
    String url = null;
    Engine engine = this.getBIObject().getEngine();
    Domain engineType;
    try {
      engineType = DAOFactory.getDomainDAO().loadDomainById(
          engine.getEngineTypeId());
    } catch (EMFUserError e) {
      throw new SpagoBIServiceException("Impossible to load engine type domain", e);
    }

    // IF THE ENGINE IS EXTERNAL
    if ("EXT".equalsIgnoreCase(engineType.getValueCd())) {
      // instance the driver class
      String driverClassName = engine.getDriverName();
      IEngineDriver aEngineDriver = null;
      try {
        aEngineDriver = (IEngineDriver) Class.forName(driverClassName).newInstance();
      } catch (Exception e) {
        throw new SpagoBIServiceException("Cannot istantiate engine driver class: " + driverClassName, e);
      }
      // get the map of the parameters
      Map mapPars = aEngineDriver.getParameterMap(object, this.subObject, userProfile, executionRole);
      // adding "system" parameters
      addSystemParametersForExternalEngines(mapPars, locale);
View Full Code Here

TOP

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

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.