171. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/13/2018 10:35:24 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

171.1 Files compared

# Location File Last Modified
1 v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\ccht\service\report CompositeReportBuilder.java Fri Dec 7 17:36:30 2018 UTC
2 v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\ccht\service\report CompositeReportBuilder.java Thu Dec 13 15:10:32 2018 UTC

171.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 272
Changed 1 2
Inserted 0 0
Removed 0 0

171.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

171.4 Active regular expressions

No regular expressions were active.

171.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrig ht 2010 VH A. All rig hts reserv ed
  3    ********* ********** ********** ********** ********** ********** *********/
  4   // Package
  5   package go v.va.med.c cht.servic e.report;
  6  
  7   // Framewo rk classes
  8   import jav a.io.IOExc eption;
  9   import jav a.util.Arr ayList;
  10   import jav a.util.Lis t;
  11   import jav a.util.Map ;
  12  
  13   import org .apache.co mmons.lang 3.Validate ;
  14  
  15   import gov .va.med.cc ht.model.r eport.Repo rtParamete rs;
  16   import gov .va.med.cc ht.model.t erminology .ReportFor mat;
  17   import gov .va.med.fw .report.Co nfigurable ReportBuil der;
  18   import gov .va.med.fw .report.Re portConfig uration;
  19   import gov .va.med.fw .report.Re portExcept ion;
  20   import gov .va.med.fw .report.da ta.QueryCr iteria;
  21   import gov .va.med.fw .report.da ta.ReportD ata;
  22   import gov .va.med.fw .report.da ta.ReportD ataService ;
  23   import gov .va.med.fw .report.ja sperreport .data.Jasp erReportDa ta;
  24  
  25   /**
  26    * This cl ass allows  to use mu ltiple dat a source f or a repor t.
  27    * 
  28    * Project : Framewor k</br> Cre ated on: 4 :59:46 PM  </br>
  29    * 
  30    * @author   DNS v
  31    */
  32   public cla ss Composi teReportBu ilder exte nds Config urableRepo rtBuilder  {
  33  
  34           pr ivate stat ic final l ong serial VersionUID  = 1325536 7222085890 25L;
  35  
  36           pr ivate Map  queryNames  = null;
  37  
  38           pr ivate Map  requiredDa taSources  = null;
  39  
  40           pu blic Compo siteReport Builder(fi nal Report DataServic e reportDa taService)  {
  41                    supe r(reportDa taService) ;
  42           }
  43  
  44           /* *
  45            *  Map of Re port ID to  list of q uery names .
  46            *  
  47            *  @param qu eryNames
  48            * /
  49           pu blic void  setQueryNa mes(Map qu eryNames)  {
  50                    this .queryName s = queryN ames;
  51           }
  52  
  53           /* *
  54            *  Map of Re port ID to  master re port requi res data s ource or n ot.
  55            *  
  56            *  @param re quiredData Sources
  57            * /
  58           pu blic void  setRequire dDataSourc es(Map req uiredDataS ources) {
  59                    this .requiredD ataSources  = require dDataSourc es;
  60           }
  61  
  62           /* *
  63            *  This meth od gets da ta source  for each q uary and s ets in
  64            *  config.se tResourceM apping exc ept for fi rst data s ource
  65            *  
  66            *  @param co nfiguratio n
  67            *  @return
  68            *  @throws R eportExcep tion
  69            * /
  70           pr otected Re portData d oRequestDa ta(ReportC onfigurati on configu ration) th rows Repor tException  {
  71  
  72                    // G et a repor t service  and a repo rt name
  73                    Repo rtDataServ ice servic e = this.g etReportDa taService( configurat ion);
  74                    Quer yCriteria  criteria =  configura tion.getQu eryCriteri a();
  75                    Stan dardReport Criteria r eportCrite ria = crit eria insta nceof Stan dardReport Criteria ?  (Standard ReportCrit eria) crit eria
  76                                      : null;
  77                    Repo rtParamete rs paramsS et = repor tCriteria  != null ?  reportCrit eria
  78                                      .getRepo rtSetup(). getReportP arameters( ) : null;
  79                    Repo rtFormat f ormat = pa ramsSet !=  null ? pa ramsSet.ge tReportFor mat()
  80                                      : null;
  81                    Stri ngBuilder  reportName  = new Str ingBuilder ();
  82                    repo rtName.app end(config uration.ge tReportNam e());
  83                    // A ppend form at type to  report na me.
  84                    if ( format !=  null && fo rmat.getDe scription( ) != null)  {
  85                             report Name.appen d(".").app end(format .getDescri ption().tr im());
  86                    }
  87                    // C heck maste r report r equires da tasource.
  88                    Obje ct tmp = r equiredDat aSources.g et(reportN ame.toStri ng());
  89                    Stri ng flag =  tmp != nul l && tmp.e quals("tru e") ? (Str ing) tmp :  "false";
  90  
  91                    bool ean datafo rMasterRep ort = new  Boolean(fl ag).boolea nValue();
  92                    // I nit to emp ty data so urce.
  93                    Repo rtData dat a = new Ja sperReport Data(new A rrayList() );
  94  
  95                    // G et data fo r reports
  96                    tmp  = this.que ryNames.ge t(reportNa me.toStrin g());
  97                    List  subReport s = tmp in stanceof L ist ? (Lis t) tmp : n ull;
  98                    int  totalOfRep orts = sub Reports !=  null ? su bReports.s ize() : 0;
  99  
  100                    // L oop throug h sub repo rts to get  a list of  queries
  101                    for  (int i = 0 ; i < tota lOfReports ; i++) {
  102                             String  queryName  = subRepo rts != nul l ? subRep orts.toStr ing():null ;
  103                             try {
  104                                      ReportCo nfiguratio n reportCo nfig = new  ReportCon figuration (queryName , configur ation
  105                                                       .g etReportID (), config uration.ge tReportOut putType(),  configura tion
  106                                                       .g etReportOu tputName() );
  107                                      reportCo nfig.setQu eryCriteri a(configur ation.getQ ueryCriter ia());
  108                                      reportCo nfig.setRe portUser(c onfigurati on.getRepo rtUser());
  109                                      reportCo nfig.setRe sourceMapp ing(config uration.ge tResourceM apping());
  110                                      // If ma ster repor t requires  data sour ce get it.
  111                                      if (data forMasterR eport && i  == 0) {
  112                                               data = ser vice.reque stReportDa ta(reportC onfig);
  113                                      } else {  // Get da ta source  for sub re ports.
  114  
  115                                               ReportData  subReport Data = ser vice.reque stReportDa ta(reportC onfig);
  116                                               if (subRep ortData !=  null && s ubReportDa ta instanc eof Jasper ReportData ) {
  117                                                       co nfiguratio n.addResou rceMapping (queryName ,
  118                                                                         ((Jasp erReportDa ta) subRep ortData).g etJasperDa taSource() );
  119                                               }
  120                                      }
  121                             } catc h (IOExcep tion e) {
  122                                      throw ne w ReportEx ception(
  123                                                       "F ailed to c reate a re port confi guration f or a subre port", e);
  124                             }
  125                    }
  126                    retu rn data;
  127           }
  128  
  129           /* *
  130            *  @see gov. va.med.fw. service.Ab stractComp onent#afte rPropertie sSet()
  131            * /
  132           pu blic void  afterPrope rtiesSet()  throws Ex ception {
  133                    supe r.afterPro pertiesSet ();
  134                    Vali date.notNu ll(this.qu eryNames,  "A queryNa mes must b e configur ed");
  135                    Vali date.notNu ll(this.re quiredData Sources, " A required DataSource s must be  configured ");
  136           }
  137   }