]> git.mxchange.org Git - jjobs-war.git/blob - src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
420ae887f41aa29503460a7df71b17e902553738
[jjobs-war.git] / src / java / org / mxchange / jjobs / beans / contact / JobsAdminContactWebRequestBean.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jjobs.beans.contact;
18
19 import java.text.MessageFormat;
20 import java.util.Date;
21 import java.util.Iterator;
22 import javax.annotation.PostConstruct;
23 import javax.enterprise.context.RequestScoped;
24 import javax.enterprise.event.Event;
25 import javax.enterprise.inject.Any;
26 import javax.faces.view.facelets.FaceletException;
27 import javax.inject.Inject;
28 import javax.inject.Named;
29 import javax.naming.Context;
30 import javax.naming.InitialContext;
31 import javax.naming.NamingException;
32 import org.mxchange.jcontacts.contact.Contact;
33 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
34 import org.mxchange.jcontacts.contact.UserContact;
35 import org.mxchange.jcontacts.contact.gender.Gender;
36 import org.mxchange.jcontacts.contact.utils.ContactUtils;
37 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
38 import org.mxchange.jcontacts.events.contact.add.AdminContactAddedEvent;
39 import org.mxchange.jcontacts.events.contact.update.AdminContactUpdatedEvent;
40 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
41 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
42 import org.mxchange.jcountry.data.Country;
43 import org.mxchange.jjobs.beans.BaseJobsController;
44 import org.mxchange.jjobs.beans.helper.JobsWebRequestController;
45 import org.mxchange.jphone.phonenumbers.DialableNumber;
46 import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
47 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
48 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
49 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
50 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
51 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
52 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
53
54 /**
55  * An administrative user bean (controller)
56  * <p>
57  * @author Roland Haeder<roland@mxchange.org>
58  */
59 @Named ("adminContactController")
60 @RequestScoped
61 public class JobsAdminContactWebRequestBean extends BaseJobsController implements JobsAdminContactWebRequestController {
62
63         /**
64          * Serial number
65          */
66         private static final long serialVersionUID = 542_145_347_916L;
67
68         /**
69          * An event fired when the administrator has added a new contact
70          */
71         @Inject
72         @Any
73         private Event<AdminAddedContactEvent> addedContactEvent;
74
75         /**
76          * Admin helper instance
77          */
78         @Inject
79         private JobsWebRequestController beanHelper;
80
81         /**
82          * Birth day
83          */
84         private Date birthday;
85
86         /**
87          * Cellphone number's carrier
88          */
89         private MobileProvider cellphoneCarrier;
90
91         /**
92          * Cellphone id number
93          */
94         private Long cellphoneId;
95
96         /**
97          * Cellphone number
98          */
99         private Long cellphoneNumber;
100
101         /**
102          * City
103          */
104         private String city;
105
106         /**
107          * Optional comments
108          */
109         private String comment;
110
111         /**
112          * Remote contact bean
113          */
114         private final ContactSessionBeanRemote contactBean;
115
116         /**
117          * General contact controller
118          */
119         @Inject
120         private JobsContactWebSessionController contactController;
121
122         /**
123          * Contact id
124          */
125         private Long contactId;
126
127         /**
128          * Country instance
129          */
130         private Country country;
131
132         /**
133          * Email address
134          */
135         private String emailAddress;
136
137         /**
138          * Family name
139          */
140         private String familyName;
141
142         /**
143          * Fax number's area code
144          */
145         private Integer faxAreaCode;
146
147         /**
148          * Country instance for fax number
149          */
150         private Country faxCountry;
151
152         /**
153          * Fax id number
154          */
155         private Long faxId;
156
157         /**
158          * Fax number
159          */
160         private Long faxNumber;
161
162         /**
163          * First name
164          */
165         private String firstName;
166
167         /**
168          * Gender instance
169          */
170         private Gender gender;
171
172         /**
173          * House number
174          */
175         private Short houseNumber;
176
177         /**
178          * House number extension
179          */
180         private String houseNumberExtension;
181
182         /**
183          * Whether a cellphone entry has been unlinked
184          */
185         private boolean isCellphoneUnlinked;
186
187         /**
188          * Whether a fax entry has been unlinked
189          */
190         private boolean isFaxUnlinked;
191
192         /**
193          * Whether a land-line number has been unlinked
194          */
195         private boolean isLandLineUnlinked;
196
197         /**
198          * Land-line id number
199          */
200         private Long landLineId;
201
202         /**
203          * Phone number area code
204          */
205         private Integer phoneAreaCode;
206
207         /**
208          * Country instance for phone number
209          */
210         private Country phoneCountry;
211
212         /**
213          * Phone number
214          */
215         private Long phoneNumber;
216
217         /**
218          * Street
219          */
220         private String street;
221
222         /**
223          * Title
224          */
225         private String title;
226
227         /**
228          * An event fired when the administrator has updated contact data
229          */
230         @Inject
231         @Any
232         private Event<AdminUpdatedContactEvent> updatedContactEvent;
233
234         /**
235          * ZIP code
236          */
237         private Integer zipCode;
238
239         /**
240          * Default constructor
241          */
242         public JobsAdminContactWebRequestBean () {
243                 // Try it
244                 try {
245                         // Get initial context
246                         Context context = new InitialContext();
247
248                         // Try to lookup
249                         this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/jratecalc-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
250                 } catch (final NamingException e) {
251                         // Throw again
252                         throw new FaceletException(e);
253                 }
254         }
255
256         @Override
257         public String addContact () {
258                 // Are all minimum fields set?
259                 if (this.getGender() == null) {
260                         // Throw NPE
261                         throw new NullPointerException("gender is null"); //NOI18N
262                 } else if (this.getFirstName() == null) {
263                         // Throw NPE
264                         throw new NullPointerException("firstName is null"); //NOI18N
265                 } else if (this.getFirstName().isEmpty()) {
266                         // Empty string
267                         throw new IllegalStateException("firstName is empty"); //NOI18N
268                 } else if (this.getFamilyName() == null) {
269                         // Throw NPE
270                         throw new NullPointerException("familyName is null"); //NOI18N
271                 } else if (this.getFamilyName().isEmpty()) {
272                         // Empty string
273                         throw new IllegalStateException("familyName is empty"); //NOI18N
274                 }
275
276                 // Create new contact instance
277                 Contact contact = this.createContactInstance();
278
279                 // Default is not same contact
280                 if (this.isSameContactFound(contact)) {
281                         // Already registered
282                         throw new FaceletException(new ContactAlreadyAddedException(contact));
283                 }
284
285                 // Init contact
286                 Contact updatedContact;
287
288                 // Try to call EJB
289                 try {
290                         // Call EJB
291                         updatedContact = this.contactBean.addContact(contact);
292                 } catch (final ContactAlreadyAddedException ex) {
293                         // Throw again
294                         throw new FaceletException(ex);
295                 }
296
297                 // Fire event
298                 this.addedContactEvent.fire(new AdminContactAddedEvent(updatedContact));
299
300                 // Clear this bean
301                 this.clear();
302
303                 // Return outcome
304                 return "admin_list_contact"; //NOI18N
305         }
306
307         @Override
308         public void copyContactToController (final Contact contact) {
309                 // The contact instance must be valid
310                 if (null == contact) {
311                         // Throw NPE again
312                         throw new NullPointerException("contact is null"); //NOI18N
313                 } else if (contact.getContactId() == null) {
314                         // Throw NPE again
315                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
316                 } else if (contact.getContactId() < 1) {
317                         // Not valid
318                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
319                 }
320
321                 // Set all fields: contact
322                 this.setContactId(contact.getContactId());
323                 this.setTitle(contact.getContactTitle());
324                 this.setBirthday(contact.getContactBirthday());
325                 this.setCity(contact.getContactCity());
326                 this.setComment(contact.getContactComment());
327                 this.setCountry(contact.getContactCountry());
328                 this.setEmailAddress(contact.getContactEmailAddress());
329                 this.setFamilyName(contact.getContactFamilyName());
330                 this.setFirstName(contact.getContactFirstName());
331                 this.setGender(contact.getContactGender());
332                 this.setHouseNumber(contact.getContactHouseNumber());
333                 this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
334                 this.setStreet(contact.getContactStreet());
335                 this.setZipCode(contact.getContactZipCode());
336
337                 // ... cellphone data
338                 if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
339                         this.setCellphoneId(contact.getContactCellphoneNumber().getPhoneId());
340                         this.setCellphoneCarrier(contact.getContactCellphoneNumber().getCellphoneProvider());
341                         this.setCellphoneNumber(contact.getContactCellphoneNumber().getPhoneNumber());
342                 }
343
344                 // ... fax data
345                 if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
346                         this.setFaxId(contact.getContactFaxNumber().getPhoneId());
347                         this.setFaxAreaCode(contact.getContactFaxNumber().getPhoneAreaCode());
348                         this.setFaxCountry(contact.getContactFaxNumber().getPhoneCountry());
349                         this.setFaxNumber(contact.getContactFaxNumber().getPhoneNumber());
350                 }
351
352                 // .. land-line data
353                 if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
354                         this.setLandLineId(contact.getContactLandLineNumber().getPhoneId());
355                         this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
356                         this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry());
357                         this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber());
358                 }
359         }
360
361         @Override
362         public Contact createContactInstance () {
363                 // Generate phone number
364                 DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
365                 DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
366                 DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
367
368                 // Create new instance
369                 Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
370
371                 // Check if contact instance is in helper and valid
372                 if (null == contact) {
373                         // Throw NPE
374                         throw new NullPointerException("beanHelper.contact is null"); //NOI18N
375                 } else if (contact.getContactId() == null) {
376                         // Throw NPE again
377                         throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
378                 } else if (contact.getContactId() < 1) {
379                         // Invalid id
380                         throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
381                 }
382
383                 // Update all data in contact
384                 this.updateContactData(contact);
385
386                 // Call EJB for updating contact data
387                 Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
388
389                 // Fire event
390                 this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
391
392                 // Clear bean
393                 this.clear();
394
395                 // Return it
396                 return contact;
397         }
398
399         @Override
400         public String editContactData () {
401                 // Get contact instance
402                 Contact contact = this.beanHelper.getContact();
403
404                 // Check if contact instance is in helper and valid
405                 if (null == contact) {
406                         // Throw NPE
407                         throw new NullPointerException("beanHelper.contact is null"); //NOI18N
408                 } else if (contact.getContactId() == null) {
409                         // Throw NPE again
410                         throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
411                 } else if (contact.getContactId() < 1) {
412                         // Invalid id
413                         throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
414                 }
415
416                 // Update all data in contact
417                 this.updateContactData(contact);
418
419                 // Call EJB for updating contact data
420                 Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
421
422                 // Fire event
423                 this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
424
425                 // Clear bean
426                 this.clear();
427
428                 // Return to contact list (for now)
429                 return "admin_list_contact"; //NOI18N
430         }
431
432         @Override
433         public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
434                 // Is it null?
435                 if (null == cellphoneNumber) {
436                         // Return null
437                         return null;
438                 }
439
440                 // Get all data
441                 String number = String.format(
442                            "%s%d%d", //NOI18N
443                            cellphoneNumber.getCellphoneProvider().getProviderCountry().getCountryExternalDialPrefix(),
444                            cellphoneNumber.getCellphoneProvider().getProviderDialPrefix(),
445                            cellphoneNumber.getPhoneNumber()
446            );
447
448                 // Return it
449                 return number;
450         }
451
452         @Override
453         public String generatePhoneNumber (final DialableNumber phoneNumber) {
454                 // Is it null?
455                 if (null == phoneNumber) {
456                         // Return null
457                         return null;
458                 }
459
460                 // Generate it
461                 String number = String.format(
462                            "%s%d%d", //NOI18N
463                            phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(),
464                            phoneNumber.getPhoneAreaCode(),
465                            phoneNumber.getPhoneNumber()
466            );
467
468                 // Return it
469                 return number;
470         }
471
472         @Override
473         @SuppressWarnings ("ReturnOfDateField")
474         public Date getBirthday () {
475                 return this.birthday;
476         }
477
478         @Override
479         @SuppressWarnings ("AssignmentToDateFieldFromParameter")
480         public void setBirthday (final Date birthday) {
481                 this.birthday = birthday;
482         }
483
484         @Override
485         public MobileProvider getCellphoneCarrier () {
486                 return this.cellphoneCarrier;
487         }
488
489         @Override
490         public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
491                 this.cellphoneCarrier = cellphoneCarrier;
492         }
493
494         @Override
495         public Long getCellphoneId () {
496                 return this.cellphoneId;
497         }
498
499         @Override
500         public void setCellphoneId (final Long cellphoneId) {
501                 this.cellphoneId = cellphoneId;
502         }
503
504         @Override
505         public Long getCellphoneNumber () {
506                 return this.cellphoneNumber;
507         }
508
509         @Override
510         public void setCellphoneNumber (Long cellphoneNumber) {
511                 this.cellphoneNumber = cellphoneNumber;
512         }
513
514         @Override
515         public String getCity () {
516                 return this.city;
517         }
518
519         @Override
520         public void setCity (final String city) {
521                 this.city = city;
522         }
523
524         @Override
525         public String getComment () {
526                 return this.comment;
527         }
528
529         @Override
530         public void setComment (final String comment) {
531                 this.comment = comment;
532         }
533
534         @Override
535         public Long getContactId () {
536                 return this.contactId;
537         }
538
539         @Override
540         public void setContactId (final Long contactId) {
541                 this.contactId = contactId;
542         }
543
544         @Override
545         public Country getCountry () {
546                 return this.country;
547         }
548
549         @Override
550         public void setCountry (final Country country) {
551                 this.country = country;
552         }
553
554         @Override
555         public String getEmailAddress () {
556                 return this.emailAddress;
557         }
558
559         @Override
560         public void setEmailAddress (final String emailAddress) {
561                 this.emailAddress = emailAddress;
562         }
563
564         @Override
565         public String getFamilyName () {
566                 return this.familyName;
567         }
568
569         @Override
570         public void setFamilyName (final String familyName) {
571                 this.familyName = familyName;
572         }
573
574         @Override
575         public Integer getFaxAreaCode () {
576                 return this.faxAreaCode;
577         }
578
579         @Override
580         public void setFaxAreaCode (final Integer faxAreaCode) {
581                 this.faxAreaCode = faxAreaCode;
582         }
583
584         @Override
585         public Country getFaxCountry () {
586                 return this.faxCountry;
587         }
588
589         @Override
590         public void setFaxCountry (final Country faxCountry) {
591                 this.faxCountry = faxCountry;
592         }
593
594         @Override
595         public Long getFaxId () {
596                 return this.faxId;
597         }
598
599         @Override
600         public void setFaxId (final Long faxId) {
601                 this.faxId = faxId;
602         }
603
604         @Override
605         public Long getFaxNumber () {
606                 return this.faxNumber;
607         }
608
609         @Override
610         public void setFaxNumber (final Long faxNumber) {
611                 this.faxNumber = faxNumber;
612         }
613
614         @Override
615         public String getFirstName () {
616                 return this.firstName;
617         }
618
619         @Override
620         public void setFirstName (final String firstName) {
621                 this.firstName = firstName;
622         }
623
624         @Override
625         public Gender getGender () {
626                 return this.gender;
627         }
628
629         @Override
630         public void setGender (final Gender gender) {
631                 this.gender = gender;
632         }
633
634         @Override
635         public Short getHouseNumber () {
636                 return this.houseNumber;
637         }
638
639         @Override
640         public void setHouseNumber (final Short houseNumber) {
641                 this.houseNumber = houseNumber;
642         }
643
644         @Override
645         public String getHouseNumberExtension () {
646                 return this.houseNumberExtension;
647         }
648
649         @Override
650         public void setHouseNumberExtension (final String houseNumberExtension) {
651                 this.houseNumberExtension = houseNumberExtension;
652         }
653
654         @Override
655         public Long getLandLineId () {
656                 return this.landLineId;
657         }
658
659         @Override
660         public void setLandLineId (final Long landLineId) {
661                 this.landLineId = landLineId;
662         }
663
664         @Override
665         public Integer getPhoneAreaCode () {
666                 return this.phoneAreaCode;
667         }
668
669         @Override
670         public void setPhoneAreaCode (final Integer phoneAreaCode) {
671                 this.phoneAreaCode = phoneAreaCode;
672         }
673
674         @Override
675         public Country getPhoneCountry () {
676                 return this.phoneCountry;
677         }
678
679         @Override
680         public void setPhoneCountry (final Country phoneCountry) {
681                 this.phoneCountry = phoneCountry;
682         }
683
684         @Override
685         public Long getPhoneNumber () {
686                 return this.phoneNumber;
687         }
688
689         @Override
690         public void setPhoneNumber (final Long phoneNumber) {
691                 this.phoneNumber = phoneNumber;
692         }
693
694         @Override
695         public String getStreet () {
696                 return this.street;
697         }
698
699         @Override
700         public void setStreet (final String street) {
701                 this.street = street;
702         }
703
704         @Override
705         public String getTitle () {
706                 return this.title;
707         }
708
709         @Override
710         public void setTitle (final String title) {
711                 this.title = title;
712         }
713
714         @Override
715         public Integer getZipCode () {
716                 return this.zipCode;
717         }
718
719         @Override
720         public void setZipCode (final Integer zipCode) {
721                 this.zipCode = zipCode;
722         }
723
724         /**
725          * Post-initialization of this class
726          */
727         @PostConstruct
728         public void init () {
729         }
730
731         /**
732          * Clears this bean
733          */
734         private void clear () {
735                 // Clear all data
736                 // - personal data
737                 this.setGender(null);
738                 this.setTitle(null);
739                 this.setFirstName(null);
740                 this.setFamilyName(null);
741                 this.setStreet(null);
742                 this.setHouseNumber(null);
743                 this.setHouseNumberExtension(null);
744                 this.setZipCode(null);
745                 this.setCity(null);
746                 this.setCountry(null);
747
748                 // - contact data
749                 this.setEmailAddress(null);
750                 this.setPhoneCountry(null);
751                 this.setPhoneAreaCode(null);
752                 this.setPhoneNumber(null);
753                 this.setCellphoneCarrier(null);
754                 this.setCellphoneNumber(null);
755                 this.setFaxCountry(null);
756                 this.setFaxAreaCode(null);
757                 this.setFaxNumber(null);
758
759                 // - other data
760                 this.setBirthday(null);
761                 this.setComment(null);
762         }
763
764         /**
765          * Checks whether the given contact is found
766          * <p>
767          * @param contact Contact inastance
768          *
769          * @return Wether contact has been found
770          */
771         private boolean isSameContactFound (final Contact contact) {
772                 // Default is not found
773                 boolean IsFound = false;
774
775                 // Get iterator
776                 Iterator<Contact> iterator = this.contactController.allContacts().iterator();
777
778                 // Loop through all
779                 while (iterator.hasNext()) {
780                         // Get next contact
781                         Contact next = iterator.next();
782
783                         // Is the same?
784                         if (ContactUtils.isSameContact(contact, next)) {
785                                 // Yes, then abort loop
786                                 IsFound = false;
787                                 break;
788                         }
789                 }
790
791                 // Return status
792                 return IsFound;
793         }
794
795         /**
796          * Updates all data in contact instance.
797          * <p>
798          * @param contact Contact instance
799          */
800         private void updateContactData (final Contact contact) {
801                 // Contact instance should be valid
802                 if (null == contact) {
803                         // Throw NPE
804                         throw new NullPointerException("contact is null"); //NOI18N
805                 } else if (contact.getContactId() == null) {
806                         // Throw NPE again
807                         throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
808                 } else if (contact.getContactId() < 1) {
809                         // Invalid id
810                         throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
811                 }
812
813                 // Update all fields
814                 contact.setContactGender(this.getGender());
815                 contact.setContactTitle(this.getTitle());
816                 contact.setContactFirstName(this.getFirstName());
817                 contact.setContactFamilyName(this.getFamilyName());
818                 contact.setContactStreet(this.getStreet());
819                 contact.setContactHouseNumber(this.getHouseNumber());
820                 contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
821                 contact.setContactZipCode(this.getZipCode());
822                 contact.setContactCity(this.getCity());
823                 contact.setContactCountry(this.getCountry());
824
825                 // Update contact's cellphone number
826                 this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
827
828                 // Update contact's land-line number
829                 this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
830
831                 // Update contact's fax number
832                 this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
833         }
834
835 }