Produced by Araxis Merge on 6/9/2017 3:51:24 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:24 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\announce | BatchManagerResults.java | Fri Apr 21 20:15:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 177 |
| 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 | /* | |||||
| 2 | * To chan ge this te mplate, ch oose Tools | Templat es | |||||
| 3 | * and ope n the temp late in th e editor. | |||||
| 4 | */ | |||||
| 5 | package go v.va.nvap. web.announ ce; | |||||
| 6 | ||||||
| 7 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 8 | import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.Announce mentBatchS ummary; | |||||
| 9 | import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.Announce rInterface ; | |||||
| 10 | import gov .va.nvap.w eb.app.Res ponseDispa tcherHttpS ervlet; | |||||
| 11 | import gov .va.nvap.w eb.helper. privacy.Co nsentManag ementHelpe r; | |||||
| 12 | import gov .va.nvap.w eb.user.Us erHelper; | |||||
| 13 | import gov .va.nvap.w eb.util.Pa ginator; | |||||
| 14 | ||||||
| 15 | import jav a.io.IOExc eption; | |||||
| 16 | import jav a.util.Arr ayList; | |||||
| 17 | import jav a.util.Dat e; | |||||
| 18 | import jav a.util.Has hMap; | |||||
| 19 | import jav a.util.Lis t; | |||||
| 20 | import jav a.util.Map ; | |||||
| 21 | ||||||
| 22 | import jav ax.ejb.EJB ; | |||||
| 23 | import jav ax.servlet .ServletEx ception; | |||||
| 24 | import jav ax.servlet .http.Http ServletReq uest; | |||||
| 25 | import jav ax.servlet .http.Http ServletRes ponse; | |||||
| 26 | import jav ax.servlet .http.Http Session; | |||||
| 27 | ||||||
| 28 | /** | |||||
| 29 | * | |||||
| 30 | * @author Tim Vu / Asha Amrit raj | |||||
| 31 | * | |||||
| 32 | */ | |||||
| 33 | public cla ss BatchMa nagerResul ts extends ResponseD ispatcherH ttpServlet { | |||||
| 34 | ||||||
| 35 | /* * | |||||
| 36 | * Serial UI D. | |||||
| 37 | * / | |||||
| 38 | pr ivate stat ic final l ong serial VersionUID = -642307 9359688193 531L; | |||||
| 39 | ||||||
| 40 | @E JB(beanInt erface = A nnouncerIn terface.cl ass, mappe dName = "A nnouncerSe rvice") | |||||
| 41 | pr ivate Anno uncerInter face annou ncer; | |||||
| 42 | ||||||
| 43 | /* * | |||||
| 44 | * Delete re cords from the batch . | |||||
| 45 | * / | |||||
| 46 | pu blic void delete(fin al HttpSer vletReques t request, | |||||
| 47 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 48 | IOExce ption { | |||||
| 49 | fina l String[] batchIds = request. getParamet erValues(" batchId"); | |||||
| 50 | ||||||
| 51 | if ( (null != b atchIds) & & (batchId s.length > 0)) { | |||||
| 52 | final List<Strin g> notNull BatchIds = new Array List<Strin g>(); | |||||
| 53 | ||||||
| 54 | for (f inal Strin g batchId : batchIds ) { | |||||
| 55 | if (Null Checker.is NotEmpty(b atchId)) { | |||||
| 56 | notNullBat chIds.add( batchId); | |||||
| 57 | } | |||||
| 58 | } | |||||
| 59 | this.a nnouncer.r emoveAnnou ncementBat ches(notNu llBatchIds ); | |||||
| 60 | } | |||||
| 61 | // D o the sear ch again | |||||
| 62 | this .unspecifi ed(request , response ); | |||||
| 63 | } | |||||
| 64 | ||||||
| 65 | pu blic Conse ntManageme ntHelper g etCmsHelpe r() { | |||||
| 66 | fina l ConsentM anagementH elper cmsH elper = th is.getBean ("cmsHelpe r", | |||||
| 67 | ConsentM anagementH elper.clas s); | |||||
| 68 | retu rn cmsHelp er; | |||||
| 69 | } | |||||
| 70 | ||||||
| 71 | /* * | |||||
| 72 | * Get the r esults fro m the Anno uncer bean . | |||||
| 73 | * / | |||||
| 74 | pu blic List< Map<String , Object>> getResult s( | |||||
| 75 | final HttpServle tRequest r equest, fi nal Pagina tor pagina tor) { | |||||
| 76 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 77 | fina l Date sd = (Date) s ession | |||||
| 78 | .getAttr ibute("bat chManagerQ ueryStartD ate"); | |||||
| 79 | fina l Date ed = (Date) s ession.get Attribute( "batchMana gerQueryEn dDate"); | |||||
| 80 | fina l String o rgOid = (S tring) ses sion | |||||
| 81 | .getAttr ibute("bat chManagerQ ueryRemote Organizati on"); | |||||
| 82 | ||||||
| 83 | // G et the lis t of Annou ncementBat chSummary by date ra nge. Start /End | |||||
| 84 | // d ate can be empty. | |||||
| 85 | fina l List<Ann ouncementB atchSummar y> summary List = thi s.announce r | |||||
| 86 | .retriev eBatchSumm aries(sd, ed, orgOid , | |||||
| 87 | Us erHelper.g etUserName (request), paginator .getCurren tPage() | |||||
| 88 | * pagi nator.getR ecordsPerP age(), | |||||
| 89 | pa ginator.ge tRecordsPe rPage()); | |||||
| 90 | ||||||
| 91 | fina l List<Map <String, O bject>> re sultList = new Array List<Map<S tring, Obj ect>>(); | |||||
| 92 | // P ut it in a map to pr event hibe rnate thre ad issues | |||||
| 93 | for (final Ann ouncementB atchSummar y summary : summaryL ist) { | |||||
| 94 | final Map<String , Object> map = new HashMap<St ring, Obje ct>(); | |||||
| 95 | map.pu t("batchId ", summary .getBatchI d()); | |||||
| 96 | map.pu t("batchSi ze", summa ry.getBatc hSize()); | |||||
| 97 | map.pu t("created Date", sum mary.getCr eatedDate( )); | |||||
| 98 | map.pu t("numberC ompleted", summary.g etNumberCo mpleted()) ; | |||||
| 99 | map.pu t("numberS cheduled", summary.g etNumberSc heduled()) ; | |||||
| 100 | map.pu t("targetO rganizatio nName", | |||||
| 101 | summary.ge tTargetOrg anizationN ame()); | |||||
| 102 | result List.add(m ap); | |||||
| 103 | } | |||||
| 104 | retu rn resultL ist; | |||||
| 105 | } | |||||
| 106 | ||||||
| 107 | pr ivate bool ean isPagi natorPrese nt(final H ttpSession session) { | |||||
| 108 | retu rn !NullCh ecker.isNu llOrEmpty( session.ge tAttribute ("paginato r")); | |||||
| 109 | } | |||||
| 110 | ||||||
| 111 | pu blic void next(final HttpServl etRequest request, | |||||
| 112 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 113 | IOExce ption { | |||||
| 114 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 115 | if ( this.isPag inatorPres ent(sessio n)) { | |||||
| 116 | final Paginator paginator = (Paginat or) sessio n | |||||
| 117 | .getAttrib ute("pagin ator"); | |||||
| 118 | pagina tor.next(r equest); | |||||
| 119 | sessio n.setAttri bute("pagi nator", pa ginator); | |||||
| 120 | sessio n.setAttri bute("batc hManagerRe sults", | |||||
| 121 | this.getRe sults(requ est, pagin ator)); | |||||
| 122 | this.f orward(req uest, resp onse, "sho w"); | |||||
| 123 | } el se { | |||||
| 124 | this.f orward(req uest, resp onse, "nos how"); | |||||
| 125 | } | |||||
| 126 | } | |||||
| 127 | ||||||
| 128 | pu blic void prev(final HttpServl etRequest request, | |||||
| 129 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 130 | IOExce ption { | |||||
| 131 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 132 | if ( this.isPag inatorPres ent(sessio n)) { | |||||
| 133 | final Paginator paginator = (Paginat or) sessio n | |||||
| 134 | .getAttrib ute("pagin ator"); | |||||
| 135 | pagina tor.previo us(request ); | |||||
| 136 | sessio n.setAttri bute("pagi nator", pa ginator); | |||||
| 137 | sessio n.setAttri bute("batc hManagerRe sults", | |||||
| 138 | this.getRe sults(requ est, pagin ator)); | |||||
| 139 | this.f orward(req uest, resp onse, "sho w"); | |||||
| 140 | } el se { | |||||
| 141 | this.f orward(req uest, resp onse, "nos how"); | |||||
| 142 | } | |||||
| 143 | } | |||||
| 144 | ||||||
| 145 | /* * | |||||
| 146 | * Delete re cords from the batch . | |||||
| 147 | * / | |||||
| 148 | pu blic void refresh(fi nal HttpSe rvletReque st request , | |||||
| 149 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 150 | IOExce ption { | |||||
| 151 | // D o the sear ch again | |||||
| 152 | this .unspecifi ed(request , response ); | |||||
| 153 | } | |||||
| 154 | ||||||
| 155 | @O verride | |||||
| 156 | pr otected vo id unspeci fied(final HttpServl etRequest request, | |||||
| 157 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 158 | IOExce ption { | |||||
| 159 | ||||||
| 160 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 161 | if ( this.isPag inatorPres ent(sessio n)) { | |||||
| 162 | Pagina tor pagina tor = (Pag inator) se ssion.getA ttribute(" paginator" ); | |||||
| 163 | if (Nu llChecker. isEmpty(pa ginator)) { | |||||
| 164 | paginato r = new Pa ginator(0) ; | |||||
| 165 | session. setAttribu te("pagina tor", pagi nator); | |||||
| 166 | } | |||||
| 167 | pagina tor.reset( ); | |||||
| 168 | final List<Map<S tring, Obj ect>> summ aryList = this.getRe sults( | |||||
| 169 | request, p aginator); | |||||
| 170 | sessio n.setAttri bute("batc hManagerRe sults", su mmaryList) ; | |||||
| 171 | this.f orward(req uest, resp onse, "sho w"); | |||||
| 172 | } el se { | |||||
| 173 | this.f orward(req uest, resp onse, "nos how"); | |||||
| 174 | } | |||||
| 175 | } | |||||
| 176 | ||||||
| 177 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.