221. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:14 AM Eastern Daylight 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.

221.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\report AbstractReportTemplate.java Wed May 29 15:26:02 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\report AbstractReportTemplate.java Mon Jun 10 19:27:47 2019 UTC

221.2 Comparison summary

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

221.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

221.4 Active regular expressions

No regular expressions were active.

221.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2004 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4   // Package
  5   package go v.va.med.f w.report;
  6  
  7   // Java cl asses
  8   import jav a.util.Map ;
  9  
  10   import org .apache.co mmons.lang .Validate;
  11  
  12   import gov .va.med.fw .cache.Cac heStrategy ;
  13   import gov .va.med.fw .report.ex celreport. ExcelRepor t;
  14   import gov .va.med.fw .service.A bstractCom ponent;
  15   import gov .va.med.fw .service.S erviceExce ption;
  16  
  17   /**
  18    * Uses ca che strate gy to cach e pre-comp iled templ ates for f aster retr ieval. A
  19    * concret e cache st rategy imp lementatio n used to  cache a re port is an
  20    * EHCache Strategy
  21    * 
  22    * Project : Framewor k</br> Cre ated on: 4 :03:08 PM  </br>
  23    * 
  24    * @author   DN S
  25    */
  26   public abs tract clas s Abstract ReportTemp late exten ds Abstrac tComponent  implement s ReportTe mplate {
  27  
  28           /* *
  29            *  An instan ce of seri alVersionU ID
  30            * /
  31           pr ivate stat ic final l ong serial VersionUID  = 1034654 1684944679 07L;
  32  
  33           /* *
  34            *  An instan ce of temp lates
  35            * /
  36           pr ivate Map  templates  = null;
  37  
  38           /* *
  39            *  An instan ce of cach e
  40            * /
  41           pr ivate Cach eStrategy  templateCa che = null ;
  42  
  43           /* *
  44            *  An instan ce of name Resolver
  45            * /
  46           pr ivate Repo rtNameReso lver nameR esolver =  null;
  47  
  48           /* *
  49            *  An indica tor to pre  compile j asper repo rt templat e at start up
  50            * /
  51           pr ivate bool ean preCom piled = fa lse;
  52  
  53           /* *
  54            *  A default  construct or
  55            * /
  56           pr otected Ab stractRepo rtTemplate () {
  57                    supe r();
  58           }
  59  
  60           /* *
  61            *  @return R eturns the  preCompil e.
  62            * /
  63           pu blic boole an isPreCo mpiled() {
  64                    retu rn preComp iled;
  65           }
  66  
  67           /* *
  68            *  @param pr eCompile
  69            *              The preC ompile to  set.
  70            * /
  71           pu blic void  setPreComp iled(boole an preComp ile) {
  72                    this .preCompil ed = preCo mpile;
  73           }
  74  
  75           /* *
  76            *  @param te mplates
  77            *              The temp lates to s et.
  78            * /
  79           pu blic void  setTemplat es(Map tem plates) {
  80                    this .templates  = templat es;
  81           }
  82  
  83           /* *
  84            *  @param na meResolver
  85            *              The name Resolver t o set.
  86            * /
  87           pu blic void  setNameRes olver(Repo rtNameReso lver nameR esolver) {
  88                    this .nameResol ver = name Resolver;
  89           }
  90  
  91           /* *
  92            *  Sets a co ncrete imp lementatio n of a cac hing strat egy
  93            *  
  94            *  @param te mpalteCach e
  95            *              The temp lateCache  to set.
  96            * /
  97           pu blic void  setTemplat eCache(Cac heStrategy  cache) {
  98                    this .templateC ache = cac he;
  99           }
  100  
  101           /* *
  102            *  Returns a  cache str ategy that  provides  concrete i mplementat ion of cac hing
  103            *  
  104            *  @return C acheStrate gy A concr ete implem entation o f a strate gy
  105            * /
  106           pu blic Cache Strategy g etTemplate Cache() {
  107                    retu rn this.te mplateCach e;
  108           }
  109  
  110           /* *
  111            *  @see gov. va.med.fw. report.Rep ortTemplat e#getCompi ledTemplat e(gov.va.m ed.fw.repo rt.ReportC onfigurati on)
  112            * /
  113           pu blic Objec t getCompi ledTemplat e(ReportCo nfiguratio n config)  throws Inv alidTempla teExceptio n {
  114                    Stri ng name =  this.nameR esolver.ge tReportNam e(config);
  115  
  116                    if ( !this.isPr eCompiled( )) {
  117                             compil eTemplates (this.temp lates);
  118                    }
  119  
  120                    retu rn this.ge tTemplateC ache().get Item(name) ;
  121           }
  122  
  123           pu blic Objec t getExcel Template(R eportConfi guration c onfig) {
  124                    Stri ng name =  this.nameR esolver.ge tReportNam e(config);
  125                    Stri ng excelTe mplateName  = name +  ".xls";
  126                    try  {
  127                             return  getCompon ent(excelT emplateNam e, ExcelRe port.class );
  128                    } ca tch (Servi ceExceptio n e) {
  129                             logger .error("Co uld not lo ad xls tem plate for  excelTempl ateName",  e);
  130                             // Do  not fail a s these ar e optional  templates
  131                    }
  132                    retu rn null;
  133           }
  134  
  135           /* *
  136            *  @see gov. va.med.fw. service.Ab stractComp onent#afte rPropertie sSet()
  137            * /
  138           pu blic void  afterPrope rtiesSet()  throws Ex ception {
  139                    if ( this.nameR esolver ==  null) {
  140                             this.n ameResolve r = new Si mpleReport NameResolv er();
  141                    }
  142                    Vali date.notNu ll(this.te mplateCach e, "A temp late cache  is requir ed");
  143                    Vali date.notEm pty(this.t emplates,  "A map of  report tem plates mus t be confi gured");
  144                    if ( this.isPre Compiled() ) {
  145                             compil eTemplates (this.temp lates);
  146                    }
  147           }
  148  
  149           pr otected ab stract voi d compileT emplates(M ap templat es) throws  InvalidTe mplateExce ption;
  150   }