]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 30 Jul 2017 20:03:49 +0000 (22:03 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 30 Jul 2017 21:00:25 +0000 (23:00 +0200)
- rewrite of almost all beans towards more cleanness
- now fields in backing beans can be "only" be set by JSF views or observer
  methods
- removed @Local from interfaces, they are already local and maybe that
  annotation is for EJBs only?
- passing beanHelper.fooBar over a JSF view to a backing bean is not needed,
  the bean can do it by itself, by CDI

- fixed tpzo

Signed-off-by: Roland Häder <roland@mxchange.org>
44 files changed:
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionController.java
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java
src/java/org/mxchange/jjobs/beans/features/JobsFeatureWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/features/JobsFeaturesWebApplicationController.java
src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestController.java
src/java/org/mxchange/jjobs/beans/phone/JobsPhoneWebApplicationController.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionController.java
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl
web/WEB-INF/templates/admin/fax/admin_form_add_contact_fax.tpl
web/admin/fax/admin_fax_delete.xhtml
web/admin/fax/admin_fax_edit.xhtml
web/admin/landline/admin_landline_delete.xhtml
web/admin/landline/admin_landline_edit.xhtml
web/admin/mobile/admin_mobile_delete.xhtml
web/admin/mobile/admin_mobile_edit.xhtml
web/admin/user/admin_user_delete.xhtml
web/admin/user/admin_user_export.xhtml
web/admin/user/admin_user_lock.xhtml
web/admin/user/admin_user_unlock.xhtml

index cdb33bb6b61b4b1132c844997ffb21fed298b50a..2ae355e711c1a1f23e39e5c15f62ba7a13017019 100644 (file)
@@ -66,6 +66,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
         * Serial number
         */
        private static final long serialVersionUID = 542_145_347_916L;
+
        /**
         * Academic academicTitle
         */
@@ -123,7 +124,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
        /**
         * Country instance
         */
-       private Country country;
+       private Country contactCountry;
 
        /**
         * Email address
@@ -181,7 +182,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
        private boolean isLandLineUnlinked;
 
        /**
-        * Whether a cellphone entry has been unlinked
+        * Whether a cmobile entry has been unlinked
         */
        private boolean isMobileNumberUnlinked;
 
@@ -230,7 +231,6 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
         */
        private String street;
 
-
        /**
         * An event fired when the administrator has updated contact data
         */
@@ -251,7 +251,12 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                super();
        }
 
-       @Override
+       /**
+        * Adds contact data to database and redirects on success. If the contact is
+        * already found, a proper exception is thrown.
+        * <p>
+        * @return Redirect outcome
+        */
        public String addContact () {
                // Are all minimum fields set?
                if (this.getPersonalTitle() == null) {
@@ -325,7 +330,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                this.setBirthday(contact.getContactBirthday());
                this.setCity(contact.getContactCity());
                this.setComment(contact.getContactComment());
-               this.setCountry(contact.getContactCountry());
+               this.setContactCountry(contact.getContactCountry());
                this.setEmailAddress(contact.getContactEmailAddress());
                this.setFamilyName(contact.getContactFamilyName());
                this.setFirstName(contact.getContactFirstName());
@@ -337,7 +342,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
 
                // Is the cell phone set?
                if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
-                       // ... cellphone data
+                       // ... cmobile data
                        this.setMobileId(contact.getContactMobileNumber().getPhoneId());
                        this.setMobileProvider(contact.getContactMobileNumber().getMobileProvider());
                        this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
@@ -400,7 +405,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                contact.setContactHouseNumber(this.getHouseNumber());
                contact.setContactZipCode(this.getZipCode());
                contact.setContactCity(this.getCity());
-               contact.setContactCountry(this.getCountry());
+               contact.setContactCountry(this.getContactCountry());
                contact.setContactEmailAddress(this.getEmailAddress());
                contact.setContactBirthday(this.getBirthday());
                contact.setContactComment(this.getComment());
@@ -455,13 +460,13 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                        // Is the number set?
                        if (mobile.getPhoneNumber() == null) {
                                // Is null
-                               throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N
+                               throw new NullPointerException("cmobile.phoneNumber is null"); //NOI18N
                        } else if (mobile.getPhoneNumber() < 1) {
                                // Abort here
-                               throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N
+                               throw new IllegalArgumentException("cmobile.phoneNumber is zero or below."); //NOI18N
                        }
 
-                       // Set cellphone number
+                       // Set cmobile number
                        contact.setContactMobileNumber(mobile);
                }
 
@@ -469,7 +474,11 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                return contact;
        }
 
-       @Override
+       /**
+        * Edits currently loaded contact's data in database.
+        * <p>
+        * @return Redirect outcome
+        */
        public String editContactData () {
                // Get contact instance
                Contact contact = this.beanHelper.getContact();
@@ -502,7 +511,13 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                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) {
@@ -522,7 +537,14 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                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) {
@@ -541,53 +563,95 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                // Return it
                return number;
        }
-       @Override
+
+       /**
+        * Getter for academic title
+        * <p>
+        * @return Academic title
+        */
        public String getAcademicTitle () {
                return this.academicTitle;
        }
-       @Override
+
+       /**
+        * Setter for academic title
+        * <p>
+        * @param academicTitle Academic title
+        */
        public void setAcademicTitle (final String academicTitle) {
                this.academicTitle = academicTitle;
        }
 
-       @Override
+       /**
+        * 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 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;
        }
@@ -603,203 +667,363 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
        }
 
-       @Override
-       public Country getCountry () {
-               return this.country;
+       /**
+        * Getter for contactCountry instance
+        * <p>
+        * @return Country instance
+        */
+       public Country getContactCountry () {
+               return this.contactCountry;
        }
 
-       @Override
-       public void setCountry (final Country country) {
-               this.country = country;
+       /**
+        * Setter for contactCountry instance
+        * <p>
+        * @param contactCountry Country instance
+        */
+       public void setContactCountry (final Country contactCountry) {
+               this.contactCountry = contactCountry;
        }
 
-       @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
+       /**
+        * 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;
        }
 
-       @Override
+       /**
+        * 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;
        }
 
-       @Override
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
        public Country getLandLineCountry () {
                return this.landLineCountry;
        }
 
-       @Override
+       /**
+        * 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;
        }
 
-       @Override
+       /**
+        * 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
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
        public Long getLandLineNumber () {
                return this.landLineNumber;
        }
 
-       @Override
+       /**
+        * 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
+       /**
+        * Getter for mobile number's carrier
+        * <p>
+        * @return Mobile number's carrier
+        */
        public MobileProvider getMobileProvider () {
                return this.mobileProvider;
        }
 
-       @Override
+       /**
+        * 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
+       /**
+        * Getter for personal title
+        * <p>
+        * @return Personal title
+        */
        public PersonalTitle getPersonalTitle () {
                return this.personalTitle;
        }
 
-       @Override
+       /**
+        * 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
+       /**
+        * Getter for ZIP code
+        * <p>
+        * @return ZIP code
+        */
        public Integer getZipCode () {
                return this.zipCode;
        }
 
-       @Override
+       /**
+        * Setter for ZIP code
+        * <p>
+        * @param zipCode ZIP code
+        */
        public void setZipCode (final Integer zipCode) {
                this.zipCode = zipCode;
        }
@@ -826,6 +1050,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
        }
 
        @Override
+       @Deprecated
        public boolean isPersonalTitleRequired () {
                // Get context parameter
                String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_admin_personal_title_enabled"); //NOI18N
@@ -837,6 +1062,32 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                return isRequired;
        }
 
+       @Override
+       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
+               }
+       }
+
        /**
         * Clears this bean
         */
@@ -851,7 +1102,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                this.setHouseNumberExtension(null);
                this.setZipCode(null);
                this.setCity(null);
-               this.setCountry(null);
+               this.setContactCountry(null);
 
                // - contact data
                this.setEmailAddress(null);
@@ -928,9 +1179,9 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                contact.setContactHouseNumberExtension(this.getHouseNumberExtension());
                contact.setContactZipCode(this.getZipCode());
                contact.setContactCity(this.getCity());
-               contact.setContactCountry(this.getCountry());
+               contact.setContactCountry(this.getContactCountry());
 
-               // Update contact's cellphone number
+               // Update contact's cmobile number
                this.isMobileNumberUnlinked = ContactUtils.updateMobileNumber(contact, this.getMobileProvider(), this.getMobileNumber());
 
                // Update contact's land-line number
index e6a2d28fee7e87addddebe178630b04b6c8d2be4..cd88e08e27a21bfce90a7f91b239d9c9bec45ada 100644 (file)
 package org.mxchange.jjobs.beans.contact;
 
 import java.io.Serializable;
-import java.util.Date;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.title.PersonalTitle;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
  * An administrative interface for user beans
@@ -33,12 +27,9 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 public interface JobsAdminContactWebRequestController extends Serializable {
 
        /**
-        * Adds contact data to database and redirects on success. If the contact is
-        * already found, a proper exception is thrown.
-        * <p>
-        * @return Redirect outcome
+        * Validates contact data and throws proper exceptions if not valid
         */
-       String addContact ();
+       void validateContactData ();
 
        /**
         * Creates an instance from contact data
@@ -54,364 +45,6 @@ public interface JobsAdminContactWebRequestController extends Serializable {
         */
        void copyContactToController (final Contact contact);
 
-       /**
-        * Edits currently loaded contact's data in database.
-        * <p>
-        * @return Redirect outcome
-        */
-       String editContactData ();
-
-       /**
-        * Getter for cellphone id
-        * <p>
-        * @return Mobile id
-        */
-       Long getMobileId ();
-
-       /**
-        * Setter for cellphone id
-        * <p>
-        * @param cellphoneId Mobile id
-        */
-       void setMobileId (final Long cellphoneId);
-
-       /**
-        * Getter for fax id
-        * <p>
-        * @return Fax id
-        */
-       Long getFaxId ();
-
-       /**
-        * Setter for fax id
-        * <p>
-        * @param faxId Fax id
-        */
-       void setFaxId (final Long faxId);
-
-       /**
-        * Getter for land-line id
-        * <p>
-        * @return Land-line id
-        */
-       Long getLandLineId ();
-
-       /**
-        * Setter for land-line id
-        * <p>
-        * @param landLineId Land-line id
-        */
-       void setLandLineId (final Long landLineId);
-
-       /**
-        * Getter for birth day
-        * <p>
-        * @return Birth day
-        */
-       Date getBirthday ();
-
-       /**
-        * Setter for birth day
-        * <p>
-        * @param birthday Birth day
-        */
-       void setBirthday (final Date birthday);
-
-       /**
-        * Getter for ellphone number's carrier
-        * <p>
-        * @return Mobile number's carrier
-        */
-       MobileProvider getMobileProvider ();
-
-       /**
-        * Setter for cellphone number's carrier prefix
-        * <p>
-        * @param cellphoneCarrier Mobile number's carrier prefix
-        */
-       void setMobileProvider (final MobileProvider cellphoneCarrier);
-
-       /**
-        * Getter for ellphone number
-        * <p>
-        * @return Mobile number
-        */
-       Long getMobileNumber ();
-
-       /**
-        * Setter for ellphone number
-        * <p>
-        * @param mobileNumber Mobile number
-        */
-       void setMobileNumber (final Long mobileNumber);
-
-       /**
-        * City
-        * <p>
-        * @return the city
-        */
-       String getCity ();
-
-       /**
-        * City
-        * <p>
-        * @param city the city to set
-        */
-       void setCity (final String city);
-
-       /**
-        * Getter for comments
-        * <p>
-        * @return Comments
-        */
-       String getComment ();
-
-       /**
-        * Setter for comment
-        * <p>
-        * @param comment Comments
-        */
-       void setComment (final String comment);
-
-       /**
-        * Getter for contact id
-        * <p>
-        * @return Contact id
-        */
-       Long getContactId ();
-
-       /**
-        * Setter for contact id
-        * <p>
-        * @param contactId Contact id
-        */
-       void setContactId (final Long contactId);
-
-       /**
-        * Getter for country instance
-        * <p>
-        * @return Country instance
-        */
-       Country getCountry ();
-
-       /**
-        * Setter for country instance
-        * <p>
-        * @param country Country instance
-        */
-       void setCountry (final Country country);
-
-       /**
-        * Getter for email address
-        * <p>
-        * @return Email address
-        */
-       String getEmailAddress ();
-
-       /**
-        * Setter for email address
-        * <p>
-        * @param emailAddress Email address
-        */
-       void setEmailAddress (final String emailAddress);
-
-       /**
-        * Family name
-        * <p>
-        * @return the familyName
-        */
-       String getFamilyName ();
-
-       /**
-        * Family name
-        * <p>
-        * @param familyName the familyName to set
-        */
-       void setFamilyName (final String familyName);
-
-       /**
-        * Getter for fax number's area code
-        * <p>
-        * @return Fax number's area code
-        */
-       Integer getFaxAreaCode ();
-
-       /**
-        * Setter for fax number's area code
-        * <p>
-        * @param faxAreaCode Fax number's area code
-        */
-       void setFaxAreaCode (final Integer faxAreaCode);
-
-       /**
-        * Getter for fax's country instance
-        * <p>
-        * @return Fax' country instance
-        */
-       Country getFaxCountry ();
-
-       /**
-        * Setter for fax's country instance
-        * <p>
-        * @param faxCountry Fax' country instance
-        */
-       void setFaxCountry (final Country faxCountry);
-
-       /**
-        * Getter for fax number
-        * <p>
-        * @return Fax number
-        */
-       Long getFaxNumber ();
-
-       /**
-        * Setter for fax number
-        * <p>
-        * @param faxNumber Fax number
-        */
-       void setFaxNumber (final Long faxNumber);
-
-       /**
-        * First name
-        * <p>
-        * @return the first name
-        */
-       String getFirstName ();
-
-       /**
-        * First name
-        * <p>
-        * @param firstName the first name to set
-        */
-       void setFirstName (final String firstName);
-
-       /**
-        * Getter for personal title
-        * <p>
-        * @return Personal title
-        */
-       PersonalTitle getPersonalTitle ();
-
-       /**
-        * Setter for personal title
-        * <p>
-        * @param personalTitle Personal title
-        */
-       void setPersonalTitle (final PersonalTitle personalTitle);
-
-       /**
-        * House number
-        * <p>
-        * @return the houseNumber
-        */
-       Short getHouseNumber ();
-
-       /**
-        * House number
-        * <p>
-        * @param houseNumber the houseNumber to set
-        */
-       void setHouseNumber (final Short houseNumber);
-
-       /**
-        * Getter for house number extension, example: 123a 'a' is then the
-        * extension and 123 is the house number.
-        * <p>
-        * @return House number extension
-        */
-       String getHouseNumberExtension ();
-
-       /**
-        * Setter for house number extension
-        * <p>
-        * @param houseNumberExtension House number extension
-        */
-       void setHouseNumberExtension (final String houseNumberExtension);
-
-       /**
-        * Getter for phone number's area code
-        * <p>
-        * @return Phone number's area code
-        */
-       Integer getLandLineAreaCode ();
-
-       /**
-        * Setter for phone number's area code
-        * <p>
-        * @param phoneAreaCode Phone number's area code
-        */
-       void setLandLineAreaCode (final Integer phoneAreaCode);
-
-       /**
-        * Getter for phone number's country instance
-        * <p>
-        * @return Phone number's country instance
-        */
-       Country getLandLineCountry ();
-
-       /**
-        * Setter for phone number's country instance
-        * <p>
-        * @param phoneCountry Phone number's country instance
-        */
-       void setLandLineCountry (final Country phoneCountry);
-
-       /**
-        * Getter for phone number
-        * <p>
-        * @return Phone number
-        */
-       Long getLandLineNumber ();
-
-       /**
-        * Setter for phone number
-        * <p>
-        * @param phoneNumber Phone number
-        */
-       void setLandLineNumber (final Long phoneNumber);
-
-       /**
-        * Street
-        * <p>
-        * @return the street
-        */
-       String getStreet ();
-
-       /**
-        * Street
-        * <p>
-        * @param street the street to set
-        */
-       void setStreet (final String street);
-
-       /**
-        * Getter for academic title
-        * <p>
-        * @return Academic title
-        */
-       String getAcademicTitle ();
-
-       /**
-        * Setter for academic title
-        * <p>
-        * @param academicTitle Academic title
-        */
-       void setAcademicTitle (final String academicTitle);
-
-       /**
-        * ZIP code
-        * <p>
-        * @return the zipCode
-        */
-       Integer getZipCode ();
-
-       /**
-        * ZIP code
-        * <p>
-        * @param zipCode the zipCode to set
-        */
-       void setZipCode (final Integer zipCode);
-
        /**
         * Getter for controller type
         * <p>
@@ -429,31 +62,15 @@ public interface JobsAdminContactWebRequestController extends Serializable {
        @Deprecated
        void setControllerType (final String controllerType);
 
-       /**
-        * Returns a text respresentation of given phone number or null if not set.
-        * <p>
-        * @param phoneNumber Phone number
-        * <p>
-        * @return Text respresentation or null
-        */
-       String generatePhoneNumber (final DialableNumber phoneNumber);
-
-       /**
-        * Returns a text representation of given cellphone number or null if not
-        * set.
-        * <p>
-        * @param mobileNumber Mobile number
-        * <p>
-        * @return Text respresentation or null
-        */
-       String generateMobileNumber (final DialableMobileNumber mobileNumber);
-
        /**
         * Checks/returns whether the personal title (Mr./Mrs.) is required for this
         * controller.
         * <p>
         * @return Whether personal title is required
+        * <p>
+        * @Deprecated Don't use this method
         */
+       @Deprecated
        boolean isPersonalTitleRequired ();
 
 }
index 16bd8700f85a9645256a721a01e353f755b32d5a..9a25c287197c44b36d03b2179cefad96ecf20682 100644 (file)
@@ -459,6 +459,13 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                return this.contactList;
        }
 
+       @Override
+       public void clearEmailAddresses () {
+               // Clear both
+               this.setEmailAddress(null);
+               this.setEmailAddressRepeat(null);
+       }
+
        @Override
        public Contact createContactInstance () {
                // Is all required data set?
@@ -598,44 +605,76 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                return "contact_data_saved"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for academic title
+        * <p>
+        * @return Academic title
+        */
        public String getAcademicTitle () {
                return this.academicTitle;
        }
 
-       @Override
+       /**
+        * Setter for academic title
+        * <p>
+        * @param academicTitle Academic title
+        */
        public void setAcademicTitle (final String academicTitle) {
                this.academicTitle = academicTitle;
        }
 
-       @Override
+       /**
+        * 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;
        }
@@ -651,12 +690,20 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for country instance
+        * <p>
+        * @return Country instance
+        */
        public Country getCountry () {
                return this.country;
        }
 
-       @Override
+       /**
+        * Setter for country instance
+        * <p>
+        * @param country Country instance
+        */
        public void setCountry (final Country country) {
                this.country = country;
        }
@@ -666,167 +713,300 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                return this.emailAddress;
        }
 
-       @Override
+       /**
+        * Setter for email address
+        * <p>
+        * @param emailAddress Email address
+        */
        public void setEmailAddress (final String emailAddress) {
                this.emailAddress = emailAddress;
        }
 
-       @Override
+       /**
+        * Getter for email address, repeated
+        * <p>
+        * @return the emailAddress, repeated
+        */
        public String getEmailAddressRepeat () {
                return this.emailAddressRepeat;
        }
 
-       @Override
+       /**
+        * Setter for email address repeated
+        * <p>
+        * @param emailAddressRepeat the emailAddress to set
+        */
        public void setEmailAddressRepeat (final String emailAddressRepeat) {
                this.emailAddressRepeat = emailAddressRepeat;
        }
 
-       @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 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
+       /**
+        * First name
+        * <p>
+        * @return the first name
+        */
        public String getFirstName () {
                return this.firstName;
        }
 
