Package it.eng.spagobi.tools.dataset.bo

Examples of it.eng.spagobi.tools.dataset.bo.IDataSet


          break;
        }
      }
    } 

    IDataSet ds = null;     
    if ( dsType!=null && !dsType.equals("")) {
      ds = instantiateCorrectIDataSetType(dsType);   
      if(ds!=null){                 
        if(trasfTypeCd!=null && !trasfTypeCd.equals("")){
          ds = setTransformer(ds, trasfTypeCd);
View Full Code Here


    return dataSetJSON;
  }
 
  private IDataSet instantiateCorrectIDataSetType(String dsType) throws Exception{

    IDataSet ds = null;
    if(dsType.equalsIgnoreCase(DataSetConstants.DS_FILE)){ 
      ds = new FileDataSet();
      String fileName = getAttributeAsString(DataSetConstants.FILE_NAME);
      ((FileDataSet)ds).setFileName(fileName);   
    }
View Full Code Here

  public JSONObject getJSONDatasetResult(BIObject obj, IEngUserProfile profile) throws Exception{
    logger.debug("IN");
    JSONObject dataSetJSON = null;   
    Integer id = obj.getDataSetId()
    //gets the dataset object informations
    IDataSet dataset = DAOFactory.getDataSetDAO().loadActiveIDataSetByID(id);
    try {
      if (dataset.getParameters() != null){
        JSONArray parsJSON = serializeJSONArrayParsList(dataset.getParameters());
        HashMap h = new HashMap();
        if(parsJSON!=null && parsJSON.length()>0){
          h = deserializeParValuesListJSONArray(parsJSON);
        }
        dataSetJSON = getDatasetTestResultList(dataset, h, profile);
View Full Code Here

   
    String dataSetLabel;
    String user;
    String callback;
 
    IDataSet dataSet;
    IDataStore dataStore;
    JSONObject dataSetJSON;
   
   
    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("SpagoBI_Console.ExecuteDataSetAction.service");
   
    try {
      super.service(request,response);
     
      dataSetLabel = getAttributeAsString( DATASET_LABEL );
      logger.debug("Parameter [" + DATASET_LABEL + "] is equals to [" + dataSetLabel + "]");     
      Assert.assertTrue(!StringUtilities.isEmpty( dataSetLabel ), "Parameter [" + DATASET_LABEL + "] cannot be null or empty");
     
      callback = getAttributeAsString( CALLBACK );
      logger.debug("Parameter [" + CALLBACK + "] is equals to [" + callback + "]");
     
      dataSet = null;
      try {
        dataSet = getDataSet(dataSetLabel);
      } catch(Throwable t) {
        throw new SpagoBIServiceException("Impossible to find a dataset whose label is [" + dataSetLabel + "]", t);
      }
      Assert.assertNotNull(dataSet, "Impossible to find a dataset whose label is [" + dataSetLabel + "]");
      Monitor monitorLD =MonitorFactory.start("SpagoBI_Console.ExecuteDataSetAction.service.LoadData")
      dataSet.loadData();
      monitorLD.stop();
      dataStore = dataSet.getDataStore();
      Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
         
     
      dataSetJSON = null;
     
      try {
View Full Code Here

      logger.debug("OUT");
    }
  }
 
  private IDataSet getDataSet(String label) {
    IDataSet dataSet;
    DataSetServiceProxy datasetProxy;
   
    datasetProxy = getConsoleEngineInstance().getDataSetServiceProxy();
    dataSet =  datasetProxy.getDataSetByLabel(label);
   
View Full Code Here

    String dataSetLabel;
    String mimeType;
    String responseType;
    JSONArray jsonArray;
   
    IDataSet dataSet;
    IDataStore dataStore;
    JSONObject dataSetJSON;
   
    String fileExtension;
    String fileName;
    boolean writeBackResponseInline;
   
    logger.debug("IN");
   
    try {
      super.service(request,response);
     
      Assert.assertNotNull(getConsoleEngineInstance(), "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of EngineInstance class");
      Assert.assertNotNull(getConsoleEngineInstance().getDataSetServiceProxy(), "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of DatasetServiceProxy class");
     

      dataSetLabel = getAttributeAsString( DATASET_LABEL );
      logger.debug("Parameter [" + DATASET_LABEL + "] is equals to [" + dataSetLabel + "]");     
      Assert.assertTrue(!StringUtilities.isEmpty( dataSetLabel ), "Parameter [" + DATASET_LABEL + "] cannot be null or empty");
       
      mimeType = getAttributeAsString( MIME_TYPE );
      logger.debug("Parameter [" + MIME_TYPE + "] is equal to [" + mimeType + "]");
      if(mimeType == null) {
        logger.warn("Parameter [" + MIME_TYPE + "] has not been valorized");
        mimeType = DEFAULT_MIME_TYPE;
        logger.debug("Parameter [" + MIME_TYPE + "] has been set equal to [" + mimeType + "]");
      }
     
      responseType = getAttributeAsString( RESPONSE_TYPE );
      logger.debug("Parameter [" + RESPONSE_TYPE + "] is equal to [" + responseType + "]");
      if(!RESPONSE_TYPE_INLINE.equalsIgnoreCase(responseType) && !RESPONSE_TYPE_ATTACHMENT.equalsIgnoreCase(responseType)) {
        logger.warn("Value [" + responseType + "] is not a valid for parameter [" + RESPONSE_TYPE + "]");
        responseType = RESPONSE_TYPE_ATTACHMENT;
        logger.debug("Parameter [" + RESPONSE_TYPE + "] has been set equal to [" + responseType + "]");
      }
       
      String test = getAttributeAsString(META);
      logger.debug("Parameter [" + META + "] is equal to [" + test + "]");
     
      jsonArray = this.getAttributeAsJSONArray(META);
      logger.debug("Parameter [" + META + "] is equal to [" + jsonArray.toString(4) + "]");
   
      dataSet = null;
      try {
        dataSet = getConsoleEngineInstance().getDataSetServiceProxy().getDataSetByLabel( dataSetLabel );
      } catch(Throwable t) {
        throw new SpagoBIServiceException("Impossible to find a dataset whose label is [" + dataSetLabel + "]", t);
      }
      Assert.assertNotNull(dataSet, "Impossible to find a dataset whose label is [" + dataSetLabel + "]");
       
     
      Assert.assertNotNull(dataSet, "Impossible to find a dataset whose label is [" + dataSetLabel + "]");
      Map params = getConsoleEngineInstance().getAnalyticalDrivers();
      dataSet.setParamsMap(params);
      dataSet.setUserProfileAttributes(UserProfileUtils.getProfileAttributes( (UserProfile) this.getEnv().get(EngineConstants.ENV_USER_PROFILE)));
      dataSet.loadData();
      dataStore = dataSet.getDataStore();
      Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
     
     
      // dataStore decoration ....
      Object resultNumber = dataStore.getMetaData().getProperty("resultNumber");
      if(resultNumber == null) dataStore.getMetaData().setProperty("resultNumber", new Integer((int)dataStore.getRecordsCount()));
View Full Code Here

/**
* @author Andrea Gioia (andrea.gioia@eng.it)
*/
public class QbeDatasetFactory {
  public static IDataSet createDataSet(IStatement statement) {
    IDataSet dataSet;
   
    dataSet = null;
    if(statement instanceof HQLStatement) {
      dataSet = new HQLDataSet( (HQLStatement)statement );
    } else if(statement instanceof JPQLStatement) {
View Full Code Here

        query.addSelectFiled(field.getUniqueName(), null, field.getName(), true, true, false, null, null);     
      }
    }
   
    IStatement statement = dataSource.createStatement(query);
    IDataSet datsSet = QbeDatasetFactory.createDataSet(statement);
   
    try {
      datsSet.loadData();
    } catch (Throwable e) {
      e.printStackTrace();
      fail();
    }
   
    IDataStore dataStore = datsSet.getDataStore();
   
    assertNotNull(dataStore);
    assertTrue(dataStore.getRecordsCount() > 0);
  }
View Full Code Here

    String dataSetLabel;
    String user;
    String callback;
    String rowId;
 
    IDataSet dataSet;
    IDataStore dataStore;
    JSONObject dataSetJSON;
   
   
    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("SpagoBI_Console.GetErrorListAction.service")
   
    try {
      super.service(request,response);
      ConsoleEngineInstance consoleEngineInstance = getConsoleEngineInstance();
   
      dataSetLabel = getAttributeAsString( DATASET_LABEL );
      logger.debug("Parameter [" + DATASET_LABEL + "] is equals to [" + dataSetLabel + "]");     
      Assert.assertTrue(!StringUtilities.isEmpty( dataSetLabel ), "Parameter [" + DATASET_LABEL + "] cannot be null or empty");
     
      callback = getAttributeAsString( CALLBACK );
      logger.debug("Parameter [" + CALLBACK + "] is equals to [" + callback + "]");
     
      rowId = getAttributeAsString( ID );
      logger.debug("Parameter [" + ID + "] is equals to [" + rowId + "]");
      Assert.assertNotNull(rowId, "Input parameters [" + ID + "] cannot be null");
     
      dataSet = null;
      try {
        dataSet = getDataSet(dataSetLabel);
      } catch(Throwable t) {
        throw new SpagoBIServiceException("Impossible to find a dataset whose label is [" + dataSetLabel + "]", t);
      }
      Assert.assertNotNull(dataSet, "Impossible to find a dataset whose label is [" + dataSetLabel + "]");
        /*
      Map params = new HashMap();
      params.put("id", rowId);
      dataSet.setParamsMap(params);
      */
      Map params = consoleEngineInstance.getAnalyticalDrivers();
      params.put("id", rowId);
      dataSet.setParamsMap(params);
      dataSet.setUserProfileAttributes(UserProfileUtils.getProfileAttributes( (UserProfile) this.getEnv().get(EngineConstants.ENV_USER_PROFILE)));
      Monitor monitorLD =MonitorFactory.start("SpagoBI_Console.GetErrorListAction.service.LoadData")
     
      dataSet.loadData();
      monitorLD.stop();
      dataStore = dataSet.getDataStore();
      Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
         
      dataStore.getMetaData().setProperty("detailProperty", ERRORS_DETAIL_COLUMN);
      //int fieldIndex = dataStore.getMetaData().getFieldIndex(ERRORS_DETAIL_COLUMN);
      //dataStore.getMetaData().getFieldMeta(fieldIndex).setProperty("detail", true);
     
View Full Code Here

      logger.debug("OUT");
    }
  }
 
  private IDataSet getDataSet(String label) {
    IDataSet dataSet;
    DataSetServiceProxy datasetProxy;
   
    datasetProxy = getConsoleEngineInstance().getDataSetServiceProxy();
    dataSet =  datasetProxy.getDataSetByLabel(label);
   
View Full Code Here

TOP

Related Classes of it.eng.spagobi.tools.dataset.bo.IDataSet

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.