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