]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
Please cherry-pick:
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / contact / PizzaAdminContactWebRequestBean.java
index 46c993dfd9b2c4b441c31dddecf5860953cc1ed6..da791cd9e9378fc62f621dbf7335ba2472508fea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -33,13 +33,13 @@ import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
+import org.mxchange.jcontacts.contact.ContactUtils;
 import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jcontacts.contact.gender.Gender;
-import org.mxchange.jcontacts.contact.utils.ContactUtils;
+import org.mxchange.jcontacts.contact.title.PersonalTitle;
 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.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;
@@ -51,7 +51,7 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
-import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController;
+import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestHelperController;
 
 /**
  * Administrative user bean (controller)
@@ -67,12 +67,17 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         */
        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
@@ -83,28 +88,13 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         * Bean helper instance
         */
        @Inject
-       private PizzaWebRequestController beanHelper;
+       private PizzaWebRequestHelperController beanHelper;
 
        /**
         * Birth day
         */
        private Date birthday;
 
-       /**
-        * Cellphone number's carrier
-        */
-       private MobileProvider cellphoneCarrier;
-
-       /**
-        * Cellphone id number
-        */
-       private Long cellphoneId;
-
-       /**
-        * Cellphone number
-        */
-       private Long cellphoneNumber;
-
        /**
         * City
         */
@@ -118,7 +108,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        /**
         * Remote contact bean
         */
-       private final ContactSessionBeanRemote contactBean;
+       private ContactSessionBeanRemote contactBean;
 
        /**
         * General contact controller
@@ -171,11 +161,6 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         */
        private String firstName;
 
-       /**
-        * Gender instance
-        */
-       private Gender gender;
-
        /**
         * House number
         */
@@ -186,11 +171,6 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         */
        private String houseNumberExtension;
 
-       /**
-        * Whether a cellphone entry has been unlinked
-        */
-       private boolean isCellphoneUnlinked;
-
        /**
         * Whether a fax entry has been unlinked
         */
@@ -202,41 +182,61 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        private boolean isLandLineUnlinked;
 
        /**
-        * Land-line id number
+        * Whether a cellphone entry has been unlinked
         */
-       private Long landLineId;
+       private boolean isMobileNumberUnlinked;
 
        /**
         * Phone number area code
         */
-       private Integer phoneAreaCode;
+       private Integer landLineAreaCode;
 
        /**
         * Country instance for phone number
         */
-       private Country phoneCountry;
+       private Country landLineCountry;
+
+       /**
+        * Land-line id number
+        */
+       private Long landLineId;
 
        /**
         * Phone number
         */
-       private Long phoneNumber;
+       private Long landLineNumber;
 
        /**
-        * Street
+        * Mobile id number
         */
-       private String street;
+       private Long mobileId;
 
        /**
-        * Title
+        * Mobile number
         */
-       private String title;
+       private Long mobileNumber;
+
+       /**
+        * Mobile number's provider
+        */
+       private MobileProvider mobileProvider;
+
+       /**
+        * PersonalTitle instance
+        */
+       private PersonalTitle personalTitle;
+
+       /**
+        * Street
+        */
+       private String street;
 
        /**
         * An event fired when the administrator has updated contact data
         */
        @Inject
        @Any
-       private Event<AdminUpdatedContactEvent> updatedContactEvent;
+       private Event<ObservableAdminUpdatedContactEvent> updatedContactEvent;
 
        /**
         * ZIP code
@@ -247,28 +247,16 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         * Default constructor
         */
        public PizzaAdminContactWebRequestBean () {
-               // Try it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup
-                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
-
-                       // Try to lookup (administative)
-                       this.adminContactBean = (AdminContactSessionBeanRemote) context.lookup("java:global/jjobs-ejb/adminContact!org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote"); //NOI18N
-               } catch (final NamingException e) {
-                       // Throw again
-                       throw new FaceletException(e);
-               }
+               // Call super constructor
+               super();
        }
 
        @Override
        public String 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
@@ -305,7 +293,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                }
 
                // Fire event
