2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
7 * Modifications Copyright (C) 2018 IBM.
8 * ===================================================================
10 * Unless otherwise specified, all software contained herein is licensed
11 * under the Apache License, Version 2.0 (the "License");
12 * you may not use this software except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 * Unless otherwise specified, all documentation contained herein is licensed
24 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
25 * you may not use this documentation except in compliance with the License.
26 * You may obtain a copy of the License at
28 * https://creativecommons.org/licenses/by/4.0/
30 * Unless required by applicable law or agreed to in writing, documentation
31 * distributed under the License is distributed on an "AS IS" BASIS,
32 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 * See the License for the specific language governing permissions and
34 * limitations under the License.
36 * ============LICENSE_END============================================
40 package org.onap.portalapp.command;
42 import java.util.List;
44 import org.onap.portalapp.portal.domain.EPUser;
45 import org.onap.portalsdk.core.command.support.SearchBase;
47 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
50 public class PostSearchBean extends SearchBase {
52 private EPUser user = null;
53 private EPUser userOrig = null;
54 private String[] selected;
55 private String[] postHrid;
56 private String[] postOrgUserId;
57 private String[] postFirstName;
58 private String[] postLastName;
59 private String[] postOrgCode;
60 private String[] postPhone;
61 private String[] postEmail;
62 private String[] postAddress1;
63 private String[] postAddress2;
64 private String[] postCity;
65 private String[] postState;
66 private String[] postZipCode;
67 private String[] postLocationClli;
68 private String[] postBusinessCountryCode;
69 private String[] postBusinessCountryName;
70 private String[] postDepartment;
71 private String[] postDepartmentName;
72 private String[] postBusinessUnit;
73 private String[] postBusinessUnitName;
74 private String[] postJobTitle;
75 private String[] postOrgManagerUserId;
76 private String[] postCommandChain;
77 private String[] postCompanyCode;
78 private String[] postCompany;
79 private String[] postCostCenter;
80 private String[] postSiloStatus;
81 private String[] postFinancialLocCode;
84 public PostSearchBean() {
88 public PostSearchBean(List<?> items) {
92 userOrig = new EPUser();
100 public String getFirstName() { return user.getFirstName(); }
101 public String getLastName() { return user.getLastName(); }
102 public String getHrid() { return user.getHrid(); }
103 public String getOrgUserId() { return user.getOrgUserId(); }
104 public String getOrgCode() { return user.getOrgCode(); }
105 public String getEmail() { return user.getEmail(); }
106 public String getOrgManagerUserId() { return user.getOrgManagerUserId(); }
108 public String getFirstNameOrig() { return user.getFirstName(); }
109 public String getLastNameOrig() { return user.getLastName(); }
110 public String getHridOrig() { return user.getHrid(); }
111 public String getOrgUserIdOrig() { return user.getOrgUserId(); }
112 public String getOrgCodeOrig() { return user.getOrgCode(); }
113 public String getEmailOrig() { return user.getEmail(); }
114 public String getOrgManagerUserIdOrig() { return user.getOrgManagerUserId(); }
117 public EPUser getUser() { return user; }
119 public String[] getPostEmail() {
123 public String[] getPostFirstName() {
124 return postFirstName;
127 public String[] getPostHrid() {
131 public String[] getPostLastName() {
135 public String[] getPostOrgCode() {
139 public String[] getPostPhone() {
143 public String[] getPostOrgUserId() {
144 return postOrgUserId;
147 public String[] getSelected() {
151 public String[] getPostAddress1() {
155 public String[] getPostBusinessCountryCode() {
156 return postBusinessCountryCode;
159 public String[] getPostCity() {
163 public String[] getPostCommandChain() {
164 return postCommandChain;
167 public String[] getPostCompany() {
171 public String[] getPostCompanyCode() {
172 return postCompanyCode;
175 public String[] getPostDepartment() {
176 return postDepartment;
179 public String[] getPostDepartmentName() {
180 return postDepartmentName;
183 public String[] getPostBusinessCountryName() {
184 return postBusinessCountryName;
187 public String[] getPostJobTitle() {
191 public String[] getPostLocationClli() {
192 return postLocationClli;
195 public String[] getPostManagerUserId() {
196 return postOrgManagerUserId;
199 public String[] getPostState() {
203 public String[] getPostZipCode() {
207 public void setFirstName(String value) { user.setFirstName(value); }
208 public void setLastName(String value) { user.setLastName(value); }
209 public void setHrid(String value) { user.setHrid(value); }
210 public void setOrgUserId(String value) { user.setOrgUserId(value); }
211 public void setOrgCode(String value) { user.setOrgCode(value); }
212 public void setEmail(String value) { user.setEmail(value); }
213 public void setOrgManagerUserId(String value) { user.setOrgManagerUserId(value); }
215 public void setFirstNameOrig(String value) { userOrig.setFirstName(value); }
216 public void setLastNameOrig(String value) { userOrig.setLastName(value); }
217 public void setHridOrig(String value) { userOrig.setHrid(value); }
218 public void setOrgUserIdOrig(String value) { userOrig.setOrgUserId(value); }
219 public void setOrgCodeOrig(String value) { userOrig.setOrgCode(value); }
220 public void setEmailOrig(String value) { userOrig.setEmail(value); }
221 public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); }
223 public void setUser(EPUser value) { this.user = value; }
225 public void setPostEmail(String[] postEmail) {
226 this.postEmail = postEmail;
229 public void setPostFirstName(String[] postFirstName) {
230 this.postFirstName = postFirstName;
233 public void setPostHrid(String[] postHrid) {
234 this.postHrid = postHrid;
237 public void setPostLastName(String[] postLastName) {
238 this.postLastName = postLastName;
241 public void setPostOrgCode(String[] postOrgCode) {
242 this.postOrgCode = postOrgCode;
245 public void setPostPhone(String[] postPhone) {
246 this.postPhone = postPhone;
249 public void setPostUserId(String[] postOrgUserId) {
250 this.postOrgUserId = postOrgUserId;
253 public void setSelected(String[] selected) {
254 this.selected = selected;
257 public void setPostAddress1(String[] postAddress1) {
258 this.postAddress1 = postAddress1;
261 public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
262 this.postBusinessCountryCode = postBusinessCountryCode;
265 public void setPostCity(String[] postCity) {
266 this.postCity = postCity;
269 public void setPostCommandChain(String[] postCommandChain) {
270 this.postCommandChain = postCommandChain;
273 public void setPostCompany(String[] postCompany) {
274 this.postCompany = postCompany;
277 public void setPostCompanyCode(String[] postCompanyCode) {
278 this.postCompanyCode = postCompanyCode;
281 public void setPostDepartment(String[] postDepartment) {
282 this.postDepartment = postDepartment;
285 public void setPostDepartmentName(String[] postDepartmentName) {
286 this.postDepartmentName = postDepartmentName;
289 public void setPostBusinessCountryName(String[] postBusinessCountryName) {
290 this.postBusinessCountryName = postBusinessCountryName;
293 public void setPostJobTitle(String[] postJobTitle) {
294 this.postJobTitle = postJobTitle;
297 public void setPostLocationClli(String[] postLocationClli) {
298 this.postLocationClli = postLocationClli;
301 public void setPostManagerUserId(String[] postOrgManagerUserId) {
302 this.postOrgManagerUserId = postOrgManagerUserId;
305 public void setPostState(String[] postState) {
306 this.postState = postState;
309 public void setPostZipCode(String[] postZipCode) {
310 this.postZipCode = postZipCode;
313 public String[] getPostAddress2() {
317 public void setPostAddress2(String[] postAddress2) {
318 this.postAddress2 = postAddress2;
321 public EPUser getUserOrig() {
325 public void setUserOrig(EPUser userOrig) {
326 this.userOrig = userOrig;
329 public String[] getPostBusinessUnit() {
330 return postBusinessUnit;
333 public void setPostBusinessUnit(String[] postBusinessUnit) {
334 this.postBusinessUnit = postBusinessUnit;
337 public String[] getPostBusinessUnitName() {
338 return postBusinessUnitName;
341 public void setPostBusinessUnitName(String[] postBusinessUnitName) {
342 this.postBusinessUnitName = postBusinessUnitName;
345 public String[] getPostCostCenter() {
346 return postCostCenter;
349 public void setPostCostCenter(String[] postCostCenter) {
350 this.postCostCenter = postCostCenter;
353 public String[] getPostSiloStatus() {
354 return postSiloStatus;
357 public void setPostSiloStatus(String[] postSiloStatus) {
358 this.postSiloStatus = postSiloStatus;
361 public String[] getPostFinancialLocCode() {
362 return postFinancialLocCode;
365 public void setPostFinancialLocCode(String[] postFinancialLocCode) {
366 this.postFinancialLocCode = postFinancialLocCode;
370 public void resetSearch() {
372 setUser(new EPUser());
376 public boolean isCriteriaUpdated() {
377 final boolean flag = true;
378 if(user==null&&userOrig==null)
380 else if(user==null||userOrig==null)
383 boolean value = Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&&
384 Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&&
385 //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&&
386 Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&&
387 Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&&
388 Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&&
389 Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()));
390 return (!(value && flag));
392 } // isCriteriaUpdated