Package it.eng.spagobi.behaviouralmodel.analyticaldriver.bo

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.bo.BIObjectParameter


        return null;
      }
      toReturn = new SpagobiAnalyticalDriver[listPars.size()];
      int i = 0;
      for (Iterator iterator = listPars.iterator(); iterator.hasNext();) {
        BIObjectParameter par = (BIObjectParameter) iterator.next();

        SpagobiAnalyticalDriver toAdd = new SpagobiAnalyticalDriver(
            par.getId()
            par.getLabel(),
            par.getParameter().getType(),
            par.getParameterUrlName(),
            null    // values, not needed
        );
        toReturn[i] = toAdd;
        i++;
View Full Code Here


      Locale locale = new Locale(language, country);
//      List parameters = biobject.getBiObjectParameters();
      if (parameters != null && parameters.size() > 0) {
        Iterator iter = parameters.iterator();
        while (iter.hasNext()) {
          BIObjectParameter biparam = (BIObjectParameter) iter.next();
          JSONObject jsonParam = new JSONObject();
          jsonParam.put("id", biparam.getParameterUrlName());
          IMessageBuilder msgBuilder = MessageBuilderFactory.getMessageBuilder();
          jsonParam.put("label", msgBuilder.getUserMessage(biparam.getLabel(), SpagoBIConstants.DEFAULT_USER_BUNDLE, locale));
          jsonParam.put("type", biparam.getParameter().getType());
          parametersJSON.put(jsonParam);
        }
      }
    } catch (Exception e) {
      logger.error("Error while adding document parameters info", e);
View Full Code Here

    pars.put("prefixName", prefixName);
    logger.debug(" prefixName: " + prefixName);
   
    ParameterValuesEncoder parValuesEncoder = new ParameterValuesEncoder();
    if (biobj.getBiObjectParameters() != null) {
        BIObjectParameter biobjPar = null;
        for (Iterator it = biobj.getBiObjectParameters().iterator(); it.hasNext();) {
        try {
            biobjPar = (BIObjectParameter) it.next();
            String value = parValuesEncoder.encode(biobjPar);
            if (value != null)
          pars.put(biobjPar.getParameterUrlName(), value);
            else
          logger.warn("value encoded IS null");
            logger.debug("Add parameter:" + biobjPar.getParameterUrlName() + "/" + value);
        } catch (Exception e) {
            logger.error("Error while processing a BIParameter", e);
        }
        }
    }
View Full Code Here

            }
           
            //define a BIObjectParameter to use it for encode (multivalue management).
            if (obj.getEngine().getClassName() == null || obj.getEngine().getClassName().equalsIgnoreCase("")){
              //EXTERNAL ENGINES
              BIObjectParameter par = getBIObjectParameter(obj, key);
              par.setParameterValues(values);
              String parsValue = encoderUtility.encode(par);
              //conversion in UTF-8 of the par
              Map parsMap = new HashMap();
              parsMap.put(key, parsValue);
              String tmpUrl = GeneralUtilities.getUrl("",  parsMap);
View Full Code Here

    List retVal = new ArrayList();
    BIObject obj = instance.getBIObject();
    List objPars = obj.getBiObjectParameters();

    for (int i=0; i < objPars.size(); i++){
      BIObjectParameter objPar = (BIObjectParameter)objPars.get(i);
      if (objPar.getParameterUrlName().equalsIgnoreCase(key)){
        retVal.add((objPar.getParameterValues()==null)?"":(String)objPar.getParameterValues().get(0));
        break;
      }
    }
    return retVal;
View Full Code Here

   * @return BIObjectParameter
   */
  private static BIObjectParameter getBIObjectParameter(BIObject obj, String urlKey){
    if (urlKey == null || urlKey.equals("")) return null;
   
    BIObjectParameter par = null;
    List objParams = obj.getBiObjectParameters();
    for (int i = 0, l = objParams.size(); i < l; i++){
      par = (BIObjectParameter) objParams.get(i);
      if (par.getParameterUrlName().equals(urlKey))
        break;
    }
   
    return par;
  }
View Full Code Here

    List parametersBO=object.getBiObjectParameters();
    Map<String, Object> currentParameters=currentConf.getParameters();
    if(currentParameters!=null){
      if(parametersBO!=null){
        for (Iterator iterator = parametersBO.iterator(); iterator.hasNext();) {
          BIObjectParameter parAss = (BIObjectParameter) iterator.next();
          String urlName=parAss.getParameterUrlName();
          // get the value if present, otherwise will keep the present one


          Object valueObj=currentParameters.get(urlName);
          if(valueObj instanceof List){ // if it is a list put it into parAss
            List val=(List)valueObj;
            parAss.setParameterValues(val);
          }
          else{ // else it is a String
            if(valueObj!=null){
              String valueString=valueObj.toString();
              List values=(new ParametersDecoder()).getOriginalValues(valueString);
              if(values!=null){
                logger.debug("Put new values "+valueString+" to parameter "+urlName);
                parAss.setParameterValues(values);
                // remove value
                currentParameters.remove(urlName);
              }
            }
          }

        }
      }

      // Add the values that have not been removed (could be chart particular parameters)

      if(parametersBO==null) parametersBO=new ArrayList<BIObjectParameter>();
      for (Iterator iterator = currentParameters.keySet().iterator(); iterator.hasNext();) {
        String lab = (String) iterator.next();
        BIObjectParameter biObjPar=new BIObjectParameter();
        biObjPar.setParameterUrlName(lab);

        Object valueObj=currentParameters.get(lab);
        if(valueObj instanceof List){ // if it is a list put it into parAss
          List val=(List)valueObj;
          biObjPar.setParameterValues(val);
        }
        else{
          if(valueObj!=null){
            String valueString=valueObj.toString();
            List values=(new ParametersDecoder()).getOriginalValues(valueString);
            biObjPar.setParameterValues(values);
          }
          else{
            continue;
          }
        }
View Full Code Here

    List parametersList=obj.getBiObjectParameters();
    logger.debug("Check for BIparameters and relative values");
    if(parametersList!=null){
      ParametersDecoder decoder = new ParametersDecoder();
      for (Iterator iterator = parametersList.iterator(); iterator.hasNext();) {
        BIObjectParameter par= (BIObjectParameter) iterator.next();
        String url=par.getParameterUrlName();
        List values=par.getParameterValues();
       
       
        if(values!=null){
          /*
          if ((values.size() >=1)) {
View Full Code Here

    logger.debug("Check for BIparameters and relative values");

    for (Iterator iterator = parametersList.iterator(); iterator.hasNext();) {
      SimpleDateFormat f = new SimpleDateFormat();
      f.applyPattern(formatServer);
      BIObjectParameter par = (BIObjectParameter) iterator.next();
      String url = par.getParameterUrlName();
      List values = par.getParameterValues();
      if (values != null) {
        if (values.size() == 1) {
          if (url.equals("ParKpiResources")) {
            this.resources = new ArrayList();
            String value = (String) values.get(0);
View Full Code Here

    //add other input parameter of the crossed doc not refreshed (will get values by the request)
    try{
      BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectByLabel(objLabel);
      List objParams = obj.getBiObjectParameters();
      for (int j=0; j<objParams.size(); j++) {
        BIObjectParameter par = (BIObjectParameter)objParams.get(j);
        if (!param.containsValue(par.getParameterUrlName())) {
          param.setProperty("sbi_par_label_param_"+idxDoc+"_"+idxPar, par.getParameterUrlName());
          param.setProperty("default_value_param_"+idxDoc+"_"+idxPar, "");
          param.setProperty("type_par_"+idxDoc+"_"+idxPar, "IN");
          idxPar++;
        }
      }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.behaviouralmodel.analyticaldriver.bo.BIObjectParameter

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.