Package it.eng.spagobi.utilities.service

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


    JSONObject attributesResponseJSON = createJSONResponseAttributes(attributesJSON);
    attributesResponseJSON.put("success", true);
    attributesResponseJSON.put("id", attrID);
    attributesResponseJSON.put("newAttr", isAdded);

    writeBackToClient(new JSONSuccess(attributesResponseJSON));

 
View Full Code Here


      try {
        Integer dsId = getAttributeAsInteger(DataSetConstants.ID);
        JSONObject dataSetJSON =getJSONDatasetResult(dsId, profile);
        if(dataSetJSON!=null){
          try {
            writeBackToClient( new JSONSuccess( dataSetJSON ) );
          } catch (IOException e) {
            throw new SpagoBIServiceException("Impossible to write back the responce to the client", e);
          }
        }else{
          throw new SpagoBIServiceException(SERVICE_NAME,"No data found");
View Full Code Here

        logger.debug(t);
        validationResult = false;
      }
      JSONObject result = new JSONObject();
      result.put("validationResult", validationResult);
      writeBackToClient( new JSONSuccess(result) );
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
      logger.debug("OUT");
    }
View Full Code Here

     
      String callback = getAttributeAsString( CALLBACK );
     
      try {
        if(callback == null) {
          writeBackToClient( new JSONSuccess( array ));
        } else {
          writeBackToClient( new JSONSuccess( array, callback ));
        }
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
View Full Code Here

        logger.debug("The following columns are required in order to invoke " +
            "the required service: " + join(missingColumns, ","));
        try {
          JSONObject obj = new JSONObject();
          obj.put("missingcolumns", join(missingColumns, ","));
          writeBackToClient( new JSONSuccess(obj) );
          return;
        } catch (IOException e) {
          String message = "Impossible to write back the responce to the client";
          throw new SpagoBIEngineServiceException(getActionName(), message, e);
        }
      }
     
      // invoke external service
      String serviceResponse = null;
      try {
        extServiceMonitor = MonitorFactory.start("QbeEngine.externalService");
        serviceResponse = invokeExternalService(serviceConfig, records);
      } finally {
        extServiceMonitor.stop();
      }
      logger.debug("Service has returned this message response:\n" + serviceResponse);
     
      try {
        JSONObject obj = new JSONObject();
        obj.put("serviceresponse", serviceResponse);
        writeBackToClient( new JSONSuccess(obj) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
View Full Code Here

      responseJSON = new JSONObject();
      responseJSON.put("results", resultsJSON);
     
     
      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) {
View Full Code Here

        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);
      }
View Full Code Here

      Query query = queryCatalogue.getFirstQuery();
      // serialize query
      JSONObject queryJSON = (JSONObject)SerializerFactory.getSerializer("application/json").serialize(query, getEngineInstance().getDataSource(), getLocale());
     
      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) {
View Full Code Here

      dataSetWriter = new JSONDataWriter();
      gridDataFeed = (JSONObject)dataSetWriter.write(dataStore);
      //logger.debug("Response object: " + gridDataFeed.toString(3));
     
      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);
      }
     
View Full Code Here

       
        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);
      }
     
View Full Code Here

TOP

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

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.