44. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 11/9/2018 12:16:38 PM 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.

44.1 Files compared

# Location File Last Modified
1 RAMS-2.3.0.zip\RAMS-2.3.0\SiteAssets RAMS_TMS.html Mon May 21 16:27:22 2018 UTC
2 RAMS-2.3.0.zip\RAMS-2.3.0\SiteAssets RAMS_TMS.html Fri Nov 9 14:54:12 2018 UTC

44.2 Comparison summary

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

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

44.4 Active regular expressions

No regular expressions were active.

44.5 Comparison detail

  1   <!--
  2   E1.1.0 RAM  Increment  1 Patch C ode
  3   January 20 15
  4   Department  of Vetera n's Affair s/Booz All en Hamilto n
  5   irb-applic ations.htm l
  6   -->
  7   <!DOCTYPE  html>
  8   <html lang ="en" xmln s:mso="urn :schemas-m icrosoft-c om:office: office"
  9     xmlns:ms dt="uuid:C 2F41010-65 B3-11d1-A2 9F-00AA00C 14882">
  10   <head>
  11   <style>
  12   input[type =text] {
  13     width: 3 30px;
  14     box-sizi ng: border -box;
  15     border:  2px solid  #ccc;
  16     border-r adius: 4px ;
  17     font-siz e: 16px;
  18     backgrou nd-color:  white;
  19     backgrou nd-repeat:  no-repeat ;
  20     padding:  10px;
  21     -webkit- transition : width 0. 4s ease-in -out;
  22     transiti on: width  0.4s ease- in-out;
  23   }
  24  
  25   input[type =text]:foc us {
  26     width: 8 0%;
  27   }
  28  
  29   /*Theme th e Tabulato r element* /
  30   #example-t able-theme  {
  31     backgrou nd-color:  #ccc;
  32     border:  1px solid  #1D5A91;
  33   }
  34  
  35   /*Theme th e header*/
  36   #example-t able-theme  .tabulato r-header {
  37     backgrou nd-color:  #1D5A91;
  38     color: # fff;
  39   }
  40  
  41   /*Allow co lumn heade r names to  wrap line s*/
  42   #example-t able-theme  .tabulato r-header . tabulator- col, #exam ple-table- theme .tab ulator-hea der .tabul ator-col-r ow-handle
  43     {
  44     white-sp ace: norma l;
  45   }
  46  
  47   /*Color th e table ro ws*/
  48   #example-t able-theme  .tabulato r-tableHol der .tabul ator-table  .tabulato r-row {
  49     color: # 000000;
  50     backgrou nd-color:  #FFFFFF;
  51   }
  52  
  53   /*Color ev en rows*/
  54   #example-t able-theme  .tabulato r-tableHol der .tabul ator-table  .tabulato r-row:nth- child(even ) {
  55     backgrou nd-color:  #EFEFEF;
  56   }
  57  
  58   div.contai ner {
  59     max-widt h: 1220px;
  60   }
  61  
  62   div.tms {
  63     backgrou nd-color:  #1D5A91;
  64     color: w hite;
  65     margin:  20px 0 20p x 0;
  66     padding:  20px;
  67     radius:  5px;
  68   }
  69  
  70   .btn-group  button {
  71     backgrou nd-color:  #1E90FF; / * Green ba ckground * /
  72     border:  1px solid  light blue ; /* Green  border */
  73     color: w hite; /* W hite text  */
  74     padding:  10px 24px ; /* Some  padding */
  75     cursor:  pointer; / * Pointer/ hand icon  */
  76     width: 5 0%; /* Set  a width i f needed * /
  77     display:  block; /*  Make the  buttons ap pear below  each othe r */
  78   }
  79  
  80   .btn-group
  81    
  82   button
  83   :not
  84    
  85   (
  86   :last-chil d
  87    
  88   )
  89   {
  90   border-bot tom
  91   :
  92    
  93   none
  94   ; /* Preve nt double  borders */
  95  
  96  
  97   }
  98  
  99   /* Add a b ackground  color on h over */
  100   .btn-group  button:ho ver {
  101     backgrou nd-color:  #3e8e41;
  102   }
  103   </style>
  104   <meta http -equiv="co ntent-type " content= "text/html ; charset= UTF-8">
  105   <meta char set="utf-8 ">
  106   <meta http -equiv="X- UA-Compati ble" conte nt="IE=11" >
  107   <meta name ="descript ion" conte nt="">
  108   <meta name ="author"  content="V eterans Af fairs Rese arch Admin istrative  Management  System">
  109   <meta http -equiv="Pr agma" cont ent="no-ca che">
  110   <meta http -equiv="Ex pires" con tent="-1">
  111   <!-- Note  there is n o responsi ve meta ta g here -->
  112   <title>RAM S - TMS Sy nchronizat ion</title >
  113   <script ty pe="text/j avascript"  src="js/j query-1.11 .3.min.js" ></script>
  114   <script ty pe="text/j avascript"  src="js/j query-ui.m in.js"></s cript>
  115     <script  src="js/js hashset-3. 0.js"></sc ript>
  116     <script  src="js/js hashtable- 3.0.js"></ script>
  117   <script ty pe="text/j avascript"  src="js/r ams-enviro nment.js"> </script>
  118   <script ty pe="text/j avascript"  src="js/d ynamicGene ration.js" ></script>
  119   <link href ="css/tabu lator.min. css" rel=" stylesheet ">
  120   <link href ="css/pace -theme-loa ding-bar.c ss" rel="s tylesheet" >
  121   <script ty pe="text/j avascript"  src="js/t abulator.m in.js"></s cript>
  122   <script sr c="js/pace .js"></scr ipt>
  123   <script ty pe="text/j avascript"  src="js/c rypto-js.m in.js"></s cript>
  124   <!-- Custo m styles f or this te mplate -->
  125   <link href ="css/styl es.css" re l="stylesh eet">
  126   <!-- Boots trap core  CSS -->
  127   <link href ="css/boot strap.min. css" rel=" stylesheet ">
  128   <script sr c="js/boot strap.min. js"></scri pt>
  129   <script sr c="js/tool tip.js"></ script>
  130   <!--[if gt e mso 9]>< xml>
  131   <mso:Custo mDocumentP roperties>
  132   <mso:ItemR etentionFo rmula msdt :dt="strin g"></mso:I temRetenti onFormula>
  133   <mso:_dlc_ policyId m sdt:dt="st ring"></ms o:_dlc_pol icyId>
  134   <mso:TaxKe ywordTaxHT Field msdt :dt="strin g"></mso:T axKeywordT axHTField>
  135   <mso:TaxKe yword msdt :dt="strin g"></mso:T axKeyword>
  136   <mso:Targe t_x0020_Au diences ms dt:dt="str ing"></mso :Target_x0 020_Audien ces>
  137   <mso:TaxCa tchAll msd t:dt="stri ng"></mso: TaxCatchAl l>
  138   </mso:Cust omDocument Properties >
  139   </xml><![e ndif]-->
  140   </head>
  141   <body>
  142     <a href= "#MainCont ent" class ="sr-only" >Skip to m ain conten t </a>
  143     <!-- Ski p to main  content -- >
  144     <!-- Fix ed navbar  -->
  145     <div cla ss="navbar  navbar-de fault navb ar-static- top" role= "navigatio n">
  146       <div c lass="cont ainer">
  147         <div  class="na vbar-heade r">
  148           <h 1 title="D epartment  of Veteran s Affairs  Seal.Veter ans Affair s Research  Administr ative Mana gement Sys tem">
  149              <a class=" navbar-bra nd" href=" #">Departm ent of Vet erans Affa irs Seal.V eterans Af fairs Rese arch
  150                Administ rative Man agement Sy stem</a>
  151           </ h1>
  152         </di v>
  153         <div  class="na vbar-colla pse collap se">
  154           <u l class="n av navbar- nav navbar -right mai n-nav">
  155              <li><a tit le="Home"  href="/sit es/IRBAppl ications/S itePages/H ome.aspx"> Home</a></ li>
  156              <li class= "active">< a title="R esearch St udy Applic ations"
  157                href="/s ites/IRBAp plications /SitePages /irb%20app lications. aspx">Rese arch Study  Applicati on</a></li >
  158              <li><a id= "investiga torActivit ies" title ="Investig ator Activ ities"
  159                href=".. /SiteAsset s/committe e_redirect .html?comm itteeActio n=investig atorActivi ties">Inve stigator
  160                  Activi ties</a></ li>
  161              <li><a tit le="Commit tee Activi ties"
  162                href=".. /SiteAsset s/committe e_redirect .html?comm itteeActio n=committe eActivitie s">Committ ee Activit ies</a></l i>
  163              <!-- <li>< a title="T MS" href=" RAMS_TMS.h tml">TMS</ a></li> -- >
  164              <li><a id= "profile"  title="Per sonal Prof ile" href= "">Persona l Profile< /a></li>
  165           </ ul>
  166         </di v>
  167         <!-- /.nav-coll apse -->
  168       </div>
  169     </div>
  170     <div cla ss="contai ner" id="M ainContent ">
  171       <h2>TM S</h2>
  172       <br>
  173       <div c lass="tms" >
  174         <p>T his page w ill synchr onize your  TMS infor mation wit h RAMS. En ter your u ser id for  TMS syste m and pres s
  175           Su bmit.</p>
  176         <p>Y our TMS in formation  will displ ay in the  table belo w.</p>
  177       </div>
  178       <br>
  179       <div>
  180         TMS  User ID:<b r> <input  type="text " id="TMSU serID"><br > <br> <in put type=" button"
  181           va lue="Submi t" onclick ="soap();"  /> <br> < br>
  182       </div>
  183       <div i d="example -table-the me"></div>
  184     </div>
  185     <div cla ss="footer ">
  186       <div c lass="cont ainer">
  187         <ul  class="foo ter-nav">
  188           <l i><a title ="About" h ref="/site s/IRBAppli cations/Si tePages/Ab out.aspx"> About</a>< /li>
  189           <l i><a title ="Training " href="/s ites/IRBAp plications /SitePages /RAMS%20On line%20Hel p.aspx">Tr aining</a> </li>
  190           <l i><a title ="Help" hr ef="/sites /IRBApplic ations/Sit ePages/RAM S%20Online %20Help.as px">Help</ a></li>
  191           <l i><a title ="FAQs" hr ef="/sites /IRBApplic ations/Sit ePages/FAQ .aspx">FAQ s</a></li>
  192           <l i><a title ="Contact  Us" href=" /sites/IRB Applicatio ns/SitePag es/Contact %20Us.aspx ">Contact  Us</a></li >
  193           <l i><a title ="Site Map " href="/s ites/IRBAp plications /SitePages /Site%20Ma p.aspx">Si te Map</a> </li>
  194           <l i><a title ="Disclaim er" href=" /sites/IRB Applicatio ns/SitePag es/Disclai mer.aspx"> Disclaimer </a></li>
  195           <l i><a title ="Privacy/ Accessibil ity" href= "/sites/IR BApplicati ons/SitePa ges/Access ibility.as px">Privac y
  196                / Access ibility</a ></li>
  197           <l i><a oncli ck="displa yVersion() ;return fa lse;" titl e="Version " href="#" >Version</ a></li>
  198           <l i><a title ="Descript ion" href= "/sites/IR BApplicati ons/SitePa ges/Descri ption.aspx ">Descript ion</a></l i>
  199             <li><a tit le="VA Hom e" href="h ttp:// DNS . URL ">VA Home< /a></li>
  200         </ul >
  201         <p i d="RAMSCop yright" cl ass="pull- right stro ng"></p>
  202       </div>
  203     </div>
  204     <script>
  205      $("#exa mple-table -theme").t abulator({
  206  
  207         fitC olumns : t rue, //fit  columns t o width of  table (op tional)
  208  
  209         colu mns : [ // Define Tab le Columns
  210  
  211                {
  212                   title  : "Course  Id",
  213                   field  : "ItemID ",
  214                   width  : 120
  215                }, {
  216                   title  : "Course  Title",
  217                   field  : "ItemDe scription" ,
  218                   width  : 470
  219                }, {
  220                   title  : "User F irst Name" ,
  221                   field  : "FirstN ame"
  222                }, {
  223                   title  : "User L ast Name",
  224                   field  : "LastNa me"
  225                }, {
  226                   title  : "Comple tion Date" ,
  227                   field  : "Comple tionDate",
  228                   width  : 260
  229                },
  230  
  231         ]
  232  
  233      });
  234  
  235      var cur rentUrl =  window.loc ation.href ;
  236      var rea lUrl = cur rentUrl.su bstring(0,  currentUr l.indexOf( "SiteAsset s") - 1);
  237      var req uestDigest  = null;
  238      var tra nsactionCo unt;
  239      var res tCallsArra y = [];
  240  
  241      var rec oncileCoun t;
  242      var new TmsRecords  = [];
  243      var tms ReportArra y = [];
  244      var exi stingRecor dsArray =  [];
  245      var tms UserID;
  246      //var l ogin = RAM S.Environm ent.TMS.tm susername;
  247      //var p w = RAMS.E nvironment .TMS.tmspw d;
  248      var log in = RAMS. Environmen t.TMS.tmsu sername;
  249      var pw  = RAMS.Env ironment.T MS.tmspwd;
  250      var dec rypted = C ryptoJS.AE S.decrypt( pw, "TMS A ccess");
  251      $(docum ent).ready (function( ) {
  252         $("# RAMSCopyri ght").appe nd(RAMSCop yright);
  253      });
  254  
  255      functio n soap() {
  256         if ( login != n ull && pw  != null) {
  257  
  258            e xistingRec ordsArray  = [];
  259            t msUserID =  document. getElement ById("TMSU serID").va lue;
  260            t ransaction Count = 0;
  261            n ewTmsRecor ds = [];
  262            s endREST("P OST", real Url + "/_a pi/Context Info", nul l, functio n(json) {
  263                requestD igest = js on.d.GetCo ntextWebIn formation. FormDigest Value;
  264            } );
  265            v ar xmlhttp  = new XML HttpReques t();
  266            x mlhttp.ope n('POST',  'https://w ww.tms.va. gov/learni ng/cxfserv ices/cxfWe bServices' , true, lo gin, decry pted
  267                   .toSt ring(Crypt oJS.enc.Ut f8));
  268  
  269            v ar sr = '< soapenv:En velope ' +  
  270                       ' xmlns:soap env="http: //schemas. xmlsoap.or g/soap/env elope/" '  +
  271                       ' xmlns:xsi= "http://ww w.w3.org/2 001/XMLSch ema-instan ce" ' +
  272                       ' xmlns:cxf= "http://cx f.elmsx.pl ateausyste ms.com/">  '
  273                   + 'xm lns:xsd="h ttp://www. w3.org/200 1/XMLSchem a" '
  274                   + '<s oapenv:Hea der/> '
  275                   + '<s oapenv:Bod y> '
  276                   + '<c xf:getStud entTrainin gEventVOXs > '
  277                   + '<c xf:arg0>'
  278                   + tms UserID
  279                   + '</ cxf:arg0>  '
  280                   + '<c xf:arg1>"S ORT_BY_COM PLETION_DA TE"</cxf:a rg1> '
  281                   + '</ cxf:getStu dentTraini ngEventVOX s>'
  282                   + '</ soapenv:Bo dy>' + '</ soapenv:En velope>';
  283  
  284            x mlhttp.onr eadystatec hange = fu nction() {
  285                if (xmlh ttp.readyS tate == 4)  {
  286                   if (x mlhttp.sta tus == 200 ) {
  287                      va r xmlRespo nse = xmlh ttp.respon seXML.docu mentElemen t;
  288  
  289                      va r fullNode List = xml Response.g etElements ByTagName( "ns2:Train ingEventVO S");
  290                      if  (fullNode List.lengt h > 0) {
  291                          //origina lTmsReturn ed = fullN odeList;
  292                          reconcile Count = fu llNodeList .length;
  293                          getExisti ngRecords( fullNodeLi st);
  294  
  295                      }  else {
  296  
  297                          alert("No  TMS Data  found.  Pl ease check  your User  ID ");
  298                      }
  299                   } els e {
  300                      al ert("Error  in retrie ving TMS I nfo.  Plea se contact  Administr ator.");
  301                      lo gError("So ap Request ", xmlhttp .status, x mlhttp.sta tusText, J SON.string ify(xmlhtt p));
  302                   }
  303  
  304                }
  305            }
  306            / / Send the  POST requ est
  307            x mlhttp.set RequestHea der('Conte nt-Type',  'text/xml' );
  308  
  309            x mlhttp.sen d(sr);
  310            / / send req uest
  311            / / ...
  312         } el se {
  313  
  314            a lert("Erro r with Cre dentials.   Please re fresh the  page");
  315  
  316         }
  317      }
  318  
  319      functio n getExist ingRecords (inTmsNode sList) {
  320  
  321         //Cr eating arr ay to stor e all the  existing T MS records  for user
  322         $.aj ax({
  323            u rl : realU rl + "/_ap i/web/list s/getbytit le('TMS')/ items?$top =500&$filt er= TMSUse rID eq '"  + tmsUserI D
  324                   + "'& $select=It emID, Comp letionDate ",
  325            h eaders : {
  326                "Accept"  : "applic ation/json ; odata=ve rbose"
  327            } ,
  328            s uccess : f unction(da ta) {
  329                // mappi ng the res ults
  330  
  331                if (data .d.results .length >  0) {//ther e are exis ting recor ds with tm sUserID
  332  
  333                   for ( existing =  0; existi ng < data. d.results. length; ex isting++)  {
  334                      va r tmsRecor d = {
  335                          "ItemID"  : data.d.r esults[exi sting].Ite mID,
  336                          "Completi onDate" :  data.d.res ults[exist ing].Compl etionDate
  337                      }
  338                      ex istingReco rdsArray.p ush(tmsRec ord);
  339  
  340                   }
  341  
  342                }
  343  
  344                reconcil eCount = r econcileCo unt - data .d.results .length; / /Calculati ng actual  amount of  records to  reconcile  - which d o not exis t in RAMS
  345                reconcil eTMSRecord s(inTmsNod esList);
  346  
  347            } ,
  348            e rror : fun ction(XMLH ttpRequest , textStat us, errorT hrown) {
  349                logError (XMLHttpRe quest.resp onseText,  errorThrow n, textSta tus, JSON. stringify( XMLHttpReq uest));
  350                alert("E rror in ge tExistingR ecords fun ction.");
  351            }
  352  
  353         });
  354  
  355      }
  356  
  357      functio n reconcil eTMSRecord s(original TmsReturne d) {
  358  
  359         for  (var j = 0 ; j < orig inalTmsRet urned.leng th; j++) {
  360            v ar TMS_Use rID;
  361            v ar lastNam e;
  362            v ar firstNa me;
  363            v ar middleI nitial;
  364            v ar itemTyp e;
  365            v ar itemID;
  366            v ar itemRev isionNum;
  367            v ar itemRev isionDate;
  368            v ar itemDes cription =  "";
  369            v ar complet ionDate;
  370            v ar complet ionStatus;
  371            v ar mapping Error = fa lse;
  372            t ry {
  373                if (orig inalTmsRet urned[j].c hildNodes[ 44].localN ame == "st udentID")  {
  374                   TMS_U serID = or iginalTmsR eturned[j] .childNode s[44].text Content;
  375                   //ale rt("TMS_Us erID is  "  + TMS_Use rID);
  376                } else {
  377                   mappi ngError =  true
  378                }
  379  
  380                if (orig inalTmsRet urned[j].c hildNodes[ 43].localN ame == "st udentFirst Name") {
  381                   first Name = ori ginalTmsRe turned[j]. childNodes [43].textC ontent;
  382                   //ale rt("firstN ame is " +  firstName );
  383                } else {
  384                   mappi ngError =  true
  385                }
  386  
  387                if (orig inalTmsRet urned[j].c hildNodes[ 45].localN ame == "st udentLastN ame") {
  388                   lastN ame = orig inalTmsRet urned[j].c hildNodes[ 45].textCo ntent;
  389                   //ale rt("firstN ame is " +  firstName );
  390                } else {
  391                   mappi ngError =  true
  392                }
  393  
  394                if (orig inalTmsRet urned[j].c hildNodes[ 46].localN ame == "st udentMI")  {
  395                   middl eInitial =  originalT msReturned [j].childN odes[46].t extContent ;
  396                   //ale rt("firstN ame is " +  firstName );
  397                } else {
  398                   mappi ngError =  true
  399                }
  400  
  401                if (orig inalTmsRet urned[j].c hildNodes[ 14].localN ame == "co mponentTyp eID") {
  402                   itemT ype = orig inalTmsRet urned[j].c hildNodes[ 14].textCo ntent;
  403                   //ale rt("firstN ame is " +  firstName );
  404                } else {
  405                   mappi ngError =  true
  406                }
  407  
  408                if (orig inalTmsRet urned[j].c hildNodes[ 12].localN ame == "co mponentID" ) {
  409                   if (o riginalTms Returned[j ].childNod es[12].tex tContent = = null
  410                          || origin alTmsRetur ned[j].chi ldNodes[12 ].textCont ent == "")  {
  411                      it emID = "00 000";
  412                      va r descInde x = origin alTmsRetur ned[j].chi ldNodes[49 ].textCont ent.indexO f("descrip tion=");
  413                      it emDescript ion = orig inalTmsRet urned[j].c hildNodes[ 49].textCo ntent.subs tring(desc Index);
  414                   } els e
  415                      it emID = ori ginalTmsRe turned[j]. childNodes [12].textC ontent;
  416                   //ale rt("firstN ame is " +  firstName );
  417                } else {
  418                   mappi ngError =  true
  419                }
  420  
  421                if (orig inalTmsRet urned[j].c hildNodes[ 39].localN ame == "re visionNumb er") {
  422                   revis ionNumber  = original TmsReturne d[j].child Nodes[39]. textConten t;
  423                   //ale rt("firstN ame is " +  firstName );
  424                } else {
  425                   mappi ngError =  true
  426                }
  427  
  428                if (orig inalTmsRet urned[j].c hildNodes[ 38].localN ame == "re visionDate ") {
  429                   revis ionDate =  originalTm sReturned[ j].childNo des[38].te xtContent;
  430                   //ale rt("firstN ame is " +  firstName );
  431                } else {
  432                   mappi ngError =  true
  433                }
  434  
  435                if (orig inalTmsRet urned[j].c hildNodes[ 9].localNa me == "com pletionDat e") {
  436                   compl etionDate  = original TmsReturne d[j].child Nodes[9].t extContent ;
  437                   //ale rt("firstN ame is " +  firstName );
  438                } else {
  439                   mappi ngError =  true
  440                }
  441  
  442                if (orig inalTmsRet urned[j].c hildNodes[ 10].localN ame == "co mpletionSt atusDescri ption") {
  443                   compl etionStatu s = origin alTmsRetur ned[j].chi ldNodes[10 ].textCont ent;
  444                   //ale rt("firstN ame is " +  firstName );
  445                } else {
  446                   mappi ngError =  true
  447                }
  448  
  449                if (mapp ingError = = true) {
  450  
  451                   alert ("Mapping  Error occu red.  Plea se contact  Administr ator");
  452  
  453                } else {
  454                   var t msItemData  = {
  455                      "_ _metadata"  : {
  456                          "type" :  "SP.Data.T MSListItem "
  457                      },
  458                      "T MSUserID"  : TMS_User ID,
  459                      "L astName" :  lastName,
  460                      "F irstName"  : firstNam e,
  461                      "M I" : middl eInitial,
  462                      "I temType" :  itemType,
  463                      "I temID" : i temID,
  464                      "I temRevisio nNum" : it emRevision Num,
  465                      "I temRevisio nDate" : i temRevisio nDate,
  466                      "I temDescrip tion" : it emDescript ion,
  467                      "C ompletionD ate" : com pletionDat e,
  468                      "C ompletionS tatus" : c ompletionS tatus
  469                   }
  470                }
  471                //alert( "Mapping C omplete ") ;
  472                if (!exi stingRecor d(itemID,  completion Date, exis tingRecord sArray)) {  //if this  record do es not exi st in curr ent record s in TMS L ist
  473  
  474                   newTm sRecords.p ush(tmsIte mData);
  475                }
  476            }  catch (er r) {
  477                logError ("reconcil eTMSRecord s()", err. name, err. message,
  478                      "E rror occur ed during  Mapping So ap Respons es to Shar ePoint Obj ect");
  479  
  480            }
  481  
  482         }//  end of For  Loop
  483         if ( newTmsReco rds.length  == 0) {
  484            a lert("0 -  new record s retrieve d.");
  485            c reateRepor t(tmsUserI D);
  486         } el se {
  487  
  488            p rocessNewT MSRecords( );
  489         }
  490      }
  491  
  492      functio n existing Record(ite mID, compl etionDate,  recordsAr ray) {
  493  
  494         for  (var k = 0 ; k < reco rdsArray.l ength; k++ ) {
  495  
  496            i f (records Array[k].I temID == i temID && r ecordsArra y[k].Compl etionDate  == complet ionDate) {
  497  
  498                return t rue;
  499            }
  500         }
  501         retu rn false;
  502  
  503      }
  504  
  505      functio n processN ewTMSRecor ds() {
  506         rest CallsArray  = [];
  507         aler t("Process ing " + ne wTmsRecord s.length +  " new rec ords.");
  508         for  (k = 0; k  < newTmsRe cords.leng th; k++) {
  509  
  510            v ar tmsObje ct = newTm sRecords[k ];
  511            r estCallsAr ray.push(t msObject.I temID);
  512            g etTMSCours e(tmsObjec t);
  513  
  514         }
  515  
  516      }
  517  
  518      functio n getTMSCo urse(tmsIt emObject)  {
  519         var  itemID = t msItemObje ct.ItemID;
  520  
  521         var  webService URL = 'htt ps://www.t ms.va.gov/ learning/c xfservices /cxfWebSer vices';
  522         var  soapMessag e = '<soap env:Envelo pe xmlns:s oapenv="ht tp://schem as.xmlsoap .org/soap/ envelope/"  xmlns:cxf ="http://c xf.elmsx.p lateausyst ems.com/"  xmlns:vo=" http://vo. cxf.webser vices.elms .plateausy stems.com" >'
  523                + '<soap env:Header />'
  524                + '<soap env:Body>'
  525                + '<cxf: findItems> '
  526                + '<cxf: itemsSearc hCriteria> '
  527                + '<vo:c aller>'
  528                + '</vo: caller>'
  529                + '<vo:i temID>'
  530                + itemID
  531                + '</vo: itemID>'
  532                + '</cxf :itemsSear chCriteria >'
  533                + '</cxf :findItems >' + '</so apenv:Body >' + '</so apenv:Enve lope>'
  534  
  535         $.aj ax({
  536            u rl : webSe rviceURL,
  537            t ype : "POS T",
  538            d ataType :  "xml",
  539            d ata : soap Message,
  540            u sername :  login, //  Most SAP w eb service s require  credential s
  541            p assword :  decrypted. toString(C ryptoJS.en c.Utf8),
  542            c ontentType  : "text/x ml; charse t=\"utf-8\ "",
  543            s uccess : f unction(da ta) {
  544                var cour seData = d ata;
  545                var titl e = "";
  546  
  547                if (tmsI temObject. ItemDescri ption == " ") {
  548                   var f ullNodeLis t = course Data.getEl ementsByTa gName("ns2 :Item");
  549                   if (f ullNodeLis t.length >  0) {
  550                      va r lastInde x = fullNo deList.len gth - 1;
  551                      tr y {
  552                          if (fullN odeList[la stIndex].c hildNodes[ 59].localN ame == "ti tle") {
  553                             title  = fullNode List[lastI ndex].chil dNodes[59] .textConte nt;
  554                             tmsIte mObject.It emDescript ion = titl e;
  555  
  556                             insert TMSItem(tm sItemObjec t);
  557  
  558                          } else {
  559  
  560                             title  = "Not Ava ilable";
  561                             tmsIte mObject.It emDescript ion = titl e;
  562  
  563                             insert TMSItem(tm sItemObjec t);
  564  
  565                          }
  566                      }  catch (err ) {
  567  
  568                          title = " Not Availa ble";
  569                          tmsItemOb ject.ItemD escription  = title;
  570                          insertTMS Item(tmsIt emObject);
  571                      }
  572                   } els e { // did  not find  that tag
  573  
  574                      ti tle = "Not  Available ";
  575                      tm sItemObjec t.ItemDesc ription =  title;
  576                      in sertTMSIte m(tmsItemO bject);
  577  
  578                   }
  579                } else {
  580  
  581                   inser tTMSItem(t msItemObje ct);
  582  
  583                }
  584  
  585            } ,
  586            e rror : fun ction(data ) {
  587                title =  "Not Avail able";
  588                tmsItemO bject.Item Descriptio n = title;
  589  
  590                insertTM SItem(tmsI temObject) ;
  591  
  592            }
  593  
  594         });
  595  
  596      }
  597  
  598      functio n insertTM SItem(newD ata) {
  599  
  600         $.aj ax({
  601            u rl : realU rl.concat( "/_api/Web /Lists/Get ByTitle('T MS')/Items "), //post  change to  applicati on list
  602            t ype : "POS T",
  603            d ata : JSON .stringify (newData),
  604            h eaders : {
  605                "X-Reque stDigest"  : requestD igest,
  606                "Content -Type" : " applicatio n/json;oda ta=verbose ",
  607                "accept"  : "applic ation/json ;odata=ver bose"
  608  
  609            } ,
  610            s uccess : f unction(da ta) {
  611  
  612                var tmsI D = newDat a.ItemID;
  613                var foun dIndex = r estCallsAr ray.indexO f(tmsID);
  614                if (foun dIndex ==  null || fo undIndex <  0) {
  615                   alert ("Remove i ndex not f ound !!");
  616                } else {
  617                   restC allsArray. splice(fou ndIndex, 1 );
  618                }
  619                //transa ctionCount  = transac tionCount  + 1;
  620                if (rest CallsArray .length <  2) {
  621                   creat eReport(ne wData.TMSU serID); // Start gene rating rep ort
  622                }
  623  
  624            } ,
  625  
  626            e rror : fun ction(XMLH ttpRequest , textStat us, errorT hrown) {
  627                alert("E rror Inser ting - " +  newData.I temID);
  628  
  629            }
  630         });
  631      }
  632  
  633      functio n createRe port(userI D) {
  634  
  635         $.aj ax({
  636            u rl : realU rl + "/_ap i/web/list s/getbytit le('TMS')/ items?$top =500&$filt er= TMSUse rID eq '"  + userID
  637                   + "'& $select=It emID, Item Descriptio n,LastName , FirstNam e,Completi onDate",
  638            m ethod : "G ET",
  639            h eaders : {
  640                "Accept"  : "applic ation/json ; odata=ve rbose"
  641            } ,
  642            s uccess : f unction(da ta) {
  643                // mappi ng the res ults
  644  
  645                populate tmsReportA rray(data) ;
  646                //This f unction wi ll populat e the stud yActionArr ay
  647            } ,
  648            e rror : fun ction(data ) {
  649                alert("E rror in Cr eateReport  " + data) ;
  650            }
  651         });
  652  
  653      }
  654  
  655      functio n populate tmsReportA rray(inDat a) {
  656  
  657         var  itemInfo =  inData;
  658         tmsR eportArray  = [];
  659         coun t = 0;
  660         //1)  THIS FUNC TION WILL  BUILD ARRA Y FROM MAI N QUERY US ING LOOP.   inData IS  THE JSON  PASSED FRO M MAIN QUE RY
  661         for  (itemCount  = 0; item Count < it emInfo.d.r esults.len gth; itemC ount++) {
  662            v ar ItemID  = itemInfo .d.results [itemCount ].ItemID;
  663            t msReportAr ray.push({
  664                "id" : i temInfo.d. results[it emCount].I D,
  665                "ItemID"  : ItemID,
  666                "ItemDes cription"  : itemInfo .d.results [itemCount ].ItemDesc ription,
  667                "FirstNa me" : item Info.d.res ults[itemC ount].Firs tName,
  668                "LastNam e" : itemI nfo.d.resu lts[itemCo unt].LastN ame,
  669                "Complet ionDate" :  itemInfo. d.results[ itemCount] .Completio nDate
  670  
  671            } );
  672         }
  673  
  674         $("# example-ta ble-theme" ).tabulato r("setData ", tmsRepo rtArray);
  675      }
  676   </script>
  677   </body>
  678   </html>