Package it.eng.spagobi.sdk.datasets.bo

Examples of it.eng.spagobi.sdk.datasets.bo.SDKDataSet





  public SDKDataSet getDataSet(Integer dataSetId) throws NotAllowedOperationException {
    SDKDataSet toReturn = null;
    logger.debug("IN: dataSetId in input = " + dataSetId);
    try {
      super.checkUserPermissionForFunctionality(SpagoBIConstants.DATASET_MANAGEMENT, "User cannot see datasets congifuration.");
      if (dataSetId == null) {
        logger.warn("DataSet identifier in input is null!");
View Full Code Here


      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

    logger.debug("IN");
    if (spagoBiDataSet == null) {
      logger.warn("SpagoBiDataSet in input is null!!");
      return null;
    }
    SDKDataSet toReturn = null;
    try {
      toReturn = new SDKDataSet();
      toReturn.setId(spagoBiDataSet.getDsId());
      toReturn.setLabel(spagoBiDataSet.getLabel());
      toReturn.setName(spagoBiDataSet.getName());
      toReturn.setDescription(spagoBiDataSet.getDescription());

      toReturn.setPivotColumnName(spagoBiDataSet.getPivotColumnName());
      toReturn.setPivotColumnValue(spagoBiDataSet.getPivotColumnValue());
      toReturn.setPivotRowName(spagoBiDataSet.getPivotRowName());
      toReturn.setNumberingRows(spagoBiDataSet.isNumRows());

      // file dataset
      toReturn.setFileName(spagoBiDataSet.getFileName());

      // jdbc dataset
      toReturn.setJdbcQuery(spagoBiDataSet.getQuery());
      if (spagoBiDataSet.getDataSource() != null) {
        toReturn.setJdbcDataSourceId(spagoBiDataSet.getDataSource().getId());
      }

      // web service dataset
      toReturn.setWebServiceAddress(spagoBiDataSet.getAdress());
      toReturn.setWebServiceOperation(spagoBiDataSet.getOperation());

      // script dataset
      toReturn.setScriptText(spagoBiDataSet.getScript());
      toReturn.setScriptLanguage(spagoBiDataSet.getLanguageScript());

      // java dataset
      toReturn.setJavaClassName(spagoBiDataSet.getJavaClassName());

      toReturn.setJsonQuery(spagoBiDataSet.getJsonQuery());
      toReturn.setDatamarts(spagoBiDataSet.getDatamarts());

      /*
      String type = null;

      if ( ScriptDataSet.DS_TYPE.equals( spagoBiDataSet.getType() ) ) {
        type = "SCRIPT";
      } else if (  JDBCDataSet.DS_TYPE.equals( spagoBiDataSet.getType() ) ) {
        type = "JDBC_QUERY";
      } else if ( JavaClassDataSet.DS_TYPE.equals( spagoBiDataSet.getType() ) ) {
        type = "JAVA_CLASS";
      } else if ( WebServiceDataSet.DS_TYPE.equals( spagoBiDataSet.getType() ) ) {
        type = "WEB_SERVICE";
      } else if ( FileDataSet.DS_TYPE.equals( spagoBiDataSet.getType() ) ) {
        type = "FILE";
      } else {
        logger.error("Dataset type [" + spagoBiDataSet.getType() + "] unknown.");
        type = "UNKNOWN";
      }

      toReturn.setType(type);
       */
      toReturn.setType(spagoBiDataSet.getType());
     
      List dataSetParameterItemList = null;
      String parametersXML=spagoBiDataSet.getParameters();
      if(parametersXML!=null && !((parametersXML.trim()).equals(""))){
        DataSetParametersList dsParam=new DataSetParametersList(parametersXML);
        dataSetParameterItemList=dsParam.getItems();
      }
      SDKDataSetParameter[] parameters = null;
      if (dataSetParameterItemList != null) {
        parameters = this.fromDataSetParameterItemListToSDKDataSetParameterArray(dataSetParameterItemList);
      } else {
        parameters = new SDKDataSetParameter[0];
      }

      toReturn.setParameters(parameters);

    } catch (Exception e) {
      logger.error("Error while converting SpagoBiDataSet into SDKDataSet.", e);
      logger.debug("Returning null.");
      return null;
View Full Code Here

public class DataSetsSDKServiceImpl extends AbstractSDKService implements DataSetsSDKService {

  static private Logger logger = Logger.getLogger(DataSetsSDKServiceImpl.class);

  public SDKDataSet getDataSet(Integer dataSetId) throws NotAllowedOperationException {
    SDKDataSet toReturn = null;
    logger.debug("IN: dataSetId in input = " + dataSetId);
    try {
      super.checkUserPermissionForFunctionality(SpagoBIConstants.DATASET_MANAGEMENT, "User cannot see datasets congifuration.");
      if (dataSetId == null) {
        logger.warn("DataSet identifier in input is null!");
View Full Code Here

      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.sdk.datasets.bo.SDKDataSet

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.