-       @Override
+       /**
+        * First name
+        * <p>
+        * @param firstName the first name to set
+        */
        public void setFirstName (final String firstName) {
                this.firstName = firstName;
        }
 
-       @Override
+       /**
+        * House number
+        * <p>
+        * @return the houseNumber
+        */
        public Short getHouseNumber () {
                return this.houseNumber;
        }
 
-       @Override
+       /**
+        * House number
+        * <p>
+        * @param houseNumber the houseNumber to set
+        */
        public void setHouseNumber (final Short houseNumber) {
                this.houseNumber = houseNumber;
        }
 
-       @Override
+       /**
+        * Getter for house number extension, example: 123a 'a' is then 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;
        }
 
-       @Override
+       /**
+        * 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;
        }
 
-       @Override
+       /**
+        * Getter for land-line number's country instance
+        * <p>
+        * @return Land-line number's country instance
+        */
        public Country getLandLineCountry () {
                return this.landLineCountry;
        }
 
-       @Override
+       /**
+        * 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;
        }
 
-       @Override
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
        public Long getLandLineNumber () {
                return this.landLineNumber;
        }
 
-       @Override
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
        public void setLandLineNumber (final Long landLineNumber) {
                this.landLineNumber = landLineNumber;
        }
 
-       @Override
+       /**
+        * Getter for mobile number
+        * <p>
+        * @return Mobile number
+        */
        public Long getMobileNumber () {
                return this.mobileNumber;
        }
 
-       @Override
+       /**
+        * Setter for mobile number
+        * <p>
+        * @param mobileNumber Mobile number
+        */
        public void setMobileNumber (final Long mobileNumber) {
                this.mobileNumber = mobileNumber;
        }
 
-       @Override
+       /**
+        * Getter for mobile number's carrier
+        * <p>
+        * @return Mobile number's carrier
+        */
        public MobileProvider getMobileProvider () {
                return this.mobileProvider;
        }
 
-       @Override
+       /**
+        * Setter for mobile number's provider
+        * <p>
+        * @param mobileProvider Mobile number's provider
+        */
        public void setMobileProvider (final MobileProvider mobileProvider) {
                this.mobileProvider = mobileProvider;
        }
 
-       @Override
+       /**
+        * Getter for personal title
+        * <p>
+        * @return Personal title
+        */
        public PersonalTitle getPersonalTitle () {
                return this.personalTitle;
        }
 
-       @Override
+       /**
+        * Setter for personal title
+        * <p>
+        * @param personalTitle Personal title
+        */
        public void setPersonalTitle (final PersonalTitle personalTitle) {
                this.personalTitle = personalTitle;
        }
 
-       @Override
+       /**
+        * Getter for street
+        * <p>
+        * @return Street
+        */
        public String getStreet () {
                return this.street;
        }
 
-       @Override
+       /**
+        * Setter for street
+        * <p>
+        * @param street Street
+        */
        public void setStreet (final String street) {
                this.street = street;
        }
 
-       @Override
+       /**
+        * Getter for ZIP code
+        * <p>
+        * @return ZIP code
+        */
        public Integer getZipCode () {
                return this.zipCode;
        }
 
-       @Override
+       /**
+        * Setter for ZIP code
+        * <p>
+        * @param zipCode ZIP code
+        */
        public void setZipCode (final Integer zipCode) {
                this.zipCode = zipCode;
        }
@@ -1027,8 +1207,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                this.setCountry(null);
 
                // - contact data
-               this.setEmailAddress(null);
-               this.setEmailAddressRepeat(null);
+               this.clearEmailAddresses();
                this.setLandLineAreaCode(null);
                this.setLandLineCountry(null);
                this.setLandLineNumber(null);
index 6277deab99f3117d823c1c1bef1661d5ae59eb66..167518df16e868dba483d08b1fced43aef1c9fd5 100644 (file)
 package org.mxchange.jjobs.beans.contact;
 
 import java.io.Serializable;
-import java.util.Date;
 import java.util.List;
-import javax.ejb.Local;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.title.PersonalTitle;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
  * An interface for user beans
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsContactWebSessionController extends Serializable {
 
        /**
@@ -39,6 +33,18 @@ public interface JobsContactWebSessionController extends Serializable {
         */
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
+       /**
+        * Getter for email address
+        * <p>
+        * @return Email address
+        */
+       String getEmailAddress ();
+
+       /**
+        * Clears both email address field
+        */
+       void clearEmailAddresses ();
+
        /**
         * Returns a list of all found contacts
         * <p>
@@ -72,315 +78,6 @@ public interface JobsContactWebSessionController extends Serializable {
         */
        Contact createContactInstance ();
 
-       /**
-        * Getter for birth day
-        * <p>
-        * @return Birth day
-        */
-       Date getBirthday ();
-
-       /**
-        * Setter for birth day
-        * <p>
-        * @param birthday Birth day
-        */
-       void setBirthday (final Date birthday);
-
-       /**
-        * Getter for mobile number's carrier
-        * <p>
-        * @return Mobile number's carrier
-        */
-       MobileProvider getMobileProvider ();
-
-       /**
-        * Setter for mobile number's provider
-        * <p>
-        * @param mobileProvider Mobile number's provider
-        */
-       void setMobileProvider (final MobileProvider mobileProvider);
-
-       /**
-        * Getter for mobile number
-        * <p>
-        * @return Mobile number
-        */
-       Long getMobileNumber ();
-
-       /**
-        * Setter for mobile number
-        * <p>
-        * @param mobileNumber Mobile number
-        */
-       void setMobileNumber (final Long mobileNumber);
-
-       /**
-        * City
-        * <p>
-        * @return the city
-        */
-       String getCity ();
-
-       /**
-        * City
-        * <p>
-        * @param city the city to set
-        */
-       void setCity (final String city);
-
-       /**
-        * Getter for comments
-        * <p>
-        * @return Comments
-        */
-       String getComment ();
-
-       /**
-        * Setter for comment
-        * <p>
-        * @param comment Comments
-        */
-       void setComment (final String comment);
-
-       /**
-        * Getter for country instance
-        * <p>
-        * @return Country instance
-        */
-       Country getCountry ();
-
-       /**
-        * Setter for country instance
-        * <p>
-        * @param country Country instance
-        */
-       void setCountry (final Country country);
-
-       /**
-        * Getter for email address
-        * <p>
-        * @return Email address
-        */
-       String getEmailAddress ();
-
-       /**
-        * Setter for email address
-        * <p>
-        * @param emailAddress Email address
-        */
-       void setEmailAddress (final String emailAddress);
-
-       /**
-        * Getter for email address, repeated
-        * <p>
-        * @return the emailAddress, repeated
-        */
-       String getEmailAddressRepeat ();
-
-       /**
-        * Setter for email address repeated
-        * <p>
-        * @param emailAddressRepeat the emailAddress to set
-        */
-       void setEmailAddressRepeat (final String emailAddressRepeat);
-
-       /**
-        * Family name
-        * <p>
-        * @return the familyName
-        */
-       String getFamilyName ();
-
-       /**
-        * Family name
-        * <p>
-        * @param familyName the familyName to set
-        */
-       void setFamilyName (final String familyName);
-
-       /**
-        * Getter for fax number's area code
-        * <p>
-        * @return Fax number's area code
-        */
-       Integer getFaxAreaCode ();
-
-       /**
-        * Setter for fax number's area code
-        * <p>
-        * @param faxAreaCode Fax number's area code
-        */
-       void setFaxAreaCode (final Integer faxAreaCode);
-
-       /**
-        * Getter for fax's country instance
-        * <p>
-        * @return Fax' country instance
-        */
-       Country getFaxCountry ();
-
-       /**
-        * Setter for fax's country instance
-        * <p>
-        * @param faxCountry Fax' country instance
-        */
-       void setFaxCountry (final Country faxCountry);
-
-       /**
-        * Getter for fax number
-        * <p>
-        * @return Fax number
-        */
-       Long getFaxNumber ();
-
-       /**
-        * Setter for fax number
-        * <p>
-        * @param faxNumber Fax number
-        */
-       void setFaxNumber (final Long faxNumber);
-
-       /**
-        * First name
-        * <p>
-        * @return the first name
-        */
-       String getFirstName ();
-
-       /**
-        * First name
-        * <p>
-        * @param firstName the first name to set
-        */
-       void setFirstName (final String firstName);
-
-       /**
-        * Getter for personal title
-        * <p>
-        * @return Personal title
-        */
-       PersonalTitle getPersonalTitle ();
-
-       /**
-        * Setter for personal title
-        * <p>
-        * @param personalTitle Personal title
-        */
-       void setPersonalTitle (final PersonalTitle personalTitle);
-
-       /**
-        * House number
-        * <p>
-        * @return the houseNumber
-        */
-       Short getHouseNumber ();
-
-       /**
-        * House number
-        * <p>
-        * @param houseNumber the houseNumber to set
-        */
-       void setHouseNumber (final Short houseNumber);
-
-       /**
-        * Getter for house number extension, example: 123a 'a' is then the
-        * extension and 123 is the house number.
-        * <p>
-        * @return House number extension
-        */
-       String getHouseNumberExtension ();
-
-       /**
-        * Setter for house number extension
-        * <p>
-        * @param houseNumberExtension House number extension
-        */
-       void setHouseNumberExtension (final String houseNumberExtension);
-
-       /**
-        * Getter for phone number's area code
-        * <p>
-        * @return Phone number's area code
-        */
-       Integer getLandLineAreaCode ();
-
-       /**
-        * Setter for phone number's area code
-        * <p>
-        * @param phoneAreaCode Phone number's area code
-        */
-       void setLandLineAreaCode (final Integer phoneAreaCode);
-
-       /**
-        * Getter for phone number's country instance
-        * <p>
-        * @return Phone number's country instance
-        */
-       Country getLandLineCountry ();
-
-       /**
-        * Setter for phone number's country instance
-        * <p>
-        * @param phoneCountry Phone number's country instance
-        */
-       void setLandLineCountry (final Country phoneCountry);
-
-       /**
-        * Getter for phone number
-        * <p>
-        * @return Phone number
-        */
-       Long getLandLineNumber ();
-
-       /**
-        * Setter for phone number
-        * <p>
-        * @param phoneNumber Phone number
-        */
-       void setLandLineNumber (final Long phoneNumber);
-
-       /**
-        * Street
-        * <p>
-        * @return the street
-        */
-       String getStreet ();
-
-       /**
-        * Street
-        * <p>
-        * @param street the street to set
-        */
-       void setStreet (final String street);
-
-       /**
-        * Getter for academic title
-        * <p>
-        * @return Academic title
-        */
-       String getAcademicTitle ();
-
-       /**
-        * Setter for academic title
-        * <p>
-        * @param academicTitle Academic title
-        */
-       void setAcademicTitle (final String academicTitle);
-
-       /**
-        * ZIP code
-        * <p>
-        * @return the zipCode
-        */
-       Integer getZipCode ();
-
-       /**
-        * ZIP code
-        * <p>
-        * @param zipCode the zipCode to set
-        */
-       void setZipCode (final Integer zipCode);
-
        /**
         * Getter for controller type
         * <p>
index 89e86a07b2f7e076d83c827383c1f7f005562843..89084e88e144f8454a58e275104a05cc7fffa205 100644 (file)
@@ -142,6 +142,46 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
        @Any
        private Event<ObservableAdminUnlinkedMobileNumberEvent> mobileNumberUnlinkedEvent;
 
+       /**
+        * Area code (city dial prefix) for fax number
+        */
+       private Integer faxAreaCode;
+
+       /**
+        * Country (for dial prefix) for fax number
+        */
+       private Country faxCountry;
+
+       /**
+        * Fax number
+        */
+       private Long faxNumber;
+
+       /**
+        * Area code (city dial prefix) for land-line number
+        */
+       private Integer landLineAreaCode;
+
+       /**
+        * Country (for dial prefix) for land-line number
+        */
+       private Country landLineCountry;
+
+       /**
+        * Land-line number
+        */
+       private Long landLineNumber;
+
+       /**
+        * Mobile provider
+        */
+       private MobileProvider mobileProvider;
+
+       /**
+        * Mobile number
+        */
+       private Long mobileNumber;
+
        /**
         * Default constructor
         */
@@ -229,8 +269,15 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                this.clear();
        }
 
