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;
}
}