]> git.mxchange.org Git - addressbook-war.git/blobdiff - src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
Don't cherry-pick:
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / contact / AddressbookAdminContactWebRequestBean.java
index ed1d5f5062f4f97a057fbd23b7bc142a68a3b808..11396494db84dc780b5229bd812ec6dd442fab3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016 - 2022 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -18,40 +18,40 @@ package org.mxchange.addressbook.beans.contact;
 
 import java.text.MessageFormat;
 import java.util.Date;
-import java.util.Iterator;
-import javax.annotation.PostConstruct;
+import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
+import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
-import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.FaceletException;
+import javax.faces.FacesException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.addressbook.beans.BaseAddressbookController;
-import org.mxchange.addressbook.beans.helper.AddressbookWebRequestController;
-import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jcontacts.contact.gender.Gender;
-import org.mxchange.jcontacts.contact.utils.ContactUtils;
+import org.mxchange.addressbook.beans.BaseAddressbookBean;
+import org.mxchange.addressbook.beans.contact.list.AddressbookContactListWebViewController;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.add.AdminContactAddedEvent;
-import org.mxchange.jcontacts.events.contact.update.AdminContactUpdatedEvent;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
+import org.mxchange.jcontacts.events.contact.deleted.AdminDeletedContactEvent;
+import org.mxchange.jcontacts.events.contact.deleted.ObservableAdminDeletedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
+import org.mxchange.jcontacts.model.contact.UserContact;
+import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jphone.model.phonenumbers.DialableNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 
 /**
  * An administrative user bean (controller)
@@ -60,31 +60,31 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
  */
 @Named ("adminContactController")
 @RequestScoped
