Package it.eng.spagobi.engines.kpi.bo

Examples of it.eng.spagobi.engines.kpi.bo.KpiResourceBlock


      try {
        if (this.resources == null || this.resources.isEmpty()) {
          logger.debug("There are no resources assigned to the Model Instance");

          KpiResourceBlock block = new KpiResourceBlock();
          block.setD(this.dateOfKPI);
          KpiLine line = getBlock(mI.getModelInstanceNodeId(), null);       
          block.setRoot(line);
          block.setOptions(options);
          logger.debug("Setted the tree Root.");
          kpiRBlocks.add(block);
        } else {
          Iterator resourcesIt = this.resources.iterator();
          while (resourcesIt.hasNext()) {
            Resource r = (Resource) resourcesIt.next();
            logger.info("-------Resource: " + r.getName());
            KpiResourceBlock block = new KpiResourceBlock();
            block.setR(r);

        block.setD(dateOfKPI);
            block.setOptions(options);
            KpiLine line = getBlock(mI.getModelInstanceNodeId(), r);
            block.setRoot(line);
            logger.debug("Setted the tree Root.");
            kpiRBlocks.add(block);
          }
        }
      } catch (EMFInternalError e) {
View Full Code Here


      ModelInstanceNode modI = DAOFactory.getModelInstanceDAO().loadModelInstanceById(mI.getModelInstanceNodeId(), dateOfKPI);

      logger.debug("Setted the List of Kpis that does not need to be persisted in db");
      if (this.resources == null || this.resources.isEmpty()) {
        logger.debug("There are no resources assigned to the Model Instance");
        KpiResourceBlock block = new KpiResourceBlock();
        block.setD(this.dateOfKPI);
        block.setParMap(this.parametersObject);
        KpiLine line = getBlock(mI.getModelInstanceNodeId(), null);
        block.setRoot(line);
        block.setTitle(name);
        block.setSubtitle(subName);
        block.setOptions(options);
        logger.debug("Setted the tree Root.");
        kpiRBlocks.add(block);

      }else {
        Iterator resourcesIt = this.resources.iterator();
        while (resourcesIt.hasNext()) {
          Resource r = (Resource) resourcesIt.next();
          logger.info("Resource: " + r.getName());
          KpiResourceBlock block = new KpiResourceBlock();
          block.setR(r);
          block.setD(dateOfKPI);
          block.setParMap(this.parametersObject);
          KpiLine line = getBlock(mI.getModelInstanceNodeId(), r);
          block.setRoot(line);
          block.setOptions(options);
          logger.debug("Setted the tree Root.");
          kpiRBlocks.add(block);
        }
      }
View Full Code Here

    bandSummaryReport=(SourceBean)subSummarySB.getAttribute("BAND")
   
    try {
    // cycle on resources
    for (Iterator iterator = resources.iterator(); iterator.hasNext();) {
      KpiResourceBlock thisBlock = (KpiResourceBlock) iterator.next();
      options = thisBlock.getOptions()
       
        if(actualHeight+separatorModelsHeight+resourceBandHeight+10<maxFirstSubTemplateHeight){
          List sourceBeansToAdd = newResource(thisBlock,bandDetailReport)
          if (sourceBeansToAdd!=null && !sourceBeansToAdd.isEmpty()){
          Iterator it = sourceBeansToAdd.iterator();
            while(it.hasNext()){
              SourceBean toAdd = (SourceBean)it.next();
              bandDetailReport.setAttribute(toAdd);
            }
          }
        }else{
         
          //Add last subreport to the List
          increaseHeight(subTemplateBaseContent);
          subreports.add(subTemplateBaseContent);
          actualHeight = new Integer(0);
          subTemplateBaseContent = createNewSubReport(countSubreports);
          countSubreports ++;
          //Get my bandDetailReport from new subreport
          subtitleSB=(SourceBean)subTemplateBaseContent.getAttribute("title");
          bandDetailReport=(SourceBean)subtitleSB.getAttribute("BAND");
          //change subtemplatesummary
          subSummarySB=(SourceBean)subTemplateBaseContent.getAttribute("summary");
          bandSummaryReport=(SourceBean)subSummarySB.getAttribute("BAND")
          //NEW SUBREPORT
          List sourceBeansToAdd = newResource(thisBlock,bandDetailReport)
          if (sourceBeansToAdd!=null && !sourceBeansToAdd.isEmpty()){
          Iterator it = sourceBeansToAdd.iterator();
            while(it.hasNext()){
              SourceBean toAdd = (SourceBean)it.next();
              bandDetailReport.setAttribute(toAdd);
           
          }
        }
     
     
     
         
          if (actualHeight+separatorHeight+valueHeight+10<maxFirstSubTemplateHeight){
            KpiLine lineRoot=thisBlock.getRoot();
            List sourceBeansToAdd2 = newLine(lineRoot, 0,true);
            if (sourceBeansToAdd2!=null && !sourceBeansToAdd2.isEmpty()){
            Iterator it = sourceBeansToAdd2.iterator();
              while(it.hasNext()){
                SourceBean toAdd = (SourceBean)it.next();
                bandDetailReport.setAttribute(toAdd);
             
            }
          }else{
            //Add last subreport to the List
            increaseHeight(subTemplateBaseContent);
            subreports.add(subTemplateBaseContent);
            actualHeight = new Integer(0);
            subTemplateBaseContent = createNewSubReport(countSubreports);
            countSubreports ++;
            //Get my bandDetailReport from new subreport
            subtitleSB=(SourceBean)subTemplateBaseContent.getAttribute("title");
            bandDetailReport=(SourceBean)subtitleSB.getAttribute("BAND");
            //change subtemplatesummary
            subSummarySB=(SourceBean)subTemplateBaseContent.getAttribute("summary");
            bandSummaryReport=(SourceBean)subSummarySB.getAttribute("BAND")
            //NEW SUBREPORT
            KpiLine lineRoot=thisBlock.getRoot();
            List sourceBeansToAdd2 = newLine(lineRoot, 0,true);
            if (sourceBeansToAdd2!=null && !sourceBeansToAdd2.isEmpty()){
            Iterator it = sourceBeansToAdd2.iterator();
              while(it.hasNext()){
                SourceBean toAdd = (SourceBean)it.next();
View Full Code Here

  }

  public void createXml(List resources){
    logger.debug("IN");
   
    KpiResourceBlock tempBlock = (KpiResourceBlock)resources.get(0);
    this.documentTitle = tempBlock.getTitle();
    this.documentSubTitle = tempBlock.getSubtitle();
    createTitle();
    createSubtitle();
   
    for (Iterator iterator = resources.iterator(); iterator.hasNext();) {
      SourceBean resToAdd = null;
      KpiResourceBlock thisBlock = (KpiResourceBlock) iterator.next();
      resToAdd = newResource(thisBlock);
          try {
          docKpiBlockS.setAttribute(resToAdd);
        } catch (SourceBeanException e) {
          logger.error("SourceBean Exception",e);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.kpi.bo.KpiResourceBlock

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.