// map that associates document labels and DOcument Containers (containing informations)
Map<String, DocumentContainer> documents=new LinkedHashMap<String, DocumentContainer>();
SpagoBIRequestContainer requestContainer=getSpagoBIRequestContainer();
SourceBean sb=requestContainer.getRequest();
// Recover currentParametersConfiguration
Map<String, CurrentConfigurationDocComp> currentConfigurationsMap=new HashMap<String, CurrentConfigurationDocComp>();
// if only one metadata style is wrong use default table style (ignore table positions)
boolean defaultStyle=false;
Map styles=docCompConf.getLstDivStyle();
//Map docsMap=docCompConf.getDocumentsMap();
Iterator iteratorStyles=styles.keySet().iterator();
for (Iterator iterator = docCompConf.getDocumentsArray().iterator(); iterator.hasNext();) {
Document doc = (Document) iterator.next();
String label=doc.getSbiObjLabel();
logger.debug("Document "+label);
// recover style informations
String styleLab=(String)iteratorStyles.next();
String styleString=(String)styles.get(styleLab);
if(styleString==null)styleString="";
MetadataStyle metadataStyle=MetadataStyle.getMetadataStyle(label,styleString.toString(), docCompConf);
if(defaultStyle==false){
defaultStyle=(metadataStyle == null) ? true : false;
}
DocumentContainer documentContainer=new DocumentContainer();
documentContainer.setStyle(metadataStyle);
documents.put(label, documentContainer);
// get its parameters configuration
logger.debug("Get parametrs configuration for document "+label);
Object urlO=sb.getAttribute("TRACE_PAR_"+label);
if(urlO!=null){
String url=urlO.toString();
CurrentConfigurationDocComp ccdc=new CurrentConfigurationDocComp(label);
ccdc.fillParsFromUrl(url);
currentConfigurationsMap.put(label, ccdc);
}
// get its svg (for highcharts document because they're created only by the client-side)
logger.debug("Get svg content for the highchart "+label);
String svg = (sb.getAttribute("SVG_"+label) != null)?sb.getAttribute("SVG_"+label).toString():null;
if(svg != null){
CurrentConfigurationDocComp ccdc = new CurrentConfigurationDocComp(label);
Map<String,Object> svgChartPar = new HashMap<String,Object>();
svgChartPar.put("SVG_"+label, svg);
ccdc.setParameters(svgChartPar);