-               this.addedContactEvent.fire(new AdminContactAddedEvent(updatedContact));
+               this.addedContactEvent.fire(new AdminAddedContactEvent(updatedContact));
 
                // Clear this bean
                this.clear();
@@ -333,7 +321,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
 
                // Set all fields: contact
                this.setContactId(contact.getContactId());
-               this.setTitle(contact.getContactTitle());
+               this.setAcademicTitle(contact.getContactTitle());
                this.setBirthday(contact.getContactBirthday());
                this.setCity(contact.getContactCity());
                this.setComment(contact.getContactComment());
@@ -341,7 +329,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                this.setEmailAddress(contact.getContactEmailAddress());
                this.setFamilyName(contact.getContactFamilyName());
                this.setFirstName(contact.getContactFirstName());
-               this.setGender(contact.getContactGender());
+               this.setPersonalTitle(contact.getContactPersonalTitle());
                this.setHouseNumber(contact.getContactHouseNumber());
                this.setHouseNumberExtension(contact.getContactHouseNumberExtension());
                this.setStreet(contact.getContactStreet());
@@ -350,9 +338,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                // Is the cell phone set?
                if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // ... cellphone data
-                       this.setCellphoneId(contact.getContactMobileNumber().getPhoneId());
-                       this.setCellphoneCarrier(contact.getContactMobileNumber().getMobileProvider());
-                       this.setCellphoneNumber(contact.getContactMobileNumber().getPhoneNumber());
+                       this.setMobileId(contact.getContactMobileNumber().getPhoneId());
+                       this.setMobileProvider(contact.getContactMobileNumber().getMobileProvider());
+                       this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
                }
 
                // Is the fax set?
@@ -368,9 +356,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
                        // .. land-line data
                        this.setLandLineId(contact.getContactLandLineNumber().getPhoneId());
-                       this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
-                       this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry());
-                       this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber());
+                       this.setLandLineAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode());
+                       this.setLandLineCountry(contact.getContactLandLineNumber().getPhoneCountry());
+                       this.setLandLineNumber(contact.getContactLandLineNumber().getPhoneNumber());
                }
 
                // Log message
@@ -380,9 +368,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        @Override
        public Contact createContactInstance () {
                // 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
@@ -398,14 +386,15 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                }
 
                // Generate phone number
-               DialableLandLineNumber landLineNumber = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableMobileNumber mobileNumber = new MobileNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
-               DialableFaxNumber faxNumber = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+               DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+               DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new instance
-               Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
+               Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName());
 
                // Add all others
+               contact.setContactTitle(this.getAcademicTitle());
                contact.setContactBirthday(this.getBirthday());
                contact.setContactStreet(this.getStreet());
                contact.setContactHouseNumber(this.getHouseNumber());
@@ -420,60 +409,60 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                contact.setContactOwnContact(Boolean.TRUE);
 
                // Don't set null or wrong references