-public class AddressbookAdminContactWebRequestBean extends BaseAddressbookController implements AddressbookAdminContactWebRequestController {
+public class AddressbookAdminContactWebRequestBean extends BaseAddressbookBean implements AddressbookAdminContactWebRequestController {
 
        /**
         * Serial number
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
+       /**
+        * Academic academicTitle
+        */
+       private String academicTitle;
+
        /**
         * An event fired when the administrator has added a new contact
         */
        @Inject
        @Any
-       private Event<AdminAddedContactEvent> addedContactEvent;
+       private Event<ObservableAdminAddedContactEvent> addedContactEvent;
 
        /**
         * Administrative contact EJB
         */
+       @EJB (lookup = "java:global/addressbook-ejb/adminContact!org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote")
        private AdminContactSessionBeanRemote adminContactBean;
 
-       /**
-        * Admin helper instance
-        */
-       @Inject
-       private AddressbookWebRequestController beanHelper;
-
        /**
         * Birth day
         */
@@ -101,15 +101,20 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private String comment;
 
        /**
-        * Remote contact bean
+        * Current contact instance
         */
-       private final ContactSessionBeanRemote contactBean;
+       private Contact contact;
 
        /**
-        * General contact controller
+        * EJB for general contact purposes
         */
-       @Inject
-       private AddressbookContactWebSessionController contactController;
+       @EJB (lookup = "java:global/addressbook-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
+       private ContactSessionBeanRemote contactBean;
+
+       /**
+        * Country instance
+        */
+       private Country contactCountry;
 
        /**
         * Contact id
@@ -117,9 +122,17 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private Long contactId;
 
        /**
-        * Country instance
+        * An instance of a contact list controller
         */
-       private Country country;
+       @Inject
+       private AddressbookContactListWebViewController contactListController;
+
+       /**
+        * Event being fired when an administrator has deleted a contact
+        */
+       @Any
+       @Inject
+       private Event<ObservableAdminDeletedContactEvent> deletedContactEvent;
 
        /**
         * Email address
@@ -156,11 +169,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         */
        private String firstName;
 
-       /**
-        * Gender instance
-        */
-       private Gender gender;
-
        /**
         * House number
         */
@@ -184,7 +192,17 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        /**
         * Whether a mobile entry has been unlinked
         */
-       private boolean isMobileUnlinked;
+       private boolean isMobileNumberUnlinked;
+
+       /**
+        * Phone number area code
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country instance for phone number
+        */
+       private Country landLineCountry;
 
        /**
         * Land-line id number
@@ -192,9 +210,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private Long landLineId;
 
        /**
-        * Mobile number's carrier
+        * Phone number
         */
-       private MobileProvider mobileCarrier;
+       private Long landLineNumber;
 
        /**
         * Mobile id number
@@ -207,36 +225,26 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        private Long mobileNumber;
 
        /**
-        * Phone number area code
+        * Mobile number's provider
         */
-       private Integer phoneAreaCode;
+       private MobileProvider mobileProvider;
 
        /**
-        * Country instance for phone number
+        * PersonalTitle instance
         */
-       private Country phoneCountry;
-
-       /**
-        * Phone number
-        */
-       private Long phoneNumber;
+       private PersonalTitle personalTitle;
 
        /**
         * Street
         */
        private String street;
 
-       /**
-        * Title
-        */
-       private String title;
-
        /**
         * An event fired when the administrator has updated contact data
         */
        @Inject
        @Any
-       private Event<AdminUpdatedContactEvent> updatedContactEvent;
+       private Event<ObservableAdminUpdatedContactEvent> updatedContactEvent;
 
        /**
         * ZIP code
@@ -247,25 +255,19 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         * Default constructor
         */
        public AddressbookAdminContactWebRequestBean () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/addressbook-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
+               // Call super constructor
+               super();
        }
 
-       @Override
-       public String addContact () {
+       /**
+        * Adds contact data to database and redirects on success. If the contact is
+        * already found, a proper exception is thrown.
+        */
+       public void addContact () {
                // Are all minimum fields set?
-               if (this.getGender() == null) {
+               if (this.getPersonalTitle() == null) {
                        // Throw NPE
-                       throw new NullPointerException("gender is null"); //NOI18N
+                       throw new NullPointerException("personalTitle is null"); //NOI18N
                } else if (this.getFirstName() == null) {
                        // Throw NPE
                        throw new NullPointerException("firstName is null"); //NOI18N
@@ -281,162 +283,324 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                }
 
                // Create new contact instance
-               Contact contact = this.createContactInstance();
+               final Contact createdContact = this.createContactInstance();
 
                // Default is not same contact
-               if (this.isSameContactFound(contact)) {
+               if (this.contactListController.isContactFound(createdContact)) {
                        // Already registered
-                       throw new FaceletException(new ContactAlreadyAddedException(contact));
+                       throw new FacesException(new ContactAlreadyAddedException(createdContact));
                }
 
                // Init contact
-               Contact updatedContact;
+               final Contact updatedContact;
 
                // Try to call EJB
                try {
                        // Call EJB
-                       updatedContact = this.adminContactBean.addContact(contact);
+                       updatedContact = this.adminContactBean.addContact(createdContact);
                } catch (final ContactAlreadyAddedException ex) {
                        // Throw again
-                       throw new FaceletException(ex);
+                       throw new FacesException(ex);
                }
 
                // Fire event
-               this.addedContactEvent.fire(new AdminContactAddedEvent(updatedContact));
+               this.addedContactEvent.fire(new AdminAddedContactEvent(updatedContact));
 
                // Clear this bean
                this.clear();
-
-               // Return outcome
-               return "admin_list_contact"; //NOI18N
        }
 
-       @Override
-       public void copyContactToController (final Contact contact) {
-               // The contact instance must be valid
-               if (null == contact) {
+       /**
+        * Observer for events being fired when a bean helper has successfully
+        * created a contact instance.
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterCreatedContactEvent (@Observes final ObservableCreatedContactEvent event) {
+               // Log message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminContactController::afterCreatedContactEvent(): contact={0} - CALLED!", contact)); //NOI18N
+
+               // The event instance must be valid
+               if (null == event) {
                        // Throw NPE again
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getCreatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
-               } else if (contact.getContactId() < 1) {
+                       throw new NullPointerException("event.createdContact is null"); //NOI18N
+               } else if (event.getCreatedContact().getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
+               } else if (event.getCreatedContact().getContactId() < 1) {
                        // Not valid
-                       throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
+                       throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
                }
 
+               // Set contact for e.g. delete method
+               this.setContact(event.getCreatedContact());
+
+               // Get contact instance from event
+               final Contact createdContact = event.getCreatedContact();
+
                // Set all fields: contact
-               this.setContactId(contact.getContactId());
-               this.setTitle(contact.getContactTitle());
-               this.setBirthday(contact.getContactBirthday());
-               this.setCity(contact.getContactCity());
-               this.setComment(contact.getContactComment());
-               this.setCountry(contact.getContactCountry());
-               this.setEmailAddress(contact.getContactEmailAddress());
-               this.setFamilyName(contact.getContactFamilyName());
-               this.setFirstName(contact.getContactFirstName());
-               this.setGender(contact.getContactGender());
-               this.setHouseNumber(contact.getContactHouseNumber());
-               this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
-               this.setStreet(contact.getContactStreet());
-               this.setZipCode(contact.getContactZipCode());
-
-               // ... mobile data
-               if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
-                       this.setMobileId(contact.getContactMobileNumber().getPhoneId());
-                       this.setMobileCarrier(contact.getContactMobileNumber().getMobileProvider());
-                       this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
+               this.setContactId(createdContact.getContactId());
+               this.setAcademicTitle(createdContact.getContactTitle());
+               this.setBirthday(createdContact.getContactBirthday());
+               this.setCity(createdContact.getContactCity());
+               this.setComment(createdContact.getContactComment());
+               this.setContactCountry(createdContact.getContactCountry());
+               this.setEmailAddress(createdContact.getContactEmailAddress());
+               this.setFamilyName(createdContact.getContactFamilyName());
+               this.setFirstName(createdContact.getContactFirstName());
+               this.setPersonalTitle(createdContact.getContactPersonalTitle());
+               this.setHouseNumber(createdContact.getContactHouseNumber());
+               this.setHouseNumberExtension(createdContact.getContactHouseNumberExtension());
+               this.setStreet(createdContact.getContactStreet());
+               this.setZipCode(createdContact.getContactZipCode());
+
+               // Is the cell phone set?
+               if (createdContact.getContactMobileNumber() instanceof DialableMobileNumber) {
+                       // ... cmobile data
+                       this.setMobileId(createdContact.getContactMobileNumber().getMobileId());
+                       this.setMobileProvider(createdContact.getContactMobileNumber().getMobileProvider());
+                       this.setMobileNumber(createdContact.getContactMobileNumber().getMobileNumber());
                }
 
-               // ... fax data
-               if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
-                       this.setFaxId(contact.getContactFaxNumber().getPhoneId());
-                       this.setFaxAreaCode(contact.getContactFaxNumber().getPhoneAreaCode());
-                       this.setFaxCountry(contact.getContactFaxNumber().getPhoneCountry());
-                       this.setFaxNumber(contact.getContactFaxNumber().getPhoneNumber());
+               // Is the fax set?
+               if (createdContact.getContactFaxNumber() instanceof DialableFaxNumber) {
+                       // ... fax data
+                       this.setFaxId(createdContact.getContactFaxNumber().getPhoneId());
+                       this.setFaxAreaCode(createdContact.getContactFaxNumber().getPhoneAreaCode());
+                       this.setFaxCountry(createdContact.getContactFaxNumber().getPhoneCountry());
+                       this.setFaxNumber(createdContact.getContactFaxNumber().getPhoneNumber());
                }
 
-               // .. land-line data
-               if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
-                       this.setLandLineId(contact.getContactLandLineNumber().getPhoneId());
-                       this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
-                       this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry());
-                       this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber());
+               // Is the land-line number set?
+               if (createdContact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
+                       // .. land-line data
+                       this.setLandLineId(createdContact.getContactLandLineNumber().getPhoneId());
+                       this.setLandLineAreaCode(createdContact.getContactLandLineNumber().getPhoneAreaCode());
+                       this.setLandLineCountry(createdContact.getContactLandLineNumber().getPhoneCountry());
+                       this.setLandLineNumber(createdContact.getContactLandLineNumber().getPhoneNumber());
                }
+
+               // Log message
+               //* NOISY-DEBUG: */ System.out.println("AdminContactController::afterCreatedContactEvent(): EXIT!"); //NOI18N
        }
 
        @Override
        public Contact createContactInstance () {
+               // Are all minimum fields set?
+               if (this.getPersonalTitle() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("personalTitle is null"); //NOI18N
+               } else if (this.getFirstName() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("firstName is null"); //NOI18N
+               } else if (this.getFirstName().isEmpty()) {
+                       // Empty string
+                       throw new IllegalStateException("firstName is empty"); //NOI18N
+               } else if (this.getFamilyName() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("familyName is null"); //NOI18N
+               } else if (this.getFamilyName().isEmpty()) {
+                       // Empty string
+                       throw new IllegalStateException("familyName is empty"); //NOI18N
+               } else if (this.getContactCountry() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("contactCountry is null"); //NOI18N
+               } else if (this.getContactCountry().getCountryId() == null) {
+                       // Throw it again
+                       throw new NullPointerException("contactCountry.countryId is null"); //NOI18N
+               } else if (this.getContactCountry().getCountryId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("contactCountry.countryId={0} is invalid", this.getContactCountry().getCountryId())); //NOI18N
+               }
+
                // Generate phone number
-               DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
-               DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+               DialableLandLineNumber landLine = null;
+               DialableMobileNumber mobile = null;
+               DialableFaxNumber fax = null;
+
+               // Are all fields set?
+               if (this.getLandLineAreaCode() != null && this.getLandLineCountry() instanceof Country && this.getLandLineNumber() != null) {
+                       // Init instance
+                       landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               }
+
+               // Are all fields set?
+               if (this.getMobileProvider() instanceof MobileProvider && this.getMobileNumber() != null) {
+                       // Initialize instance
+                       mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+               }
+
+               // Are all fields set?
+               if (this.getFaxAreaCode() != null && this.getFaxCountry() instanceof Country && this.getFaxNumber() != null) {
+                       // Initialize instance
+                       fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+               }
 
                // Create new instance
-               Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
+               final Contact localContact = new UserContact(
+                                         this.getPersonalTitle(),
+                                         this.getFirstName(),
+                                         this.getFamilyName(),
+                                         this.getContactCountry(),
+                                         Boolean.FALSE,
+                                         this.getStreet(),
+                                         this.getHouseNumber(),
+                                         this.getHouseNumberExtension(),
+                                         this.getZipCode(),
+                                         this.getCity(),
+                                         this.getEmailAddress(),
+                                         this.getAcademicTitle(),
+                                         this.getBirthday(),
+                                         this.getComment()
+                         );
+
+               // Add missing fields
+               localContact.setContactId(this.getContactId());
+
+               // Don't set null or wrong references
+               if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
+                       // Now the number must be given
+                       if (landLine.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
+                       } else if (landLine.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalStateException("phone.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (landLine.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
+                       } else if (landLine.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalStateException("phone.phoneNumber is zero or below."); //NOI18N
+                       }
 
-               // Check if contact instance is in helper and valid
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("beanHelper.contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
-               } else if (contact.getContactId() < 1) {
-                       // Invalid id
-                       throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+                       // Set phone number
+                       localContact.setContactLandLineNumber(landLine);
                }
 
-               // Update all data in contact
-               this.updateContactData(contact);
+               // Don't set null or wrong references
+               if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
+                       // Now the number must be given
+                       if (fax.getPhoneAreaCode() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
+                       } else if (fax.getPhoneAreaCode() < 1) {
+                               // Abort here
+                               throw new IllegalStateException("fax.phoneAreaCode is zero or below."); //NOI18N
+                       } else if (fax.getPhoneNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
+                       } else if (fax.getPhoneNumber() < 1) {
+                               // Abort here
+                               throw new IllegalStateException("fax.phoneNumber is zero or below."); //NOI18N
+                       }
 
-               // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+                       // Set fax number
+                       localContact.setContactFaxNumber(fax);
+               }
 
-               // Fire event
-               this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
+               // Is the provider set?
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
+                       // Is the number set?
+                       if (mobile.getMobileNumber() == null) {
+                               // Is null
+                               throw new NullPointerException("cmobile.phoneNumber is null"); //NOI18N
+                       } else if (mobile.getMobileNumber() < 1) {
+                               // Abort here
+                               throw new IllegalStateException("cmobile.phoneNumber is zero or below."); //NOI18N
+                       }
 
-               // Clear bean
-               this.clear();
+                       // Set cmobile number
+                       localContact.setContactMobileNumber(mobile);
+               }
 
                // Return it
-               return contact;
+               return localContact;
        }
 
-       @Override
-       public String editContactData () {
+       /**
+        * Deletes currently chosen contact and returns to list view
+        *
+        * @return
+        */
+       public String deleteContactData () {
+               // Is contact set?
+               if (this.getContact() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.contact is null");
+               } else if (this.getContact().getContactId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.contact.contactId is null");
+               } else if (this.getContact().getContactId() < 1) {
+                       // Throw IAE
+                       throw new NullPointerException(MessageFormat.format("this.contact.contactId={0} is not valid.", this.getContact().getContactId()));
+               }
+
+               try {
+                       // Invoke EJB
+                       this.adminContactBean.deleteContactData(this.getContact());
+               } catch (final ContactNotFoundException ex) {
+                       // Throw it again
+                       throw new FacesException(ex);
+               }
+
+               // Fire event
+               this.deletedContactEvent.fire(new AdminDeletedContactEvent(this.getContact()));
+
+               // Return to list view
+               return "admin_list_contacts";
+       }
+
+       /**
+        * Edits currently loaded contact's data in database.
+        */
+       public void editContactData () {
                // Get contact instance
-               Contact contact = this.beanHelper.getContact();
+               final Contact createdContact = this.createContactInstance();
 
                // Check if contact instance is in helper and valid
-               if (null == contact) {
+               if (null == createdContact) {
                        // Throw NPE
                        throw new NullPointerException("beanHelper.contact is null"); //NOI18N
-               } else if (contact.getContactId() == null) {
+               } else if (createdContact.getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
-               } else if (contact.getContactId() < 1) {
+                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N
+               } else if (createdContact.getContactId() < 1) {
                        // Invalid id
-                       throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+                       throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", createdContact.getContactId())); //NOI18N
                }
 
                // Update all data in contact
-               this.updateContactData(contact);
+               this.updateContactData(createdContact);
 
-               // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               // Init updated contact instance
+               final Contact updatedContact;
+
+               try {
+                       // Call EJB for updating contact data
+                       updatedContact = this.contactBean.updateContactData(createdContact, this.isMobileNumberUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               } catch (final ContactNotFoundException ex) {
+                       // Throw as a cause
+                       throw new FacesException(ex);
+               }
 
                // Fire event
-               this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
+               this.updatedContactEvent.fire(new AdminUpdatedContactEvent(updatedContact));
 
                // Clear bean
                this.clear();
-
-               // Return to contact list (for now)
-               return "admin_list_contact"; //NOI18N
        }
 
-       @Override
+       /**
+        * Returns a text representation of given mobile number or null if not set.
+        * <p>
+        * @param mobileNumber Mobile number
+        * <p>
+        * @return Text representation or null
+        */
        public String generateMobileNumber (final DialableMobileNumber mobileNumber) {
                // Is it null?
                if (null == mobileNumber) {
@@ -445,18 +609,25 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                }
 
                // Get all data
-               String number = String.format(
-                          "%s%d%d", //NOI18N
-                          mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
-                          mobileNumber.getMobileProvider().getProviderDialPrefix(),
-                          mobileNumber.getPhoneNumber()
-          );
+               final String number = String.format(
+                                        "%s%d%d", //NOI18N
+                                        mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
+                                        mobileNumber.getMobileProvider().getProviderDialPrefix(),
+                                        mobileNumber.getMobileNumber()
+                        );
 
                // Return it
                return number;
        }
 
-       @Override
+       /**
+        * Returns a text representation of given land-line or fax number or null if
+        * not set.
+        * <p>
+        * @param phoneNumber Land-line or fax number
+        * <p>
+        * @return Text representation or null
+        */
        public String generatePhoneNumber (final DialableNumber phoneNumber) {
                // Is it null?
                if (null == phoneNumber) {
@@ -465,286 +636,517 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                }
 
                // Generate it
-               String number = String.format(
-                          "%s%d%d", //NOI18N
-                          phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(),
-                          phoneNumber.getPhoneAreaCode(),
-                          phoneNumber.getPhoneNumber()
-          );
+               final String number = String.format(
+                                        "%s%d%d", //NOI18N
+                                        phoneNumber.getPhoneCountry().getCountryExternalDialPrefix(),
+                                        phoneNumber.getPhoneAreaCode(),
+                                        phoneNumber.getPhoneNumber()
+                        );
 
                // Return it
                return number;
        }
 
-       @Override
+       /**
+        * Getter for academic title
+        * <p>
+        * @return Academic title
+        */
+       public String getAcademicTitle () {
+               return this.academicTitle;
+       }
+
+       /**
+        * Setter for academic title
+        * <p>
+        * @param academicTitle Academic title
+        */
+       public void setAcademicTitle (final String academicTitle) {
+               this.academicTitle = academicTitle;
+       }
+
+       /**
+        * Getter for birth day
+        * <p>
+        * @return Birth day
+        */
        @SuppressWarnings ("ReturnOfDateField")
        public Date getBirthday () {
                return this.birthday;
        }
 
-       @Override
+       /**
+        * Setter for birth day
+        * <p>
+        * @param birthday Birth day
+        */
        @SuppressWarnings ("AssignmentToDateFieldFromParameter")
        public void setBirthday (final Date birthday) {
                this.birthday = birthday;
        }
 
-       @Override
+       /**
+        * Getter for city name
+        * <p>
+        * @return City name
+        */
        public String getCity () {
                return this.city;
        }
 
-       @Override
+       /**
+        * Setter for city name
+        * <p>
+        * @param city City name
+        */
        public void setCity (final String city) {
                this.city = city;
        }
 
-       @Override
+       /**
+        * Getter for comments
+        * <p>
+        * @return Comments
+        */
        public String getComment () {
                return this.comment;
        }
 
-       @Override
+       /**
+        * Setter for comment
+        * <p>
+        * @param comment Comments
+        */
        public void setComment (final String comment) {
                this.comment = comment;
        }
 
-       @Override
+       /**
+        * Getter for contact instance
+        * <p>
+        * @return Contact instance
+        */
+       public Contact getContact () {
+               return this.contact;
+       }
+
+       /**
+        * Setter for contact instance
+        * <p>
+        * @param contact Contact instance
+        */
+       public void setContact (final Contact contact) {
+               this.contact = contact;
+       }
+
+       /**
+        * Getter for contactCountry instance
+        * <p>
+        * @return Country instance
+        */
+       public Country getContactCountry () {
+               return this.contactCountry;
+       }
+
+       /**
+        * Setter for contactCountry instance
+        * <p>
+        * @param contactCountry Country instance
+        */
+       public void setContactCountry (final Country contactCountry) {
+               this.contactCountry = contactCountry;
+       }
+
+       /**
+        * Getter for contact id
+        * <p>
+        * @return Contact id
+        */
        public Long getContactId () {
                return this.contactId;
        }
 
-       @Override
+       /**
+        * Setter for contact id
+        * <p>
+        * @param contactId Contact id
+        */
        public void setContactId (final Long contactId) {
                this.contactId = contactId;
        }
 
        @Override
-       public Country getCountry () {
-               return this.country;
-       }
-
-       @Override
-       public void setCountry (final Country country) {
-               this.country = country;
+       public String getControllerType () {
+               return "admin"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for email address
+        * <p>
+        * @return Email address
+        */
        public String getEmailAddress () {
                return this.emailAddress;
        }
 
-       @Override
+       /**
+        * Setter for email address
+        * <p>
+        * @param emailAddress Email address
+        */
        public void setEmailAddress (final String emailAddress) {
                this.emailAddress = emailAddress;
        }
 
-       @Override
+       /**
+        * Family name
+        * <p>
+        * @return the familyName
+        */
        public String getFamilyName () {
                return this.familyName;
        }
 
-       @Override
+       /**
+        * Family name
+        * <p>
+        * @param familyName the familyName to set
+        */
        public void setFamilyName (final String familyName) {
                this.familyName = familyName;
        }
 
-       @Override
+       /**
+        * Getter for fax number's area code
+        * <p>
+        * @return Fax number's area code
+        */
        public Integer getFaxAreaCode () {
                return this.faxAreaCode;
        }
 
-       @Override
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
        public void setFaxAreaCode (final Integer faxAreaCode) {
                this.faxAreaCode = faxAreaCode;
        }
 
-       @Override
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
        public Country getFaxCountry () {
                return this.faxCountry;
        }
 
-       @Override
+       /**
+        * Setter for fax's country instance
+        * <p>
+        * @param faxCountry Fax' country instance
+        */
        public void setFaxCountry (final Country faxCountry) {
                this.faxCountry = faxCountry;
        }
 
-       @Override
+       /**
+        * Getter for fax id
+        * <p>
+        * @return Fax id
+        */
        public Long getFaxId () {
                return this.faxId;
        }
 
-       @Override
+       /**
+        * Setter for fax id
+        * <p>
+        * @param faxId Fax id
+        */
        public void setFaxId (final Long faxId) {
                this.faxId = faxId;
        }
 
-       @Override
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
        public Long getFaxNumber () {
                return this.faxNumber;
        }
 
-       @Override
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
        public void setFaxNumber (final Long faxNumber) {
                this.faxNumber = faxNumber;
        }
 
-       @Override
+       /**
+        * Getter for first name
+        * <p>
+        * @return First name
+        */
        public String getFirstName () {
                return this.firstName;
        }
 
-       @Override
+       /**
+        * Setter for first name
+        * <p>
+        * @param firstName First name
+        */
        public void setFirstName (final String firstName) {
                this.firstName = firstName;
        }
 
-       @Override
-       public Gender getGender () {
-               return this.gender;
-       }
-
-       @Override
-       public void setGender (final Gender gender) {
-               this.gender = gender;
-       }
-
-       @Override
+       /**
+        * Getter for house number
+        * <p>
+        * @return House number
+        */
        public Short getHouseNumber () {
                return this.houseNumber;
        }
 
-       @Override
+       /**
+        * Setter for house number
+        * <p>
+        * @param houseNumber House number
+        */
        public void setHouseNumber (final Short houseNumber) {
                this.houseNumber = houseNumber;
        }
 
-       @Override
+       /**
+        * Getter for house number extension. Example: 123a, 'a' is the extension
+        * and 123 is the house number.
+        * <p>
+        * @return House number extension
+        */
        public String getHouseNumberExtension () {
                return this.houseNumberExtension;
        }
 
-       @Override
+       /**
+        * Setter for house number extension
+        * <p>
+        * @param houseNumberExtension House number extension
+        */
        public void setHouseNumberExtension (final String houseNumberExtension) {
                this.houseNumberExtension = houseNumberExtension;
        }
 
-       @Override
+       /**
+        * Getter for land-line number's area code
+        * <p>
+        * @return Land-line number's area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line number's area code
+        * <p>
+        * @param landLineAreaCode Land-line number's area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line number's country instance
+        * <p>
+        * @param landLineCountry Land-line number's country instance
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line id
+        * <p>
+        * @return Land-line id
+        */
        public Long getLandLineId () {
                return this.landLineId;
        }
 
-       @Override
+       /**
+        * Setter for land-line id
+        * <p>
+        * @param landLineId Land-line id
+        */
        public void setLandLineId (final Long landLineId) {
                this.landLineId = landLineId;
        }
 
-       @Override
-       public MobileProvider getMobileCarrier () {
-               return this.mobileCarrier;
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
        }
 
-       @Override
-       public void setMobileCarrier (final MobileProvider mobileCarrier) {
-               this.mobileCarrier = mobileCarrier;
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
        }
 
-       @Override
+       /**
+        * Getter for mobile id
+        * <p>
+        * @return Mobile id
+        */
        public Long getMobileId () {
                return this.mobileId;
        }
 
-       @Override
+       /**
+        * Setter for mobile id
+        * <p>
+        * @param mobileId Mobile id
+        */
        public void setMobileId (final Long mobileId) {
                this.mobileId = mobileId;
        }
 
-       @Override
+       /**
+        * Getter for mobile number
+        * <p>
+        * @return Mobile number
+        */
        public Long getMobileNumber () {
                return this.mobileNumber;
        }
 
-       @Override
-       public void setMobileNumber (Long mobileNumber) {
+       /**
+        * Setter for mobile number
+        * <p>
+        * @param mobileNumber Mobile number
+        */
+       public void setMobileNumber (final Long mobileNumber) {
                this.mobileNumber = mobileNumber;
        }
 
-       @Override
-       public Integer getPhoneAreaCode () {
-               return this.phoneAreaCode;
-       }
-
-       @Override
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               this.phoneAreaCode = phoneAreaCode;
-       }
-
-       @Override
-       public Country getPhoneCountry () {
-               return this.phoneCountry;
+       /**
+        * Getter for mobile number's carrier
+        * <p>
+        * @return Mobile number's carrier
+        */
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
        }
 
-       @Override
-       public void setPhoneCountry (final Country phoneCountry) {
-               this.phoneCountry = phoneCountry;
+       /**
+        * Setter for mobile number's carrier prefix
+        * <p>
+        * @param mobileProvider Mobile number's carrier prefix
+        */
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
        }
 
-       @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+       /**
+        * Getter for personal title
+        * <p>
+        * @return Personal title
+        */
+       public PersonalTitle getPersonalTitle () {
+               return this.personalTitle;
        }
 
-       @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       /**
+        * Setter for personal title
+        * <p>
+        * @param personalTitle Personal title
+        */
+       public void setPersonalTitle (final PersonalTitle personalTitle) {
+               this.personalTitle = personalTitle;
        }
 
-       @Override
+       /**
+        * Getter for street name
+        * <p>
+        * @return Street name
+        */
        public String getStreet () {
                return this.street;
        }
 
-       @Override
+       /**
+        * Setter for street name
+        * <p>
+        * @param street Street name
+        */
        public void setStreet (final String street) {
                this.street = street;
        }
 
-       @Override
-       public String getTitle () {
-               return this.title;
-       }
-
-       @Override
-       public void setTitle (final String title) {
-               this.title = title;
-       }
-
-       @Override
+       /**
+        * Getter for ZIP code
+        * <p>
+        * @return ZIP code
+        */
        public Integer getZipCode () {
                return this.zipCode;
        }
 
-       @Override
-       public void setZipCode (final Integer zipCode) {
-               this.zipCode = zipCode;
-       }
-
        /**
-        * Post-initialization of this class
+        * Setter for ZIP code
+        * <p>
+        * @param zipCode ZIP code
         */
-       @PostConstruct
-       public void init () {
+       public void setZipCode (final Integer zipCode) {
+               this.zipCode = zipCode;
        }
 
        @Override
-       public boolean isGenderRequired () {
-               // Get context parameter
-               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_admin_gender_enabled"); //NOI18N
-
-               // Is it set?
-               boolean isRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
-
-               // Return value
-               return isRequired;
+       public void validateContactData () {
+               if (this.getPersonalTitle() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("contactController.gender is null"); //NOI18N
+               } else if (this.getFirstName() == null) {
+                       // ... and again
+                       throw new NullPointerException("contactController.firstName is null"); //NOI18N
+               } else if (this.getFirstName().isEmpty()) {
+                       // ... and again
+                       throw new IllegalArgumentException("contactController.firstName is empty"); //NOI18N
+               } else if (this.getFamilyName() == null) {
+                       // ... and again
+                       throw new NullPointerException("contactController.familyName is null"); //NOI18N
+               } else if (this.getFamilyName().isEmpty()) {
+                       // ... and again
+                       throw new IllegalArgumentException("contactController.familyName is empty"); //NOI18N
+               } else if (this.getEmailAddress() == null) {
+                       // ... and again
+                       throw new NullPointerException("contactController.emailAddress is null"); //NOI18N
+               } else if (this.getEmailAddress().isEmpty()) {
+                       // ... and again
+                       throw new IllegalArgumentException("contactController.emailAddress is empty"); //NOI18N
+               }
        }
 
        /**
@@ -752,9 +1154,10 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         */
        private void clear () {
                // Clear all data
+               this.setContact(null);
+
                // - personal data
-               this.setGender(null);
-               this.setTitle(null);
+               this.setAcademicTitle(null);
                this.setFirstName(null);
                this.setFamilyName(null);
                this.setStreet(null);
@@ -762,14 +1165,14 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.setHouseNumberExtension(null);
                this.setZipCode(null);
                this.setCity(null);
-               this.setCountry(null);
+               this.setContactCountry(null);
 
                // - contact data
                this.setEmailAddress(null);
-               this.setPhoneCountry(null);
-               this.setPhoneAreaCode(null);
-               this.setPhoneNumber(null);
-               this.setMobileCarrier(null);
+               this.setLandLineCountry(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineNumber(null);
+               this.setMobileProvider(null);
                this.setMobileNumber(null);
                this.setFaxCountry(null);
                this.setFaxAreaCode(null);
@@ -780,37 +1183,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.setComment(null);
        }
 
-       /**
-        * Checks whether the given contact is found
-        * <p>
-        * @param contact Contact inastance
-        *
-        * @return Wether contact has been found
-        */
-       private boolean isSameContactFound (final Contact contact) {
-               // Default is not found
-               boolean IsFound = false;
-
-               // Get iterator
-               Iterator<Contact> iterator = this.contactController.allContacts().iterator();
-
-               // Loop through all
-               while (iterator.hasNext()) {
-                       // Get next contact
-                       Contact next = iterator.next();
-
-                       // Is the same?
-                       if (ContactUtils.isSameContact(contact, next)) {
-                               // Yes, then abort loop
-                               IsFound = false;
-                               break;
-                       }
-               }
-
-               // Return status
-               return IsFound;
-       }
-
        /**
         * Updates all data in contact instance.
         * <p>
@@ -823,15 +1195,15 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                        throw new NullPointerException("contact is null"); //NOI18N
                } else if (contact.getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
                } else if (contact.getContactId() < 1) {
                        // Invalid id
                        throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
                }
 
                // Update all fields
-               contact.setContactGender(this.getGender());
-               contact.setContactTitle(this.getTitle());
+               contact.setContactPersonalTitle(this.getPersonalTitle());
+               contact.setContactTitle(this.getAcademicTitle());
                contact.setContactFirstName(this.getFirstName());
                contact.setContactFamilyName(this.getFamilyName());
                contact.setContactStreet(this.getStreet());
@@ -839,13 +1211,13 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
                contact.setContactZipCode(this.getZipCode());
                contact.setContactCity(this.getCity());
-               contact.setContactCountry(this.getCountry());
+               contact.setContactCountry(this.getContactCountry());
 
-               // Update contact's mobile number
-               this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
+               // Update contact's cmobile number
+               this.isMobileNumberUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
-               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
+               this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Update contact's fax number
                this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());