Package it.eng.spagobi.utilities

Examples of it.eng.spagobi.utilities.ParametersDecoder


     */
    private void addParToParMap(Map params, String parName, String parValue) {
  logger.debug("IN.parName:"+parName+" /parValue:"+parValue);
  String newParValue;

  ParametersDecoder decoder = new ParametersDecoder();
  if (decoder.isMultiValues(parValue)) {
      List values = decoder.decode(parValue);
      newParValue = "";
      for (int i = 0; i < values.size(); i++) {
    newParValue += (i > 0 ? "," : "");
    newParValue += values.get(i);
      }
View Full Code Here


    String parameters="";
      //Search if the chart has parameters
    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();
       
View Full Code Here

            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

      dateformat = dateformat.replaceAll("m", "M");
      dateformat = dateformat.replaceAll("Y", "y");
    }
   
    JRParameter[] reportParameters = report.getParameters();
    ParametersDecoder decoder = new ParametersDecoder();
    for (int i = 0; i < reportParameters.length; i++) {
      JRParameter parameter = reportParameters[i];
     
      logger.debug("Examining parameter with name [" + parameter.getName() + "] ...");

      String paramValueString = null;

      if(getEnv().get( parameter.getName() ) instanceof String ){ 
        paramValueString=(String) getEnv().get( parameter.getName() );
      }
     
      if (paramValueString == null) {
        logger.debug("No value found for parameter with name [" + parameter.getName() + "]");
      } else {
        logger.debug("Value found for parameter with name [" + parameter.getName() + "] is [" + paramValueString + "]");
        /*
         * The ParameterConverter converts a single value. Multi-value
         * parameters are assumed to contains values that are String type.
         * If they are not Strings (list of dates, list of numbers, ...) the
         * converter will not work.
         */
        if (decoder.isMultiValues(paramValueString)) {
          logger.debug("Value found for parameter with name [" + parameter.getName() + "] is [" + paramValueString + "] and it is multivalue. " +
          "Cannot adapt parameter nature");
          continue;
        }
        Class aReportParameterClass = parameter.getValueClass();
View Full Code Here

   * @return the string
   */
  private String decodeParameterValue(String parValue) {
    String newParValue;

    ParametersDecoder decoder = new ParametersDecoder();
    if (decoder.isMultiValues(parValue)) {
      List values = decoder.decode(parValue);
      newParValue = "";
      for (int i = 0; i < values.size(); i++) {
        newParValue += (i > 0 ? "," : "");
        newParValue += values.get(i);
      }
View Full Code Here

   * @return the string
   */
  private String decodeParameterValue(String parValue) {
    String newParValue;
     
    ParametersDecoder decoder = new ParametersDecoder();
    if(decoder.isMultiValues(parValue)) {     
      List values = decoder.decode(parValue);
      newParValue = "";
      for(int i = 0; i < values.size(); i++) {
        newParValue += (i>0?",":"");
        newParValue += values.get(i);
      }
View Full Code Here

          if((parameterValue==null) || parameterValue.trim().equals("") ){
            continue;
          }
         
          String decodedParameterValue = parameterValue;
          ParametersDecoder decoder = new ParametersDecoder();
          if(decoder.isMultiValues(parameterValue)) {
            decodedParameterValue = (String)decoder.decode(parameterValue).get(0);
          }
                 
        newQuery = ParameterSetter.setParameters(queryStr, as, parameterValue);       
        }
      }   
View Full Code Here

          String parameterValue = request.getParameter(name);
          if((parameterValue==null) || parameterValue.trim().equals("") ){
            continue;
          }
          String decodedParameterValue = parameterValue;
          ParametersDecoder decoder = new ParametersDecoder();
          if(decoder.isMultiValues(parameterValue)) {
            decodedParameterValue = (String)decoder.decode(parameterValue).get(0);
          }
        newQuery = ParameterUtilities.setParameters(queryStr, as, parameterValue);       
        }
      }   
      return newQuery;
View Full Code Here

    if (paramaterValue == null)
      return null;
    else {
      String paramaterValueStr = paramaterValue.toString();
      String toReturn = "";
      ParametersDecoder decoder = new ParametersDecoder();
      if (decoder.isMultiValues(paramaterValueStr)) {
        List values = decoder.decode(paramaterValueStr);
        // toReturn = (String) values.get(0);
        for (int i = 0; i < values.size(); i++) {
          toReturn += (i > 0 ? "," : "");
          toReturn += values.get(i);
        }
View Full Code Here

     */
    private void addParToParMap(Map params, String parName, String parValue) {
  logger.debug("IN.parName:"+parName+" /parValue:"+parValue);
  String newParValue;

  ParametersDecoder decoder = new ParametersDecoder();
  if (decoder.isMultiValues(parValue)) {
      List values = decoder.decode(parValue);
      newParValue = "";
      for (int i = 0; i < values.size(); i++) {
    newParValue += (i > 0 ? "," : "");
    newParValue += values.get(i);
      }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.ParametersDecoder

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.