Changeset 386 in tmcsimulator for trunk/webapps/einotebook/scripts


Ignore:
Timestamp:
04/20/2019 12:11:46 PM (7 years ago)
Author:
jdalbey
Message:

Updated LoadEvents?.js to parse all event types except CMS_EVALUATION. Modified build.xml to write svn revision number to webapps/common/js so the revision number can be included in the web page title of our apps. Write ShowRevision? function in displayutils.js to do that.

Location:
trunk/webapps/einotebook/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/einotebook/scripts/Evaluation.js

    r359 r386  
    3737                var text = "<table class='evaluation'>" + 
    3838                                   "<tr>" + 
    39                                    "<th class='evaluationType' colspan='2'>" + type + " Evalution</th>" + 
     39                                   "<th class='evaluationType' colspan='2'>" + type + " Evaluation</th>" + 
    4040                                   "</tr>" + 
    4141                                   "<tr>" + 
  • trunk/webapps/einotebook/scripts/LoadEvents.js

    r374 r386  
    2424            if (currEvt.childNodes[child].localName != undefined) 
    2525            { 
     26                var tagName = currEvt.childNodes[child].localName.toUpperCase(); 
    2627                // Determine the tag type and dispatch it for further processing 
    27                 switch(currEvt.childNodes[child].localName) 
     28                switch(tagName) 
    2829                { 
    2930                    case "TIME_INDEX":  
     
    5455                        break; 
    5556                    case "TELEPHONE":  
    56                         telProp = new Evaluation("Telephone Conversation",  
     57                        telProp = new Evaluation("TELEPHONE CONVERSATION",  
    5758                                 parseTelephone(currEvt.childNodes[child]) );   
    5859                        evalarray.push(telProp); 
     
    6667                        } 
    6768                        break; 
    68                     case "TMT_RADIO":  break; 
    69                     case "MAINTENANCE_RADIO": break; 
    70                     // case *_EVALUATION: break; 
    71  
     69 
     70                    case "TMT_RADIO":   
     71                    case "MAINTENANCE_RADIO":  
     72                        var result = new Array();    
     73                        result.push("Details:"); 
     74                        result.push(currEvt.childNodes[child].textContent.trim()); 
     75                        var radProp = new Property(tagName, result );  
     76                        proparray.push(radProp); 
     77                        break; 
     78 
     79                    case "FACILITATOR_EVALUATION":  
     80                    case "CAD_EVALUATION": 
     81                    case "ATMS_EVALUATION": 
     82                    case "ACTIVITY_LOG_EVALUATION": 
     83                    case "RADIO_EVALUATION": 
     84                        // remove the suffix 
     85                        var evalType = tagName.replace("_EVALUATION",""); 
     86                        // Build the evaluation item 
     87                        var facEval = new Evaluation(evalType,  
     88                                 parseEvaluation(currEvt.childNodes[child]) );   
     89                        evalarray.push(facEval); 
     90                        break; 
     91                         
     92                    case "CMS_EVALUATION": 
     93                        // TODO: Complete this partial implementation 
     94                        var result = new Array();    
     95                        result.push("Expected Action:"); 
     96                        result.push("Action will appear here."); 
     97                        var cmsEval = new Evaluation("CMS", result); 
     98                        evalarray.push(cmsEval); 
     99                        break; 
    72100                } 
    73101            } 
     
    134162                result.push(dialog[line].attributes["Role"].value); 
    135163                result.push(dialog[line].textContent); 
     164            } 
     165        } 
     166    } 
     167    return result; 
     168} 
     169function parseEvaluation(element) 
     170{ 
     171    var result = new Array(); 
     172    var details = element.getElementsByTagName("EXPECTED_ACTION"); 
     173    if (details.length > 0) 
     174    { 
     175        for (detail in details) 
     176        { 
     177            if (details[detail].textContent != undefined) 
     178            {                 
     179                result.push("Expected Action:"); 
     180                result.push(details[detail].textContent.trim()); 
    136181            } 
    137182        } 
Note: See TracChangeset for help on using the changeset viewer.