199. EPMO Open Source Coordination Office Redaction File Detail Report

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

199.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\persistent\ldap PersonContextMapper.java Wed May 29 15:26:04 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\persistent\ldap PersonContextMapper.java Tue Jun 11 11:39:48 2019 UTC

199.2 Comparison summary

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

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

199.4 Active regular expressions

No regular expressions were active.

199.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2008 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4   package go v.va.med.f w.persiste nt.ldap;
  5  
  6   import jav a.util.Arr ayList;
  7   import jav a.util.Lis t;
  8   import jav a.util.Set ;
  9   import jav a.util.Tre eSet;
  10  
  11   import jav ax.naming. NamingEnum eration;
  12   import jav ax.naming. NamingExce ption;
  13   import jav ax.naming. directory. Attributes ;
  14  
  15   import org .springfra mework.lda p.core.Att ributesMap per;
  16  
  17   import gov .va.med.fw .model.lda p.LdapCons tants;
  18   import gov .va.med.fw .model.lda p.LdapPers on;
  19  
  20   /**
  21    * Maps at tributes f rom DirCon textOperat ions to pr operties o f LdapPers on.
  22    * 
  23    * CISS ci ss_framewo rk Jun 23,  2008
  24    * 
  25    * @author  
D NS
  26    */
  27   public cla ss PersonC ontextMapp er impleme nts Attrib utesMapper <LdapPerso n>, LdapCo nstants {
  28           pr ivate Stri ng groupOU ;
  29  
  30           pu blic void  setGroupOU (String gr oupOU) {
  31                    this .groupOU =  groupOU;
  32           }
  33  
  34           /* public Obj ect mapFro mContext(O bject ctx)  {
  35                    DirC ontextOper ations dir Context =  (DirContex tOperation s) ctx;
  36                    Ldap Person per son = new  LdapPerson ();
  37                    pers on.setDn(d irContext. getStringA ttribute(D ISTINGUISH ED_NAME));
  38                    pers on.setShor tDnString( dirContext .getDn().t oString()) ;
  39                    pers on.setFull Name(dirCo ntext.getS tringAttri bute(CN));
  40                    pers on.setDisp layName(di rContext.g etStringAt tribute(DI SPLAY_NAME ));
  41                    pers on.setLast Name(dirCo ntext.getS tringAttri bute(SN));
  42                    pers on.setFirs tName(dirC ontext.get StringAttr ibute(GIVE N_NAME));
  43                    pers on.setMidd leName(dir Context.ge tStringAtt ribute(MID DLE_NAME)) ;
  44                    pers on.setSamA ccountName (dirContex t.getStrin gAttribute (SAM_ACCOU NT_NAME));
  45                    pers on.setUser PrincipalN ame(dirCon text.getSt ringAttrib ute(USER_P RINCIPAL)) ;
  46                    pers on.setBadP asswordCou nt(dirCont ext.getStr ingAttribu te(BAD_PWD _COUNT));
  47                    pers on.setTitl e(dirConte xt.getStri ngAttribut e(TITLE));
  48                    pers on.setDesc ription(di rContext.g etStringAt tribute(DE SCRIPTION) );
  49                    pers on.setDepa rtment(dir Context.ge tStringAtt ribute(DEP ARTMENT));
  50                    pers on.setOffi ce(dirCont ext.getStr ingAttribu te(OFFICE) );
  51                    pers on.setTele phoneNumbe r(dirConte xt.getStri ngAttribut e(TELEPHON E_NUMBER)) ;
  52                    pers on.setEmai l(dirConte xt.getStri ngAttribut e(EMAIL));
  53  
  54                    Stri ng[] group sArray = d irContext. getStringA ttributes( MEMBER_OF) ;
  55                    if ( groupsArra y != null)  {
  56                             List<S tring> gro ups = Arra ys.asList( groupsArra y);
  57                             List<S tring> cis sGroups =  new ArrayL ist<String >();
  58  
  59                             for (I terator i  = groups.i terator();  i.hasNext ();) {
  60                                      String u serDn = (S tring) i.n ext();
  61  
  62                                      if (user Dn.contain s(OU_CISS)  && userDn .contains( "=" + grou pOU))
  63                                               // Add onl y the CN p ortion of  the distin guished na me
  64                                               cissGroups .add(userD n.substrin g(3, userD n.indexOf( COMMA)));
  65  
  66                             }
  67                             person .setGroups (new TreeS et<String> (groups));
  68                             person .setCissGr oups(new T reeSet<Str ing>(cissG roups));
  69                    }
  70                    retu rn person;
  71           }* /
  72  
  73           @O verride
  74           pu blic LdapP erson mapF romAttribu tes(Attrib utes attri butes) thr ows Naming Exception  {
  75                    Ldap Person per son = new  LdapPerson ();
  76                    pers on.setDn(a ttributes. get(DISTIN GUISHED_NA ME).get(). toString() );
  77                    pers on.setFull Name(attri butes.get( CN).get(). toString() );
  78                    pers on.setDisp layName(at tributes.g et(DISPLAY _NAME).get ().toStrin g());
  79                    pers on.setLast Name(attri butes.get( SN).get(). toString() );
  80                    pers on.setFirs tName(attr ibutes.get (GIVEN_NAM E).get().t oString()) ;
  81                    // M iddle name  is option al from LD AP
  82                    if(a ttributes. get(MIDDLE _NAME) !=  null) {
  83                             person .setMiddle Name(attri butes.get( MIDDLE_NAM E).get().t oString()) ;
  84                    }
  85                    else  {
  86                             person .setMiddle Name("");
  87                    }
  88                    pers on.setSamA ccountName (attribute s.get(SAM_ ACCOUNT_NA ME).get(). toString() );
  89                    pers on.setUser PrincipalN ame(attrib utes.get(U SER_PRINCI PAL).get() .toString( ));
  90                    if(a ttributes. get(TITLE)  != null)  {
  91                             person .setTitle( attributes .get(TITLE ).get().to String());
  92                    }
  93                    else  {
  94                             person .setTitle( "");
  95                    }
  96                    if(a ttributes. get(DESCRI PTION) !=  null) {
  97                             person .setDescri ption(attr ibutes.get (DESCRIPTI ON).get(). toString() );
  98                    }
  99                    else  {
  100                             person .setDescri ption("");
  101                    }
  102                    if(a ttributes. get(DEPART MENT) != n ull) {
  103                             person .setDepart ment(attri butes.get( DEPARTMENT ).get().to String());
  104                    }
  105                    else  {
  106                             person .setDepart ment("");
  107                    }
  108                    if(a ttributes. get(OFFICE ) != null)  {
  109                             person .setOffice (attribute s.get(OFFI CE).get(). toString() );
  110                    }
  111                    else  {
  112                             person .setOffice ("");
  113                    }
  114                    if(a ttributes. get(TELEPH ONE_NUMBER ) != null)  {
  115                             person .setTeleph oneNumber( attributes .get(TELEP HONE_NUMBE R).get().t oString()) ;
  116                    }
  117                    else  {
  118                             person .setTeleph oneNumber( "");
  119                    }
  120                    pers on.setEmai l(attribut es.get(EMA IL).get(). toString() );
  121                    
  122                    Nami ngEnumerat ion<?> nam ingGroups  = attribut es.get(MEM BER_OF).ge tAll();
  123                    if ( namingGrou ps != null ) {
  124                             List<S tring> cis sGroups =  new ArrayL ist<String >();
  125                             Set<St ring> grou ps = new T reeSet<Str ing>();
  126                             while( namingGrou ps.hasMore ()) {
  127                                      String u serDn = (S tring) nam ingGroups. next();
  128                                      groups.a dd(userDn) ;
  129                                      if (user Dn.contain s(OU_CISS)  && userDn .contains( "=" + grou pOU))
  130                                               // Add onl y the CN p ortion of  the distin guished na me
  131                                               cissGroups .add(userD n.substrin g(3, userD n.indexOf( COMMA)));
  132  
  133                             }
  134                             person .setGroups (new TreeS et<String> (groups));
  135                             person .setCissGr oups(new T reeSet<Str ing>(cissG roups));
  136                    }
  137                    retu rn person;
  138           }
  139   }