Produced by Araxis Merge on 6/11/2019 10:54:14 AM 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 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\report | ReportConfiguration.java | Wed May 29 15:26:02 2019 UTC |
| 2 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\report | ReportConfiguration.java | Mon Jun 10 19:27:47 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 562 |
| 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 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrii ght 2004 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | // Package | |
| 5 | package go v.va.med.f w.report; | |
| 6 | ||
| 7 | // Java cl asses | |
| 8 | import jav a.io.IOExc eption; | |
| 9 | import jav a.io.Seria lizable; | |
| 10 | import jav a.util.Has hMap; | |
| 11 | import jav a.util.Map ; | |
| 12 | ||
| 13 | import org .apache.co mmons.lang .Validate; | |
| 14 | ||
| 15 | import gov .va.med.fw .report.da ta.QueryCr iteria; | |
| 16 | import gov .va.med.fw .security. UserPrinci pal; | |
| 17 | ||
| 18 | /** | |
| 19 | * Encapsu lates conf iguration informatio n to creat e a report | |
| 20 | * | |
| 21 | * Project : Framewor k</br> Cre ated on: 1 0:25:20 AM </br> | |
| 22 | * | |
| 23 | * @author DN S
|
|
| 24 | */ | |
| 25 | public cla ss ReportC onfigurati on impleme nts Serial izable { | |
| 26 | ||
| 27 | /* * | |
| 28 | * An instan ce of seri alVersionU ID | |
| 29 | * / | |
| 30 | pr ivate stat ic final l ong serial VersionUID = 7728613 5809386403 80L; | |
| 31 | ||
| 32 | /* * | |
| 33 | * A default report ty pe is in P DF | |
| 34 | * / | |
| 35 | pr ivate Repo rtExported Type.Code reportOutp utType = n ull; | |
| 36 | ||
| 37 | /* * | |
| 38 | * A report name | |
| 39 | * / | |
| 40 | pr ivate Stri ng reportN ame = null ; | |
| 41 | ||
| 42 | /* * | |
| 43 | * A report id | |
| 44 | * / | |
| 45 | pr ivate Stri ng reportI D = null; | |
| 46 | ||
| 47 | /* * | |
| 48 | * An instan ce of repo rtOutputNa me | |
| 49 | * / | |
| 50 | pr ivate Stri ng reportO utputName = null; | |
| 51 | ||
| 52 | /* * | |
| 53 | * A map con taining ke y-value pa irs of str ing resour ces | |
| 54 | * / | |
| 55 | pr ivate Map resourceMa pping = nu ll; | |
| 56 | ||
| 57 | /* * | |
| 58 | * A report criteria u sed to bui ld a query string | |
| 59 | * / | |
| 60 | pr ivate Quer yCriteria queryCrite ria = null ; | |
| 61 | ||
| 62 | /* * | |
| 63 | * An instan ce of repo rtUser | |
| 64 | * / | |
| 65 | pr ivate User Principal reportUser = null; | |
| 66 | ||
| 67 | /* * | |
| 68 | * A constru ctor to co nfigure a report wit h a specif ic name, i d and in P DF | |
| 69 | * type A re port name is used as a name of an output report fi le in PDF | |
| 70 | * type. | |
| 71 | * | |
| 72 | * @param na me | |
| 73 | * A report name | |
| 74 | * @param ID | |
| 75 | * A report ID | |
| 76 | * @throws I OException | |
| 77 | * / | |
| 78 | pu blic Repor tConfigura tion(Strin g name, St ring ID) t hrows IOEx ception { | |
| 79 | this (name, ID, ReportExp ortedType. PDF); | |
| 80 | } | |
| 81 | ||
| 82 | /* * | |
| 83 | * A constru ctor to co nfigure a report wit h a specif ic name an d in a | |
| 84 | * specific type. A re port name and ID are used to f orm an out put report | |
| 85 | * file. | |
| 86 | * | |
| 87 | * @param na me | |
| 88 | * A report name | |
| 89 | * @param ID | |
| 90 | * A report id | |
| 91 | * @param ty pe | |
| 92 | * A report type | |
| 93 | * @throws I OException | |
| 94 | * Thrown in case of errors cr eating an output fil e | |
| 95 | * / | |
| 96 | pu blic Repor tConfigura tion(Strin g name, St ring ID, R eportExpor tedType.Co de type) | |
| 97 | throws IOExcepti on { | |
| 98 | this (name, ID, type, get DefaultOut putFileNam e(name, ID , type)); | |
| 99 | } | |
| 100 | ||
| 101 | /* * | |
| 102 | * A constru ctor to co nfigure a report wit h a specif ic name, a specific | |
| 103 | * output na me, and in a specifi c type. | |
| 104 | * | |
| 105 | * @param na me | |
| 106 | * A report name | |
| 107 | * @param ID | |
| 108 | * A report id | |
| 109 | * @param ty pe | |
| 110 | * A report type | |
| 111 | * @param ou tput | |
| 112 | * A report output na me | |
| 113 | * @throws I OException | |
| 114 | * Thrown in case of errors cr eating an output fil e | |
| 115 | * / | |
| 116 | pu blic Repor tConfigura tion(Strin g name, St ring ID, R eportExpor tedType.Co de type, S tring outp ut) | |
| 117 | throws IOExcepti on { | |
| 118 | ||
| 119 | Vali date.notNu ll(name, " A report n ame must n ot be NULL "); | |
| 120 | Vali date.notNu ll(ID, "A report ID must not b e NULL"); | |
| 121 | Vali date.notNu ll(type, " A report t ype must n ot be NULL "); | |
| 122 | Vali date.notNu ll(output, "A report output st ream must not be NUL L"); | |
| 123 | ||
| 124 | this .reportNam e = name; | |
| 125 | this .reportID = ID; | |
| 126 | this .reportOut putType = type; | |
| 127 | this .reportOut putName = output; | |
| 128 | } | |
| 129 | ||
| 130 | /* * | |
| 131 | * Returns a user asso ciated wit h this rep ort | |
| 132 | * | |
| 133 | * @return A user asso ciated wit h this rep ort | |
| 134 | * / | |
| 135 | pu blic UserP rincipal g etReportUs er() { | |
| 136 | retu rn reportU ser; | |
| 137 | } | |
| 138 | ||
| 139 | /* * | |
| 140 | * Sets a us er associa ted with t his report | |
| 141 | * | |
| 142 | * @param re portUser | |
| 143 | * A user | |
| 144 | * / | |
| 145 | pu blic void setReportU ser(UserPr incipal re portUser) { | |
| 146 | this .reportUse r = report User; | |
| 147 | } | |
| 148 | ||
| 149 | /* * | |
| 150 | * Returns a report ty pe | |
| 151 | * | |
| 152 | * @return R eturns the reportFor mat. | |
| 153 | * / | |
| 154 | pu blic Repor tExportedT ype.Code g etReportOu tputType() { | |
| 155 | retu rn reportO utputType; | |
| 156 | } | |
| 157 | ||
| 158 | /* * | |
| 159 | * Returns a report na me | |
| 160 | * | |
| 161 | * @return R eturns the reportNam e. | |
| 162 | * / | |
| 163 | pu blic Strin g getRepor tName() { | |
| 164 | retu rn reportN ame; | |
| 165 | } | |
| 166 | ||
| 167 | /* * | |
| 168 | * Returns a report ID | |
| 169 | * | |
| 170 | * @return R eturns the reportNam e. | |
| 171 | * / | |
| 172 | pu blic Strin g getRepor tID() { | |
| 173 | retu rn reportI D; | |
| 174 | } | |
| 175 | ||
| 176 | /* * | |
| 177 | * Returns a map conta ining a co llection o f key-valu e pairs th at might b e | |
| 178 | * used duri ng a const ruction of a report | |
| 179 | * | |
| 180 | * @return R eturns the resourceM apping. | |
| 181 | * / | |
| 182 | pu blic Map g etResource Mapping() { | |
| 183 | if ( resourceMa pping == n ull) | |
| 184 | resour ceMapping = new Hash Map(); | |
| 185 | retu rn resourc eMapping; | |
| 186 | } | |
| 187 | ||
| 188 | /* * | |
| 189 | * Sets a ma p containi ng a colle ction of k ey-value p airs that might be u sed | |
| 190 | * during a constructi on of a re port | |
| 191 | * | |
| 192 | * @param re sourceMapp ing | |
| 193 | * The reso urceMappin g to set. | |
| 194 | * / | |
| 195 | pu blic void setResourc eMapping(M ap resourc eMapping) { | |
| 196 | this .resourceM apping = r esourceMap ping; | |
| 197 | } | |
| 198 | ||
| 199 | /* * | |
| 200 | * This meth od adds an entry int o resource Mapping. t hat might be used du ring | |
| 201 | * a constru ction of a report | |
| 202 | * | |
| 203 | * @param re sourceMapp ing | |
| 204 | * The reso urceMappin g to set. | |
| 205 | * / | |
| 206 | pu blic void addResourc eMapping(O bject key, Object va lue) { | |
| 207 | if ( this.resou rceMapping == null) | |
| 208 | this.r esourceMap ping = new HashMap() ; | |
| 209 | this .resourceM apping.put (key, valu e); | |
| 210 | } | |
| 211 | ||
| 212 | /* * | |
| 213 | * @return R eturns the queryCrit eria. | |
| 214 | * / | |
| 215 | pu blic Query Criteria g etQueryCri teria() { | |
| 216 | retu rn queryCr iteria; | |
| 217 | } | |
| 218 | ||
| 219 | /* * | |
| 220 | * @param qu eryCriteri a | |
| 221 | * The repo rtCriteria to set. | |
| 222 | * / | |
| 223 | pu blic void setQueryCr iteria(Que ryCriteria queryCrit eria) { | |
| 224 | this .queryCrit eria = que ryCriteria ; | |
| 225 | } | |
| 226 | ||
| 227 | /* * | |
| 228 | * @return R eturns the reportOut putName. | |
| 229 | * / | |
| 230 | pu blic Strin g getRepor tOutputNam e() { | |
| 231 | retu rn reportO utputName; | |
| 232 | } | |
| 233 | ||
| 234 | /* * | |
| 235 | * @see java .lang.Obje ct#toStrin g() | |
| 236 | * / | |
| 237 | pu blic Strin g toString () { | |
| 238 | Stri ngBuilder info = new StringBui lder(); | |
| 239 | info .append("R eport Name : ").appen d(this.rep ortName).a ppend("Rep ort ID: ") .append( | |
| 240 | this.rep ortID).app end("Gener ated repor t name: ") .append(th is.reportO utputName) | |
| 241 | .append( "Report Fo rmat ").ap pend(this. reportOutp utType.get Alias()); | |
| 242 | retu rn info.to String(); | |
| 243 | } | |
| 244 | ||
| 245 | /* * | |
| 246 | * @see java .lang.Obje ct#finaliz e() | |
| 247 | * / | |
| 248 | pr otected vo id finaliz e() throws Throwable { | |
| 249 | this .queryCrit eria = nul l; | |
| 250 | this .reportOut putType = null; | |
| 251 | this .reportID = null; | |
| 252 | this .reportNam e = null; | |
| 253 | if ( this.resou rceMapping != null) { | |
| 254 | this.r esourceMap ping.clear (); | |
| 255 | } | |
| 256 | this .resourceM apping = n ull; | |
| 257 | } | |
| 258 | ||
| 259 | /* * | |
| 260 | * Gets a de fault oupu t file nam e for a re port based on a repo rt name an d | |
| 261 | * its type. | |
| 262 | * | |
| 263 | * @param na me | |
| 264 | * A report 's name | |
| 265 | * @param ID | |
| 266 | * A report 's ID | |
| 267 | * @param ty pe | |
| 268 | * A report 's type | |
| 269 | * @param ou tput | |
| 270 | * A report output fi le | |
| 271 | * @return A report's file name | |
| 272 | * / | |
| 273 | pr ivate stat ic String getDefault OutputFile Name(Strin g name, St ring ID, | |
| 274 | Report ExportedTy pe.Code ty pe) { | |
| 275 | ||
| 276 | Vali date.notNu ll(name, " A report n ame must n ot be NULL "); | |
| 277 | Vali date.notNu ll(ID, "A report ID must not b e NULL"); | |
| 278 | Vali date.notNu ll(type, " A report t ype must n ot be NULL "); | |
| 279 | ||
| 280 | retu rn ID + "- " + name + "." + typ e.getAlias ().toLower Case(); | |
| 281 | } | |
| 282 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.