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

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


   
    String dataSetLabel;
    String user;
    String callback;
 
    IDataSet dataSet;
    IDataStore dataStore;
   
    logger.debug("IN");
    Monitor monitor =MonitorFactory.start("SpagoBI_Console.GetConsoleDataAction.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 + "]");
     
      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 = consoleEngineInstance.getAnalyticalDrivers();
      dataSet.setParamsMap(params);
      dataSet.setUserProfileAttributes(UserProfileUtils.getProfileAttributes( (UserProfile) this.getEnv().get(EngineConstants.ENV_USER_PROFILE)));
      //dataSet.setParamsMap(getEnv());
      //gets the max number of rows for the table
      String strRowLimit = ConsoleEngineConfig.getInstance().getProperty("CONSOLE-TABLE-ROWS-LIMIT");
      int rowLimit = (strRowLimit == null)? 0 : Integer.parseInt(strRowLimit);
      Monitor monitorLD =MonitorFactory.start("SpagoBI_Console.GetConsoleDataAction.service.LoadData");
      if (rowLimit > 0){
        dataSet.loadData(-1, -1, rowLimit);
      }else{
        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");
     
      JSONObject results = new JSONObject();
      try {
        JSONDataWriter writer = new JSONDataWriter();
       
View Full Code Here


      logger.debug("OUT");
    }
  }
 
  private IDataSet getDataSet(String label) {
    IDataSet dataSet;
    DataSetServiceProxy datasetProxy;
    ConsoleEngineInstance engineInstance;
   
    engineInstance = getConsoleEngineInstance();
    dataSet = engineInstance.getDataSet(label);
    if (dataSet == null || dataSet.hasDataStoreTransformer()) {
      logger.debug("Dataset with label " + label + " was not already loaded. Invoking DataSetService....");
      datasetProxy = engineInstance.getDataSetServiceProxy();
      dataSet = datasetProxy.getDataSetByLabel(label);
      engineInstance.setDataSet(label, dataSet);
    } else {
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.GetWarningListAction.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.GetWarningListAction.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

    }
   
    if(confSB != null) {
      IDataSource dataSource = null;
      String query = null;
      IDataSet dataSet = null;
     
      dataSet = (IDataSet)datamartProvider.getEnv().get(EngineConstants.ENV_DATASET);
      if(dataSet != null) {
        datamartProvider.setDs(dataSet);
        return;
View Full Code Here

   
   
    public DataMart getDataMart() throws GeoEngineException {
     
      DataMart dataMart = null;
      IDataSet dataSet;
     
      dataSet = (IDataSet)getEnv().get(EngineConstants.ENV_DATASET);

      if(dataSet == null) {
        JDBCDataSet jdbcDataSet = new JDBCDataSet();
        jdbcDataSet.setQuery(query);
        jdbcDataSet.setDataSource(dataSource);
        dataSet = jdbcDataSet;
        dataSet.setParamsMap(getEnv());
      }
     
          
      if( dataSet.hasBehaviour(QuerableBehaviour.class.getName()) ) {
        QuerableBehaviour querableBehaviour = (QuerableBehaviour)dataSet.getBehaviour( QuerableBehaviour.class.getName() );
        //querableBehaviour.setQueryTransformer( getDrillQueryTransformer() );
        querableBehaviour.setQueryTransformer( new DrillThroughQueryTransformer(this) );
               
        try {
          logger.warn("trying to load data...");
        dataSet.loadData();
        logger.warn("success!!");
      } catch (Throwable e) {
        logger.error("failure!!",e);
        throw new GeoEngineException("Impossible to load data from dataset");
      }
       
      IDataStore dataStore = dataSet.getDataStore();
      IDataStoreMetaData dataStoreMeta = dataStore.getMetaData();
      dataStoreMeta.setIdField( dataStoreMeta.getFieldIndex( getSelectedLevel().getColumnId() ));
   
      dataMart = new DataMart();
      dataMart.setDataStore(dataStore);
View Full Code Here

       *
       * @return the executable query
       */
      public String getExecutableQuery() {
      String executableQuery;     
      IDataSet dataSet;
       
        dataSet = (IDataSet)getEnv().get(EngineConstants.ENV_DATASET);
     
        if(dataSet != null) {
          executableQuery = (String)dataSet.getQuery();
        } else {
          executableQuery = query;
        }
       
     
View Full Code Here

    private SpagoBiDataSet getDataSet(String requestConnectionName,HttpSession session,IEngUserProfile profile,String documentId) {
      logger.debug("IN");
    logger.debug("IN.documentId:"+documentId);
    DataSetServiceProxy proxyDataset =new DataSetServiceProxy((String)profile.getUserUniqueIdentifier(),session);
    //get document's dataset
    IDataSet dataset = proxyDataset.getDataSet(documentId);
   
    if (dataset==null) {
        logger.warn("Data Set IS NULL. There are problems reading DataSet informations");
        return null;
    }
    SpagoBiDataSet biDataset = null;
    try {
      biDataset= dataset.toSpagoBiDataSet();
    } catch (Exception e) {
      logger.error("Cannot retrive SpagoBi DataSet", e);
    }
    logger.debug("OUT");
    return biDataset;
View Full Code Here

  }


  public IDataSet getDsFromKpiId(Integer kpiId) throws EMFUserError {
    logger.debug("IN");
    IDataSet toReturn = null;
    Session aSession = null;
    Transaction tx = null;

    try {
      aSession = getSession();
View Full Code Here


  public static String getDataSetResultFromId(IEngUserProfile profile,String dsId, Map parameters) throws Exception {
   
    IDataSetDAO dsDAO = DAOFactory.getDataSetDAO();
    IDataSet ds = dsDAO.loadActiveIDataSetByID(Integer.valueOf(dsId));
 
    String result=DataSetAccessFunctions.getDataSetResult(profile, ds, parameters);
    return result;
  }
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.