-               if ((landLineNumber instanceof DialableLandLineNumber) && (landLineNumber.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) {
+               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 (landLineNumber.getPhoneAreaCode() == null) {
+                       if (landLine.getPhoneAreaCode() == null) {
                                // Is null
                                throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
-                       } else if (landLineNumber.getPhoneAreaCode() < 1) {
+                       } else if (landLine.getPhoneAreaCode() < 1) {
                                // Abort here
                                throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
-                       } else if (landLineNumber.getPhoneNumber() == null) {
+                       } else if (landLine.getPhoneNumber() == null) {
                                // Is null
                                throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
-                       } else if (landLineNumber.getPhoneNumber() < 1) {
+                       } else if (landLine.getPhoneNumber() < 1) {
                                // Abort here
                                throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
                        }
 
                        // Set phone number
-                       contact.setContactLandLineNumber(landLineNumber);
+                       contact.setContactLandLineNumber(landLine);
                }
 
                // Don't set null or wrong references
-               if ((faxNumber instanceof DialableFaxNumber) && (faxNumber.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) {
+               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 (faxNumber.getPhoneAreaCode() == null) {
+                       if (fax.getPhoneAreaCode() == null) {
                                // Is null
                                throw new NullPointerException("fax.phoneAreaCode is null"); //NOI18N
-                       } else if (faxNumber.getPhoneAreaCode() < 1) {
+                       } else if (fax.getPhoneAreaCode() < 1) {
                                // Abort here
                                throw new IllegalArgumentException("fax.phoneAreaCode is zero or below."); //NOI18N
-                       } else if (faxNumber.getPhoneNumber() == null) {
+                       } else if (fax.getPhoneNumber() == null) {
                                // Is null
                                throw new NullPointerException("fax.phoneNumber is null"); //NOI18N
-                       } else if (faxNumber.getPhoneNumber() < 1) {
+                       } else if (fax.getPhoneNumber() < 1) {
                                // Abort here
                                throw new IllegalArgumentException("fax.phoneNumber is zero or below."); //NOI18N
                        }
 
                        // Set fax number
-                       contact.setContactFaxNumber(faxNumber);
+                       contact.setContactFaxNumber(fax);
                }
 
                // Is the provider set?
-               if ((mobileNumber instanceof DialableMobileNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileProvider() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
                        // Is the number set?
-                       if (mobileNumber.getPhoneNumber() == null) {
+                       if (mobile.getPhoneNumber() == null) {
                                // Is null
                                throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N
-                       } else if (mobileNumber.getPhoneNumber() < 1) {
+                       } else if (mobile.getPhoneNumber() < 1) {
                                // Abort here
                                throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N
                        }
 
                        // Set cellphone number
-                       contact.setContactMobileNumber(mobileNumber);
+                       contact.setContactMobileNumber(mobile);
                }
 
                // Return it
@@ -501,10 +490,10 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                this.updateContactData(contact);
 
                // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileNumberUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
 
                // Fire event
-               this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
+               this.updatedContactEvent.fire(new AdminUpdatedContactEvent(updatedContact));
 
                // Clear bean
                this.clear();
@@ -514,9 +503,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        }
 
        @Override
-       public String generateCellphoneNumber (final DialableMobileNumber cellphoneNumber) {
+       public String generateMobileNumber (final DialableMobileNumber mobileNumber) {
                // Is it null?
-               if (null == cellphoneNumber) {
+               if (null == mobileNumber) {
                        // Return null
                        return null;
                }
@@ -524,9 +513,9 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                // Get all data
                String number = String.format(
                           "%s%d%d", //NOI18N
-                          cellphoneNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
-                          cellphoneNumber.getMobileProvider().getProviderDialPrefix(),
-                          cellphoneNumber.getPhoneNumber()
+                          mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
+                          mobileNumber.getMobileProvider().getProviderDialPrefix(),
+                          mobileNumber.getPhoneNumber()
           );
 
                // Return it
@@ -554,45 +543,25 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        }
 
        @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getBirthday () {
-               return this.birthday;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setBirthday (final Date birthday) {
-               this.birthday = birthday;
-       }
-
-       @Override
-       public MobileProvider getCellphoneCarrier () {
-               return this.cellphoneCarrier;
-       }
-
-       @Override
-       public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
-               this.cellphoneCarrier = cellphoneCarrier;
-       }
-
-       @Override
-       public Long getCellphoneId () {
-               return this.cellphoneId;
+       public String getAcademicTitle () {
+               return this.academicTitle;
        }
 
        @Override
-       public void setCellphoneId (final Long cellphoneId) {
-               this.cellphoneId = cellphoneId;
+       public void setAcademicTitle (final String academicTitle) {
+               this.academicTitle = academicTitle;
        }
 
        @Override
-       public Long getCellphoneNumber () {
-               return this.cellphoneNumber;
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getBirthday () {
+               return this.birthday;
        }
 
        @Override
-       public void setCellphoneNumber (Long cellphoneNumber) {
-               this.cellphoneNumber = cellphoneNumber;
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setBirthday (final Date birthday) {
+               this.birthday = birthday;
        }
 
        @Override
@@ -716,16 +685,6 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                this.firstName = firstName;
        }
 
-       @Override
-       public Gender getGender () {
-               return this.gender;
-       }
-
-       @Override
-       public void setGender (final Gender gender) {
-               this.gender = gender;
-       }
-
        @Override
        public Short getHouseNumber () {
                return this.houseNumber;
@@ -746,6 +705,26 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                this.houseNumberExtension = houseNumberExtension;
        }
 
+       @Override
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       @Override
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       @Override
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       @Override
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
        @Override
        public Long getLandLineId () {
                return this.landLineId;
@@ -757,53 +736,63 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        }
 
        @Override
-       public Integer getPhoneAreaCode () {
-               return this.phoneAreaCode;
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
        }
 
        @Override
-       public void setPhoneAreaCode (final Integer phoneAreaCode) {
-               this.phoneAreaCode = phoneAreaCode;
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
        }
 
        @Override
-       public Country getPhoneCountry () {
-               return this.phoneCountry;
+       public Long getMobileId () {
+               return this.mobileId;
        }
 
        @Override
-       public void setPhoneCountry (final Country phoneCountry) {
-               this.phoneCountry = phoneCountry;
+       public void setMobileId (final Long mobileId) {
+               this.mobileId = mobileId;
        }
 
        @Override
-       public Long getPhoneNumber () {
-               return this.phoneNumber;
+       public Long getMobileNumber () {
+               return this.mobileNumber;
        }
 
        @Override
-       public void setPhoneNumber (final Long phoneNumber) {
-               this.phoneNumber = phoneNumber;
+       public void setMobileNumber (Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
        }
 
        @Override
-       public String getStreet () {
-               return this.street;
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
        }
 
        @Override
-       public void setStreet (final String street) {
-               this.street = street;
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
        }
 
        @Override
-       public String getTitle () {
-               return this.title;
+       public PersonalTitle getPersonalTitle () {
+               return this.personalTitle;
+       }
+
+       @Override
+       public void setPersonalTitle (final PersonalTitle personalTitle) {
+               this.personalTitle = personalTitle;
+       }
+
+       @Override
+       public String getStreet () {
+               return this.street;
        }
 
        @Override
-       public void setTitle (final String title) {
-               this.title = title;
+       public void setStreet (final String street) {
+               this.street = street;
        }
 
        @Override
@@ -821,12 +810,26 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
         */
        @PostConstruct
        public void init () {
+               // Try it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup
+                       this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
+
+                       // Try to lookup (administative)
+                       this.adminContactBean = (AdminContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/adminContact!org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote"); //NOI18N
+               } catch (final NamingException e) {
+                       // Throw again
+                       throw new FaceletException(e);
+               }
        }
 
        @Override
-       public boolean isGenderRequired () {
+       public boolean isPersonalTitleRequired () {
                // Get context parameter
-               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_admin_gender_enabled"); //NOI18N
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_admin_personal_title_enabled"); //NOI18N
 
                // Is it set?
                boolean isRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
@@ -841,7 +844,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        private void clear () {
                // Clear all data
                // - personal data
-               this.setTitle(null);
+               this.setAcademicTitle(null);
                this.setFirstName(null);
                this.setFamilyName(null);
                this.setStreet(null);
@@ -853,11 +856,11 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
 
                // - contact data
                this.setEmailAddress(null);
-               this.setPhoneCountry(null);
-               this.setPhoneAreaCode(null);
-               this.setPhoneNumber(null);
-               this.setCellphoneCarrier(null);
-               this.setCellphoneNumber(null);
+               this.setLandLineCountry(null);
+               this.setLandLineAreaCode(null);
+               this.setLandLineNumber(null);
+               this.setMobileProvider(null);
+               this.setMobileNumber(null);
                this.setFaxCountry(null);
                this.setFaxAreaCode(null);
                this.setFaxNumber(null);
@@ -917,8 +920,8 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                }
 
                // 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());
@@ -929,10 +932,10 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                contact.setContactCountry(this.getCountry());
 
                // Update contact's cellphone number
-               this.isCellphoneUnlinked = ContactUtils.updateMobileNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
+               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());