Produced by Araxis Merge on 2/21/2018 6:58:06 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | CUI-CPP-v2.4.0-source-archive.zip\app\controllers\api\v1 | claims_controller.rb | Thu Dec 21 03:33:17 2017 UTC |
| 2 | CUI-CPP-v2.4.0-source-archive.zip\app\controllers\api\v1 | claims_controller.rb | Tue Feb 6 20:05:02 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 176 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | # This err or is rais ed when in coming mes sage does not valida te with Ex am Managem ent 1.0 xs d | |
| 2 | class Exam Management Validation Error < Ru ntimeError ; end | |
| 3 | ||
| 4 | class Api: :V1::Claim sControlle r < Action Controller ::Base | |
| 5 | include ExamReques tHelper, C ontentionH elper, App ointmentHe lper, Clar ificationH elper | |
| 6 | skip_bef ore_filter :verify_a uthenticit y_token | |
| 7 | ||
| 8 | def crea te | |
| 9 | exam_r equest_xml = request .body.read | |
| 10 | begin | |
| 11 | ||
| 12 | noti ficationDo c = Nokog iri::XML(e xam_reques t_xml) | |
| 13 | noti ficationTy pe = XmlHe lper.getCo ntentType( notificati onDoc) | |
| 14 | vali date_xml(n otificatio nDoc, noti ficationTy pe) | |
| 15 | ||
| 16 | exam _request_h ash = Hash .from_xml( exam_reque st_xml) | |
| 17 | ||
| 18 | if n otificatio nType == ' ExamSchedu lingReques tCreatedEv ent' | |
| 19 | pr ocessExamS chedulingR equestCrea tedEvent(e xam_reques t_xml, exa m_request_ hash) | |
| 20 | #E xamRequest Helper.del ay.createR equestObje ct(exam_re quest_xml) | |
| 21 | re nder :json => "Reque st to proc ess ExamMa nagementEv entNotific ation rece ived", sta tus: 200 | |
| 22 | elsi f notifica tionType = = 'Content ionCancell ationReque stedEvent' | |
| 23 | pr ocessCance llationReq uest(notif icationDoc ) | |
| 24 | re nder :json => "Reque st to proc ess Conten tionCancel lationRequ estedEvent received" , status: 200 | |
| 25 | elsi f notifica tionType = = 'Appoint mentCancel RequestEve nt' | |
| 26 | pr ocessAppoi ntmentCanc elRequestE vent(notif icationDoc ) | |
| 27 | re nder :json => "Appoi ntmentCanc elRequestE vent succe ssfully re ceived" | |
| 28 | elsi f notifica tionType = = 'ExamSch edulingReq uestCancel lationEven t' | |
| 29 | pr ocessExamS chedulingR equestCanc ellationEv ent(notifi cationDoc) | |
| 30 | re nder :json => "ExamS chedulingR equestCanc ellationEv ent succes sfully rec eived" | |
| 31 | elsi f notifica tionType = = 'Resched uleRequest Event' | |
| 32 | pr ocessResch eduleReque stEvent(no tification Doc) | |
| 33 | re nder :json => "Resch eduleReque stEvent su ccessfully received" | |
| 34 | elsi f notifica tionType = = 'Clarifi cationResp onseEvent' | |
| 35 | pr ocessClari ficationRe sponseEven t(notifica tionDoc) | |
| 36 | re nder :json => "Clari ficationRe sponseEven t successf ully recei ved" | |
| 37 | elsi f notifica tionType = = 'Reworke dExamSched ulingReque stCreatedE vent' | |
| 38 | pr ocess_rewo rked_exam_ scheduling _request_c reated_eve nt(exam_re quest_xml, exam_requ est_hash) | |
| 39 | re nder :json => "Rewor kedExamSch edulingReq uestCreate dEvent suc cessfully received" | |
| 40 | else | |
| 41 | re nder :json => "Inval id request " | |
| 42 | end | |
| 43 | rescue ExamManag ementValid ationError , Standard Error => e | |
| 44 | rend er :json = > "\nInval id request :\n" + e.m essage+"\n "+e.backtr ace.join(" \n"), stat us: 400 | |
| 45 | Rail s.logger.i nfo e.mess age | |
| 46 | end | |
| 47 | end | |
| 48 | ||
| 49 | private | |
| 50 | ||
| 51 | def vali date_xml o rig_doc, m sg_type | |
| 52 | xsd_pa th = Rails .root.join ("app", "x sd", "Exam Management ", "exchan ge", "Exam Management -1.0.xsd") | |
| 53 | xsd = Nokogiri:: XML::Schem a(File.ope n(xsd_path )) | |
| 54 | doc = process_at om_feed or ig_doc | |
| 55 | ||
| 56 | errors = xsd.val idate(doc) .map { |er ror| error .message } | |
| 57 | if !er rors.empty ? | |
| 58 | erro r_str = er rors.join( "\n") | |
| 59 | rais e ExamMana gementVali dationErro r.new("Inc oming mess age, "+msg _type+", i s not comp atible wit h Exam Man agement 1. 0 IEPD\n"\ | |
| 60 | "#{e rrors.leng th} valida tion error (s):\n"\ | |
| 61 | "#{e rror_str}" ) | |
| 62 | end | |
| 63 | end | |
| 64 | ||
| 65 | def proc ess_atom_f eed orig_d oc | |
| 66 | em_tag = o rig_doc.xp ath("//em: ExamManage mentEventN otificatio n", "em" = > "http:// DNS /vler/sche mas/vlerSu persetSche ma/examMan agement/1. 0") | |
| 67 | doc = Nokogiri:: XML("<?xml version=\ "1.0\" enc oding=\"UT F-8\"?>") | |
| 68 | ||
| 69 | raise ExamManage mentValida tionError. new("Messa ge "+msg_t ype+", mig ht not be an IEPD 1. 0") if doc .nil? | |
| 70 | ||
| 71 | doc.ro ot = em_ta g.first | |
| 72 | doc | |
| 73 | end | |
| 74 | ||
| 75 | def perf ormInitial Check(noti fication_x ml) | |
| 76 | notifi cationXml = ExamMana gementNoti fication.f ind_by_xml (notificat ion_xml) | |
| 77 | if (no tification Xml != nil ) | |
| 78 | rais e Exceptio n, "Duplic ate ExamMa nagement n otificatio n." | |
| 79 | retu rn false | |
| 80 | elsif | |
| 81 | #sav e the noti fication | |
| 82 | Exam Management Notificati on.create( xml: notif ication_xm l) | |
| 83 | retu rn true | |
| 84 | end | |
| 85 | return false | |
| 86 | end | |
| 87 | ||
| 88 | ||
| 89 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.