62. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/2/2019 1:06:55 PM Central 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.

62.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\service\impl AuditLoggerServiceImpl.java Wed Mar 27 19:22:43 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\service\impl AuditLoggerServiceImpl.java Fri Mar 29 17:28:52 2019 UTC

62.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 238
Changed 2 4
Inserted 0 0
Removed 0 0

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

62.4 Active regular expressions

No regular expressions were active.

62.5 Comparison detail

  1   /**
  2    * 
  3    */
  4   package go v.va.med.a rs.service .impl;
  5  
  6   import jav a.util.Arr ays;
  7   import jav a.util.Dat e;
  8   import jav a.util.Lis t;
  9  
  10   import org .apache.co mmons.lang .ObjectUti ls;
  11   import org .springfra mework.bea ns.factory .annotatio n.Autowire d;
  12   import org .springfra mework.htt p.HttpStat us;
  13   import org .springfra mework.ste reotype.Se rvice;
  14  
  15   import gov .va.med.ar s.constant s.ErrorMes sages;
  16   import gov .va.med.ar s.constant s.IAuditLo gConstants ;
  17   import gov .va.med.ar s.dao.ars. IAuditLogg erReposito ry;
  18   import gov .va.med.ar s.dao.ars. IClaimAtta chmentsVie wRepositor y;
  19   import gov .va.med.ar s.exceptio ns.Generic Exception;
  20   import gov .va.med.ar s.model.re quest.Audi tLogger;
  21   import gov .va.med.ar s.model.re quest.Expo rtAsPDF;
  22   import gov .va.med.ar s.service. IAuditLogg erService;
  23   import gov .va.med.do main.ars.A rsauditlog ;
  24   import gov .va.med.do main.ars.C laimattach mentsView;
  25  
  26   /**
  27    * @author  
D NS     GANGAV
  28    *
  29    */
  30   @Service
  31   public cla ss AuditLo ggerServic eImpl impl ements IAu ditLoggerS ervice {
  32  
  33           @A utowired
  34           IC laimAttach mentsViewR epository  claimAttac hmentRepos itory;
  35           
  36           @A utowired
  37           IA uditLogger Repository  auditLogg erReposito ry;
  38           
  39           @O verride
  40           pu blic Strin g getPathF orExportAs PDF(Export AsPDF requ est) throw s GenericE xception {
  41                    if(r equest ==  null) {
  42                             throw  new Generi cException (ErrorMess ages.BAD_R EQUEST, "R equired Da ta is miss ing", Http Status.BAD _REQUEST);
  43                    }
  44  
  45                    Stri ng attachm entPath =  null;
  46                    Clai mattachmen tsView cv  = claimAtt achmentRep ository.fi ndOneByAtt achIdLx(re quest.getA ttachIdLx( ));
  47                    if ( cv == null  || cv.get AttachIdLx () == null  || cv.get Attachment Path() ==  null) {
  48                             throw  new Generi cException (ErrorMess ages.NOT_F OUND, "Dat a not foun d for Expo rtAsPDF At tachIdLx",  HttpStatu s.NOT_FOUN D);
  49                    }
  50                    atta chmentPath  = cv.getA ttachmentP ath();                                   
  51                    atta chmentPath  = extract Attachment (attachmen tPath);
  52                    
  53                    // ? ? This see ms to be l eft-over c ode to pat ch-up some  database  paths that  have been  changed.
  54                    // T he proper  thing to d o is updat e the data base!!
  55   //                attachment Path = att achmentPat h.replace( "https:// SERVER . DOMAIN/POR T ", "/u02") ;
  56  
  57                    Arsa uditlog ar sAuditLog  = new Arsa uditlog(
  58                                      IAuditLo gConstants .METHODNAM E, 
  59                                      request. getVhaName (), 
  60                                      request. getAttachI dLx(),
  61                                      new Date (),
  62                                      "ClaimAt tachIdLx="  + request .getAttach IdLx(),    // IAuditL ogConstant s.REQUESTA RGS + requ est.getAtt achIdLx(),
  63                                      IAuditLo gConstants .EXPORTPDF ACTION,
  64                                      true,
  65                                      1L);             
  66                    if ( arsAuditLo g != null)  {
  67                             auditL oggerRepos itory.save (arsAuditL og);
  68                    }
  69                    retu rn attachm entPath;
  70                    
  71           }
  72  
  73           @O verride
  74           pu blic Strin g getPathF orTheAttac hment(Audi tLogger au ditLogger)  throws Ge nericExcep tion {
  75   //               audi tLogger =  (AuditLogg er) Object Utils.defa ultIfNull( auditLogge r, null); 
  76                    // ? ? effectiv ely, if (a uditLogger ==null) au ditLogger  = null; //  Why?
  77  
  78                    if(a uditLogger  == null)  {
  79                             throw  new Generi cException (ErrorMess ages.BAD_R EQUEST, "R equired Da ta is miss ing", Http Status.BAD _REQUEST);
  80                    }
  81  
  82                    Stri ng attachm entPath =  null;
  83                    Clai mattachmen tsView cv  = claimAtt achmentRep ository.fi ndOneByAtt achIdLx(au ditLogger. getAttachI dLx());
  84                    if ( cv == null  || cv.get AttachIdLx () == null  || cv.get Attachment Path() ==  null) {
  85                             throw  new Generi cException (ErrorMess ages.NOT_F OUND, "Dat a not foun d for a gi ven Attach IdLx", Htt pStatus.NO T_FOUND);
  86                    }
  87                    atta chmentPath  = cv.getA ttachmentP ath();                                   
  88                    atta chmentPath  = extract Attachment (attachmen tPath);      // Not s ure about  this ??
  89                    
  90                    Arsa uditlog ar sAuditLog  = setAudit LogData(at tachmentPa th, auditL ogger);
  91                    if ( arsAuditLo g != null)  {
  92                             auditL oggerRepos itory.save (arsAuditL og);
  93                    }
  94                    retu rn attachm entPath;
  95           }
  96  
  97           pu blic Strin g extractA ttachment( String mul tiplePathA ddress) {
  98                    // I t would be  good to k now why XM L is being  treated s pecially.
  99                    List <String> p athAddress  = Arrays. asList(mul tiplePathA ddress.spl it("<"));
  100                    if ( pathAddres s.size() >  1) {
  101                             for (S tring path : pathAddr ess) {
  102                                      if (path .toUpperCa se().conta ins("XML") ) {
  103                                               return pat h;
  104                                      }
  105                             }
  106                    }
  107                    retu rn pathAdd ress.get(0 );
  108           }
  109  
  110           pr ivate Arsa uditlog se tAuditLogD ata(String  attachmen tPath, Aud itLogger a uditLogger ) {
  111                    Arsa uditlog ar sAuditLog  = null;
  112                String a uditAction  = auditLo gger.getIs Download()  != null & & auditLog ger.getIsD ownload()
  113                                      ? IAudit LogConstan ts.DOWNLOA DACTION
  114                                      : IAudit LogConstan ts.VIEWACT ION;
  115                    arsA uditLog =  new Arsaud itlog(IAud itLogConst ants.METHO DNAME, aud itLogger.g etVhaName( ), auditLo gger.getAt tachIdLx() , new Date (),
  116                                               IAuditLogC onstants.R EQUESTARGS +auditLogg er.getAtta chIdLx(),  auditActio n, true, 1 L);              
  117                    retu rn arsAudi tLog;
  118           }
  119  
  120  
  121   }