-       @Override
-       public String doLinkAddFaxNumber (final Contact contact) {
+       /**
+        * Links fax number to contact from bean helper as "main fax number".
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doLinkMainFaxNumber () {
+               // Get contact from helper
+               Contact contact = this.beanHelper.getContact();
+
                // Is all data properly set?
                if (null == contact) {
                        // Throw NPE
@@ -241,58 +288,60 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                } else if (contact.getContactId() < 1) {
                        // Is not valid
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
-               } else if ((this.adminPhoneController.getFaxNumber() == null) && (this.adminPhoneController.getPhoneCountry() == null) && ((this.adminPhoneController.getPhoneAreaCode() == null) || (this.adminPhoneController.getPhoneAreaCode() < 1)) && ((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1))) {
-                       // All fields are empty
-                       throw new NullPointerException("faxNumber, mobileProvider and phoneNumer are null"); //NOI18N
-               } else if ((this.adminPhoneController.getFaxNumber() instanceof DialableFaxNumber) && (this.adminPhoneController.getPhoneCountry() instanceof Country) && (this.adminPhoneController.getPhoneAreaCode() instanceof Integer) && (this.adminPhoneController.getPhoneNumber() instanceof Long)) {
-                       // All fields are set
-                       throw new IllegalStateException("faxNumber, mobileProvider and phoneNumer are all set"); //NOI18N
-               } else if ((this.adminPhoneController.getPhoneCountry() == null) && ((this.adminPhoneController.getPhoneAreaCode() instanceof Integer) || (this.adminPhoneController.getPhoneNumber() instanceof Long))) {
-                       // No country selected
-                       this.showFacesMessage("form_add_contact_fax:phoneCountry", "ERROR_ADMIN_NO_PHONE_COUNTRY_SELECTED"); //NOI18N
-                       return ""; //NOI18N
-               } else if (((this.adminPhoneController.getPhoneAreaCode() == null) || (this.adminPhoneController.getPhoneAreaCode() < 1)) && ((this.adminPhoneController.getPhoneCountry() instanceof Country) || (this.adminPhoneController.getPhoneNumber() instanceof Long))) {
-                       // No area code entered
-                       this.showFacesMessage("form_add_contact_fax:phoneAreaCode", "ERROR_ADMIN_NO_PHONE_AREA_CODE_ENTERED"); //NOI18N
-                       return ""; //NOI18N
-               } else if (((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1)) && ((this.adminPhoneController.getPhoneCountry() instanceof Country) || (this.adminPhoneController.getPhoneAreaCode() instanceof Integer))) {
-                       // No phone number entered
-                       this.showFacesMessage("form_add_contact_fax:phoneNumber", "ERROR_ADMIN_NO_PHONE_NUMBER_ENTERED"); //NOI18N
-                       return ""; //NOI18N
+               } else if (this.getFaxCountry() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.faxCountry is null"); //NOI18N
+               } else if (this.getFaxCountry().getCountryId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.faxCountry.countryId is null"); //NOI18N
+               } else if (this.getFaxCountry().getCountryId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxCountry.countryId={0} is not valid.", this.getFaxCountry().getCountryId())); //NOI18N
+               } else if (this.getFaxAreaCode() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.faxAreaCode is null"); //NOI18N
+               } else if (this.getFaxAreaCode() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxAreaCode={0} is invalid", this.getFaxAreaCode())); //NOI18N
+               } else if (this.getFaxNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.faxNumber is null"); //NOI18N
+               } else if (this.getFaxNumber() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber={0} is invalid", this.getFaxNumber())); //NOI18N
                }
 
                // Init instances
                Contact updatedContact;
-               DialableFaxNumber faxNumber = this.adminPhoneController.getFaxNumber();
+               DialableFaxNumber number = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Try it again
                try {
-                       // All fine so far, then which was choosen?
-                       if (faxNumber instanceof DialableFaxNumber) {
-                               // User has choosen number
-                               updatedContact = this.adminPhoneBean.linkExistingFaxNumberWithContact(contact, faxNumber);
-                       } else {
-                               // Create new instance
-                               faxNumber = new FaxNumber(this.adminPhoneController.getPhoneCountry(), this.adminPhoneController.getPhoneAreaCode(), this.adminPhoneController.getPhoneNumber());
-
-                               // Link it, too
-                               updatedContact = this.adminPhoneBean.linkNewFaxNumberWithContact(contact, faxNumber);
-                       }
+                       // Link it, too
+                       updatedContact = this.adminPhoneBean.linkNewFaxNumberWithContact(contact, number);
                } catch (final PhoneNumberAlreadyLinkedException ex) {
                        // Throw again as cause
-                       this.showFacesMessage("form_add_contact_fax:phoneNumber", ex); //NOI18N
+                       this.showFacesMessage("form_add_contact_fax:faxNumber", ex); //NOI18N
                        return ""; //NOI18N
                }
 
                // Fire event
-               this.adminLinkedFaxNumberEvent.fire(new AdminLinkedFaxNumberEvent(updatedContact, faxNumber));
+               this.adminLinkedFaxNumberEvent.fire(new AdminLinkedFaxNumberEvent(updatedContact, number));
 
                // Return to contact profile
                return "admin_show_contact"; //NOI18N
        }
 
-       @Override
-       public String doLinkAddLandLineNumber (final Contact contact) {
+       /**
+        * Links land-line number to contact from bean helper as "main land-line
+        * number".
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doLinkMainLandLineNumber () {
+               // Get contact from helper
+               Contact contact = this.beanHelper.getContact();
+
                // Is all data properly set?
                if (null == contact) {
                        // Throw NPE
@@ -303,58 +352,59 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                } else if (contact.getContactId() < 1) {
                        // Is not valid
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
-               } else if ((this.adminPhoneController.getLandLineNumber() == null) && (this.adminPhoneController.getPhoneCountry() == null) && ((this.adminPhoneController.getPhoneAreaCode() == null) || (this.adminPhoneController.getPhoneAreaCode() < 1)) && ((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1))) {
-                       // All fields are empty
-                       throw new NullPointerException("landLineNumber, mobileProvider and phoneNumer are null"); //NOI18N
-               } else if ((this.adminPhoneController.getLandLineNumber() instanceof DialableLandLineNumber) && (this.adminPhoneController.getPhoneCountry() instanceof Country) && (this.adminPhoneController.getPhoneAreaCode() instanceof Integer) && (this.adminPhoneController.getPhoneNumber() instanceof Long)) {
-                       // All fields are set
-                       throw new IllegalStateException("landLineNumber, mobileProvider and phoneNumer are all set"); //NOI18N
-               } else if ((this.adminPhoneController.getPhoneCountry() == null) && ((this.adminPhoneController.getPhoneAreaCode() instanceof Integer) || (this.adminPhoneController.getPhoneNumber() instanceof Long))) {
-                       // No country selected
-                       this.showFacesMessage("form_add_contact_landLine:phoneCountry", "ERROR_ADMIN_NO_PHONE_COUNTRY_SELECTED"); //NOI18N
-                       return ""; //NOI18N
-               } else if (((this.adminPhoneController.getPhoneAreaCode() == null) || (this.adminPhoneController.getPhoneAreaCode() < 1)) && ((this.adminPhoneController.getPhoneCountry() instanceof Country) || (this.adminPhoneController.getPhoneNumber() instanceof Long))) {
-                       // No area code entered
-                       this.showFacesMessage("form_add_contact_landLine:phoneAreaCode", "ERROR_ADMIN_NO_PHONE_AREA_CODE_ENTERED"); //NOI18N
-                       return ""; //NOI18N
-               } else if (((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1)) && ((this.adminPhoneController.getPhoneCountry() instanceof Country) || (this.adminPhoneController.getPhoneAreaCode() instanceof Integer))) {
-                       // No phone number entered
-                       this.showFacesMessage("form_add_contact_landLine:phoneNumber", "ERROR_ADMIN_NO_PHONE_NUMBER_ENTERED"); //NOI18N
-                       return ""; //NOI18N
+               } else if (this.getLandLineCountry() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.landLineCountry is null"); //NOI18N
+               } else if (this.getLandLineCountry().getCountryId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.landLineCountry.countryId is null"); //NOI18N
+               } else if (this.getLandLineCountry().getCountryId() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineCountry.countryId={0} is not valid.", this.getLandLineCountry().getCountryId())); //NOI18N
+               } else if (this.getLandLineAreaCode() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.landLineAreaCode is null"); //NOI18N
+               } else if (this.getLandLineAreaCode() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineAreaCode={0} is invalid", this.getLandLineAreaCode())); //NOI18N
+               } else if (this.getLandLineNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.landLineNumber is null"); //NOI18N
+               } else if (this.getLandLineNumber() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber={0} is invalid", this.getLandLineNumber())); //NOI18N
                }
 
                // Init instance
                Contact updatedContact;
-               DialableLandLineNumber landLineNumber = this.adminPhoneController.getLandLineNumber();
+               DialableLandLineNumber number = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
 
                // Try it again
                try {
-                       // All fine so far, then which was choosen?
-                       if (landLineNumber instanceof DialableLandLineNumber) {
-                               // User has choosen number
-                               updatedContact = this.adminPhoneBean.linkExistingLandLineNumberWithContact(contact, landLineNumber);
-                       } else {
-                               // Create new instance
-                               landLineNumber = new LandLineNumber(this.adminPhoneController.getPhoneCountry(), this.adminPhoneController.getPhoneAreaCode(), this.adminPhoneController.getPhoneNumber());
-
-                               // Link it, too
-                               updatedContact = this.adminPhoneBean.linkNewLandLineNumberWithContact(contact, landLineNumber);
-                       }
+                       // Link it, too
+                       updatedContact = this.adminPhoneBean.linkNewLandLineNumberWithContact(contact, number);
                } catch (final PhoneNumberAlreadyLinkedException ex) {
                        // Throw again as cause
-                       this.showFacesMessage("form_add_contact_landLine:phoneNumber", ex); //NOI18N
+                       this.showFacesMessage("form_add_contact_landLine:landLineNumber", ex); //NOI18N
                        return ""; //NOI18N
                }
 
                // Fire event
-               this.adminLinkedLandLineNumberEvent.fire(new AdminLinkedLandLineNumberEvent(updatedContact, landLineNumber));
+               this.adminLinkedLandLineNumberEvent.fire(new AdminLinkedLandLineNumberEvent(updatedContact, number));
 
                // Return to contact profile
                return "admin_show_contact"; //NOI18N
        }
 
-       @Override
-       public String doLinkAddMobileNumber (final Contact contact) {
+       /**
+        * Links mobile number to contact from bean helper as "main mobile number".
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doLinkMainMobileNumber () {
+               // Get contact from helper
+               Contact contact = this.beanHelper.getContact();
+
                // Is all data properly set?
                if (null == contact) {
                        // Throw NPE
@@ -365,52 +415,188 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                } else if (contact.getContactId() < 1) {
                        // Is not valid
                        throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
-               } else if ((this.adminPhoneController.getMobileNumber() == null) && (this.adminPhoneController.getMobileProvider() == null) && ((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1))) {
-                       // All fields are empty
-                       throw new NullPointerException("mobileNumber, mobileProvider and phoneNumer are null"); //NOI18N
-               } else if ((this.adminPhoneController.getMobileNumber() instanceof DialableMobileNumber) && (this.adminPhoneController.getMobileProvider() instanceof MobileProvider) && (this.adminPhoneController.getPhoneNumber() instanceof Long)) {
-                       // All fields are set
-                       throw new IllegalStateException("mobileNumber, mobileProvider and phoneNumer are all set"); //NOI18N
-               } else if ((this.adminPhoneController.getMobileProvider() == null) && (this.adminPhoneController.getPhoneNumber() instanceof Long)) {
-                       // No mobile provider selected
-                       this.showFacesMessage("form_add_contact_mobile:phoneCountry", "ERROR_ADMIN_NO_PHONE_MOBILE_PROVIDER_SELECTED"); //NOI18N
-                       return ""; //NOI18N
-               } else if (((this.adminPhoneController.getPhoneNumber() == null) || (this.adminPhoneController.getPhoneNumber() < 1)) && (this.adminPhoneController.getMobileProvider() instanceof MobileProvider)) {
-                       // No phone number entered
-                       this.showFacesMessage("form_add_contact_mobile:phoneNumber", "ERROR_ADMIN_NO_PHONE_NUMBER_ENTERED"); //NOI18N
-                       return ""; //NOI18N
+               } else if (this.getMobileProvider() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.mobileProvider is null"); //NOI18N
+               } else if (this.getMobileProvider().getProviderId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.mobileProvider.providerId is null"); //NOI18N
+               } else if (this.getMobileProvider().getProviderId() < 1) {
+                       // Throw NPE
+                       throw new NullPointerException(MessageFormat.format("this.mobileProvider.providerId={0} is invalid", this.getMobileProvider().getProviderId())); //NOI18N
+               } else if (this.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.mobileNumber is null"); //NOI18N
+               } else if (this.getMobileNumber() < 1) {
+                       // Invalid id number
+                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber={0} is invalid", this.getMobileNumber())); //NOI18N
                }
 
                // Init instance
                Contact updatedContact;
-               DialableMobileNumber mobileNumber = this.adminPhoneController.getMobileNumber();
+               DialableMobileNumber number = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
 
                // Try it again
                try {
-                       // All fine so far, then which was choosen?
-                       if (mobileNumber instanceof DialableMobileNumber) {
-                               // User has choosen number
-                               updatedContact = this.adminPhoneBean.linkExistingMobileNumberWithContact(contact, mobileNumber);
-                       } else {
-                               // Create new instance
-                               mobileNumber = new MobileNumber(this.adminPhoneController.getMobileProvider(), this.adminPhoneController.getPhoneNumber());
-
-                               // Link it, too
-                               updatedContact = this.adminPhoneBean.linkNewMobileNumberWithContact(contact, mobileNumber);
-                       }
+                       // Link it, too
+                       updatedContact = this.adminPhoneBean.linkNewMobileNumberWithContact(contact, number);
                } catch (final PhoneNumberAlreadyLinkedException ex) {
                        // Throw again as cause
-                       this.showFacesMessage("form_add_contact_mobile:phoneNumber", ex); //NOI18N
+                       this.showFacesMessage("form_add_contact_mobile:mobileNumber", ex); //NOI18N
                        return ""; //NOI18N
                }
 
                // Fire event
-               this.adminLinkedMobileNumberEvent.fire(new AdminLinkedMobileNumberEvent(updatedContact, mobileNumber));
+               this.adminLinkedMobileNumberEvent.fire(new AdminLinkedMobileNumberEvent(updatedContact, number));
 
                // Return to contact profile
                return "admin_show_contact"; //NOI18N
        }
 
+       /**
+        * Getter for fax area code
+        * <p>
+        * @return Fax area code
+        */
+       public Integer getFaxAreaCode () {
+               return this.faxAreaCode;
+       }
+
+       /**
+        * Setter for fax area code
+        * <p>
+        * @param faxAreaCode Fax area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode) {
+               this.faxAreaCode = faxAreaCode;
+       }
+
+       /**
+        * Getter for fax numbers country
+        * <p>
+        * @return Fax numbers country
+        */
+       public Country getFaxCountry () {
+               return this.faxCountry;
+       }
+
+       /**
+        * Setter for fax numbers country
+        * <p>
+        * @param faxCountry Fax numbers country
+        */
+       public void setFaxCountry (final Country faxCountry) {
+               this.faxCountry = faxCountry;
+       }
+
+       /**
+        * Getter for fax number
+        * <p>
+        * @return Fax number
+        */
+       public Long getFaxNumber () {
+               return this.faxNumber;
+       }
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @param faxNumber Fax number
+        */
+       public void setFaxNumber (final Long faxNumber) {
+               this.faxNumber = faxNumber;
+       }
+
+       /**
+        * Getter for land-line area code
+        * <p>
+        * @return Land-line area code
+        */
+       public Integer getLandLineAreaCode () {
+               return this.landLineAreaCode;
+       }
+
+       /**
+        * Setter for land-line area code
+        * <p>
+        * @param landLineAreaCode Land-line area code
+        */
+       public void setLandLineAreaCode (final Integer landLineAreaCode) {
+               this.landLineAreaCode = landLineAreaCode;
+       }
+
+       /**
+        * Getter for land-line country
+        * <p>
+        * @return Land-line country
+        */
+       public Country getLandLineCountry () {
+               return this.landLineCountry;
+       }
+
+       /**
+        * Setter for land-line country
+        * <p>
+        * @param landLineCountry Land-line country
+        */
+       public void setLandLineCountry (final Country landLineCountry) {
+               this.landLineCountry = landLineCountry;
+       }
+
+       /**
+        * Getter for land-line number
+        * <p>
+        * @return Land-line number
+        */
+       public Long getLandLineNumber () {
+               return this.landLineNumber;
+       }
+
+       /**
+        * Setter for land-line number
+        * <p>
+        * @param landLineNumber Land-line number
+        */
+       public void setLandLineNumber (final Long landLineNumber) {
+               this.landLineNumber = landLineNumber;
+       }
+
+       /**
+        * Getter for mobile provider
+        * <p>
+        * @return Mobile provider
+        */
+       public MobileProvider getMobileProvider () {
+               return this.mobileProvider;
+       }
+
+       /**
+        * Setter for mobile provider
+        * <p>
+        * @param mobileProvider Mobile provider
+        */
+       public void setMobileProvider (final MobileProvider mobileProvider) {
+               this.mobileProvider = mobileProvider;
+       }
+
+       /**
+        * Getter for mobile number
+        * <p>
+        * @return Mobile number
+        */
+       public Long getMobileNumber () {
+               return this.mobileNumber;
+       }
+
+       /**
+        * Setter for mobile number
+        * <p>
+        * @param mobileNumber Mobile number
+        */
+       public void setMobileNumber (final Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
+       }
+
        /**
         * Post-construction method
         */
@@ -429,7 +615,11 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                }
        }
 
-       @Override
+       /**
+        * Unlinks fax data with current contact
+        * <p>
+        * @return Redirect outcome
+        */
        public String unlinkFaxContactData () {
                // Is all data set
                if (this.beanHelper.getFaxNumber() == null) {
@@ -477,7 +667,11 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                return "admin_show_contact"; //NOI18N
        }
 
-       @Override
+       /**
+        * Unlinks land-line data with current contact
+        * <p>
+        * @return Redirect outcome
+        */
        public String unlinkLandLineContactData () {
                // Is all data set
                if (this.beanHelper.getLandLineNumber() == null) {
@@ -525,7 +719,11 @@ public abstract class JobsAdminContactPhoneWebRequestBean extends BaseJobsContro
                return "admin_show_contact"; //NOI18N
        }
 
-       @Override
+       /**
+        * Unlinks mobile data with current contact
+        * <p>
+        * @return Redirect outcome
+        */
        public String unlinkMobileContactData () {
                // Is all data set
                if (this.beanHelper.getMobileNumber() == null) {
index 05e4f607896bacf7b7346ccc22db027df38a8ab8..5e598b86c08448c175eaf62a9e63c41ebb504025 100644 (file)
 package org.mxchange.jjobs.beans.contact.phone;
 
 import java.io.Serializable;
-import javax.ejb.Local;
-import org.mxchange.jcontacts.contact.Contact;
 
 /**
  * An interface for user beans
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsAdminContactPhoneWebRequestController extends Serializable {
 
-       /**
-        * Unlinks fax data with current contact
-        * <p>
-        * @return Redirect outcome
-        */
-       String unlinkFaxContactData ();
-
-       /**
-        * Unlinks land-line data with current contact
-        * <p>
-        * @return Redirect outcome
-        */
-       String unlinkLandLineContactData ();
-
-       /**
-        * Unlinks mobile data with current contact
-        * <p>
-        * @return Redirect outcome
-        */
-       String unlinkMobileContactData ();
-
-       /**
-        * Links given contact instance with set fax number or entered data. If both
-        * is set, a proper exception is thrown as this is an invalid state.
-        * <p>
-        * @param contact Contact instance to link with existing/new data
-        * <p>
-        * @return Redirect outcome
-        */
-       String doLinkAddFaxNumber (final Contact contact);
-
-       /**
-        * Links given contact instance with set land-line number or entered data.
-        * If both is set, a proper exception is thrown as this is an invalid state.
-        * <p>
-        * @param contact Contact instance to link with existing/new data
-        * <p>
-        * @return Redirect outcome
-        */
-       String doLinkAddLandLineNumber (final Contact contact);
-
-       /**
-        * Links given contact instance with set mobile or entered data. If both is
-        * set, a proper exception is thrown as this is an invalid state.
-        * <p>
-        * @param contact Contact instance to link with existing/new data
-        * <p>
-        * @return Redirect outcome
-        */
-       String doLinkAddMobileNumber (final Contact contact);
-
 }
index 2c244ea1fb17ce292fa3b35e375329631daf29fe..d3b2cd926639cdf7791dcb05a1816e789aa98733 100644 (file)
@@ -18,7 +18,6 @@ package org.mxchange.jjobs.beans.contact.phone;
 
 import java.io.Serializable;
 import java.util.List;
-import javax.ejb.Local;
 import org.mxchange.jcontacts.contact.Contact;
 
 /**
@@ -26,7 +25,6 @@ import org.mxchange.jcontacts.contact.Contact;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsContactPhoneWebSessionController extends Serializable {
 
        /**
index b8db871a22731c48f0b0f4ea93cd36a71bba7d53..0b9697b7b4a5e639771c55c6d3b8e4065e6b7c25 100644 (file)
  */
 package org.mxchange.jjobs.beans.country;
 
-import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Locale;
-import java.util.MissingResourceException;
 import java.util.Objects;
-import java.util.ResourceBundle;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -50,7 +44,7 @@ import org.mxchange.jjobs.beans.BaseJobsController;
  */
 @Named ("adminCountryController")
 @RequestScoped
-public abstract class JobsAdminCountryWebRequestBean extends BaseJobsController implements JobsAdminCountryWebRequestController {
+public class JobsAdminCountryWebRequestBean extends BaseJobsController implements JobsAdminCountryWebRequestController {
 
        /**
         * Serial number
@@ -113,7 +107,14 @@ public abstract class JobsAdminCountryWebRequestBean extends BaseJobsController
                super();
        }
 
-       @Override
+       /**
+        * Adds country to all relevant beans and sends it to the EJB. A redirect
+        * should happen after successfull creation.
+        * <p>
+        * @return Redirect outcome
+        * <p>
+        * @todo Add field validation
+        */
        public String addCountry () {
                // Create new country object
                Country country = new CountryData();
@@ -153,77 +154,115 @@ public abstract class JobsAdminCountryWebRequestBean extends BaseJobsController
                return "admin_list_country"; //NOI18N
        }
 
-       @Override
-       public List<Country> allCountries () {
-               // Return "cached" version
-               return this.countryController.allCountries();
-       }
-
-       @Override
+       /**
+        * Getter for abroad dial prefix
+        * <p>
+        * @return Abroad dial prefix
+        */
        public String getCountryAbroadDialPrefix () {
                return this.countryAbroadDialPrefix;
        }
 
-       @Override
+       /**
+        * Setter for abroad dial prefix
+        * <p>
+        * @param countryAbroadDialPrefix Abroad dial prefix
+        */
        public void setCountryAbroadDialPrefix (final String countryAbroadDialPrefix) {
                this.countryAbroadDialPrefix = countryAbroadDialPrefix;
        }
 
-       @Override
+       /**
+        * Getter for 2-characters country code
+        * <p>
+        * @return Country code
+        */
        public String getCountryCode () {
                return this.countryCode;
        }
 
-       @Override
+       /**
+        * Setter for 2-characters country code
+        * <p>
+        * @param countryCode Country code
+        */
        public void setCountryCode (final String countryCode) {
                this.countryCode = countryCode;
        }
 
-       @Override
+       /**
+        * Getter for external dial prefix
+        * <p>
+        * @return External dial prefix
+        */
        public String getCountryExternalDialPrefix () {
                return this.countryExternalDialPrefix;
        }
 
-       @Override
+       /**
+        * Setter for external dial prefix
+        * <p>
+        * @param countryExternalDialPrefix External dial prefix
+        */
        public void setCountryExternalDialPrefix (final String countryExternalDialPrefix) {
                this.countryExternalDialPrefix = countryExternalDialPrefix;
        }
 
-       @Override
+       /**
+        * Getter for i18n key for country name
+        * <p>
+        * @return i18n key for country name
+        */
        public String getCountryI18nKey () {
                return this.countryI18nKey;
        }
 
-       @Override
+       /**
+        * Setter for i18n key for country name
+        * <p>
+        * @param countryI18nKey i18n key for country name
+        */
        public void setCountryI18nKey (final String countryI18nKey) {
                this.countryI18nKey = countryI18nKey;
        }
 
-       @Override
+       /**
+        * Getter for whether the local dial prefix is required for local calls
+        * <p>
+        * @return Whether the local dial prefix is required
+        */
        public Boolean getCountryIsLocalPrefixRequired () {
                return this.countryIsLocalPrefixRequired;
        }
 
-       @Override
+       /**
+        * Setter for whether the local dial prefix is required for local calls
+        * <p>
+        * @param countryIsLocalPrefixRequired Whether the local dial prefix is
+        *                                     required
+        */
        public void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired) {
                this.countryIsLocalPrefixRequired = countryIsLocalPrefixRequired;
        }
 
-       @Override
+       /**
+        * Getter for country code (example: 49 for Germany, 63 for Philippines)
+        * <p>
+        * @return Dial number without prefix
+        */
        public Short getCountryPhoneCode () {
                return this.countryPhoneCode;
        }
 
-       @Override
+       /**
+        * Setter for country code (example: 49 for Germany, 63 for Philippines)
+        * <p>
+        * @param countryPhoneCode Country code
+        */
        public void setCountryPhoneCode (final Short countryPhoneCode) {
                this.countryPhoneCode = countryPhoneCode;
        }
 
-       @Override
-       public boolean hasCountries () {
-               return (!this.allCountries().isEmpty());
-       }
-
        /**
         * Post-construction method
         */
@@ -291,131 +330,4 @@ public abstract class JobsAdminCountryWebRequestBean extends BaseJobsController
                return isAdded;
        }
 
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
-        */
-       protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
-               // Get context parameter
-               Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        */
-       protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
-               // Get context parameter
-               String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-               // Is it null?
-               if (null == contextValue) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
-               }
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Checks whether debug mode is enabled for given controller
-        * <p>
-        * @param controllerName Name of controller
-        * <p>
-        * @return Whether debug mode is enabled
-        */
-       protected boolean isDebugModeEnabled (final String controllerName) {
-               // Parameters should be valid
-               if (null == controllerName) {
-                       // Throw NPE
-                       throw new NullPointerException("controllerName is null"); //NOI18N
-               } else if (controllerName.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
-               }
-               // Try to get context parameter
-               String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-               // Is it set and true?
-               boolean isEnabled = Boolean.parseBoolean(contextParameter) == Boolean.TRUE;
-               // Return it
-               return isEnabled;
-       }
-
-       /**
-        * Loads resource bundle for given locale. This must be implemented per
-        * project so all projects can still customize their methods. Calling
-        * ResourceBundleloadBundle() in this class means that also the bundle files
-        * must be present here.
-        * <p>
-        * @param locale Locale from e.g. FacesContext
-        * <p>
-        * @return Initialized and loaded resource bundle
-        */
-       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
-
-       /**
-        * Shows a faces message for given causing exception. The message from the
-        * exception is being inserted into the message.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param cause    Causing exception
-        */
-       protected void showFacesMessage (final String clientId, final Throwable cause) {
-               // Get context and add message
-               this.showFacesMessage(clientId, cause.getMessage());
-       }
-
-       /**
-        * Shows a faces message with given message (i18n) key.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param i18nKey  Message key
-        * <p>
-        * @throws NullPointerException If clientId or i18nKey is null
-        * @throws IllegalArgumentException If clientId or i18nKey is empty
-        */
-       protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
-               // Both parameter must be valid
-               if (null == clientId) {
-                       // Throw NPE
-                       throw new NullPointerException("clientId is null"); //NOI18N
-               } else if (clientId.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("clientId is null"); //NOI18N
-               } else if (null == i18nKey) {
-                       // Throw NPE
-                       throw new NullPointerException("i18nKey is null"); //NOI18N
-               } else if (i18nKey.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
-               }
-               // Get current locale
-               Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-               // Get bundle bundle
-               ResourceBundle bundle = this.loadResourceBundle(locale);
-               // Default is i18nKey
-               String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N
-               // Try it
-               try {
-                       // Get message
-                       message = bundle.getString(i18nKey);
-               } catch (final MissingResourceException ex) {
-                       // Did not find it, ignored
-               }
-               // Get context and add message
-               FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
-       }
-
 }
