Produced by Araxis Merge on 11/9/2017 4:31:05 PM 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 | PPS-N_B397.zip\PPS-N_B397\PPS-N_B397\PS_PPS_ui\src\main\java\gov\va\med\pharmacy\peps\presentation\common\controller | SiteListsController.java | Thu Nov 9 15:03:16 2017 UTC |
2 | PPS-N_B397.zip\PPS-N_B397\PPS-N_B397\PS_PPS_ui\src\main\java\gov\va\med\pharmacy\peps\presentation\common\controller | SiteListsController.java | Thu Nov 9 20:03:50 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 234 |
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 | package go v.va.med.p harmacy.pe ps.present ation.comm on.control ler; | |
2 | ||
3 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
4 | import org .springfra mework.ste reotype.Co ntroller; | |
5 | import org .springfra mework.ui. Model; | |
6 | import org .springfra mework.web .bind.WebD ataBinder; | |
7 | import org .springfra mework.web .bind.anno tation.Ini tBinder; | |
8 | import org .springfra mework.web .bind.anno tation.Mod elAttribut e; | |
9 | import org .springfra mework.web .bind.anno tation.Req uestMappin g; | |
10 | import org .springfra mework.web .bind.anno tation.Req uestMethod ; | |
11 | ||
12 | import gov .va.med.ph armacy.pep s.common.e xception.A uthenticat ionExcepti on; | |
13 | import gov .va.med.ph armacy.pep s.common.e xception.V alidationE xception; | |
14 | import gov .va.med.ph armacy.pep s.common.v o.EditSite ListVo; | |
15 | import gov .va.med.ph armacy.pep s.common.v o.Role; | |
16 | import gov .va.med.ph armacy.pep s.presenta tion.commo n.controll er.item.Ab stractMana geItemCont roller; | |
17 | import gov .va.med.ph armacy.pep s.presenta tion.commo n.spring.a nnotation. RoleNeeded ; | |
18 | import gov .va.med.ph armacy.pep s.service. common.ses sion.SiteL istService ; | |
19 | ||
20 | /** | |
21 | * Handles the reque sts from t he siteLis t.jsp fron t page. | |
22 | * @author
|
|
23 | * | |
24 | */ | |
25 | @Controlle r("siteLis tsControll er") | |
26 | public cla ss SiteLis tsControll er extends AbstractM anageItemC ontroller { | |
27 | ||
28 | privat e static f inal Strin g EDIT_SIT E_LIST_INS TANCE = "e ditSiteLis tInstance" ; | |
29 | ||
30 | privat e static f inal Strin g LIST_TIT LE = "list Title"; | |
31 | ||
32 | /** | |
33 | * | |
34 | */ | |
35 | @Autow ired | |
36 | privat e SiteList Service si teListServ ice; | |
37 | ||
38 | /** In itBinder. | |
39 | * @pa ram binder WebDataBi nder insta nce | |
40 | */ | |
41 | @InitB inder | |
42 | protec ted void i nitBinderD TO(WebData Binder bin der) { | |
43 | bi nder.setAl lowedField s( | |
44 | "sitesEx cludedList .vistaSite Vo_*", | |
45 | "sitesIn cludedList .vistaSite Vo_*" | |
46 | ); | |
47 | } | |
48 | ||
49 | /** | |
50 | * Add EditSiteL ist along with the l ists of si tes to inc lude and e xclude to the model. | |
51 | * Thi s method g uarantees that this informatio n will be added to t he model f irst, | |
52 | * so that it is available when modi fying the list of si tes. | |
53 | * | |
54 | * @pa ram model Spring mod el object | |
55 | */ | |
56 | @Model Attribute( ) | |
57 | public void popu lateModel( Model mode l) { | |
58 | mo del.addAtt ribute(LIS T_TITLE, " Edit Site List"); | |
59 | Ed itSiteList Vo editSit eList = ge tEditSiteL ist(); | |
60 | ed itSiteList .setSitesE xcludedLis t(siteList Service.ge tExcludedC omplianceS ites()); | |
61 | ed itSiteList .setSitesI ncludedLis t(siteList Service.ge tIncludedC omplianceS ites()); | |
62 | mo del.addAtt ribute(EDI T_SITE_LIS T_INSTANCE , editSite List); | |
63 | } | |
64 | ||
65 | /** | |
66 | * A g et to disp lay site l ists. | |
67 | * | |
68 | * @pa ram model Model inst ance | |
69 | * @re turn Strin g instance | |
70 | * @th rows Authe nticationE xception e xception | |
71 | */ | |
72 | @Reque stMapping( value = "/ editSiteLi st.go", me thod = Req uestMethod .GET) | |
73 | @RoleN eeded(role s = { Role .PSS_PPSN_ SUPERVISOR }) | |
74 | public String di splaySiteL ists(Model model) th rows Authe nticationE xception { | |
75 | ||
76 | pa geTrail.cl earTrail() ; | |
77 | pa geTrail.ad dPage("edi tSiteList" , "Edit Si te List", true); | |
78 | ||
79 | re turn "edit .site.list "; | |
80 | } | |
81 | ||
82 | /** | |
83 | * Upd ates the s ite lists. | |
84 | * | |
85 | * @pa ram editSi teList Edi tSiteListV o instance | |
86 | * @re turn Strin g instance | |
87 | * @th rows Valid ationExcep tion excep tion | |
88 | */ | |
89 | @Reque stMapping( value = "/ editSiteLi st.go", me thod = Req uestMethod .POST) | |
90 | @RoleN eeded(role s = { Role .PSS_PPSN_ SUPERVISOR }) | |
91 | public String su bmitSiteLi sts(@Model Attribute( EDIT_SITE_ LIST_INSTA NCE) EditS iteListVo editSiteLi st) | |
92 | th rows Valid ationExcep tion { | |
93 | ||
94 | Ed itSiteList Vo newStit eList = ge tEditSiteL ist(); | |
95 | if (newStite List != nu ll) { | |
96 | getUser( ); | |
97 | // We se t vaDataFi elds to nu ll to avoi d the fram ework | |
98 | // to lo ok for thi s fields w hen gettin g the valu es from th e request. | |
99 | newStite List.setVa DataFields (null); | |
100 | bindAndU pdateSpeci alHandling (newStiteL ist); | |
101 | ||
102 | siteList Service.sa veExcluded Sites(newS titeList.g etSitesExc ludedList( ), getUser ()); | |
103 | siteList Service.sa veIncluded Sites(newS titeList.g etSitesInc ludedList( ), getUser ()); | |
104 | } | |
105 | ||
106 | re turn REDIR ECT + "edi tSiteList. go"; | |
107 | } | |
108 | ||
109 | /** | |
110 | * Get s the curr ent EditSi teListVo i nstance. | |
111 | * @re turn EditS iteListVo instance | |
112 | */ | |
113 | privat e EditSite ListVo get EditSiteLi st() { | |
114 | re turn flowS cope.get(E ditSiteLis tVo.class) ; | |
115 | } | |
116 | ||
117 | ||
118 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.