Produced by Araxis Merge on 6/9/2017 3:51:25 PM 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:51:25 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-web\src\main\java\gov\va\nvap\web\document | ViewAttachment.java | Fri Apr 21 20:03:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 93 |
| 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 | package go v.va.nvap. web.docume nt; | |||||
| 2 | ||||||
| 3 | import gov .va.nvap.c ommon.tran sformer.Tr ansformerE xception; | |||||
| 4 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 5 | import gov .va.nvap.c ommon.xpat h.XPathExc eption; | |||||
| 6 | import gov .va.nvap.w eb.helper. document.D ocumentHel per; | |||||
| 7 | import gov .va.nvap.w eb.helper. document.D ocumentTyp e; | |||||
| 8 | import gov .va.nvap.w eb.helper. document.M ediaType; | |||||
| 9 | import gov .va.nvap.w eb.helper. document.R epresentat ionType; | |||||
| 10 | ||||||
| 11 | import jav a.io.IOExc eption; | |||||
| 12 | ||||||
| 13 | import jav ax.servlet .ServletEx ception; | |||||
| 14 | import jav ax.servlet .http.Http ServletReq uest; | |||||
| 15 | import jav ax.servlet .http.Http ServletRes ponse; | |||||
| 16 | import jav ax.servlet .http.Http Session; | |||||
| 17 | ||||||
| 18 | /** | |||||
| 19 | * Helps i n viewing documents such as th e C32. TOD O: Create a XSL for C62 | |||||
| 20 | * documen ts. | |||||
| 21 | * | |||||
| 22 | * @author Asha Amri traj | |||||
| 23 | */ | |||||
| 24 | public cla ss ViewAtt achment ex tends | |||||
| 25 | gov. va.nvap.we b.app.Resp onseDispat cherHttpSe rvlet { | |||||
| 26 | ||||||
| 27 | /* * | |||||
| 28 | * Serial UI D. | |||||
| 29 | * / | |||||
| 30 | pr ivate stat ic final l ong serial VersionUID = 2743404 1514091430 23L; | |||||
| 31 | ||||||
| 32 | /* * | |||||
| 33 | * Get the d ocument he lper from Spring. | |||||
| 34 | * / | |||||
| 35 | pu blic Docum entHelper getDocumen tHelper() { | |||||
| 36 | retu rn this.ge tBean("ada pterDocume ntHelper", DocumentH elper.clas s); | |||||
| 37 | } | |||||
| 38 | ||||||
| 39 | @O verride | |||||
| 40 | pr otected vo id unspeci fied(final HttpServl etRequest request, | |||||
| 41 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 42 | IOExce ption { | |||||
| 43 | ||||||
| 44 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 45 | // G et the doc ument from session | |||||
| 46 | fina l String d ocument = (String) s ession.get Attribute( "document" ); | |||||
| 47 | // G et the med iaType, re presentati on and doc ument type from the URL | |||||
| 48 | // p arameter | |||||
| 49 | fina l String m ediaTypeSt r = reques t.getParam eter("medi aType"); | |||||
| 50 | fina l String r epresentat ionStr = r equest.get Parameter( "represent ation"); | |||||
| 51 | fina l String d ocTypeStr = request. getParamet er("docTyp e"); | |||||
| 52 | ||||||
| 53 | fina l Document Type docTy pe = Docum entType.fr omValue(do cTypeStr); | |||||
| 54 | fina l MediaTyp e mediaTyp e = MediaT ype.fromVa lue(mediaT ypeStr); | |||||
| 55 | fina l Represen tationType represent ationType = Represen tationType | |||||
| 56 | .fromVal ue(represe ntationStr ); | |||||
| 57 | ||||||
| 58 | // P roceed onl y if the r equired pa ramters ar e present | |||||
| 59 | if ( NullChecke r.isNotEmp ty(mediaTy pe) | |||||
| 60 | && NullC hecker.isN otEmpty(do cument)) { | |||||
| 61 | try { | |||||
| 62 | String a ttachmentC ontent = n ull; | |||||
| 63 | switch ( docType) { | |||||
| 64 | case C62 : | |||||
| 65 | attachment Content = this.getDo cumentHelp er() | |||||
| 66 | .get C62Attachm ent(docume nt); | |||||
| 67 | break; | |||||
| 68 | case Pri vacyConsen tDirective : | |||||
| 69 | attachment Content = this.getDo cumentHelp er() | |||||
| 70 | .get PrivacyCon sentDirect iveAttachm ent(docume nt); | |||||
| 71 | break; | |||||
| 72 | default: | |||||
| 73 | throw new RuntimeExc eption("Do cument typ e not supp orted!"); | |||||
| 74 | } | |||||
| 75 | if (Null Checker.is NotEmpty(a ttachmentC ontent)) { | |||||
| 76 | this.getDo cumentHelp er().write Attachment ToStream(r esponse, | |||||
| 77 | atta chmentCont ent, media Type, repr esentation Type); | |||||
| 78 | } else { | |||||
| 79 | session.se tAttribute ("informat ionMessage ", | |||||
| 80 | "The re are no attachment s associat ed with th is record. "); | |||||
| 81 | this.forwa rd(request , response , "noattac hment"); | |||||
| 82 | } | |||||
| 83 | } catc h (final T ransformer Exception ex) { | |||||
| 84 | throw ne w ServletE xception(e x); | |||||
| 85 | } catc h (final X PathExcept ion ex) { | |||||
| 86 | throw ne w ServletE xception(e x); | |||||
| 87 | } | |||||
| 88 | } el se { | |||||
| 89 | // Med ia type & document h as to be s et | |||||
| 90 | this.f orward(req uest, resp onse, "err or"); | |||||
| 91 | } | |||||
| 92 | } | |||||
| 93 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.