index 16dba6a56058ddaf2bd1a2a96a88c90b0444e28d..21d02d1f5d7eba3be9832ad40a6f56a8759aef4f 100644 (file)
@@ -17,8 +17,6 @@
 package org.mxchange.jjobs.beans.country;
 
 import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jcountry.data.Country;
 
 /**
  * An interface for administrative country beans
@@ -27,111 +25,4 @@ import org.mxchange.jcountry.data.Country;
  */
 public interface JobsAdminCountryWebRequestController extends Serializable {
 
-       /**
-        * A list of all countries
-        * <p>
-        * @return All countries
-        */
-       List<Country> allCountries ();
-
-       /**
-        * Adds country to all relevant beans and sends it to the EJB. A redirect
-        * should happen after successfull creation.
-        * <p>
-        * @return Redirect outcome
-        */
-       String addCountry ();
-
-       /**
-        * Checks whether countries has been registered
-        * <p>
-        * @return Whether countries has been registered
-        */
-       boolean hasCountries ();
-
-       /**
-        * Getter for abroad dial prefix
-        * <p>
-        * @return Abroad dial prefix
-        */
-       String getCountryAbroadDialPrefix ();
-
-       /**
-        * Setter for abroad dial prefix
-        * <p>
-        * @param countryAbroadDialPrefix Abroad dial prefix
-        */
-       void setCountryAbroadDialPrefix (final String countryAbroadDialPrefix);
-
-       /**
-        * Getter for 2-characters country code
-        * <p>
-        * @return Country code
-        */
-       String getCountryCode ();
-
-       /**
-        * Setter for 2-characters country code
-        * <p>
-        * @param countryCode Country code
-        */
-       void setCountryCode (final String countryCode);
-
-       /**
-        * Getter for i18n key for country name
-        * <p>
-        * @return i18n key for country name
-        */
-       String getCountryI18nKey ();
-
-       /**
-        * Setter for i18n key for country name
-        * <p>
-        * @param countryI18nKey i18n key for country name
-        */
-       void setCountryI18nKey (final String countryI18nKey);
-
-       /**
-        * Getter for whether the local dial prefix is required for local calls
-        * <p>
-        * @return Whether the local dial prefix is required
-        */
-       Boolean getCountryIsLocalPrefixRequired ();
-
-       /**
-        * Setter for whether the local dial prefix is required for local calls
-        * <p>
-        * @param countryIsLocalPrefixRequired Whether the local dial prefix is
-        *                                     required
-        */
-       void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired);
-
-       /**
-        * Getter for external dial prefix
-        * <p>
-        * @return External dial prefix
-        */
-       String getCountryExternalDialPrefix ();
-
-       /**
-        * Setter for external dial prefix
-        * <p>
-        * @param countryExternalDialPrefix External dial prefix
-        */
-       void setCountryExternalDialPrefix (final String countryExternalDialPrefix);
-
-       /**
-        * Getter for country code (example: 49 for Germany, 63 for Philippines)
-        * <p>
-        * @return Dial number without prefix
-        */
-       Short getCountryPhoneCode ();
-
-       /**
-        * Setter for country code (example: 49 for Germany, 63 for Philippines)
-        * <p>
-        * @param countryPhoneCode Country code
-        */
-       void setCountryPhoneCode (final Short countryPhoneCode);
-
 }
index 7baaa96e46b6be78740da99c6fed394f69b559d4..5a1edceef1a87781af24d5891311a93ce8034e00 100644 (file)
  */
 package org.mxchange.jjobs.beans.features;
 
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
 import javax.inject.Named;
 import org.mxchange.jjobs.beans.BaseJobsController;
 
@@ -34,7 +28,7 @@ import org.mxchange.jjobs.beans.BaseJobsController;
  */
 @Named ("featureController")
 @ApplicationScoped
-public abstract class JobsFeatureWebApplicationBean extends BaseJobsController implements JobsFeaturesWebApplicationController {
+public class JobsFeatureWebApplicationBean extends BaseJobsController implements JobsFeaturesWebApplicationController {
 
        /**
         * Serial number
@@ -84,131 +78,4 @@ public abstract class JobsFeatureWebApplicationBean extends BaseJobsController i
                return isEnabled;
        }
 
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
-        */
-       protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
-               // Get context parameter
-               Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        */
-       protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
-               // Get context parameter
-               String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-               // Is it null?
-               if (null == contextValue) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
-               }
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Checks whether debug mode is enabled for given controller
-        * <p>
-        * @param controllerName Name of controller
-        * <p>
-        * @return Whether debug mode is enabled
-        */
-       protected boolean isDebugModeEnabled (final String controllerName) {
-               // Parameters should be valid
-               if (null == controllerName) {
-                       // Throw NPE
-                       throw new NullPointerException("controllerName is null"); //NOI18N
-               } else if (controllerName.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
-               }
-               // Try to get context parameter
-               String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-               // Is it set and true?
-               boolean isEnabled = Boolean.parseBoolean(contextParameter) == Boolean.TRUE;
-               // Return it
-               return isEnabled;
-       }
-
-       /**
-        * Loads resource bundle for given locale. This must be implemented per
-        * project so all projects can still customize their methods. Calling
-        * ResourceBundleloadBundle() in this class means that also the bundle files
-        * must be present here.
-        * <p>
-        * @param locale Locale from e.g. FacesContext
-        * <p>
-        * @return Initialized and loaded resource bundle
-        */
-       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
-
-       /**
-        * Shows a faces message for given causing exception. The message from the
-        * exception is being inserted into the message.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param cause    Causing exception
-        */
-       protected void showFacesMessage (final String clientId, final Throwable cause) {
-               // Get context and add message
-               this.showFacesMessage(clientId, cause.getMessage());
-       }
-
-       /**
-        * Shows a faces message with given message (i18n) key.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param i18nKey  Message key
-        * <p>
-        * @throws NullPointerException If clientId or i18nKey is null
-        * @throws IllegalArgumentException If clientId or i18nKey is empty
-        */
-       protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
-               // Both parameter must be valid
-               if (null == clientId) {
-                       // Throw NPE
-                       throw new NullPointerException("clientId is null"); //NOI18N
-               } else if (clientId.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("clientId is null"); //NOI18N
-               } else if (null == i18nKey) {
-                       // Throw NPE
-                       throw new NullPointerException("i18nKey is null"); //NOI18N
-               } else if (i18nKey.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
-               }
-               // Get current locale
-               Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-               // Get bundle bundle
-               ResourceBundle bundle = this.loadResourceBundle(locale);
-               // Default is i18nKey
-               String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N
-               // Try it
-               try {
-                       // Get message
-                       message = bundle.getString(i18nKey);
-               } catch (final MissingResourceException ex) {
-                       // Did not find it, ignored
-               }
-               // Get context and add message
-               FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
-       }
-
 }
index 68b8f4ec4093a7d5873081d3907756a9fa2d7e83..5afb23145196526d21a095901c1c1720aeb00179 100644 (file)
 package org.mxchange.jjobs.beans.features;
 
 import java.io.Serializable;
-import javax.ejb.Local;
 
 /**
  * An interface for country beans
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsFeaturesWebApplicationController extends Serializable {
 
        /**
index 23f8512bddfdba8d7106540bf4000d396198ccda..06d6cd847e75a06b937f44cd4a7ce8bef667f425 100644 (file)
@@ -18,6 +18,8 @@ package org.mxchange.jjobs.beans.helper;
 
 import java.text.MessageFormat;
 import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
 import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.contact.Contact;
@@ -26,9 +28,17 @@ import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
+import org.mxchange.jphone.events.helper.fax.created.HelperCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.helper.fax.created.ObservableHelperCreatedFaxNumberEvent;
+import org.mxchange.jphone.events.helper.landline.created.HelperCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.helper.landline.created.ObservableHelperCreatedLandLineNumberEvent;
+import org.mxchange.jphone.events.helper.mobile.created.HelperCreatedMobileNumberEvent;
+import org.mxchange.jphone.events.helper.mobile.created.ObservableHelperCreatedMobileNumberEvent;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jusercore.events.user.helper.created.HelperCreatedUserEvent;
+import org.mxchange.jusercore.events.user.helper.created.ObservableHelperCreatedUserEvent;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -99,6 +109,34 @@ public class JobsWebRequestHelperBean extends BaseJobsController implements Jobs
        @Inject
        private JobsUserWebSessionController userController;
 
+       /**
+        * Event for when a user instance was created
+        */
+       @Any
+       @Inject
+       private Event<ObservableHelperCreatedUserEvent> userCreatedEvent;
+
+       /**
+        * Event for when a fax number instance was created
+        */
+       @Any
+       @Inject
+       private Event<ObservableHelperCreatedFaxNumberEvent> faxNumberCreatedEvent;
+
+       /**
+        * Event for when a land-line number instance was created
+        */
+       @Any
+       @Inject
+       private Event<ObservableHelperCreatedLandLineNumberEvent> landLineNumberCreatedEvent;
+
+       /**
+        * Event for when a mobile number instance was created
+        */
+       @Any
+       @Inject
+       private Event<ObservableHelperCreatedMobileNumberEvent> mobileNumberCreatedEvent;
+
        /**
         * Default constructor
         */
@@ -139,40 +177,38 @@ public class JobsWebRequestHelperBean extends BaseJobsController implements Jobs
                // Validate fax instance
                if (this.getFaxNumber() == null) {
                        // Throw NPE
-                       throw new NullPointerException("this.faxNumber is null");
+                       throw new NullPointerException("this.faxNumber is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneId() == null) {
                        // Throw again
-                       throw new NullPointerException("this.faxNumber.phoneId is null");
+                       throw new NullPointerException("this.faxNumber.phoneId is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneId() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneId={0} is not valid", this.getFaxNumber().getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneId={0} is not valid", this.getFaxNumber().getPhoneId())); //NOI18N
                } else if (this.getFaxNumber().getPhoneAreaCode() == null) {
                        // Throw again
-                       throw new NullPointerException("this.faxNumber.phoneAreaCode is null");
+                       throw new NullPointerException("this.faxNumber.phoneAreaCode is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneAreaCode() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
                } else if (this.getFaxNumber().getPhoneCountry() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.faxNumber.phoneCountry is null");
+                       throw new NullPointerException("this.faxNumber.phoneCountry is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneCountry().getCountryId() == null) {
                        // ... throw again
-                       throw new NullPointerException("this.faxNumber.phoneCountry.countryId is null");
+                       throw new NullPointerException("this.faxNumber.phoneCountry.countryId is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneCountry().getCountryId() < 1) {
                        // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneCountry.countryId={0} is invalid", this.getFaxNumber().getPhoneCountry().getCountryId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneCountry.countryId={0} is invalid", this.getFaxNumber().getPhoneCountry().getCountryId())); //NOI18N
                } else if (this.getFaxNumber().getPhoneNumber() == null) {
                        // Throw NPE again ...
-                       throw new NullPointerException("this.faxNumber.phoneNumber is null");
+                       throw new NullPointerException("this.faxNumber.phoneNumber is null"); //NOI18N
                } else if (this.getFaxNumber().getPhoneNumber() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneNumber={0} is not valid", this.getFaxNumber().getPhoneNumber()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.faxNumber.phoneNumber={0} is not valid", this.getFaxNumber().getPhoneNumber())); //NOI18N
                }
 
-               // Copy all (changeable) data fields to admin controller
-               this.adminPhoneController.setPhoneAreaCode(this.getFaxNumber().getPhoneAreaCode());
-               this.adminPhoneController.setPhoneCountry(this.getFaxNumber().getPhoneCountry());
-               this.adminPhoneController.setPhoneNumber(this.getFaxNumber().getPhoneNumber());
+               // Fire event
+               this.faxNumberCreatedEvent.fire(new HelperCreatedFaxNumberEvent(this.getFaxNumber()));
        }
 
        @Override
@@ -180,40 +216,38 @@ public class JobsWebRequestHelperBean extends BaseJobsController implements Jobs
                // Validate land-line instance
                if (this.getLandLineNumber() == null) {
                        // Throw NPE
-                       throw new NullPointerException("this.landLineNumber is null");
+                       throw new NullPointerException("this.landLineNumber is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneId() == null) {
                        // Throw again
-                       throw new NullPointerException("this.landLineNumber.phoneId is null");
+                       throw new NullPointerException("this.landLineNumber.phoneId is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneId() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneId={0} is not valid", this.getLandLineNumber().getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneId={0} is not valid", this.getLandLineNumber().getPhoneId())); //NOI18N
                } else if (this.getLandLineNumber().getPhoneAreaCode() == null) {
                        // Throw again
-                       throw new NullPointerException("this.landLineNumber.phoneAreaCode is null");
+                       throw new NullPointerException("this.landLineNumber.phoneAreaCode is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneAreaCode() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneAreaCode={0} is not valid", this.getFaxNumber().getPhoneAreaCode())); //NOI18N
                } else if (this.getLandLineNumber().getPhoneCountry() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.landLineNumber.phoneCountry is null");
+                       throw new NullPointerException("this.landLineNumber.phoneCountry is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() == null) {
                        // ... throw again
-                       throw new NullPointerException("this.landLineNumber.phoneCountry.countryId is null");
+                       throw new NullPointerException("this.landLineNumber.phoneCountry.countryId is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneCountry().getCountryId() < 1) {
                        // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneCountry.countryId={0} is invalid", this.getLandLineNumber().getPhoneCountry().getCountryId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneCountry.countryId={0} is invalid", this.getLandLineNumber().getPhoneCountry().getCountryId())); //NOI18N
                } else if (this.getLandLineNumber().getPhoneNumber() == null) {
                        // Throw NPE again ...
-                       throw new NullPointerException("this.landLineNumber.phoneNumber is null");
+                       throw new NullPointerException("this.landLineNumber.phoneNumber is null"); //NOI18N
                } else if (this.getLandLineNumber().getPhoneNumber() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneNumber={0} is not valid", this.getLandLineNumber().getPhoneNumber()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.landLineNumber.phoneNumber={0} is not valid", this.getLandLineNumber().getPhoneNumber())); //NOI18N
                }
 
-               // Copy all (changeable) data fields to admin controller
-               this.adminPhoneController.setPhoneAreaCode(this.getLandLineNumber().getPhoneAreaCode());
-               this.adminPhoneController.setPhoneCountry(this.getLandLineNumber().getPhoneCountry());
-               this.adminPhoneController.setPhoneNumber(this.getLandLineNumber().getPhoneNumber());
+               // Fire event
+               this.landLineNumberCreatedEvent.fire(new HelperCreatedLandLineNumberEvent(this.getLandLineNumber()));
        }
 
        @Override
@@ -221,33 +255,32 @@ public class JobsWebRequestHelperBean extends BaseJobsController implements Jobs
                // Validate mobile instance
                if (this.getMobileNumber() == null) {
                        // Throw NPE
-                       throw new NullPointerException("this.mobileNumber is null");
+                       throw new NullPointerException("this.mobileNumber is null"); //NOI18N
                } else if (this.getMobileNumber().getPhoneId() == null) {
                        // Throw again
-                       throw new NullPointerException("this.mobileNumber.phoneId is null");
+                       throw new NullPointerException("this.mobileNumber.phoneId is null"); //NOI18N
                } else if (this.getMobileNumber().getPhoneId() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneId={0} is not valid", this.getMobileNumber().getPhoneId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneId={0} is not valid", this.getMobileNumber().getPhoneId())); //NOI18N
                } else if (this.getMobileNumber().getMobileProvider() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("this.mobileNumber.mobileProvider is null");
+                       throw new NullPointerException("this.mobileNumber.mobileProvider is null"); //NOI18N
                } else if (this.getMobileNumber().getMobileProvider().getProviderId() == null) {
                        // ... throw again
-                       throw new NullPointerException("this.mobileNumber.mobileProvider.providerId is null");
+                       throw new NullPointerException("this.mobileNumber.mobileProvider.providerId is null"); //NOI18N
                } else if (this.getMobileNumber().getMobileProvider().getProviderId() < 1) {
                        // Invalid id
-                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.mobileProvider.providerId={0} is invalid", this.getMobileNumber().getMobileProvider().getProviderId()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.mobileProvider.providerId={0} is invalid", this.getMobileNumber().getMobileProvider().getProviderId())); //NOI18N
                } else if (this.getMobileNumber().getPhoneNumber() == null) {
                        // Throw NPE again ...
-                       throw new NullPointerException("this.mobileNumber.phoneNumber is null");
+                       throw new NullPointerException("this.mobileNumber.phoneNumber is null"); //NOI18N
                } else if (this.getMobileNumber().getPhoneNumber() < 1) {
                        // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneNumber={0} is not valid", this.getMobileNumber().getPhoneNumber()));
+                       throw new IllegalArgumentException(MessageFormat.format("this.mobileNumber.phoneNumber={0} is not valid", this.getMobileNumber().getPhoneNumber())); //NOI18N
                }
 
-               // Copy all (changeable) data fields to admin controller
-               this.adminPhoneController.setMobileProvider(this.getMobileNumber().getMobileProvider());
-               this.adminPhoneController.setPhoneNumber(this.getMobileNumber().getPhoneNumber());
+               // Fire event
+               this.mobileNumberCreatedEvent.fire(new HelperCreatedMobileNumberEvent(this.getMobileNumber()));
        }
 
        @Override
@@ -276,9 +309,8 @@ public class JobsWebRequestHelperBean extends BaseJobsController implements Jobs
                // Set all phone instances
                this.setPhoneInstances(userContact);
 
-               // Set all fields: user
-               this.userController.setUserName(this.getUser().getUserName());
-               this.adminUserController.setUserName(this.getUser().getUserName());
+               // Fire event
+               this.userCreatedEvent.fire(new HelperCreatedUserEvent(this.getUser()));
        }
 
        @Override
index 77c9c8b675b5c3b1458ee0bf614479968af66656..4dab41b380939690eb0a4b5509bfa3c5d334de86 100644 (file)
@@ -104,7 +104,15 @@ public abstract class JobsAdminMobileProviderWebRequestBean extends BaseJobsCont
                super();
        }
 
