2 * Copyright (C) 2016 - 2020 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jfinancials.beans.contact;
19 import java.text.MessageFormat;
20 import java.util.Date;
21 import java.util.Objects;
23 import javax.enterprise.context.RequestScoped;
24 import javax.enterprise.event.Observes;
25 import javax.faces.application.FacesMessage;
26 import javax.faces.view.facelets.FaceletException;
27 import javax.inject.Inject;
28 import javax.inject.Named;
29 import org.mxchange.jcontacts.model.contact.Contact;
30 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
31 import org.mxchange.jcontacts.model.contact.Contacts;
32 import org.mxchange.jcontacts.model.contact.UserContact;
33 import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
34 import org.mxchange.jcountry.model.data.Country;
35 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
36 import org.mxchange.jfinancials.beans.contact.list.FinancialsContactListWebViewController;
37 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
38 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
39 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
40 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
41 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
42 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
43 import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
44 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
45 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
46 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
47 import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
48 import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
51 * A general contact bean (controller)
53 * @author Roland Häder<roland@mxchange.org>
55 @Named ("contactController")
57 public class FinancialsContactWebRequestBean extends BaseFinancialsBean implements FinancialsContactWebRequestController {
62 private static final long serialVersionUID = 542_145_347_916L;
65 * Academic academicTitle
67 private String academicTitle;
72 private Date birthday;
82 private String comment;
85 * EJB for general contact purposes
87 @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
88 private ContactSessionBeanRemote contactBean;
91 * An instance of a contact-list backing bean
93 private FinancialsContactListWebViewController contactListController;
98 private Country country;
103 private String emailAddress;
106 * Email address repeated
108 private String emailAddressRepeat;
113 private String familyName;
116 * Fax number's area code
118 private Integer faxAreaCode;
121 * Country instance for fax number
123 private Country faxCountry;
128 private Long faxNumber;
133 private String firstName;
138 private Short houseNumber;
141 * House number extension
143 private String houseNumberExtension;
146 * Whether a fax entry has been unlinked
148 private boolean isFaxUnlinked;
151 * Whether a land-line number has been unlinked
153 private boolean isLandLineUnlinked;
156 * Whether a mobile entry has been unlinked
158 private boolean isMobileUnlinked;
161 * Phone number area code
163 private Integer landLineAreaCode;
166 * Country instance for phone number
168 private Country landLineCountry;
173 private Long landLineNumber;
178 private Long mobileNumber;
181 * Mobile number's carrier
183 private MobileProvider mobileProvider;
186 * Personal academicTitle
188 private PersonalTitle personalTitle;
193 private String street;
196 * Login bean (controller)
199 private FinancialsUserLoginWebSessionController userLoginController;
204 private Integer zipCode;
207 * Default constructor
209 public FinancialsContactWebRequestBean () {
210 // Call super constructor
215 * Event observer for newly added users by administrator
217 * @param event Event being fired
219 public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
220 // Event and contained entity instance should not be null
223 throw new NullPointerException("event is null"); //NOI18N
224 } else if (event.getAddedUser() == null) {
226 throw new NullPointerException("event.addedUser is null"); //NOI18N
227 } else if (event.getAddedUser().getUserId() == null) {
229 throw new NullPointerException("event.addedUser.userId is null"); //NOI18N
230 } else if (event.getAddedUser().getUserId() < 1) {
232 throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N
240 * Observes events being fired when an administrator has linked a new user
241 * with existing contact data.
243 * @param event Event being fired
245 public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
246 // Event and contained entity instance should not be null
249 throw new NullPointerException("event is null"); //NOI18N
250 } else if (event.getLinkedUser() == null) {
252 throw new NullPointerException("event.linkedUser is null"); //NOI18N
253 } else if (event.getLinkedUser().getUserContact() == null) {
255 throw new NullPointerException("event.linkedUser.userContact is null"); //NOI18N
256 } else if (event.getLinkedUser().getUserContact().getContactId() == null) {
258 throw new NullPointerException("event.linkedUser.userContact.contactId is null"); //NOI18N
259 } else if (event.getLinkedUser().getUserContact().getContactId() < 1) {
261 throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getLinkedUser(), event.getLinkedUser().getUserContact().getContactId())); //NOI18N
269 * Event observer for logged-in user
271 * @param event Event instance
273 public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
274 // Event and contained entity instance should not be null
277 throw new NullPointerException("event is null"); //NOI18N
278 } else if (event.getLoggedInUser() == null) {
280 throw new NullPointerException("event.loggedInUser is null"); //NOI18N
281 } else if (event.getLoggedInUser().getUserId() == null) {
283 throw new NullPointerException("event.loggedInUser.userId is null"); //NOI18N
284 } else if (event.getLoggedInUser().getUserId() < 1) {
286 throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
289 // Copy all data to this bean
290 this.copyContact(event.getLoggedInUser().getUserContact());
294 public void clearEmailAddresses () {
296 this.setEmailAddress(null);
297 this.setEmailAddressRepeat(null);
301 public Contact createContactInstance () {
302 // Is all required data set?
303 if (!this.isRequiredPersonalDataSet()) {
304 // No, then abort here
305 throw new FaceletException(new IllegalArgumentException("Not all personal data is set, but createContactInstance() is called.")); //NOI18N
308 // Required personal data must be set
309 assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
311 // Generate phone number
312 DialableLandLineNumber phone = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
313 DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
314 DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
316 // Create new contact
317 Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName());
318 contact.setContactStreet(this.getStreet());
319 contact.setContactHouseNumber(this.getHouseNumber());
320 contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
321 contact.setContactZipCode(this.getZipCode());
322 contact.setContactCity(this.getCity());
323 contact.setContactCountry(this.getCountry());
324 contact.setContactEmailAddress(this.getEmailAddress());
325 contact.setContactBirthday(this.getBirthday());
326 contact.setContactComment(this.getComment());
328 // Don't set null or wrong references
329 if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
330 // Now the number must be given
331 if (phone.getPhoneAreaCode() == null) {
333 throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
334 } else if (phone.getPhoneAreaCode() < 1) {
336 throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
337 } else if (phone.getPhoneNumber() == null) {
339 throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
340 } else if (phone.getPhoneNumber() < 1) {
342 throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
346 contact.setContactLandLineNumber(phone);
349 // Don't set null or wrong references
350 if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
351 // Now the number must be given
352 if (fax.getPhoneAreaCode() == null) {
354 throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
355 } else if (fax.getPhoneAreaCode() < 1) {
357 throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
358 } else if (fax.getPhoneNumber() == null) {
360 throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
361 } else if (fax.getPhoneNumber() < 1) {
363 throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
367 contact.setContactFaxNumber(fax);
370 // Is the provider set?
371 if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
372 // Is the number set?
373 if (mobile.getPhoneNumber() == null) {
375 throw new NullPointerException("mobile.phoneNumber is null"); //NOI18N
376 } else if (mobile.getPhoneNumber() < 1) {
378 throw new IllegalArgumentException("mobile.phoneNumber is zero or below."); //NOI18N
382 contact.setContactMobileNumber(mobile);
390 public String doChangePersonalContactData () {
391 // This method shall only be called if the user is logged-in
392 if (!this.userLoginController.isUserLoggedIn()) {
394 throw new IllegalStateException("User is not logged-in"); //NOI18N
395 } else if (!this.isRequiredChangePersonalDataSet()) {
396 // Not all required fields are set
397 throw new FaceletException("Not all required fields are set."); //NOI18N
398 } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
399 // Password not matching
400 this.showFacesMessage("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()), FacesMessage.SEVERITY_ERROR); //NOI18N
404 // Get contact instance
405 Contact contact = this.userLoginController.getLoggedInUser().getUserContact();
407 // It should be there, so run some tests on it
408 assert (contact instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N
409 assert (contact.getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N
410 assert (contact.getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N
413 contact.setContactPersonalTitle(this.getPersonalTitle());
414 contact.setContactFirstName(this.getFirstName());
415 contact.setContactFamilyName(this.getFamilyName());
416 contact.setContactStreet(this.getStreet());
417 contact.setContactHouseNumber(this.getHouseNumber());
418 contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
419 contact.setContactZipCode(this.getZipCode());
420 contact.setContactCity(this.getCity());
421 contact.setContactCountry(this.getCountry());
423 // Update contact's mobile number
424 this.isMobileUnlinked = Contacts.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
426 // Update contact's land-line number
427 this.isLandLineUnlinked = Contacts.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
429 // Update contact's fax number
430 this.isFaxUnlinked = Contacts.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
432 // Send it to the EJB
433 this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
436 return "contact_data_saved"; //NOI18N
440 * Getter for academic title
442 * @return Academic title
444 public String getAcademicTitle () {
445 return this.academicTitle;
449 * Setter for academic title
451 * @param academicTitle Academic title
453 public void setAcademicTitle (final String academicTitle) {
454 this.academicTitle = academicTitle;
458 * Getter for birth day
462 @SuppressWarnings ("ReturnOfDateField")
463 public Date getBirthday () {
464 return this.birthday;
468 * Setter for birth day
470 * @param birthday Birth day
472 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
473 public void setBirthday (final Date birthday) {
474 this.birthday = birthday;
478 * Getter for city name
482 public String getCity () {
487 * Setter for city name
489 * @param city City name
491 public void setCity (final String city) {
496 * Getter for comments
500 public String getComment () {
507 * @param comment Comments
509 public void setComment (final String comment) {
510 this.comment = comment;
514 public String getControllerType () {
515 return "general"; //NOI18N
520 public void setControllerType (final String controllerType) {
521 throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
525 * Getter for country instance
527 * @return Country instance
529 public Country getCountry () {
534 * Setter for country instance
536 * @param country Country instance
538 public void setCountry (final Country country) {
539 this.country = country;
543 public String getEmailAddress () {
544 return this.emailAddress;
548 * Setter for email address
550 * @param emailAddress Email address
552 public void setEmailAddress (final String emailAddress) {
553 this.emailAddress = emailAddress;
557 * Getter for email address, repeated
559 * @return the emailAddress, repeated
561 public String getEmailAddressRepeat () {
562 return this.emailAddressRepeat;
566 * Setter for email address repeated
568 * @param emailAddressRepeat the emailAddress to set
570 public void setEmailAddressRepeat (final String emailAddressRepeat) {
571 this.emailAddressRepeat = emailAddressRepeat;
577 * @return the familyName
579 public String getFamilyName () {
580 return this.familyName;
586 * @param familyName the familyName to set
588 public void setFamilyName (final String familyName) {
589 this.familyName = familyName;
593 * Getter for fax number's area code
595 * @return Fax number's area code
597 public Integer getFaxAreaCode () {
598 return this.faxAreaCode;
602 * Setter for fax number's area code
604 * @param faxAreaCode Fax number's area code
606 public void setFaxAreaCode (final Integer faxAreaCode) {
607 this.faxAreaCode = faxAreaCode;
611 * Getter for fax's country instance
613 * @return Fax' country instance
615 public Country getFaxCountry () {
616 return this.faxCountry;
620 * Setter for fax's country instance
622 * @param faxCountry Fax' country instance
624 public void setFaxCountry (final Country faxCountry) {
625 this.faxCountry = faxCountry;
629 * Getter for fax number
633 public Long getFaxNumber () {
634 return this.faxNumber;
638 * Setter for fax number
640 * @param faxNumber Fax number
642 public void setFaxNumber (final Long faxNumber) {
643 this.faxNumber = faxNumber;
649 * @return the first name
651 public String getFirstName () {
652 return this.firstName;
658 * @param firstName the first name to set
660 public void setFirstName (final String firstName) {
661 this.firstName = firstName;
667 * @return the houseNumber
669 public Short getHouseNumber () {
670 return this.houseNumber;
676 * @param houseNumber the houseNumber to set
678 public void setHouseNumber (final Short houseNumber) {
679 this.houseNumber = houseNumber;
683 * Getter for house number extension, example: 123a 'a' is then the
684 * extension and 123 is the house number.
686 * @return House number extension
688 public String getHouseNumberExtension () {
689 return this.houseNumberExtension;
693 * Setter for house number extension
695 * @param houseNumberExtension House number extension
697 public void setHouseNumberExtension (final String houseNumberExtension) {
698 this.houseNumberExtension = houseNumberExtension;
702 * Getter for land-line number's area code
704 * @return Land-line number's area code
706 public Integer getLandLineAreaCode () {
707 return this.landLineAreaCode;
711 * Setter for land-line number's area code
713 * @param landLineAreaCode Land-line number's area code
715 public void setLandLineAreaCode (final Integer landLineAreaCode) {
716 this.landLineAreaCode = landLineAreaCode;
720 * Getter for land-line number's country instance
722 * @return Land-line number's country instance
724 public Country getLandLineCountry () {
725 return this.landLineCountry;
729 * Setter for land-line number's country instance
731 * @param landLineCountry Land-line number's country instance
733 public void setLandLineCountry (final Country landLineCountry) {
734 this.landLineCountry = landLineCountry;
738 * Getter for land-line number
740 * @return Land-line number
742 public Long getLandLineNumber () {
743 return this.landLineNumber;
747 * Setter for land-line number
749 * @param landLineNumber Land-line number
751 public void setLandLineNumber (final Long landLineNumber) {
752 this.landLineNumber = landLineNumber;
756 * Getter for mobile number
758 * @return Mobile number
760 public Long getMobileNumber () {
761 return this.mobileNumber;
765 * Setter for mobile number
767 * @param mobileNumber Mobile number
769 public void setMobileNumber (final Long mobileNumber) {
770 this.mobileNumber = mobileNumber;
774 * Getter for mobile number's carrier
776 * @return Mobile number's carrier
778 public MobileProvider getMobileProvider () {
779 return this.mobileProvider;
783 * Setter for mobile number's provider
785 * @param mobileProvider Mobile number's provider
787 public void setMobileProvider (final MobileProvider mobileProvider) {
788 this.mobileProvider = mobileProvider;
792 * Getter for personal title
794 * @return Personal title
796 public PersonalTitle getPersonalTitle () {
797 return this.personalTitle;
801 * Setter for personal title
803 * @param personalTitle Personal title
805 public void setPersonalTitle (final PersonalTitle personalTitle) {
806 this.personalTitle = personalTitle;
814 public String getStreet () {
821 * @param street Street
823 public void setStreet (final String street) {
824 this.street = street;
828 * Getter for ZIP code
832 public Integer getZipCode () {
837 * Setter for ZIP code
839 * @param zipCode ZIP code
841 public void setZipCode (final Integer zipCode) {
842 this.zipCode = zipCode;
846 public boolean isEmailAddressRegistered (final Contact contact) {
848 if (null == contact) {
850 throw new NullPointerException("contact is null"); //NOI18N
851 } else if (contact.getContactEmailAddress() == null) {
853 throw new NullPointerException("contact.contactEmailAddress is null"); //NOI18N
854 } else if (contact.getContactEmailAddress().isEmpty()) {
856 throw new IllegalArgumentException("contact.contactEmailAddress is empty."); //NOI18N
859 // Default is not registered
860 boolean isRegistered = false;
863 for (final Contact currentContact : this.contactListController.getAllContacts()) {
864 // Is same contact found?
865 if (currentContact.getContactEmailAddress().equals(contact.getContactEmailAddress())) {
866 // Found same email address
869 // Skipp further iterations
879 public boolean isEmailAddressRegistered (final String emailAddress) {
880 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
884 public boolean isRequiredChangePersonalDataSet () {
885 return ((this.getPersonalTitle() != null) &&
886 (this.getFirstName() != null) &&
887 (this.getFamilyName() != null) &&
888 (this.getStreet() != null) &&
889 (this.getHouseNumber() != null) &&
890 (this.getZipCode() != null) &&
891 (this.getCity() != null));
895 public boolean isRequiredPersonalDataSet () {
896 return ((this.getPersonalTitle() != null) &&
897 (this.getFirstName() != null) &&
898 (this.getFamilyName() != null) &&
899 (this.getStreet() != null) &&
900 (this.getHouseNumber() != null) &&
901 (this.getZipCode() != null) &&
902 (this.getCity() != null) &&
903 (this.getEmailAddress() != null) &&
904 (this.getEmailAddressRepeat() != null));
908 public boolean isSameEmailAddressEntered () {
909 return (Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat()));
913 public void updateContactDataFromController (final Contact contact) {
914 // Is the instance valid?
915 if (null == contact) {
917 throw new NullPointerException("contact is null"); //NOI18N
918 } else if (contact.getContactId() == null) {
920 throw new NullPointerException("contact.contactId is null"); //NOI18N
921 } else if (contact.getContactId() < 1) {
922 // Not valid id number
923 throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
927 this.copyContact(contact);
933 private void clear () {
936 this.setPersonalTitle(null);
937 this.setAcademicTitle(null);
938 this.setFirstName(null);
939 this.setFamilyName(null);
940 this.setStreet(null);
941 this.setHouseNumber(null);
942 this.setHouseNumberExtension(null);
943 this.setZipCode(null);
945 this.setCountry(null);
948 this.clearEmailAddresses();
949 this.setLandLineAreaCode(null);
950 this.setLandLineCountry(null);
951 this.setLandLineNumber(null);
952 this.setMobileProvider(null);
953 this.setMobileNumber(null);
954 this.setFaxAreaCode(null);
955 this.setFaxCountry(null);
956 this.setFaxNumber(null);
959 this.setBirthday(null);
960 this.setComment(null);
964 * Copies given contact into the controller
966 * @param contact Contact instance
968 private void copyContact (final Contact contact) {
971 this.setPersonalTitle(contact.getContactPersonalTitle());
972 this.setAcademicTitle(contact.getContactTitle());
973 this.setFirstName(contact.getContactFirstName());
974 this.setFamilyName(contact.getContactFamilyName());
975 this.setStreet(contact.getContactStreet());
976 this.setHouseNumber(contact.getContactHouseNumber());
977 this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
978 this.setZipCode(contact.getContactZipCode());
979 this.setCity(contact.getContactCity());
980 this.setCountry(contact.getContactCountry());
981 this.setEmailAddress(contact.getContactEmailAddress());
982 this.setBirthday(contact.getContactBirthday());
983 this.setComment(contact.getContactComment());
985 // Get mobile, phone and fax instance
986 DialableMobileNumber mobile = contact.getContactMobileNumber();
987 DialableFaxNumber fax = contact.getContactFaxNumber();
988 DialableLandLineNumber phone = contact.getContactLandLineNumber();
991 if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) {
992 this.setLandLineCountry(phone.getPhoneCountry());
993 this.setLandLineAreaCode(phone.getPhoneAreaCode());
994 this.setLandLineNumber(phone.getPhoneNumber());
997 if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
998 this.setMobileProvider(mobile.getMobileProvider());
999 this.setMobileNumber(mobile.getPhoneNumber());
1002 if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
1003 this.setFaxCountry(fax.getPhoneCountry());
1004 this.setFaxAreaCode(fax.getPhoneAreaCode());
1005 this.setFaxNumber(fax.getPhoneNumber());