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