-       @Override
+       /**
+        * Adds a mobile provider to database by calling the EJB. A pre-check on
+        * dial-prefix and country combination is done, if found, an exception is
+        * thrown. A redirect should take place after successfull creation.
+        * <p>
+        * @return Redirect outcome
+        * <p>
+        * @todo Add field validation
+        */
        public String addMobileProvider () {
                // Create mobile provider
                MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
@@ -134,42 +142,74 @@ public abstract class JobsAdminMobileProviderWebRequestBean extends BaseJobsCont
                return "admin_list_mobile_provider"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for country instance ('s dial data)
+        * <p>
+        * @return Country instance
+        */
        public Country getProviderCountry () {
                return this.providerCountry;
        }
 
-       @Override
+       /**
+        * Setter for country instance ('s dial data)
+        * <p>
+        * @param providerCountry Country instance
+        */
        public void setProviderCountry (final Country providerCountry) {
                this.providerCountry = providerCountry;
        }
 
-       @Override
+       /**
+        * Getter for provider dial prefix
+        * <p>
+        * @return Provider dial prefix
+        */
        public Long getProviderDialPrefix () {
                return this.providerDialPrefix;
        }
 
-       @Override
+       /**
+        * Setter for provider dial prefix
+        * <p>
+        * @param providerDialPrefix Provider dial prefix
+        */
        public void setProviderDialPrefix (final Long providerDialPrefix) {
                this.providerDialPrefix = providerDialPrefix;
        }
 
-       @Override
+       /**
+        * Getter for pattern for mail gateway
+        * <p>
+        * @return Pattern for mail gateway
+        */
        public String getProviderMailPattern () {
                return this.providerMailPattern;
        }
 
-       @Override
+       /**
+        * Setter for pattern for mail gateway
+        * <p>
+        * @param providerMailPattern Pattern for mail gateway
+        */
        public void setProviderMailPattern (final String providerMailPattern) {
                this.providerMailPattern = providerMailPattern;
        }
 
-       @Override
+       /**
+        * Getter for provider name
+        * <p>
+        * @return Provider name
+        */
        public String getProviderName () {
                return this.providerName;
        }
 
-       @Override
+       /**
+        * Setter for provider name
+        * <p>
+        * @param providerName Provider name
+        */
        public void setProviderName (final String providerName) {
                this.providerName = providerName;
        }
index f6032b206927d64ff33d8b04997733833c527cb1..5535088d36f441a8d5483a01a5250baf70f5ce90 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.mobileprovider;
 
 import java.io.Serializable;
-import org.mxchange.jcountry.data.Country;
 
 /**
  * An interface for a request web controller (bean) for administrative mobile
@@ -27,69 +26,4 @@ import org.mxchange.jcountry.data.Country;
  */
 public interface JobsAdminMobileProviderWebRequestController extends Serializable {
 
-       /**
-        * Adds a mobile provider to database by calling the EJB. A pre-check on
-        * dial-prefix and country combination is done, if found, an exception is
-        * thrown. A redirect should take place after successfull creation.
-        * <p>
-        * @return Redirect outcome
-        */
-       String addMobileProvider ();
-
-       /**
-        * Getter for provider dial prefix
-        * <p>
-        * @return Provider dial prefix
-        */
-       Long getProviderDialPrefix ();
-
-       /**
-        * Setter for provider dial prefix
-        * <p>
-        * @param providerDialPrefix Provider dial prefix
-        */
-       void setProviderDialPrefix (final Long providerDialPrefix);
-
-       /**
-        * Getter for provider name
-        * <p>
-        * @return Provider name
-        */
-       String getProviderName ();
-
-       /**
-        * Setter for provider name
-        * <p>
-        * @param providerName Provider name
-        */
-       void setProviderName (final String providerName);
-
-       /**
-        * Getter for country instance ('s dial data)
-        * <p>
-        * @return Country instance
-        */
-       Country getProviderCountry ();
-
-       /**
-        * Setter for country instance ('s dial data)
-        * <p>
-        * @param country Country instance
-        */
-       void setProviderCountry (final Country country);
-
-       /**
-        * Getter for pattern for mail gateway
-        * <p>
-        * @return Pattern for mail gateway
-        */
-       String getProviderMailPattern ();
-
-       /**
-        * Setter for pattern for mail gateway
-        * <p>
-        * @param providerMailPattern Pattern for mail gateway
-        */
-       void setProviderMailPattern (final String providerMailPattern);
-
 }
index 79fd461296e0dd10a3227bcf55db339d53780264..dc89c8dcecbe52dd73c83b6e6859a78192f791de 100644 (file)
@@ -96,7 +96,6 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
         */
        private DialableFaxNumber faxNumber;
 
-
        /**
         * Event being fired when an administrator has deleted fax number
         */
@@ -110,6 +109,7 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
        @Inject
        @Any
        private Event<AdminUpdatedFaxNumberEvent> faxNumberUpdatedEvent;
+
        /**
         * land-line number
         */
@@ -128,8 +128,9 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
        @Inject
        @Any
        private Event<AdminUpdatedLandLineNumberEvent> landLineNumberUpdatedEvent;
+
        /**
-        * mobile number
+        * Chosen mobile number
         */
        private DialableMobileNumber mobileNumber;
 
@@ -207,7 +208,11 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                // System.out.println(MessageFormat.format("{0}: Constructed, caller: {1}", this.getClass().getSimpleName(), caller));
        }
 
-       @Override
+       /**
+        * Returns a list of all unused ("non-linked") land-line numbers
+        * <p>
+        * @return List with all unused land-line numbers
+        */
        public List<DialableFaxNumber> allNonLinkedFaxNumbers () {
                // Get list of all mobile numbers
                List<DialableFaxNumber> list = this.phoneController.allFaxNumbers();
@@ -219,7 +224,11 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return list;
        }
 
-       @Override
+       /**
+        * Returns a list of all unused ("non-linked") land-line numbers
+        * <p>
+        * @return List with all unused land-line numbers
+        */
        public List<DialableLandLineNumber> allNonLinkedLandLineNumbers () {
                // Get list of all mobile numbers
                List<DialableLandLineNumber> list = this.phoneController.allLandLineNumbers();
@@ -231,7 +240,11 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return list;
        }
 
-       @Override
+       /**
+        * Returns a list of all unused ("non-linked") mobile numbers
+        * <p>
+        * @return List with all unused mobile numbers
+        */
        public List<DialableMobileNumber> allNonLinkedMobileNumbers () {
                // Get list of all mobile numbers
                List<DialableMobileNumber> list = this.phoneController.allMobileNumbers();
@@ -243,172 +256,200 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return list;
        }
 
-       @Override
-       public String deleteFaxData (final DialableFaxNumber faxNumber) {
+       /**
+        * Deletes given fax entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String deleteFaxData () {
+               // Get fax number from bean helper
+               DialableFaxNumber number = this.beanHelper.getFaxNumber();
+
                // Is all data set
-               if (faxNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("faxNumber is null"); //NOI18N
-               } else if (faxNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("faxNumber.phoneId is null"); //NOI18N
-               } else if (faxNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid", faxNumber.getPhoneId())); //NOI18N
-               } else if (faxNumber.getPhoneCountry() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getPhoneCountry() == null) {
                        // Throw NPE
                        throw new NullPointerException("faxNumber.phoneCountry is null"); //NOI18N
-               } else if (faxNumber.getPhoneCountry().getCountryId() == null) {
+               } else if (number.getPhoneCountry().getCountryId() == null) {
                        // Throw NPE
                        throw new NullPointerException("faxNumber.phoneCountry.countryId is null"); //NOI18N
-               } else if (faxNumber.getPhoneCountry().getCountryId() < 1) {
+               } else if (number.getPhoneCountry().getCountryId() < 1) {
                        // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneCountry.countryId={0} is not valid", faxNumber.getPhoneCountry().getCountryId())); //NOI18N
-               } else if (faxNumber.getPhoneAreaCode() == null) {
+                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneCountry.countryId={0} is not valid", number.getPhoneCountry().getCountryId())); //NOI18N
+               } else if (number.getPhoneAreaCode() == null) {
                        // ... throw again
                        throw new NullPointerException("faxNumber.phoneAreaCode is null"); //NOI18N
-               } else if (faxNumber.getPhoneAreaCode() < 1) {
+               } else if (number.getPhoneAreaCode() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid.", faxNumber.getPhoneAreaCode())); //NOI18N
-               } else if (faxNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid.", number.getPhoneAreaCode())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("faxNumber.phoneNumber is null"); //NOI18N
-               } else if (faxNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid.", faxNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                }
 
                // Call EJB
-               this.adminPhoneBean.deleteFaxData(faxNumber);
+               this.adminPhoneBean.deleteFaxData(number);
 
                // Fire event
-               this.faxNumberDeletedEvent.fire(new AdminFaxNumberDeletedEvent(faxNumber));
+               this.faxNumberDeletedEvent.fire(new AdminFaxNumberDeletedEvent(number));
 
                // All fine, redirect
                return "admin_list_fax"; //NOI18N
        }
 
-       @Override
-       public String deleteLandLineData (final DialableLandLineNumber landLineNumber) {
+       /**
+        * Deletes given land-line entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String deleteLandLineData () {
+               // Get land-line number from helper
+               DialableLandLineNumber number = this.beanHelper.getLandLineNumber();
+
                // Is all data set
-               if (landLineNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("landLineNumber is null"); //NOI18N
-               } else if (landLineNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
-               } else if (landLineNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", landLineNumber.getPhoneId())); //NOI18N
-               } else if (landLineNumber.getPhoneCountry() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getPhoneCountry() == null) {
                        // Throw NPE
                        throw new NullPointerException("landLineNumber.phoneCountry is null"); //NOI18N
-               } else if (landLineNumber.getPhoneCountry().getCountryId() == null) {
+               } else if (number.getPhoneCountry().getCountryId() == null) {
                        // Throw NPE
                        throw new NullPointerException("landLineNumber.phoneCountry.countryId is null"); //NOI18N
-               } else if (landLineNumber.getPhoneCountry().getCountryId() < 1) {
+               } else if (number.getPhoneCountry().getCountryId() < 1) {
                        // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneCountry.countryId={0} is not valid", landLineNumber.getPhoneCountry().getCountryId())); //NOI18N
-               } else if (landLineNumber.getPhoneAreaCode() == null) {
+                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneCountry.countryId={0} is not valid", number.getPhoneCountry().getCountryId())); //NOI18N
+               } else if (number.getPhoneAreaCode() == null) {
                        // ... throw again
                        throw new NullPointerException("landLineNumber.phoneAreaCode is null"); //NOI18N
-               } else if (landLineNumber.getPhoneAreaCode() < 1) {
+               } else if (number.getPhoneAreaCode() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid.", landLineNumber.getPhoneAreaCode())); //NOI18N
-               } else if (landLineNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid.", number.getPhoneAreaCode())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("landLineNumber.phoneNumber is null"); //NOI18N
-               } else if (landLineNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid.", landLineNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                }
 
                // Call EJB
-               this.adminPhoneBean.deleteLandLineData(landLineNumber);
+               this.adminPhoneBean.deleteLandLineData(number);
 
                // Fire event
-               this.landLineNumberDeletedEvent.fire(new AdminLandLineNumberDeletedEvent(landLineNumber));
+               this.landLineNumberDeletedEvent.fire(new AdminLandLineNumberDeletedEvent(number));
 
                // All fine, redirect
                return "admin_list_landline"; //NOI18N
        }
 
-       @Override
-       public String deleteMobileData (final DialableMobileNumber mobileNumber) {
+       /**
+        * Deletes given mobile entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String deleteMobileData () {
+               // Get mobile number from helper
+               DialableMobileNumber number = this.beanHelper.getMobileNumber();
+
                // Is all data set
-               if (mobileNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
-               } else if (mobileNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
-               } else if (mobileNumber.getMobileProvider() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getMobileProvider() == null) {
                        // Throw NPE
                        throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
+               } else if (number.getMobileProvider().getProviderId() == null) {
                        // ... throw again
                        throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
+               } else if (number.getMobileProvider().getProviderId() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
-               } else if (mobileNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", number.getMobileProvider().getProviderId())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("mobileNumber.phoneNumber is null"); //NOI18N
-               } else if (mobileNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", mobileNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                }
 
                // Call EJB
-               this.adminPhoneBean.deleteMobileData(mobileNumber);
+               this.adminPhoneBean.deleteMobileData(number);
 
                // Fire event
-               this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(mobileNumber));
+               this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(number));
 
                // All fine, redirect
                return "admin_list_mobile"; //NOI18N
        }
 
-       @Override
-       public String editFaxData (final DialableFaxNumber faxNumber) {
+       /**
+        * Changes fax entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doChangeFaxNumber () {
+               // Get fax number from bean helper
+               DialableFaxNumber number = this.beanHelper.getFaxNumber();
+
                // Is all data set
-               if (faxNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("faxNumber is null"); //NOI18N
-               } else if (faxNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("faxNumber.phoneId is null"); //NOI18N
-               } else if (faxNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid", faxNumber.getPhoneId())); //NOI18N
-               } else if (faxNumber.getPhoneCountry() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getPhoneCountry() == null) {
                        // Throw NPE
                        throw new NullPointerException("faxNumber.phoneCountry is null"); //NOI18N
-               } else if (faxNumber.getPhoneCountry().getCountryId() == null) {
+               } else if (number.getPhoneCountry().getCountryId() == null) {
                        // Throw NPE
                        throw new NullPointerException("faxNumber.phoneCountry.countryId is null"); //NOI18N
-               } else if (faxNumber.getPhoneCountry().getCountryId() < 1) {
+               } else if (number.getPhoneCountry().getCountryId() < 1) {
                        // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneCountry.countryId={0} is not valid", faxNumber.getPhoneCountry().getCountryId())); //NOI18N
-               } else if (faxNumber.getPhoneAreaCode() == null) {
+                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneCountry.countryId={0} is not valid", number.getPhoneCountry().getCountryId())); //NOI18N
+               } else if (number.getPhoneAreaCode() == null) {
                        // ... throw again
                        throw new NullPointerException("faxNumber.phoneAreaCode is null"); //NOI18N
-               } else if (faxNumber.getPhoneAreaCode() < 1) {
+               } else if (number.getPhoneAreaCode() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid.", faxNumber.getPhoneAreaCode())); //NOI18N
-               } else if (faxNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneAreaCode={0} is not valid.", number.getPhoneAreaCode())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("faxNumber.phoneNumber is null"); //NOI18N
-               } else if (faxNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid.", faxNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("faxNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                }
 
                // Is the mobile provider and number the same?
-               if ((Objects.equals(this.getPhoneCountry(), faxNumber.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), faxNumber.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), faxNumber.getPhoneNumber()))) {
+               if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
                        this.showFacesMessage("form_edit_fax:faxNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -417,12 +458,12 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                }
 
                // Set all data
-               faxNumber.setPhoneCountry(this.getPhoneCountry());
-               faxNumber.setPhoneAreaCode(this.getPhoneAreaCode());
-               faxNumber.setPhoneNumber(this.getPhoneNumber());
+               number.setPhoneCountry(this.getPhoneCountry());
+               number.setPhoneAreaCode(this.getPhoneAreaCode());
+               number.setPhoneNumber(this.getPhoneNumber());
 
                // Send to bean
-               DialableFaxNumber updatedNumber = this.adminPhoneBean.updateFaxData(faxNumber);
+               DialableFaxNumber updatedNumber = this.adminPhoneBean.updateFaxData(number);
 
                // Fire event
                this.faxNumberUpdatedEvent.fire(new AdminFaxNumberUpdatedEvent(updatedNumber));
@@ -431,43 +472,50 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return "admin_show_fax"; //NOI18N
        }
 
-       @Override
-       public String editLandLineData (final DialableLandLineNumber landLineNumber) {
+       /**
+        * Changes land-line entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doChangeLandLineNumber () {
+               // Get land-line number from helper
+               DialableLandLineNumber number = this.beanHelper.getLandLineNumber();
+
                // Is all data set
-               if (landLineNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("landLineNumber is null"); //NOI18N
-               } else if (landLineNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
-               } else if (landLineNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", landLineNumber.getPhoneId())); //NOI18N
-               } else if (landLineNumber.getPhoneCountry() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getPhoneCountry() == null) {
                        // Throw NPE
                        throw new NullPointerException("landLineNumber.phoneCountry is null"); //NOI18N
-               } else if (landLineNumber.getPhoneCountry().getCountryId() == null) {
+               } else if (number.getPhoneCountry().getCountryId() == null) {
                        // Throw NPE
                        throw new NullPointerException("landLineNumber.phoneCountry.countryId is null"); //NOI18N
-               } else if (landLineNumber.getPhoneCountry().getCountryId() < 1) {
+               } else if (number.getPhoneCountry().getCountryId() < 1) {
                        // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneCountry.countryId={0} is not valid", landLineNumber.getPhoneCountry().getCountryId())); //NOI18N
-               } else if (landLineNumber.getPhoneAreaCode() == null) {
+                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneCountry.countryId={0} is not valid", number.getPhoneCountry().getCountryId())); //NOI18N
+               } else if (number.getPhoneAreaCode() == null) {
                        // ... throw again
                        throw new NullPointerException("landLineNumber.phoneAreaCode is null"); //NOI18N
-               } else if (landLineNumber.getPhoneAreaCode() < 1) {
+               } else if (number.getPhoneAreaCode() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid.", landLineNumber.getPhoneAreaCode())); //NOI18N
-               } else if (landLineNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneAreaCode={0} is not valid.", number.getPhoneAreaCode())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("landLineNumber.phoneNumber is null"); //NOI18N
-               } else if (landLineNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid.", landLineNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("landLineNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                }
 
                // Is the mobile provider and number the same?
-               if ((Objects.equals(this.getPhoneCountry(), landLineNumber.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), landLineNumber.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), landLineNumber.getPhoneNumber()))) {
+               if ((Objects.equals(this.getPhoneCountry(), number.getPhoneCountry())) && (Objects.equals(this.getPhoneAreaCode(), number.getPhoneAreaCode())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
                        this.showFacesMessage("form_edit_landline:landLineNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -476,12 +524,12 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                }
 
                // Set all data
-               landLineNumber.setPhoneCountry(this.getPhoneCountry());
-               landLineNumber.setPhoneAreaCode(this.getPhoneAreaCode());
-               landLineNumber.setPhoneNumber(this.getPhoneNumber());
+               number.setPhoneCountry(this.getPhoneCountry());
+               number.setPhoneAreaCode(this.getPhoneAreaCode());
+               number.setPhoneNumber(this.getPhoneNumber());
 
                // Send to bean
-               DialableLandLineNumber updatedNumber = this.adminPhoneBean.updateLandLineData(landLineNumber);
+               DialableLandLineNumber updatedNumber = this.adminPhoneBean.updateLandLineData(number);
 
                // Fire event
                this.landLineNumberUpdatedEvent.fire(new AdminLandLineNumberUpdatedEvent(updatedNumber));
@@ -490,33 +538,40 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return "admin_show_landline"; //NOI18N
        }
 
-       @Override
-       public String editMobileData (final DialableMobileNumber mobileNumber) {
+       /**
+        * Changes mobile entry data
+        * <p>
+        * @return Redirect outcome
+        */
+       public String doUpdateMobileNumber () {
+               // Get mobile number from helper
+               DialableMobileNumber number = this.beanHelper.getMobileNumber();
+
                // Is all data set
-               if (mobileNumber == null) {
+               if (number == null) {
                        // Not set, throw NPE
                        throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getPhoneId() == null) {
+               } else if (number.getPhoneId() == null) {
                        // Throw NPE again
                        throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
-               } else if (mobileNumber.getPhoneId() < 1) {
+               } else if (number.getPhoneId() < 1) {
                        // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
-               } else if (mobileNumber.getMobileProvider() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", number.getPhoneId())); //NOI18N
+               } else if (number.getMobileProvider() == null) {
                        // Throw NPE
                        throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
+               } else if (number.getMobileProvider().getProviderId() == null) {
                        // ... throw again
                        throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
+               } else if (number.getMobileProvider().getProviderId() < 1) {
                        // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
-               } else if (mobileNumber.getPhoneNumber() == null) {
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", number.getMobileProvider().getProviderId())); //NOI18N
+               } else if (number.getPhoneNumber() == null) {
                        // Throw NPE again
                        throw new NullPointerException("mobileNumber.phoneNumber is null"); //NOI18N
-               } else if (mobileNumber.getPhoneNumber() < 1) {
+               } else if (number.getPhoneNumber() < 1) {
                        // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", mobileNumber.getPhoneNumber())); //NOI18N
+                       throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", number.getPhoneNumber())); //NOI18N
                } else if (this.getMobileProvider() == null) {
                        // Not provided
                        this.showFacesMessage("form_edit_mobile:mobileProvider", "ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED"); //NOI18N
@@ -534,7 +589,7 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                }
 
                // Is the mobile provider and number the same?
-               if ((Objects.equals(this.getMobileProvider(), mobileNumber.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), mobileNumber.getPhoneNumber()))) {
+               if ((Objects.equals(this.getMobileProvider(), number.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), number.getPhoneNumber()))) {
                        // Show message
                        this.showFacesMessage("form_edit_mobile:mobileNumber", "ERROR_ADMIN_NO_CHANGE_ENTERED"); //NOI18N
 
@@ -543,11 +598,11 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                }
 
                // Set all data
-               mobileNumber.setMobileProvider(this.getMobileProvider());
-               mobileNumber.setPhoneNumber(this.getPhoneNumber());
+               number.setMobileProvider(this.getMobileProvider());
+               number.setPhoneNumber(this.getPhoneNumber());
 
                // Send to bean
-               DialableMobileNumber updatedNumber = this.adminPhoneBean.updateMobileData(mobileNumber);
+               DialableMobileNumber updatedNumber = this.adminPhoneBean.updateMobileData(number);
 
                // Fire event
                this.mobileNumberUpdatedEvent.fire(new AdminMobileNumberUpdatedEvent(updatedNumber));
@@ -556,76 +611,128 @@ public abstract class JobsAdminPhoneWebRequestBean extends BaseJobsController im
                return "admin_show_mobile"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for chosen fax number
+        * <p>
+        * @return fax number
+        */
        public DialableFaxNumber getFaxNumber () {
-               // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
-               // System.out.println(MessageFormat.format("{0}: Returning this.faxNumber={1}, caller: {2}", this.getClass().getSimpleName(), this.faxNumber, caller));
                return this.faxNumber;
        }
 
-       @Override
+       /**
+        * Setter for chosen fax number
+        * <p>
+        * @param faxNumber fax number
+        */
        public void setFaxNumber (final DialableFaxNumber faxNumber) {
-               // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[THREAD_STACK].getClassName(), Thread.currentThread().getStackTrace()[THREAD_STACK].getMethodName());
-               // System.out.println(MessageFormat.format("{0}: Settin faxNumber={1}, previous: this.faxNumber={2}, caller: {3}", this.getClass().getSimpleName(), faxNumber, this.faxNumber, caller));
                this.faxNumber = faxNumber;
        }
 
-       @Override
+       /**
+        * Getter for chosen land-line number
+        * <p>
+        * @return land-line number
+        */
        public DialableLandLineNumber getLandLineNumber () {
                return this.landLineNumber;
        }
 
-       @Override
+       /**
+        * Setter for chosen land-line number
+        * <p>
+        * @param landLineNumber land-line number
+        */
        public void setLandLineNumber (final DialableLandLineNumber landLineNumber) {
                this.landLineNumber = landLineNumber;
        }
 
-       @Override
+       /**
+        * Getter for chosen mobile number
+        * <p>
+        * @return mobile number
+        */
        public DialableMobileNumber getMobileNumber () {
                return this.mobileNumber;
        }
 
-       @Override
+       /**
+        * Setter for chosen mobile number
+        * <p>
+        * @param mobileNumber mobile number
+        */
        public void setMobileNumber (final DialableMobileNumber mobileNumber) {
                this.mobileNumber = mobileNumber;
        }
 
-       @Override
+       /**
+        * Getter for mobile provider
+        * <p>
+        * @return Mobile provider
+        */
        public MobileProvider getMobileProvider () {
                return this.mobileProvider;
        }
 
-       @Override
+       /**
+        * Setter for mobile provider
+        * <p>
+        * @param mobileProvider Mobile provider
+        */
        public void setMobileProvider (final MobileProvider mobileProvider) {
                this.mobileProvider = mobileProvider;
        }
 
-       @Override
+       /**
+        * Getter for phone area code
+        * <p>
+        * @return Phone area code
+        */
        public Integer getPhoneAreaCode () {
                return this.phoneAreaCode;
        }
 
-       @Override
+       /**
+        * Setter for phone area code
+        * <p>
+        * @param phoneAreaCode Phone area code
+        */
        public void setPhoneAreaCode (final Integer phoneAreaCode) {
                this.phoneAreaCode = phoneAreaCode;
        }
 
-       @Override
+       /**
+        * Getter for phone country (for dial prefix)
+        * <p>
+        * @return Phone country
+        */
        public Country getPhoneCountry () {
                return this.phoneCountry;
        }
 
-       @Override
+       /**
+        * Setter for phone country (for dial prefix)
+        * <p>
+        * @param phoneCountry Phone country
+        */
        public void setPhoneCountry (final Country phoneCountry) {
                this.phoneCountry = phoneCountry;
        }
 
-       @Override
+       /**
+        * Getter for dial number without prefix
+        * <p>
+        * @return Dial number without prefix
+        */
        public Long getPhoneNumber () {
                return this.phoneNumber;
        }
 
-       @Override
+       /**
+        * Setter for dial number without prefix
+        * <p>
+        * @param phoneNumber Dial number without prefix
+        */
        public void setPhoneNumber (final Long phoneNumber) {
                this.phoneNumber = phoneNumber;
        }
index 16986987416b750c5a9509ebbc8a6812b6605039..8e22d2d041fe34be4a2f1b57fdd6120441a44921 100644 (file)
 package org.mxchange.jjobs.beans.phone;
 
 import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Local;
-import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
  * An interface for a request web controller (bean) for administrative phone
@@ -31,180 +24,6 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsAdminPhoneWebRequestController extends Serializable {
 
-       /**
-        * Returns a list of all unused ("non-linked") mobile numbers
-        * <p>
-        * @return List with all unused mobile numbers
-        */
-       List<DialableMobileNumber> allNonLinkedMobileNumbers ();
-
-       /**
-        * Returns a list of all unused ("non-linked") land-line numbers
-        * <p>
-        * @return List with all unused land-line numbers
-        */
-       List<DialableFaxNumber> allNonLinkedFaxNumbers ();
-
-       /**
-        * Returns a list of all unused ("non-linked") land-line numbers
-        * <p>
-        * @return List with all unused land-line numbers
-        */
-       List<DialableLandLineNumber> allNonLinkedLandLineNumbers ();
-
-       /**
-        * Deletes given fax entry data
-        * <p>
-        * @param faxNumber Fax number to delete
-        * <p>
-        * @return Redirect outcome
-        */
-       String deleteFaxData (final DialableFaxNumber faxNumber);
-
-       /**
-        * Changes fax entry data
-        * <p>
-        * @param faxNumber Fax number to change data
-        * <p>
-        * @return Redirect outcome
-        */
-       String editFaxData (final DialableFaxNumber faxNumber);
-
-       /**
-        * Deletes given land-line entry data
-        * <p>
-        * @param landLineNumber Land-line number to delete
-        * <p>
-        * @return Redirect outcome
-        */
-       String deleteLandLineData (final DialableLandLineNumber landLineNumber);
-
-       /**
-        * Changes land-line entry data
-        * <p>
-        * @param landLineNumber Land-line number to change data
-        * <p>
-        * @return Redirect outcome
-        */
-       String editLandLineData (final DialableLandLineNumber landLineNumber);
-
-       /**
-        * Deletes given mobile entry data
-        * <p>
-        * @param mobileNumber Mobile number to delete
-        * <p>
-        * @return Redirect outcome
-        */
-       String deleteMobileData (final DialableMobileNumber mobileNumber);
-
-       /**
-        * Changes mobile entry data
-        * <p>
-        * @param mobileNumber Mobile number to change data
-        * <p>
-        * @return Redirect outcome
-        */
-       String editMobileData (final DialableMobileNumber mobileNumber);
-
-       /**
-        * Getter for mobile provider
-        * <p>
-        * @return Mobile provider
-        */
-       MobileProvider getMobileProvider ();
-
-       /**
-        * Setter for mobile provider
-        * <p>
-        * @param mobileProvider Mobile provider
-        */
-       void setMobileProvider (final MobileProvider mobileProvider);
-
-       /**
-        * Getter for choosen fax number
-        * <p>
-        * @return fax number
-        */
-       DialableFaxNumber getFaxNumber ();
-
-       /**
-        * Setter for choosen fax number
-        * <p>
-        * @param faxNumber fax number
-        */
-       void setFaxNumber (final DialableFaxNumber faxNumber);
-
-       /**
-        * Getter for choosen land-line number
-        * <p>
-        * @return land-line number
-        */
-       DialableLandLineNumber getLandLineNumber ();
-
-       /**
-        * Setter for choosen land-line number
-        * <p>
-        * @param landLineNumber land-line number
-        */
-       void setLandLineNumber (final DialableLandLineNumber landLineNumber);
-
-       /**
-        * Getter for choosen mobile number
-        * <p>
-        * @return mobile number
-        */
-       DialableMobileNumber getMobileNumber ();
-
-       /**
-        * Setter for choosen mobile number
-        * <p>
-        * @param mobileNumber mobile number
-        */
-       void setMobileNumber (final DialableMobileNumber mobileNumber);
-
-       /**
-        * Getter for phone area code
-        * <p>
-        * @return Phone area code
-        */
-       Integer getPhoneAreaCode ();
-
-       /**
-        * Setter for phone area code
-        * <p>
-        * @param phoneAreaCode Phone area code
-        */
-       void setPhoneAreaCode (final Integer phoneAreaCode);
-
-       /**
-        * Getter for phone country (for dial prefix)
-        * <p>
-        * @return Phone country
-        */
-       Country getPhoneCountry ();
-
-       /**
-        * Setter for phone country (for dial prefix)
-        * <p>
-        * @param phoneCountry Phone country
-        */
-       void setPhoneCountry (final Country phoneCountry);
-
-       /**
-        * Getter for dial number without prefix
-        * <p>
-        * @return Dial number without prefix
-        */
-       Long getPhoneNumber ();
-
-       /**
-        * Setter for dial number without prefix
-        * <p>
-        * @param phoneNumber Dial number without prefix
-        */
-       void setPhoneNumber (final Long phoneNumber);
-
 }
index 03ade1cbcc137aa628d1af0828ff30b7ef727cfd..93727ed82e8a31e73e339d81242bc5b2e64d7aca 100644 (file)
@@ -18,7 +18,6 @@ package org.mxchange.jjobs.beans.phone;
 
 import java.io.Serializable;
 import java.util.List;
-import javax.ejb.Local;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
@@ -29,7 +28,6 @@ import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsPhoneWebApplicationController extends Serializable {
 
        /**
index 8ee995be32249392be0afc9d2e9393e0dac72d78..b47737248bea24d44fb971e8dd7aa4f8875554ec 100644 (file)
@@ -41,6 +41,7 @@ import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.delete.AdminDeletedUserEvent;
 import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
+import org.mxchange.jusercore.events.user.helper.created.ObservableHelperCreatedUserEvent;
 import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
 import org.mxchange.jusercore.events.user.locked.AdminLockedUserEvent;
@@ -187,7 +188,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
        private String userPasswordRepeat;
 
        /**
-        * Event being fired when admin unlocks an account
+        * Event being fired when administrator unlocks an account
         */
        @Inject
        @Any
@@ -201,7 +202,13 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                super();
        }
 
-       @Override
+       /**
+        * Adds user instance to database by preparing a complete user instance and
+        * sending it to the EJB. The data set in the controller is being verified,
+        * e.g. if the user name or email address is not used yet.
+        * <p>
+        * @return Redirect outcome
+        */
        public String addUser () {
                // Get contact from bean helper to "cache" it locally
                Contact contact = this.beanHelper.getContact();
@@ -215,32 +222,12 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                        throw new IllegalArgumentException("userName is null"); //NOI18N
                } else if (contact == null) {
                        // No contact instance set, so test required fields: gender, first name and family name
-                       if (this.contactController.getPersonalTitle() == null) {
-                               // Throw NPE again
-                               throw new NullPointerException("contactController.gender is null"); //NOI18N
-                       } else if (this.contactController.getFirstName() == null) {
-                               // ... and again
-                               throw new NullPointerException("contactController.firstName is null"); //NOI18N
-                       } else if (this.adminContactController.getFirstName().isEmpty()) {
-                               // ... and again
-                               throw new IllegalArgumentException("contactController.firstName is empty"); //NOI18N
-                       } else if (this.adminContactController.getFamilyName() == null) {
-                               // ... and again
-                               throw new NullPointerException("contactController.familyName is null"); //NOI18N
-                       } else if (this.adminContactController.getFamilyName().isEmpty()) {
-                               // ... and again
-                               throw new IllegalArgumentException("contactController.familyName is empty"); //NOI18N
-                       } else if (this.adminContactController.getEmailAddress() == null) {
-                               // ... and again
-                               throw new NullPointerException("contactController.emailAddress is null"); //NOI18N
-                       } else if (this.adminContactController.getEmailAddress().isEmpty()) {
-                               // ... and again
-                               throw new IllegalArgumentException("contactController.emailAddress is empty"); //NOI18N
-                       }
+                       this.adminContactController.validateContactData();
                }
 
                // Create new user instance
                User user = new LoginUser();
+
                // Set user name, CONFIRMED and INVISIBLE
                user.setUserName(this.getUserName());
                user.setUserMustChangePassword(this.getUserMustChangePassword());
@@ -331,6 +318,37 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                return "admin_list_user"; //NOI18N
        }
 
+       /**
+        * Event observer for when a bean helper has successfully created a user
+        * instance, means the user exists. If the user does not exist, this event
+        * should not fire but instead a proper exception must be thrown.
+        * <p>
+        * @param event User created event
+        */
+       public void afterHelperCreatedUserEvent (@Observes final ObservableHelperCreatedUserEvent event) {
+               // Is the instance valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getCreatedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdUser is null"); //NOI18N
+               } else if (event.getCreatedUser().getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdUser.userId is null"); //NOI18N
+               } else if (event.getCreatedUser().getUserId() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("event.createdUser.userId={0} is not valid", event.getCreatedUser().getUserId())); //NOI18N
+               }
+
+               // Get user instance
+               User user = event.getCreatedUser();
+
+               // Set all fields here
+               this.setUserName(user.getUserName());
+               this.setUserLockReason(user.getUserLastLockedReason());
+       }
+
        /**
         * Event observer for new user registrations
         * <p>
@@ -360,8 +378,15 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                this.clear();
        }
 
-       @Override
-       public String deleteUserData (final User user) {
+       /**
+        * Deletes given user account
+        * <p>
+        * @return Redirect outcome
+        */
+       public String deleteUserData () {
+               // Get user instance into local variable
+               User user = this.beanHelper.getUser();
+
                // Is the user instance valid and CONFIRMED?
                if (null == user) {
                        // Throw NPE
@@ -389,7 +414,11 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                return "admin_list_user"; //NOI18N
        }
 
-       @Override
+       /**
+        * Edits currently loaded user's data in database.
+        * <p>
+        * @return Redirect outcome
+        */
        public String editUserData () {
                // Get user instance
                User user = this.beanHelper.getUser();
@@ -464,62 +493,110 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                return "admin_list_user"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for user delete reason
+        * <p>
+        * @return User delete reason
+        */
        public String getUserDeleteReason () {
                return this.userDeleteReason;
        }
 
-       @Override
+       /**
+        * Setter for user delete reason
+        * <p>
+        * @param userDeleteReason User delete reason
+        */
        public void setUserDeleteReason (final String userDeleteReason) {
                this.userDeleteReason = userDeleteReason;
        }
 
-       @Override
+       /**
+        * Getter for user lock reason
+        * <p>
+        * @return User lock reason
+        */
        public String getUserLockReason () {
                return this.userLockReason;
        }
 
-       @Override
+       /**
+        * Setter for user lock reason
+        * <p>
+        * @param userLockReason User lock reason
+        */
        public void setUserLockReason (final String userLockReason) {
                this.userLockReason = userLockReason;
        }
 
-       @Override
+       /**
+        * Getter for flag if user needs to change password
+        * <p>
+        * @return Flag if user needs to change password
+        */
        public Boolean getUserMustChangePassword () {
                return this.userMustChangePassword;
        }
 
-       @Override
+       /**
+        * Setter for flag if user needs to change password
+        * <p>
+        * @param userMustChangePassword Flag if user needs to change password
+        */
        public void setUserMustChangePassword (final Boolean userMustChangePassword) {
                this.userMustChangePassword = userMustChangePassword;
        }
 
-       @Override
+       /**
+        * Getter for user name
+        * <p>
+        * @return User name
+        */
        public String getUserName () {
                return this.userName;
        }
 
-       @Override
+       /**
+        * Setter for user name
+        * <p>
+        * @param userName User name
+        */
        public void setUserName (final String userName) {
                this.userName = userName;
        }
 
-       @Override
+       /**
+        * Getter for clear-text user password
+        * <p>
+        * @return Clear-text user password
+        */
        public String getUserPassword () {
                return this.userPassword;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password
+        * <p>
+        * @param userPassword Clear-text user password
+        */
        public void setUserPassword (final String userPassword) {
                this.userPassword = userPassword;
        }
 
-       @Override
+       /**
+        * Getter for clear-text user password repeated
+        * <p>
+        * @return Clear-text user password repeated
+        */
        public String getUserPasswordRepeat () {
                return this.userPasswordRepeat;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password repeated
+        * <p>
+        * @param userPasswordRepeat Clear-text user password repeated
+        */
        public void setUserPasswordRepeat (final String userPasswordRepeat) {
                this.userPasswordRepeat = userPasswordRepeat;
        }
@@ -543,8 +620,16 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                }
        }
 
-       @Override
-       public String lockUserAccount (final User user) {
+       /**
+        * Locks selected user's account. This method makes sure that a lock reason
+        * is provided that th user later can read on login attempts.
+        * <p>
+        * @return Redirect outcome
+        */
+       public String lockUserAccount () {
+               // Get user instance
+               User user = this.beanHelper.getUser();
+
                // Is the user instance valid and CONFIRMED?
                if (null == user) {
                        // Throw NPE
@@ -593,8 +678,16 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                return "admin_show_user"; //NOI18N
        }
 
-       @Override
-       public String unlockUserAccount (final User user) {
+       /**
+        * Unlocks selected user's account. This method makes sure that the account
+        * is locked.
+        * <p>
+        * @return Redirect outcome
+        */
+       public String unlockUserAccount () {
+               // Get user instance
+               User user = this.beanHelper.getUser();
+
                // Is the user instance valid and CONFIRMED?
                if (null == user) {
                        // Throw NPE
index 08ae18cd6a77dda96919654c589fab207ec25171..3674d192ca5385450c1f1b5d4bf9a07444a5b442 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jjobs.beans.user;
 
 import java.io.Serializable;
-import org.mxchange.jusercore.model.user.User;
 
 /**
  * An interface for user beans
@@ -26,133 +25,4 @@ import org.mxchange.jusercore.model.user.User;
  */
 public interface JobsAdminUserWebRequestController extends Serializable {
 
-       /**
-        * Adds user instance to database by preparing a complete user instance and
-        * sending it to the EJB. The data set in the controller is being verified,
-        * e.g. if the user name or email address is not used yet.
-        * <p>
-        * @return Redirect outcome
-        */
-       String addUser ();
-
-       /**
-        * Deletes given user account
-        * <p>
-        * @param user User instance to delete
-        * <p>
-        * @return Redirect outcome
-        */
-       String deleteUserData (final User user);
-
-       /**
-        * Edits currently loaded user's data in database.
-        * <p>
-        * @return Redirect outcome
-        */
-       String editUserData ();
-
-       /**
-        * Locks selected user's account. This method makes sure that a lock reason
-        * is provided that th user later can read on login attempts.
-        * <p>
-        * @param user User instance to be locked
-        * <p>
-        * @return Redirect outcome
-        */
-       String lockUserAccount (final User user);
-
-       /**
-        * Unlocks selected user's account. This method makes sure that the account
-        * is locked.
-        * <p>
-        * @param user User instance to be unlocked
-        * <p>
-        * @return Redirect outcome
-        */
-       String unlockUserAccount (final User user);
-
-       /**
-        * Getter for user name
-        * <p>
-        * @return User name
-        */
-       String getUserName ();
-
-       /**
-        * Setter for user name
-        * <p>
-        * @param userName User name
-        */
-       void setUserName (final String userName);
-
-       /**
-        * Getter for clear-text user password
-        * <p>
-        * @return Clear-text user password
-        */
-       String getUserPassword ();
-
-       /**
-        * Setter for clear-text user password
-        * <p>
-        * @param userPassword Clear-text user password
-        */
-       void setUserPassword (final String userPassword);
-
-       /**
-        * Getter for clear-text user password repeated
-        * <p>
-        * @return Clear-text user password repeated
-        */
-       String getUserPasswordRepeat ();
-
-       /**
-        * Setter for clear-text user password repeated
-        * <p>
-        * @param userPasswordRepeat Clear-text user password repeated
-        */
-       void setUserPasswordRepeat (final String userPasswordRepeat);
-
-       /**
-        * Getter for flag if user needs to change password
-        * <p>
-        * @return Flag if user needs to change password
-        */
-       Boolean getUserMustChangePassword ();
-
-       /**
-        * Setter for flag if user needs to change password
-        * <p>
-        * @param userMustChangePassword Flag if user needs to change password
-        */
-       void setUserMustChangePassword (final Boolean userMustChangePassword);
-
-       /**
-        * Getter for user lock reason
-        * <p>
-        * @return User lock reason
-        */
-       String getUserLockReason ();
-
-       /**
-        * Setter for user lock reason
-        * <p>
-        * @param userLockReason User lock reason
-        */
-       void setUserLockReason (final String userLockReason);
-
-       /**
-        * Getter for user delete reason
-        * <p>
-        * @return User delete reason
-        */
-       String getUserDeleteReason ();
-
-       /**
-        * Setter for user delete reason
-        * <p>
-        * @param userDeleteReason User delete reason
-        */
-       void setUserDeleteReason (final String userDeleteReason);
-
 }
index 13bfc28637bfb0a2f3940ae3cf4557a6ca6d81a1..1a915770c4abe0795a59024f4ee0b715d1b99045 100644 (file)
@@ -40,6 +40,7 @@ import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
+import org.mxchange.jusercore.events.user.helper.created.ObservableHelperCreatedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
 import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
 import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
@@ -328,6 +329,36 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.clear();
        }
 
+       /**
+        * Event observer for when a bean helper has successfully created a user
+        * instance, means the user exists. If the user does not exist, this event
+        * should not fire but instead a proper exception must be thrown.
+        * <p>
+        * @param event User created event
+        */
+       public void afterHelperCreatedUserEvent (@Observes final ObservableHelperCreatedUserEvent event) {
+               // Is the instance valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getCreatedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdUser is null"); //NOI18N
+               } else if (event.getCreatedUser().getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.createdUser.userId is null"); //NOI18N
+               } else if (event.getCreatedUser().getUserId() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("event.createdUser.userId={0} is not valid", event.getCreatedUser().getUserId())); //NOI18N
+               }
+
+               // Get user instance
+               User user = event.getCreatedUser();
+
+               // Set all fields here
+               this.copyUser(user);
+       }
+
        /**
         * Event observer when user confirmed account.
         * <p>
@@ -387,6 +418,29 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                }
        }
 
+       /**
+        * Event observer for user password changes
+        * <p>
+        * @param event Event being fired
+        */
+       public void afterUserPasswordChangedEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
+               // Is it valid?
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getUserPassword() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("event.userPassword is null"); //NOI18N
+               } else if (event.getUserPassword().isEmpty()) {
+                       // Throw NPE
+                       throw new IllegalArgumentException("event.userPassword is empty"); //NOI18N
+               }
+
+               // Set it here
+               this.setUserPassword(event.getUserPassword());
+               this.setUserPasswordRepeat(event.getUserPassword());
+       }
+
        /**
         * Event observer for new user registrations
         * <p>
@@ -498,6 +552,19 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                return this.visibleUserList;
        }
 
+       @Override
+       public void clearUserName () {
+               // Clear it
+               this.setUserName(null);
+       }
+
+       @Override
+       public void clearUserPasswords () {
+               // Clear both
+               this.setUserPassword(null);
+               this.setUserPasswordRepeat(null);
+       }
+
        @Override
        public User createUserInstance (final boolean createContactData) {
                // Trace message
@@ -586,7 +653,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
                        // Password not matching
                        throw new FaceletException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()));
-               } else if (!this.featureController.isFeatureEnabled("change_user_personal_data")) {
+               } else if (!this.featureController.isFeatureEnabled("change_user_personal_data")) { //NOI18N
                        // Editing is not allowed
                        throw new IllegalStateException("User tried to edit personal data."); //NOI18N
                }
@@ -618,22 +685,38 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                return "user_contact_data_saved"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for user id
+        * <p>
+        * @return User id
+        */
        public Long getUserId () {
                return this.userId;
        }
 
-       @Override
+       /**
+        * Setter for user id
+        * <p>
+        * @param userId User id
+        */
        public void setUserId (final Long userId) {
                this.userId = userId;
        }
 
-       @Override
+       /**
+        * Getter for user name
+        * <p>
+        * @return User name
+        */
        public String getUserName () {
                return this.userName;
        }
 
-       @Override
+       /**
+        * Setter for user name
+        * <p>
+        * @param userName User name
+        */
        public void setUserName (final String userName) {
                this.userName = userName;
        }
@@ -643,27 +726,47 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                return this.userPassword;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password
+        * <p>
+        * @param userPassword Clear-text user password
+        */
        public void setUserPassword (final String userPassword) {
                this.userPassword = userPassword;
        }
 
-       @Override
+       /**
+        * Getter for clear-text user password repeated
+        * <p>
+        * @return Clear-text user password repeated
+        */
        public String getUserPasswordRepeat () {
                return this.userPasswordRepeat;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password repeated
+        * <p>
+        * @param userPasswordRepeat Clear-text user password repeated
+        */
        public void setUserPasswordRepeat (final String userPasswordRepeat) {
                this.userPasswordRepeat = userPasswordRepeat;
        }
 
-       @Override
+       /**
+        * Getter for user profile mode
+        * <p>
+        * @return User profile mode
+        */
        public ProfileMode getUserProfileMode () {
                return this.userProfileMode;
        }
 
-       @Override
+       /**
+        * Setter for user profile mode
+        * <p>
+        * @param userProfileMode User profile mode
+        */
        public void setUserProfileMode (final ProfileMode userProfileMode) {
                this.userProfileMode = userProfileMode;
        }
@@ -671,7 +774,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        @Override
        public boolean ifBothPasswordsEmptyAllowed () {
                // Check feature first
-               return ((this.featureController.isFeatureEnabled("allow_user_registration_empty_password")) &&
+               return ((this.featureController.isFeatureEnabled("allow_user_registration_empty_password")) && //NOI18N
                                ((this.getUserPassword() == null) || (this.getUserPassword().isEmpty())) &&
                                ((this.getUserPasswordRepeat() == null) || (this.getUserPasswordRepeat().isEmpty())));
        }
@@ -928,9 +1031,8 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                this.setUserProfileMode(null);
 
                // - other data
-               this.setUserName(null);
-               this.setUserPassword(null);
-               this.setUserPasswordRepeat(null);
+               this.clearUserName();
+               this.clearUserPasswords();
        }
 
        /**
index 9ca38edacfea705633b36f9c3040dc58aa85a106..ec16ac09bdd366889e68b31d2115fcddc6b0d0f0 100644 (file)
@@ -22,7 +22,6 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 
 /**
  * An interface for user beans
@@ -33,9 +32,28 @@ public interface JobsUserWebSessionController extends Serializable {
 
        /**
         * Minimum password length
+        * <p>
+        * @deprecated Better set as context parameter
         */
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
+       /**
+        * Getter for clear-text user password
+        * <p>
+        * @return Clear-text user password
+        */
+       String getUserPassword ();
+
+       /**
+        * Clears both user passwords
+        */
+       void clearUserPasswords ();
+
+       /**
+        * Clears user name
+        */
+       void clearUserName ();
+
        /**
         * Checks if both user passwords are left empty and if this is enabled
         * (allowed) in context parameter. If true, the calling bean should create a
@@ -127,76 +145,6 @@ public interface JobsUserWebSessionController extends Serializable {
         */
        User createUserLogin ();
 
-       /**
-        * Getter for user id
-        * <p>
-        * @return User id
-        */
-       Long getUserId ();
-
-       /**
-        * Setter for user id
-        * <p>
-        * @param userId User id
-        */
-       void setUserId (final Long userId);
-
-       /**
-        * Getter for user name
-        * <p>
-        * @return User name
-        */
-       String getUserName ();
-
-       /**
-        * Setter for user name
-        * <p>
-        * @param userName User name
-        */
-       void setUserName (final String userName);
-
-       /**
-        * Getter for clear-text user password
-        * <p>
-        * @return Clear-text user password
-        */
-       String getUserPassword ();
-
-       /**
-        * Setter for clear-text user password
-        * <p>
-        * @param userPassword Clear-text user password
-        */
-       void setUserPassword (final String userPassword);
-
-       /**
-        * Getter for clear-text user password repeated
-        * <p>
-        * @return Clear-text user password repeated
-        */
-       String getUserPasswordRepeat ();
-
-       /**
-        * Setter for clear-text user password repeated
-        * <p>
-        * @param userPasswordRepeat Clear-text user password repeated
-        */
-       void setUserPasswordRepeat (final String userPasswordRepeat);
-
-       /**
-        * Getter for user profile mode
-        * <p>
-        * @return User profile mode
-        */
-       ProfileMode getUserProfileMode ();
-
-       /**
-        * Setter for user profile mode
-        * <p>
-        * @param userProfileMode User profile mode
-        */
-       void setUserProfileMode (final ProfileMode userProfileMode);
-
        /**
         * Checks whether all required personal data is set
         * <p>
index a14c96fb2c02796bccf210abf758e356d3559810..2e223024a279874304998389c70c42329ae8a26b 100644 (file)
@@ -92,7 +92,11 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements
                super();
        }
 
-       @Override
+       /**
+        * Changes logged-in user's email address if the current password matches.
+        * <p>
+        * @return Redirect outcome
+        */
        public String doUserChangeEmailAddress () {
                // This method shall only be called if the user is logged-in
                if (!this.userLoginController.isUserLoggedIn()) {
@@ -152,22 +156,38 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements
                return "user_login_email_change_queued"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for email address 1 (changing)
+        * <p>
+        * @return Email address
+        */
        public String getEmailAddress () {
                return this.emailAddress;
        }
 
-       @Override
+       /**
+        * Setter for email address 1 (changing)
+        * <p>
+        * @param emailAddress Email address 1
+        */
        public void setEmailAddress (final String emailAddress) {
                this.emailAddress = emailAddress;
        }
 
-       @Override
+       /**
+        * Getter for email address 2 (repeat changing)
+        * <p>
+        * @return Email address 2
+        */
        public String getEmailAddressRepeat () {
                return this.emailAddressRepeat;
        }
 
-       @Override
+       /**
+        * Setter for email address 2 (repeat changing)
+        * <p>
+        * @param emailAddressRepeat Email address 2
+        */
        public void setEmailAddressRepeat (final String emailAddressRepeat) {
                this.emailAddressRepeat = emailAddressRepeat;
        }
index 2988e5c3758afda89dbd7f95076a0b4b71b3dfd3..7d21354aa59bfa183c0700ffa0fa6d6e3669692f 100644 (file)
@@ -25,34 +25,6 @@ import java.io.Serializable;
  */
 public interface JobsEmailChangeWebSessionController extends Serializable {
 
-       /**
-        * Getter for email address 1 (changing)
-        * <p>
-        * @return Email address
-        */
-       String getEmailAddress ();
-
-       /**
-        * Setter for email address 1 (changing)
-        * <p>
-        * @param emailAddress Email address 1
-        */
-       void setEmailAddress (final String emailAddress);
-
-       /**
-        * Getter for email address 2 (repeat changing)
-        * <p>
-        * @return Email address 2
-        */
-       String getEmailAddressRepeat ();
-
-       /**
-        * Setter for email address 2 (repeat changing)
-        * <p>
-        * @param emailAddressRepeat Email address 2
-        */
-       void setEmailAddressRepeat (final String emailAddressRepeat);
-
        /**
         * Checks whether all required are set for changing email address
         * <p>
@@ -60,11 +32,4 @@ public interface JobsEmailChangeWebSessionController extends Serializable {
         */
        boolean isRequiredChangeEmailAddressSet ();
 
-       /**
-        * Changes logged-in user's email address if the current password matches.
-        * <p>
-        * @return New target page
-        */
-       String doUserChangeEmailAddress ();
-
 }
index 6afeb7bd33f4c1456f2de6877fb38e4ebf8060ac..bf2e6a173af24230ae4900aa9f11f6b0186f18ca 100644 (file)
@@ -170,7 +170,12 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                this.updatePasswordHistory(event.getPasswordHistory());
        }
 
-       @Override
+       /**
+        * Logout for administrator area. If a logged-in user instance exists, it is
+        * being logged-out, too.
+        * <p>
+        * @return Outcome (should be redirected)
+        */
        public String doAdminLogout () {
                // Is a user logged-in?
                if (this.isUserLoggedIn()) {
@@ -188,17 +193,21 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                return "index?faces-redirect=true"; //NOI18N
        }
 
-       @Override
+       /**
+        * Logins the user, if the account is found, confirmed and unlocked.
+        * <p>
+        * @return Redirect target
+        */
        public String doUserLogin () {
                // Get user instance
                User user = this.userController.createUserLogin();
 
                // Create login container
-               LoginContainer container = new UserLoginContainer(user, this.userController.getUserPassword());
+               LoginContainer loginContainer = new UserLoginContainer(user, this.userController.getUserPassword());
 
                try {
                        // Call bean
-                       User confirmedUser = this.userLoginBean.validateUserAccountStatus(container);
+                       User confirmedUser = this.userLoginBean.validateUserAccountStatus(loginContainer);
 
                        // All fine here so set it here
                        this.setLoggedInUser(confirmedUser);
@@ -234,7 +243,11 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                }
        }
 
-       @Override
+       /**
+        * Logout for current user by invalidating the current session.
+        * <p>
+        * @return Outcome (should be redirected)
+        */
        public String doUserLogout () {
                // Is loggedInUser set?
                if (this.getLoggedInUser() == null) {
@@ -282,12 +295,20 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                this.loggedInUser = loggedInUser;
        }
 
-       @Override
+       /**
+        * Getter for current password (clear text)
+        * <p>
+        * @return Current password
+        */
        public String getUserCurrentPassword () {
                return this.userCurrentPassword;
        }
 
-       @Override
+       /**
+        * Setter for current password (clear text)
+        * <p>
+        * @param userCurrentPassword Current password
+        */
        public void setUserCurrentPassword (final String userCurrentPassword) {
                this.userCurrentPassword = userCurrentPassword;
        }
index e28f22c1884bbf933c951de051bc4ca52dafb4df..d76afcc724c3c713a5370e4ffe990d7a846af0ae 100644 (file)
@@ -18,7 +18,6 @@ package org.mxchange.jjobs.beans.user.login;
 
 import java.io.Serializable;
 import java.util.List;
-import javax.ejb.Local;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
 
@@ -27,7 +26,6 @@ import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsUserLoginWebSessionController extends Serializable {
 
        /**
@@ -53,28 +51,6 @@ public interface JobsUserLoginWebSessionController extends Serializable {
         */
        void setBaseTemplatePathName (final String baseTemplatePathName);
 
-       /**
-        * Logout for administrator area. If a logged-in user instance exists, it is
-        * being logged-out, too.
-        * <p>
-        * @return Outcome (should be redirected)
-        */
-       String doAdminLogout ();
-
-       /**
-        * Logins the user, if the account is found, confirmed and unlocked.
-        * <p>
-        * @return Redirect target
-        */
-       String doUserLogin ();
-
-       /**
-        * Logout for current user by invalidating the current session.
-        * <p>
-        * @return Outcome (should be redirected)
-        */
-       String doUserLogout ();
-
        /**
         * Getter for logged-in user instance
         * <p>
@@ -110,20 +86,6 @@ public interface JobsUserLoginWebSessionController extends Serializable {
         */
        boolean isInvisible ();
 
-       /**
-        * Setter for current password (clear text)
-        * <p>
-        * @param userCurrentPassword Current password
-        */
-       void setUserCurrentPassword (final String userCurrentPassword);
-
-       /**
-        * Getter for current password (clear text)
-        * <p>
-        * @return Current password
-        */
-       String getUserCurrentPassword ();
-
        /**
         * Checks whether the (previously entered) current password matches with
         * from the user instance.
index 9fba63ba268abe66098a371eb4122ee90c892724..9d2dce6b65ee02f819f9df588d86441f1035376a 100644 (file)
@@ -103,7 +103,13 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                super();
        }
 
-       @Override
+       /**
+        * Changes logged-in user's password. It must not match with current
+        * password and should not appear in password history list for X
+        * (configurable) entries.
+        * <p>
+        * @return Redirect outcome
+        */
        public String doChangePassword () {
                // This method shall only be called if the user is logged-in
                if (!this.userLoginController.isUserLoggedIn()) {
@@ -173,7 +179,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                        PasswordHistory passwordHistory = this.userBean.updateUserPassword(user, baseUrl);
 
                        // Fire event
-                       this.userUpdatedPasswordEvent.fire(new UpdatedUserPasswordEvent(passwordHistory));
+                       this.userUpdatedPasswordEvent.fire(new UpdatedUserPasswordEvent(passwordHistory,this.getUserPassword()));
                } catch (final UserNotFoundException | UserStatusUnconfirmedException | UserStatusLockedException ex) {
                        // Clear bean
                        this.clear();
@@ -189,32 +195,56 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                return "login_data_saved"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for current clear-text user password
+        * <p>
+        * @return Current clear-text user password
+        */
        public String getUserCurrentPassword () {
                return this.userCurrentPassword;
        }
 
-       @Override
+       /**
+        * Setter for current clear-text user password
+        * <p>
+        * @param userCurrentPassword Current clear-text user password
+        */
        public void setUserCurrentPassword (final String userCurrentPassword) {
                this.userCurrentPassword = userCurrentPassword;
        }
 
-       @Override
+       /**
+        * Getter for clear-text user password
+        * <p>
+        * @return Clear-text user password
+        */
        public String getUserPassword () {
                return this.userPassword;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password
+        * <p>
+        * @param userPassword Clear-text user password
+        */
        public void setUserPassword (final String userPassword) {
                this.userPassword = userPassword;
        }
 
-       @Override
+       /**
+        * Getter for clear-text user password repeated
+        * <p>
+        * @return Clear-text user password repeated
+        */
        public String getUserPasswordRepeat () {
                return this.userPasswordRepeat;
        }
 
-       @Override
+       /**
+        * Setter for clear-text user password repeated
+        * <p>
+        * @param userPasswordRepeat Clear-text user password repeated
+        */
        public void setUserPasswordRepeat (final String userPasswordRepeat) {
                this.userPasswordRepeat = userPasswordRepeat;
        }
index c6c5ea235acab99f8a49329ef9db7c44c0429901..57680e7d4eb471451c4981f2d7d762c7799bf353 100644 (file)
 package org.mxchange.jjobs.beans.user.password;
 
 import java.io.Serializable;
-import javax.ejb.Local;
 
 /**
  * An interface for user beans
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-@Local
 public interface JobsUserPasswordWebRequestController extends Serializable {
 
-       /**
-        * Getter for clear-text user password
-        * <p>
-        * @return Clear-text user password
-        */
-       String getUserPassword ();
-
-       /**
-        * Setter for clear-text user password
-        * <p>
-        * @param userPassword Clear-text user password
-        */
-       void setUserPassword (final String userPassword);
-
-       /**
-        * Getter for current clear-text user password
-        * <p>
-        * @return Current clear-text user password
-        */
-       String getUserCurrentPassword ();
-
-       /**
-        * Setter for current clear-text user password
-        * <p>
-        * @param userCurrentPassword Current clear-text user password
-        */
-       void setUserCurrentPassword (final String userCurrentPassword);
-
-       /**
-        * Getter for clear-text user password repeated
-        * <p>
-        * @return Clear-text user password repeated
-        */
-       String getUserPasswordRepeat ();
-
-       /**
-        * Setter for clear-text user password repeated
-        * <p>
-        * @param userPasswordRepeat Clear-text user password repeated
-        */
-       void setUserPasswordRepeat (final String userPasswordRepeat);
-
-       /**
-        * Changes logged-in user's password. It must not match with current
-        * password and should not appear in password history list for X
-        * (configurable) entries.
-        * <p>
-        * @return Redirect outcome
-        */
-       String doChangePassword ();
-
        /**
         * Checks if all 3 passwords are set: old password, 2x new password
         * <p>
index daf3dbf02ff96e9ad7e8ed9e1e63b6381ff0a1d1..dff3b2cc2e71f32438c69266390c98310c4aba01 100644 (file)
@@ -16,7 +16,6 @@
  */
 package org.mxchange.jjobs.beans.user.register;
 
-import java.text.MessageFormat;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
@@ -39,9 +38,13 @@ import org.mxchange.jusercore.exceptions.DataRepeatMismatchException;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
+import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.juserlogincore.events.registration.UserRegisteredEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
+import org.mxchange.juserlogincore.events.user.password_change.UpdatedUserPasswordEvent;
 import org.mxchange.juserlogincore.login.UserLoginUtils;
 import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
@@ -89,7 +92,14 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
        private JobsUserWebSessionController userController;
 
        /**
-        * An en event fireable when a new user has registered
+        * An event being fired when a user password was changed
+        */
+       @Inject
+       @Any
+       private Event<ObservableUpdatedUserPasswordEvent> userPasswordChangedEvent;
+
+       /**
+        * An event being fired when a new user has registered
         */
        @Inject
        @Any
@@ -103,7 +113,12 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                super();
        }
 
-       @Override
+       /**
+        * Registers the user, if not found. Otherwise this method should throw an
+        * exception.
+        * <p>
+        * @return Redirection target
+        */
        public String doFinishRegistration () {
                // Is registration enabled?
                if (!this.featureController.isFeatureEnabled("user_registration")) { //NOI18N
@@ -131,7 +146,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                        } else {
                                // May happen here, reset field
-                               this.userController.setUserName(null);
+                               this.userController.clearUserName();
                                this.showFacesMessage("form_register_single:userName", "ERROR_USER_NAME_ALREADY_USED"); //NOI18N
                                return ""; //NOI18N
                        }
@@ -142,8 +157,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                throw new FaceletException(new EmailAddressAlreadyRegisteredException(user));
                        } else {
                                // May happen here, reset fields
-                               this.contactController.setEmailAddress(null);
-                               this.contactController.setEmailAddressRepeat(null);
+                               this.contactController.clearEmailAddresses();
                                this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N
                                return ""; //NOI18N
                        }
@@ -151,11 +165,10 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                        // Is multi-page enabled?
                        if (this.featureController.isFeatureEnabled("user_register_multiple_page")) { //NOI18N
                                // Not same email address entered, should not happen here
-                               throw new FaceletException(new DataRepeatMismatchException(MessageFormat.format("Email addresses not matching: {0} != {1}", this.contactController.getEmailAddress(), this.contactController.getEmailAddressRepeat()))); //NOI18N
+                               throw new FaceletException(new DataRepeatMismatchException("Email addresses not matching.")); //NOI18N
                        } else {
                                // May happen here, reset fields
-                               this.contactController.setEmailAddress(null);
-                               this.contactController.setEmailAddressRepeat(null);
+                               this.contactController.clearEmailAddresses();
                                this.showFacesMessage("form_register_single:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING"); //NOI18N
                                return ""; //NOI18N
                        }
@@ -168,9 +181,11 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                // Both passwords are left empty and is allowed, then generate a random password
                                randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
 
-                               // Set it in both fields
-                               this.userController.setUserPassword(randomPassword);
-                               this.userController.setUserPasswordRepeat(randomPassword);
+                               // Generate (ignored) password-history
+                               PasswordHistory passwordHistory = new UserPasswordHistory(randomPassword, user);
+
+                               // Fire event
+                               this.userPasswordChangedEvent.fire(new UpdatedUserPasswordEvent(passwordHistory, randomPassword));
                        }
                }
 
@@ -216,7 +231,13 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                }
        }
 
-       @Override
+       /**
+        * Handles registration request send from first page. The (maybe) entered
+        * user name and email address is not used and that privacy and T&C are
+        * accepted.
+        * <p>
+        * @return Redirect
+        */
        public String doRegisterMultiPage1 () {
                // Is registration enabled?
                if (!this.featureController.isFeatureEnabled("user_registration")) { //NOI18N
@@ -233,21 +254,19 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                        throw new NullPointerException("user is null after createUserInstance() was called"); //NOI18N
                } else if ((this.featureController.isFeatureEnabled("user_login_require_user_name")) && (this.userController.isUserNameRegistered(user))) { //NOI18N
                        // User name is already used, so clear it
-                       this.userController.setUserName(null);
+                       this.userController.clearUserName();
                        this.showFacesMessage("form_register_page1:userName", "ERROR_USER_NAME_ALREADY_USED"); //NOI18N
                        return ""; //NOI18N
                } else if (!this.contactController.isSameEmailAddressEntered()) {
                        // Not same email address entered, clear both
-                       this.contactController.setEmailAddress(null);
-                       this.contactController.setEmailAddressRepeat(null);
+                       this.contactController.clearEmailAddresses();
                        this.showFacesMessage("form_register_page1:emailAddressRepeat", "ERROR_EMAIL_ADDRESSES_MISMATCHING"); //NOI18N
                        return ""; //NOI18N
                } else if (!this.userController.isSamePasswordEntered()) {
                        // Is multi-page enabled?
                        if (this.featureController.isFeatureEnabled("user_register_multiple_page")) { //NOI18N
                                // Unset both
-                               this.userController.setUserPassword(null);
-                               this.userController.setUserPasswordRepeat(null);
+                               this.userController.clearUserPasswords();
 
                                // Output faces message
                                this.showFacesMessage("form_register_page1:userPassword", "ERROR_USER_PASSWORD_EMPTY"); //NOI18N
@@ -257,9 +276,11 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                // Both passwords are left empty and is allowed, then generate a random password
                                String randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
 
-                               // Set it in both fields
-                               this.userController.setUserPassword(randomPassword);
-                               this.userController.setUserPasswordRepeat(randomPassword);
+                               // Generate (ignored) password-history
+                               PasswordHistory passwordHistory = new UserPasswordHistory(randomPassword, user);
+
+                               // Fire event
+                               this.userPasswordChangedEvent.fire(new UpdatedUserPasswordEvent(passwordHistory, randomPassword));
                        }
                }
 
@@ -273,8 +294,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                // Check if email address is registered
                if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
                        // Email address has already been taken, clear both
-                       this.contactController.setEmailAddress(null);
-                       this.contactController.setEmailAddressRepeat(null);
+                       this.contactController.clearEmailAddresses();
                        this.showFacesMessage("form_register_page1:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N
                        return ""; //NOI18N
                }
index 8ef9ba3b6805b62da302bcf8f6141d2d064d7d4c..6a9c78b3228d5a83340c903ddb282bdfb6db7b79 100644 (file)
@@ -25,21 +25,4 @@ import java.io.Serializable;
  */
 public interface JobsUserRegisterWebSessionController extends Serializable {
 
-       /**
-        * Registers the user, if not found. Otherwise this method should throw an
-        * exception.
-        * <p>
-        * @return Redirection target
-        */
-       String doFinishRegistration ();
-
-       /**
-        * Handles registration request send from first page. The (maybe) entered
-        * user name and email address is not used and that privacy and T&C are
-        * accepted.
-        * <p>
-        * @return Redirect
-        */
-       String doRegisterMultiPage1 ();
-
 }
index f74b94d21e22dcb1f2bb650b08403af969fa66be..23658c34c4a2afee31ad5b481cabb40329f0313d 100644 (file)
@@ -91,7 +91,12 @@ public class JobsResendLinkWebSessionBean extends BaseJobsController implements
                super();
        }
 
-       @Override
+       /**
+        * Resends (new) confirmation link to given email address, if found.
+        * Otherwise an exception is thrown. On success a redirect takes place.
+        * <p>
+        * @return Redirect outcome
+        */
        public String doResendLink () {
                // The email address should not be empty as the JSF validates this
                if (this.getEmailAddress() == null) {
@@ -163,12 +168,20 @@ public class JobsResendLinkWebSessionBean extends BaseJobsController implements
                return "user_resend_done"; //NOI18N
        }
 
-       @Override
+       /**
+        * Getter for email address 1 (changing)
+        * <p>
+        * @return Email address
+        */
        public String getEmailAddress () {
                return this.emailAddress;
        }
 
-       @Override
+       /**
+        * Setter for email address 1 (changing)
+        * <p>
+        * @param emailAddress Email address 1
+        */
        public void setEmailAddress (final String emailAddress) {
                this.emailAddress = emailAddress;
        }
index b8821aa643cf8abf99794612da340f0701f9d7e2..391f2a9e5e27e540a4b7fe3c63b9225bdb12c825 100644 (file)
@@ -25,26 +25,4 @@ import java.io.Serializable;
  */
 public interface JobsResendLinkWebSessionController extends Serializable {
 
-       /**
-        * Getter for email address 1 (changing)
-        * <p>
-        * @return Email address
-        */
-       String getEmailAddress ();
-
-       /**
-        * Setter for email address 1 (changing)
-        * <p>
-        * @param emailAddress Email address 1
-        */
-       void setEmailAddress (final String emailAddress);
-
-       /**
-        * Resends (new) confirmation link to given email address, if found.
-        * Otherwise an exception is thrown. On success a redirect takes place.
-        * <p>
-        * @return Redirection target
-        */
-       String doResendLink ();
-
 }
index 6c1bd0f65d6ebd94a4ed7990a56274e73cb9b62e..e2a4dc83021598c30799dd425ff3e7dc64601aa5 100644 (file)
@@ -733,7 +733,7 @@ ADMIN_RESEND_USER_CONFIRMATION_LINK_NOTICE=By sending a new confirmation link to
 PAGE_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link
 CONTENT_TITLE_ADMIN_RESEND_USER_CONFIRMATION_LINK=Send new confirmation link:
 ADMIN_SHOW_USER_ID=User id:
-TABLE_SUMMARY_ADMIN_LIST_USER_ACTIVITY_LOG=This table shows choosen user's activity log.
+TABLE_SUMMARY_ADMIN_LIST_USER_ACTIVITY_LOG=This table shows chosen user's activity log.
 ADMIN_LINK_SHOW_USER_ACTIVITY_LOG=List user's actitivy log
 PAGE_TITLE_ADMIN_USER_ACTIVITY_LOG=Logfile of user activity
 CONTENT_TITLE_ADMIN_USER_ACTIVITY_LOG=Logfile of user activity:
index 8ed4e71e910fb96c89838ecc0923d52fa33b48eb..7ab91ab7dfd198289683031968929950ffe03823 100644 (file)
                                </div>
 
                                <div class="table_right_medium">
-                                       <h:selectOneMenu  styleClass="select" id="country" value="#{adminContactController.country}" converter="CountryConverter">
+                                       <h:selectOneMenu styleClass="select" id="country" value="#{adminContactController.contactCountry}">
+                                               <f:converter converterId="CountryConverter" />
                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
                                                <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryCode} (#{msg[country.countryI18nKey]})" />
                                        </h:selectOneMenu>
index 65ec7dbc1cc175f764d9de35bddb7cb26f0b41af..df6fefcd984a4070010f72bb9beb18f7f4d6c7b4 100644 (file)
@@ -49,7 +49,7 @@
 
                                <div class="table_right_medium">
                                        <ui:include src="/WEB-INF/templates/input_fields/fax_input_fields.tpl">
-                                               <ui:param name="targetController" value="#{adminPhoneController}" />
+                                               <ui:param name="targetController" value="#{adminContactPhoneController}" />
                                        </ui:include>
                                </div>
 
@@ -67,9 +67,7 @@
                        <div class="table_footer">
                                <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
 
-                               <h:commandButton styleClass="submit" id="submit_add_link_contact_fax" type="submit" action="#{adminContactPhoneController.doLinkAddFaxNumber(beanHelper.contact)}" value="#{msg.BUTTON_ADMIN_LINK_ADD_CONTACT_FAX_NUMBER}">
-                                       <f:param name="contactId" value="#{param.contactId}" />
-                               </h:commandButton>
+                               <h:commandButton styleClass="submit" id="submit_add_link_contact_fax" type="submit" action="#{adminContactPhoneController.doLinkMainFaxNumber()}" value="#{msg.BUTTON_ADMIN_LINK_ADD_CONTACT_FAX_NUMBER}" />
                        </div>
                </h:panelGroup>
        </h:form>
index 1c29b5379aefa2d5b91055b11b9f49705b8d4aa3..f34fbfafdda7f85be4cca114238165c0fbe858c6 100644 (file)
@@ -39,7 +39,7 @@
                                </div>
 
                                <div class="table_footer">
-                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_fax" value="#{msg.BUTTON_ADMIN_DELETE_FAX}" action="#{adminPhoneController.deleteFaxData(beanHelper.faxNumber)}" />
+                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_fax" value="#{msg.BUTTON_ADMIN_DELETE_FAX}" action="#{adminPhoneController.deleteFaxData()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index 88707af6a553d1534b794cfdbd3fc6cda7de0b59..b6f722256c647f7a5a52264424489265ab584115 100644 (file)
@@ -33,7 +33,7 @@
 
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton styleClass="submit" type="submit" id="edit_fax" value="#{msg.BUTTON_ADMIN_EDIT_FAX_NUMBER}" action="#{adminPhoneController.editFaxData(beanHelper.faxNumber)}" />
+                                       <h:commandButton styleClass="submit" type="submit" id="edit_fax" value="#{msg.BUTTON_ADMIN_EDIT_FAX_NUMBER}" action="#{adminPhoneController.doChangeFaxNumber()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index f04185a98563e6271f693c201cc5bda2a7dafb0e..16cd072636adaf7cac57aab806cea9f7ac8c7327 100644 (file)
@@ -39,7 +39,7 @@
                                </div>
 
                                <div class="table_footer">
-                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_landline" value="#{msg.BUTTON_ADMIN_DELETE_LAND_LINE}" action="#{adminPhoneController.deleteLandLineData(beanHelper.landLineNumber)}" />
+                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_landline" value="#{msg.BUTTON_ADMIN_DELETE_LAND_LINE}" action="#{adminPhoneController.deleteLandLineData()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index 28acb79acf2ca1e296874dbc66884873645fcdeb..17e9529dc3ca42332e4ec338bc5fbc0351826e26 100644 (file)
@@ -33,7 +33,7 @@
 
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton styleClass="submit" type="submit" id="edit_landline" value="#{msg.BUTTON_ADMIN_EDIT_LAND_LINE_NUMBER}" action="#{adminPhoneController.editLandLineData(beanHelper.landLineNumber)}" />
+                                       <h:commandButton styleClass="submit" type="submit" id="edit_landline" value="#{msg.BUTTON_ADMIN_EDIT_LAND_LINE_NUMBER}" action="#{adminPhoneController.doChangeLandLineNumber()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index ab7219d3d6e6d61e05c48acf9bf15ce9e06aaa02..3c8b2d14f4ccbcc6fbfd15f2e418e158cd695d20 100644 (file)
@@ -39,7 +39,7 @@
                                </div>
 
                                <div class="table_footer">
-                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_mobile" value="#{msg.BUTTON_ADMIN_DELETE_MOBILE_NUMBER}" action="#{adminPhoneController.deleteMobileData(beanHelper.mobileNumber)}" />
+                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_mobile" value="#{msg.BUTTON_ADMIN_DELETE_MOBILE_NUMBER}" action="#{adminPhoneController.deleteMobileData()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index ab6b2bdd4956e2441de613f511fe26a5553af619..fef08d8671fdcc487016da21e48897e3773cdd2f 100644 (file)
@@ -33,7 +33,7 @@
 
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton styleClass="submit" type="submit" id="edit_mobile" value="#{msg.BUTTON_ADMIN_EDIT_MOBILE_NUMBER}" action="#{adminPhoneController.editMobileData(beanHelper.mobileNumber)}" />
+                                       <h:commandButton styleClass="submit" type="submit" id="edit_mobile" value="#{msg.BUTTON_ADMIN_EDIT_MOBILE_NUMBER}" action="#{adminPhoneController.doUpdateMobileNumber()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index 25c8161f69fce8a9702f05dc73a22710927f6ada..e1aec671f0368b3306ac3950678fa92c20642531 100644 (file)
@@ -57,7 +57,7 @@
 
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_user" value="#{msg.BUTTON_ADMIN_DELETE_USER}" action="#{adminUserController.deleteUserData(beanHelper.user)}" />
+                                       <h:commandButton styleClass="delete_button" type="submit" id="delete_user" value="#{msg.BUTTON_ADMIN_DELETE_USER}" action="#{adminUserController.deleteUserData()}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index 15bf8cbb2967c1b290ac49159d9ba9cbcaeb5ff5..79731fec36003225af4d6ac78a281e0c5b578e4f 100644 (file)
                                                <h:outputText value="#{msg.ADMIN_EXPORT_CONTACT_LANDLINE_NUMBER}" />
                                        </f:facet>
 
-                                       <h:outputText value="#{adminContactController.generatePhoneNumber(user.userContact.contactLandLineNumber)}" />
+                                       <h:outputText value="#{adminContactController.generateLandLineNumber(user.userContact.contactLandLineNumber)}" />
                                </p:column>
 
                                <p:column>
                                                <h:outputText value="#{msg.ADMIN_EXPORT_CONTACT_FAX_NUMBER}" />
                                        </f:facet>
 
-                                       <h:outputText value="#{adminContactController.generatePhoneNumber(user.userContact.contactFaxNumber)}" />
+                                       <h:outputText value="#{adminContactController.generateLandLineNumber(user.userContact.contactFaxNumber)}" />
                                </p:column>
 
                                <p:column>
index b48474cf6bff35394c37ce38a7013ab6cc18f789..c2b01b3eaac3e7f13246ecd2205e5c5ca1972538 100644 (file)
@@ -80,7 +80,7 @@
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
 
-                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.lockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_LOCK_USER_ACCOUNT}" />
+                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.lockUserAccount()}" value="#{msg.BUTTON_ADMIN_LOCK_USER_ACCOUNT}" />
                                </div>
                        </h:panelGroup>
                </h:form>
index 08acbb8a8b0a29c52284433e31221332a9cd4e58..288b64d82023ecb56f215119be2de942e550a4f7 100644 (file)
                                <div class="table_footer">
                                        <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
 
-                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.unlockUserAccount(beanHelper.user)}" value="#{msg.BUTTON_ADMIN_UNLOCK_USER_ACCOUNT}" />
+                                       <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.unlockUserAccount()}" value="#{msg.BUTTON_ADMIN_UNLOCK_USER_ACCOUNT}" />
                                </div>
                        </h:panelGroup>
                </h:form>