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

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


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


          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

    logger.debug("IN");
    JSONObject dataSetJSON = null;   
    //Integer id = obj.getDataSetId(); 
    //gets the dataset object informations   
    try {
      IDataSet dataset = DAOFactory.getDataSetDAO().loadActiveIDataSetByID(dsId);
      if (dataset.getParameters() != null){
        //JSONArray parsJSON = serializeJSONArrayParsList(dataset.getParameters());
        JSONArray parsJSON = getAttributeAsJSONArray(DataSetConstants.PARS);
        HashMap h = new HashMap();
        if(parsJSON!=null && parsJSON.length()>0){
          h = deserializeParValuesListJSONArray(parsJSON);
View Full Code Here

   * @return the data set
   * @throws EMFUserError the EMF user error
   */
  public IDataSet loadActiveIDataSetByID(Integer dsId) throws EMFUserError {
    logger.debug("IN");
    IDataSet toReturn = null;
    Session aSession = null;
    Transaction tx = null;

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

   * @throws EMFUserError the EMF user error
   * @see it.eng.spagobi.tools.dataset.dao.IDataSetDAO#loadDataSetByLabel(string)
   */ 
  public IDataSet loadActiveDataSetByLabel(String label) throws EMFUserError {
    logger.debug("IN");
    IDataSet toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   * @param hibDataSet The hybernate data set
   * @return The corrispondent <code>DataSet</code> object
   * @throws EMFUserError
   */
  public IDataSet toIDataSet(SbiDataSetHistory hibDataSet) throws EMFUserError{
    IDataSet ds = null;
    if(hibDataSet instanceof SbiFileDataSet){   
      ds = new FileDataSet();
      ((FileDataSet)ds).setFileName(((SbiFileDataSet)hibDataSet).getFileName());   
      ds.setDsType(DataSetConstants.FILE);
    }

    if(hibDataSet instanceof SbiQueryDataSet){     
      ds=new JDBCDataSet();
      ((JDBCDataSet)ds).setQuery(((SbiQueryDataSet)hibDataSet).getQuery());

      SbiDataSource sbids=((SbiQueryDataSet)hibDataSet).getDataSource();
      if(sbids!=null){
        DataSourceDAOHibImpl dataSourceDao=new DataSourceDAOHibImpl();
        IDataSource dataSource=dataSourceDao.toDataSource(sbids);
        ((JDBCDataSet)ds).setDataSource(dataSource);
      }
      ds.setDsType(DataSetConstants.QUERY);
    }

    if(hibDataSet instanceof SbiWSDataSet){     
      ds=new WebServiceDataSet();
      ((WebServiceDataSet)ds).setAddress(((SbiWSDataSet)hibDataSet).getAdress());
      ((WebServiceDataSet)ds).setOperation(((SbiWSDataSet)hibDataSet).getOperation());
      ds.setDsType(DataSetConstants.WEB_SERVICE);
    }

    if(hibDataSet instanceof SbiScriptDataSet){     
      ds=new ScriptDataSet();
      ((ScriptDataSet)ds).setScript(((SbiScriptDataSet)hibDataSet).getScript());
      ((ScriptDataSet)ds).setLanguageScript(((SbiScriptDataSet)hibDataSet).getLanguageScript());
      ds.setDsType(DataSetConstants.SCRIPT);
    }

    if(hibDataSet instanceof SbiJClassDataSet){     
      ds=new JavaClassDataSet();
      ((JavaClassDataSet)ds).setClassName(((SbiJClassDataSet)hibDataSet).getJavaClassName());
      ds.setDsType(DataSetConstants.JAVA_CLASS);
    }
   
    if (hibDataSet instanceof SbiQbeDataSet) {     
      ds = new QbeDataSet();
      SbiQbeDataSet aSbiQbeDataSet = (SbiQbeDataSet) hibDataSet;
      QbeDataSet qbeDataset = (QbeDataSet) ds;
      qbeDataset.setJsonQuery(aSbiQbeDataSet.getJsonQuery());
      qbeDataset.setDatamarts(aSbiQbeDataSet.getDatamarts());
     
      SbiDataSource sbids = aSbiQbeDataSet.getDataSource();
      if (sbids!=null){
        DataSourceDAOHibImpl dataSourceDao = new DataSourceDAOHibImpl();
        IDataSource dataSource = dataSourceDao.toDataSource(sbids);
        qbeDataset.setDataSource(dataSource);       
      }
      ds.setDsType(DataSetConstants.QBE);
     
    }

    if(ds!=null){
      if(hibDataSet.getSbiDsConfig()!=null){
        ds.setId(hibDataSet.getSbiDsConfig().getDsId());
        ds.setName(hibDataSet.getSbiDsConfig().getName());
        ds.setLabel(hibDataSet.getSbiDsConfig().getLabel());
        ds.setDescription(hibDataSet.getSbiDsConfig().getDescription())
      }
 
      ds.setTransformerId((hibDataSet.getTransformer()==null)?null:hibDataSet.getTransformer().getValueId());
      ds.setPivotColumnName(hibDataSet.getPivotColumnName());
      ds.setPivotRowName(hibDataSet.getPivotRowName());
      ds.setPivotColumnValue(hibDataSet.getPivotColumnValue());
      ds.setNumRows(hibDataSet.isNumRows());
 
      ds.setParameters(hibDataSet.getParameters());   
      ds.setDsMetadata(hibDataSet.getDsMetadata());   
 
      if(ds.getPivotColumnName() != null
          && ds.getPivotColumnValue() != null
          && ds.getPivotRowName() != null){
        ds.setDataStoreTransformer(
            new PivotDataSetTransformer(ds.getPivotColumnName(), ds.getPivotColumnValue(), ds.getPivotRowName(), ds.isNumRows()));
      }
    }
    return ds;
  }
View Full Code Here

          IDataStore dataStore = null;
         
          if (!isFormEngineInstance) {
            // case of standard QBE
           
            IDataSet dataSet = null;
           
            Integer limit = 0;
            Integer start = 0;
            Integer maxSize = QbeEngineConfig.getInstance().getResultLimit()
            boolean isMaxResultsLimitBlocking = QbeEngineConfig.getInstance().isMaxResultLimitBlocking();
            dataSet = QbeDatasetFactory.createDataSet(statement);
            dataSet.setAbortOnOverflow(isMaxResultsLimitBlocking);
           
            Map userAttributes = new HashMap();
            UserProfile profile = (UserProfile)this.getEnv().get(EngineConstants.ENV_USER_PROFILE);
            Iterator it = profile.getUserAttributeNames().iterator();
            while(it.hasNext()) {
              String attributeName = (String)it.next();
              Object attributeValue = profile.getUserAttribute(attributeName);
              userAttributes.put(attributeName, attributeValue);
            }
            dataSet.addBinding("attributes", userAttributes);
            dataSet.addBinding("parameters", this.getEnv());
            logger.debug("Executing query ...");
            dataSet.loadData(start, limit, (maxSize == null? -1: maxSize.intValue()));
           
            dataStore = dataSet.getDataStore();
         
          } else {
            // case of FormEngine
           
            JDBCDataSet dataset = new JDBCDataSet();
View Full Code Here

      super.checkUserPermissionForFunctionality(SpagoBIConstants.DATASET_MANAGEMENT, "User cannot see datasets congifuration.");
      if (dataSetId == null) {
        logger.warn("DataSet identifier in input is null!");
        return null;
      }
      IDataSet dataSet = DAOFactory.getDataSetDAO().loadActiveIDataSetByID(dataSetId);
      if (dataSet == null) {
        logger.warn("DataSet with identifier [" + dataSetId + "] not existing.");
        return null;
      }
      toReturn = new SDKObjectsConverter().fromSpagoBiDataSetToSDKDataSet(dataSet.toSpagoBiDataSet());
    } catch(NotAllowedOperationException e) {
      throw e;
    } catch(Exception e) {
      logger.error("Error while retrieving SDKEngine list", e);
      logger.debug("Returning null");
View Full Code Here

    try {
      super.checkUserPermissionForFunctionality(SpagoBIConstants.DATASET_MANAGEMENT, "User cannot see datasets congifuration.");
      List dataSetList = DAOFactory.getDataSetDAO().loadAllActiveDataSets();
      toReturn = new SDKDataSet[dataSetList.size()];
      for (int i = 0; i < dataSetList.size(); i++) {
        IDataSet dataSet = (IDataSet) dataSetList.get(i);
        SDKDataSet sdkDataSet = new SDKObjectsConverter().fromSpagoBiDataSetToSDKDataSet(dataSet.toSpagoBiDataSet());
        toReturn[i] = sdkDataSet;
      }
    } catch(NotAllowedOperationException e) {
      throw e;
    } catch(Exception e) {
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.