37226. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/17/2019 10:54:16 AM Central 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.

37226.1 Files compared

# Location File Last Modified
1 v1_iter_1_VIP_Build_4_Dec_2018_CG.zip\v1_iter_1_VIP_Build_4\portlets\caret-portlet\docroot\WEB-INF\src\gov\va\caret\controller\dashboard\config CbopcDashboardConfig.java Wed Jan 16 16:07:30 2019 UTC
2 v1_iter_1_VIP_Build_4_Dec_2018_CG.zip\v1_iter_1_VIP_Build_4\portlets\caret-portlet\docroot\WEB-INF\src\gov\va\caret\controller\dashboard\config CbopcDashboardConfig.java Wed Jan 16 21:50:36 2019 UTC

37226.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 708
Changed 2 6
Inserted 0 0
Removed 0 0

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

37226.4 Active regular expressions

No regular expressions were active.

37226.5 Comparison detail

  1   package go v.va.caret .controlle r.dashboar d.config;
  2  
  3   import jav a.util.Arr ayList;
  4   import jav a.util.Arr ays;
  5   import jav a.util.Col lection;
  6   import jav a.util.Col lections;
  7   import jav a.util.Has hMap;
  8   import jav a.util.Lin kedHashSet ;
  9   import jav a.util.Lis t;
  10   import jav a.util.Map ;
  11   import jav a.util.Set ;
  12   import jav a.util.Tre eMap;
  13  
  14   import jav ax.portlet .PortletRe quest;
  15  
  16   import com .liferay.p ortal.kern el.excepti on.PortalE xception;
  17   import com .liferay.p ortal.kern el.excepti on.SystemE xception;
  18   import com .liferay.p ortal.kern el.util.Pr opsUtil;
  19   import com .liferay.p ortal.kern el.util.St ringPool;
  20   import com .liferay.p ortal.mode l.Role;
  21   import com .liferay.p ortal.mode l.User;
  22   import com .liferay.p ortal.serv ice.RoleLo calService Util;
  23   import com .liferay.p ortal.serv ice.UserLo calService Util;
  24   import com .liferay.p ortal.util .PortalUti l;
  25   import com .liferay.u til.portle t.PortletP rops;
  26  
  27   import gov .va.caret. Applicatio nWorkFlowE xception;
  28   import gov .va.caret. letters.Oc cLetterTyp e;
  29   import gov .va.caret. model.supp ort.WorkIt emSupport;
  30   import gov .va.caret. model.supp ort.WorkTy pe;
  31   import gov .va.caret. model.supp ort.occ.St ipendConfi g;
  32   import gov .va.caret. security.C Action;
  33   import gov .va.caret. security.C Action.Car etCan;
  34   import gov .va.caret. security.C odifiedRol e;
  35   import gov .va.caret. util.Caret StrPool;
  36   import gov .va.caret. util.Caret Util;
  37   import gov .va.caret. view.Adhoc Report;
  38   import gov .va.caret. view.Cache dReport;
  39   import gov .va.caret. view.Enabl edSearch;
  40   import gov .va.caret. view.Gener icReport;
  41   import gov .va.caret. view.Repor tParameter ;
  42   import gov .va.caret. view.Resul tMap;
  43   import gov .va.caret. workflow.O wnerQueue;
  44  
  45  
  46   public cla ss CbopcDa shboardCon fig extend s Dashboar dConfig {
  47  
  48           /* *
  49            *  
  50            * /
  51           pr ivate stat ic final l ong serial VersionUID  = -591003 8587835405 338L;
  52           pu blic final  String VI EW = "/jsp /dashboard /cbopc.jsp ";
  53           pu blic final  static St ring NDX =  "CBOPC_";
  54           fi nal static  GenericRe port MY_OC C_WORK = n ew Generic Report("my OccWork",  true, "cre ationDate" , false, G enericRepo rt.CBOPC_Q UERY_NDX,  ReportPara meter.user Id );
  55           fi nal static  GenericRe port MY_NO TES = new  GenericRep ort("myNot es", true,  "nt.creat ionDate",  true, Gene ricReport. NOTES_QUER Y_NDX, Rep ortParamet er.userId  );
  56           pr ivate Gene ricReport[ ] cbopcRep orts;
  57           pr ivate Stri ng queueId s;
  58           pr ivate Set< Long> oqId s = new ja va.util.Ha shSet<Long >();
  59           pr ivate Map< Long,Map<S tring, Lon g>> cached Access = n ew HashMap <Long,Map< String, Lo ng>>();
  60           bo olean week lyWorkEnab led = fals e;
  61           
  62           pu blic stati c int OCC_ DUE_DAYS =  15;
  63           
  64           pr ivate stat ic Generic Report[] a llCbopcQue s =  new G enericRepo rt[]{ 
  65                             
  66                             new Ge nericRepor t("myCscWo rk", true,  "creation Date", fal se, Generi cReport.CB OPC_QUERY_ NDX, Repor tParameter .queueIds  ),
  67                             new Ge nericRepor t("cbopcCh ampva", tr ue, "creat ionDate",  false, Gen ericReport .CBOPC_QUE RY_NDX ),
  68                             new Ge nericRepor t("insuran ceChange",  true, "cr eationDate ", false,  GenericRep ort.CBOPC_ QUERY_NDX  ),
  69                             new Ge nericRepor t("cbopcVe ndor", tru e, "creati onDate", f alse, Gene ricReport. CBOPC_QUER Y_NDX ),
  70                             new Ge nericRepor t("cbopcRe view", tru e, "creati onDate", f alse, Gene ricReport. CBOPC_QUER Y_NDX ),
  71                             new Ge nericRepor t("tierCha nge", true , "creatio nDate", fa lse, Gener icReport.C BOPC_QUERY _NDX ),
  72                             new Ge nericRepor t("revocat ions", tru e, "creati onDate", f alse, Gene ricReport. CBOPC_QUER Y_NDX ),
  73                             new Ge nericRepor t("reinsta tements",  true, "cre ationDate" , false, G enericRepo rt.CBOPC_Q UERY_NDX ) ,
  74                             new Ge nericRepor t("vcgInfo Change", t rue, "crea tionDate",  false  ),
  75                             new Ge nericRepor t("occVeri fy", true,  "creation Date", fal se, Generi cReport.CB OPC_QUERY_ NDX ),
  76                             new Ge nericRepor t("occSupe rvisor", t rue, "crea tionDate",  false, Ge nericRepor t.CBOPC_QU ERY_NDX ),
  77                             new Ge nericRepor t("conside ration", t rue, "crea tionDate",  false, Ge nericRepor t.CBOPC_QU ERY_NDX ),
  78                             new Ge nericRepor t("rejecte dPayments" , true, "c reationDat e", false,  GenericRe port.CBOPC _QUERY_NDX  ),
  79                             new Ge nericRepor t("lostChe cks", true , "creatio nDate", fa lse, Gener icReport.C BOPC_QUERY _NDX ),
  80                             new Ge nericRepor t("heldPay ments", tr ue, "creat ionDate",  false, Gen ericReport .CBOPC_QUE RY_NDX ),
  81   //                        new Ge nericRepor t("duplica tePayments ", true, " creationDa te", false , GenericR eport.CBOP C_QUERY_ND X ),
  82                             
  83                             new Ge nericRepor t("occVeri fy", true,  "creation Date", fal se, Generi cReport.CB OPC_QUERY_ NDX )
  84                             }; 
  85           
  86           pr ivate stat ic Generic Report[] o therReport s = new Ge nericRepor t[]{
  87                             new Ge nericRepor t("vendors "),
  88                             new Ca chedReport ("readyWee klyWork"),
  89                             //new  GenericRep ort("blsRa tes", true , "county" , false, G enericRepo rt.CBOPC_Q UERY_NDX ) ,
  90                             new Ad hocReport( "vcgNotes" , ReportPa rameter.cl assPk ),
  91                             new Ad hocReport( "workNotes ", ReportP arameter.c lassPk ),
  92                             new Ca chedReport ("persnAud it"),
  93                             new Ca chedReport ("persn"),
  94                             new Ca chedReport ("workAudi t"),
  95                             new Ca chedReport ("blsAudit "),
  96                             new Ca chedReport ("vcgAudit "),
  97                             new Ca chedReport ("assmtAud it"),
  98                             new Ca chedReport ("vcgOpenW ork"),
  99                             new Ca chedReport ("vcgAssoc iatedCalls "),
  100                             new Ca chedReport ("vcgOpenR efs"),
  101                             new Ca chedReport ("vcgClose dWork"),
  102                             new Ca chedReport ("vcgClose dRefs"),
  103                             new Ca chedReport ("assmtAud itAll"),
  104                             new Ca chedReport ("assmtAud itPeriodic All"),
  105                             new Ca chedReport ("periodic Assessment sAll"),
  106                             new Ca chedReport ("vcgSuppo rtingDocsA ll"),
  107                             new Ca chedReport ("vcgDocsH istoryAll" )
  108           };
  109           
  110           pr ivate stat ic Collect ion<WorkTy pe> enable dWork = nu ll; 
  111           
  112           pr ivate long  getQueueI d( String  queueName  ){
  113                    try{
  114                             return  OwnerQueu e.valueOf(  queueName .substring ( 6, queue Name.lengt h() ) ).qu eueId;
  115                    } ca tch (Illeg alArgument Exception  e){}
  116                    retu rn -1;
  117           }
  118           
  119           pu blic Strin g getQueue Ids(){
  120                    retu rn queueId s == null  || queueId s.isEmpty( )? "-1": q ueueIds;
  121           }
  122           
  123           pu blic Cbopc DashboardC onfig() {
  124                    supe r();
  125                    this .reports =  new Gener icReport[0 ];
  126                    this .enabledSe arch = new  EnabledSe arch( new  CachedRepo rt("vcgs") , new Cach edReport(" workItems" ), new Cac hedReport( "vendors") , new Cach edReport(" payments")  , new Cac hedReport( "paymentCo nfig") );
  127           }
  128           
  129           pu blic Gener icReport[]  initDashb oardQus (  PortletReq uest reque st ){
  130                    
  131                    Set< GenericRep ort> repor tQues = ne w LinkedHa shSet<Gene ricReport> ();
  132                    
  133                    Stri ngBuilder  sb = new S tringBuild er();
  134                    
  135                    for  ( CaretCan  cbopcQueA ction : Ca retCan.CBO PC_FUNCTIO N.getCbopc Ques () ){
  136                             if ( C Action.can DoCaret (  request, c bopcQueAct ion ) ){
  137                                      String[]  ques = Po rtletProps .getArray(  cbopcQueA ction.name () );
  138                                      sb.appen d( getQueu eId( cbopc QueAction. name() ) ) .append(St ringPool.C OMMA_AND_S PACE);
  139                                      if ( que s.length >  0 ){
  140                                               for ( Stri ng que: qu es ){
  141                                                       Ge nericRepor t report =  getCbopcQ ue( que );
  142                                                       if  ( report! = null ){
  143                                                                repo rtQues.add ( report ) ;
  144                                                       }
  145                                               }
  146                                      }
  147                                      if ( cbo pcQueActio n.name().s tartsWith( NDX) ){
  148                                               try{
  149                                                       th is.oqIds.a dd( OwnerQ ueue.value Of( cbopcQ ueAction.n ame().subs tring(NDX. length())  ).getQueue Id() );
  150                                               } catch (  java.lang. IllegalArg umentExcep tion i ){}
  151                                      }
  152                             }
  153                    }
  154                    this .queueIds  = sb.lengt h() == 0?  "-1": sb.s ubstring(  0, sb.leng th()-2 );
  155                    this .cbopcRepo rts = repo rtQues.toA rray(new G enericRepo rt[reportQ ues.size() ]);
  156                    repo rtQues.add (MY_OCC_WO RK);
  157                    repo rtQues.add (MY_NOTES) ;
  158                    repo rtQues.add All( Array s.asList(  otherRepor ts ) );
  159                    this .reports =  reportQue s.toArray( new Generi cReport[re portQues.s ize()]);
  160                    
  161                    List <Role> rol es = null;
  162                    try  {
  163                             roles  = RoleLoca lServiceUt il.getSubt ypeRoles(  PropsUtil. get( "role s.regular. subtypes"  ) );
  164                    } ca tch (Syste mException  e1) {
  165                             Applic ationWorkF lowExcepti on.handleE xception(e 1);
  166                    }
  167                    setU sers( requ est, roles  );
  168                    
  169                    Resu ltMap.getC aretMap(re quest).put ("menu", " occ");
  170   //               if (  CAction.c anDoCaret  ( request,  CAction.C aretCan.AP PLY_FM_PAY MENT ) ) {
  171   //                        try {
  172   //                                 weeklyWo rkEnabled  = StiPtLoc alServiceU til.countB yStipends( "lost-chec k", new Da te()) > 0;
  173   //                        } catc h (Applica tionWorkFl owExceptio n e) {
  174   //                                 e.printS tackTrace( );    
  175   //                        }
  176   //               }
  177                    
  178                    Resu ltMap.getC aretMap(re quest).put ( CaretStr Pool.USERM AP, reques t.getPortl etSession( ).getAttri bute(Caret StrPool.US ERMAP) );
  179                    retu rn this.re ports;
  180           }
  181  
  182           
  183           pu blic void  setUsers(P ortletRequ est reques t, List<Ro le> roles  )  {
  184                    if (  roles ==  null ) ret urn;
  185                    @Sup pressWarni ngs("unche cked")
  186                    Map< String,Lon g> userMap  = (Map<St ring,Long> )request.g etPortletS ession().g etAttribut e(CaretStr Pool.USERM AP);
  187                    if (  userMap = = null ) {
  188                             userMa p = new Tr eeMap<Stri ng,Long>() ;
  189                    }
  190                    
  191                    if (  userMap.i sEmpty() ) {
  192                             List<S tring> cod es = Array s.asList(P ortletProp s.getArray ( CaretStr Pool.OCC_A SSIGNABLE_ ROLES ) );
  193                             List<S tring> lis t = new Ar rayList<>( );
  194                             for (  String cod e: codes ) {
  195                                      String r oleName =  CodifiedRo le.getRole Name(code) ;
  196                                      if ( rol eName == n ull ) cont inue;
  197                                      list.add ( roleName  );
  198                             }
  199                             
  200                             for (  Role role:  roles ){
  201                                      if ( lis t.contains ( role.get Name() ) ) {
  202                                               try {
  203                                                       Li st<User> u sers = Use rLocalServ iceUtil.ge tRoleUsers ( role.get RoleId() ) ;
  204                                                       fo r ( User u ser: users  ){
  205                                                                user Map.put(us er.getFull Name(), us er.getUser Id() );
  206                                                       }
  207                                               } catch (S ystemExcep tion e) {
  208                                                       Ap plicationW orkFlowExc eption.han dleExcepti on(e);
  209                                               }
  210                                      }
  211                             }
  212                             reques t.getPortl etSession( ).setAttri bute(Caret StrPool.US ERMAP, use rMap);
  213                    }
  214           }
  215           
  216           pu blic Map<S tring, Lon g> getAssi gnees(Work ItemSuppor t workItem ) {
  217                    if (  workItem. getWorkTyp e().workNa me != null  ){
  218   //                        WorkNa me workNam e = workIt em.getWork Type().wor kName;
  219                             
  220   //                        if ( o qIds.conta ins( workN ame.getQue ueId() ) ) {
  221                             if ( o qIds.conta ins( workI tem.getQue ueId() ) ) {
  222   //                                 return g etQueueUse rs( workNa me.getQueu eId() );
  223                                      return g etQueueUse rs( workIt em.getQueu eId() );
  224                             }
  225                             
  226                    }
  227                    retu rn Collect ions.empty Map();
  228           }
  229           
  230           pr ivate Map< String, Lo ng> getQue ueUsers(lo ng queueId ) {
  231                     if ( cache d DNS . URL  containsKe y(queueId)  ){
  232                              return cac hed DNS . URL  get(queueI d);
  233                    }
  234                    
  235                    Map< String,Lon g> userMap  = new Tre eMap<Strin g,Long>();
  236                    try  {
  237                             List<L ong> roleI ds = new A rrayList<L ong>();
  238                             for (  String key : Codified Role.getCo difiedKeys () ){
  239                                      Role rol e = RoleLo calService Util.getRo le( compan yId, Codif iedRole.ge tRoleName( key) );
  240                                      OwnerQue ue ownerQu eue = Owne rQueue.get OwnerQue(q ueueId);
  241                                      if ( own erQueue !=  null ){
  242                                               try{
  243                                                       CA ction.Care tCan actio n = CActio n.CaretCan .valueOf(  NDX + owne rQueue.nam e());
  244                                                       if  ( CAction .canDoCare t ( compan yId, actio n, role.ge tRoleId()  ) ){
  245                                                                role Ids.add(ro le.getRole Id());
  246                                                       }
  247                                               } catch (  Exception  e ){
  248                                                       _l og.warn( o wnerQueue. name() );
  249                                               }
  250                                      }
  251                             }
  252                             
  253                             for (  long roleI d : roleId s ){
  254                                      List<Use r> users =  UserLocal ServiceUti l.getRoleU sers( role Id );
  255                                      for ( Us er user: u sers ){
  256                                               if ( user. getUserId( ) == userI d ) contin ue;
  257                                               userMap.pu t(user.get FullName() , user.get UserId() ) ;
  258                                      }
  259                             }
  260                              cached DNS . URL  put(queueI d, userMap );
  261                    } ca tch (Syste mException  e1) {
  262                             Applic ationWorkF lowExcepti on.handleE xception(e 1);
  263                    } ca tch (Porta lException  e) {
  264                             e.prin tStackTrac e();
  265                    }
  266                    retu rn userMap ;
  267           }
  268  
  269           pr ivate Gene ricReport  getCbopcQu e( String  queName )  {
  270                    for  ( GenericR eport que:  allCbopcQ ues ){
  271                             if ( q ue.getPage Name().equ als( queNa me ) ){
  272                                      return q ue;
  273                             }
  274                    }
  275                    retu rn null;
  276           }
  277  
  278           pu blic CActi on.CaretCa n[] getCre ateActions (){
  279                    if (  weeklyWor kEnabled   ) {
  280                             return  new CActi on.CaretCa n[]{ CActi on.CaretCa n.APPLY_FM _PAYMENT } ;
  281                    } el se {
  282                             return  new CActi on.CaretCa n[0];
  283                    }
  284           }
  285   /*
  286    * (non-Ja vadoc)
  287    * @see go v.va.caret .controlle r.dashboar d.config.D ashboardCo nfig#getTo olsActions ()
  288    */
  289           @O verride
  290           pu blic Caret Can[] getT oolsAction s() {
  291                    retu rn new CAc tion.Caret Can[]{
  292                                      CAction. CaretCan.S TIPEND_CAL CULATOR,
  293                                      CAction. CaretCan.V IEW_BLS_RA TES
  294                             };
  295           }
  296           
  297           pu blic final  CAction.C aretCan[]  getMessage Actions(){
  298                    retu rn new CAc tion.Caret Can[]{
  299                             CActio n.CaretCan .INTERNAL_ MESSAGE
  300                    };
  301           }
  302           
  303           @O verride
  304           pu blic Strin g getView( ) {
  305                    retu rn VIEW;
  306           }
  307           
  308           pu blic void  loadReport s( Portlet Request re quest ) th rows Appli cationWork FlowExcept ion{
  309                    init DashboardQ us(request );
  310                    supe r.loadRepo rts( reque st );
  311                    Map< String,Obj ect> caret  = ResultM ap.getCare tMap(reque st);
  312                    care t.put(Care tStrPool.U SE_DATE_RA NGE, true) ;
  313                    care t.put(Care tStrPool.U SE_WORKTYP ES, true);
  314                    care t.put( Car etStrPool. WORKITEM_T YPES, getE nabledWork () );
  315                    care t.put( Car etStrPool. FILTER_STA TUSES, Sti pendConfig .OCC_PAYME NT_STATUSE S );
  316                    care t.put( "cg Roles", ne w String[] {"primary- cg", "seco ndary-cg",  "secondar y-two-cg"}  );
  317                    care t.put( Car etStrPool. VHA_SYSTEM , CaretUti l.getVhaOr gTreeNoDis trict( Por talUtil.ge tCompanyId ( request  ), true )  );
  318                    care t.put("cbo pcQue", cb opcReports );
  319                    care t.put(Care tStrPool.O CC_LETTER_ NAMES, Arr ays.asList (OccLetter Type.value s()));
  320  
  321           }
  322           
  323           pu blic Colle ction<Work Type> getE nabledWork () {
  324                    if (  CbopcDash boardConfi g.enabledW ork == nul l || Cbopc DashboardC onfig.enab ledWork.is Empty() )  {
  325                             CbopcD ashboardCo nfig.enabl edWork = A rrays.asLi st(new Wor kType[]{
  326                                              
  327                                               WorkType.C _INFO_CHAN GE,
  328   //                                          WorkType.F ACILITY_CH ANGE, 
  329                                               WorkType.H ELD_PAYMEN T,
  330                                               WorkType.A PPROVED_DI SPOSITION,
  331                                               WorkType.I NSURANCE_C HANGE,
  332   //                                          WorkType.L OST_CHECK,
  333                                               WorkType.M ANUAL_PAYM ENT,
  334                                               WorkType.N AME_CHANGE
  335                                               WorkType.P II_CHANGE,  
  336                                               WorkType.R ECOUPMENT,
  337                                               WorkType.R EINSTATED_ DISPOSITIO N,
  338                                               WorkType.R EJECTED_PA YMENT,
  339                                               WorkType.R ETURNED_PA YMENT,
  340                                               WorkType.R EVOKED_DIS POSITION,
  341                                               WorkType.V CG_INFO_CH ANGE,
  342                                               WorkType.T IER_UPDATE ,
  343                                               WorkType.V _INFO_CHAN GE,
  344                                               WorkType.A DDRESS_CHA NGE, 
  345                                               });
  346                    }
  347                    retu rn CbopcDa shboardCon fig.enable dWork;
  348           }
  349  
  350           pu blic boole an canAssi gn(WorkTyp e workType ) {
  351                    retu rn false;
  352           }
  353           
  354           pu blic Set<L ong> getOw nerQueueId s(){
  355                    retu rn oqIds;
  356           }
  357   }