]> git.mxchange.org Git - addressbook-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Mon, 10 Apr 2017 20:08:20 +0000 (22:08 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 10 Apr 2017 20:11:23 +0000 (22:11 +0200)
- not just cellphones, let's support any mobile phone
- mobileNumbers was no longer used
- tpzo fixed

13 files changed:
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestController.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionBean.java
src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookContactPhoneWebSessionController.java
src/java/org/mxchange/addressbook/beans/helper/AddressbookWebRequestHelper.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestBean.java
src/java/org/mxchange/addressbook/beans/phone/AddressbookAdminPhoneWebRequestController.java
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java
src/java/org/mxchange/addressbook/beans/user/password/AddressbookUserPasswordWebRequestBean.java
src/java/org/mxchange/addressbook/converter/cellphone/AddressbookCellphoneConverter.java
web/admin/cellphone/admin_cellphone_show.xhtml

index e7e316fd3d2de90c5fd785ff382e80ae4a9f486b..9b75c12e665403dc8e34ea2e36eebb2fde6183ed 100644 (file)
@@ -32,6 +32,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.addressbook.beans.helper.AddressbookWebRequestController;
+import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.contact.UserContact;
@@ -44,12 +45,12 @@ import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -73,6 +74,11 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        @Any
        private Event<AdminAddedContactEvent> addedContactEvent;
 
+       /**
+        * Administrative contact EJB
+        */
+       private AdminContactSessionBeanRemote adminContactBean;
+
        /**
         * Admin helper instance
         */
@@ -84,21 +90,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         */
        private Date birthday;
 
-       /**
-        * Cellphone number's carrier
-        */
-       private MobileProvider cellphoneCarrier;
-
-       /**
-        * Cellphone id number
-        */
-       private Long cellphoneId;
-
-       /**
-        * Cellphone number
-        */
-       private Long cellphoneNumber;
-
        /**
         * City
         */
@@ -180,11 +171,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         */
        private String houseNumberExtension;
 
-       /**
-        * Whether a cellphone entry has been unlinked
-        */
-       private boolean isCellphoneUnlinked;
-
        /**
         * Whether a fax entry has been unlinked
         */
@@ -195,11 +181,31 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
         */
        private boolean isLandLineUnlinked;
 
+       /**
+        * Whether a mobile entry has been unlinked
+        */
+       private boolean isMobileUnlinked;
+
        /**
         * Land-line id number
         */
        private Long landLineId;
 
+       /**
+        * Mobile number's carrier
+        */
+       private MobileProvider mobileCarrier;
+
+       /**
+        * Mobile id number
+        */
+       private Long mobileId;
+
+       /**
+        * Mobile number
+        */
+       private Long mobileNumber;
+
        /**
         * Phone number area code
         */
@@ -289,7 +295,7 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                // Try to call EJB
                try {
                        // Call EJB
-                       updatedContact = this.contactBean.addContact(contact);
+                       updatedContact = this.adminContactBean.addContact(contact);
                } catch (final ContactAlreadyAddedException ex) {
                        // Throw again
                        throw new FaceletException(ex);
@@ -335,11 +341,11 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.setStreet(contact.getContactStreet());
                this.setZipCode(contact.getContactZipCode());
 
-               // ... cellphone data
-               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
-                       this.setCellphoneId(contact.getContactCellphoneNumber().getPhoneId());
-                       this.setCellphoneCarrier(contact.getContactCellphoneNumber().getCellphoneProvider());
-                       this.setCellphoneNumber(contact.getContactCellphoneNumber().getPhoneNumber());
+               // ... mobile data
+               if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
+                       this.setMobileId(contact.getContactMobileNumber().getPhoneId());
+                       this.setMobileCarrier(contact.getContactMobileNumber().getMobileProvider());
+                       this.setMobileNumber(contact.getContactMobileNumber().getPhoneNumber());
                }
 
                // ... fax data
@@ -363,7 +369,7 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        public Contact createContactInstance () {
                // Generate phone number
                DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new instance
@@ -385,7 +391,7 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.updateContactData(contact);
 
                // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
 
                // Fire event
                this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
@@ -418,7 +424,7 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.updateContactData(contact);
 
                // Call EJB for updating contact data
-               Contact updatedContact = this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               Contact updatedContact = this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
 
                // Fire event
                this.updatedContactEvent.fire(new AdminContactUpdatedEvent(updatedContact));
@@ -431,9 +437,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
        }
 
        @Override
-       public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
+       public String generateMobileNumber (final DialableMobileNumber mobileNumber) {
                // Is it null?
-               if (null == cellphoneNumber) {
+               if (null == mobileNumber) {
                        // Return null
                        return null;
                }
@@ -441,9 +447,9 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                // Get all data
                String number = String.format(
                           "%s%d%d", //NOI18N
-                          cellphoneNumber.getCellphoneProvider().getProviderCountry().getCountryExternalDialPrefix(),
-                          cellphoneNumber.getCellphoneProvider().getProviderDialPrefix(),
-                          cellphoneNumber.getPhoneNumber()
+                          mobileNumber.getMobileProvider().getProviderCountry().getCountryExternalDialPrefix(),
+                          mobileNumber.getMobileProvider().getProviderDialPrefix(),
+                          mobileNumber.getPhoneNumber()
           );
 
                // Return it
@@ -482,36 +488,6 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.birthday = birthday;
        }
 
-       @Override
-       public MobileProvider getCellphoneCarrier () {
-               return this.cellphoneCarrier;
-       }
-
-       @Override
-       public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
-               this.cellphoneCarrier = cellphoneCarrier;
-       }
-
-       @Override
-       public Long getCellphoneId () {
-               return this.cellphoneId;
-       }
-
-       @Override
-       public void setCellphoneId (final Long cellphoneId) {
-               this.cellphoneId = cellphoneId;
-       }
-
-       @Override
-       public Long getCellphoneNumber () {
-               return this.cellphoneNumber;
-       }
-
-       @Override
-       public void setCellphoneNumber (Long cellphoneNumber) {
-               this.cellphoneNumber = cellphoneNumber;
-       }
-
        @Override
        public String getCity () {
                return this.city;
@@ -662,6 +638,36 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.landLineId = landLineId;
        }
 
+       @Override
+       public MobileProvider getMobileCarrier () {
+               return this.mobileCarrier;
+       }
+
+       @Override
+       public void setMobileCarrier (final MobileProvider mobileCarrier) {
+               this.mobileCarrier = mobileCarrier;
+       }
+
+       @Override
+       public Long getMobileId () {
+               return this.mobileId;
+       }
+
+       @Override
+       public void setMobileId (final Long mobileId) {
+               this.mobileId = mobileId;
+       }
+
+       @Override
+       public Long getMobileNumber () {
+               return this.mobileNumber;
+       }
+
+       @Override
+       public void setMobileNumber (Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
+       }
+
        @Override
        public Integer getPhoneAreaCode () {
                return this.phoneAreaCode;
@@ -763,8 +769,8 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.setPhoneCountry(null);
                this.setPhoneAreaCode(null);
                this.setPhoneNumber(null);
-               this.setCellphoneCarrier(null);
-               this.setCellphoneNumber(null);
+               this.setMobileCarrier(null);
+               this.setMobileNumber(null);
                this.setFaxCountry(null);
                this.setFaxAreaCode(null);
                this.setFaxNumber(null);
@@ -835,8 +841,8 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                contact.setContactCity(this.getCity());
                contact.setContactCountry(this.getCountry());
 
-               // Update contact's cellphone number
-               this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
+               // Update contact's mobile number
+               this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
 
                // Update contact's land-line number
                this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
index 80e1a0c7a352164ccee93a11680ac03a6158013f..b6a4a6d39d5fa87648fe43ace2cb759fd68479b4 100644 (file)
@@ -22,7 +22,7 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 
 /**
@@ -55,25 +55,25 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        void copyContactToController (final Contact contact);
 
        /**
-        * Edits cuirrently loaded contact's data in database.
+        * Edits currently loaded contact's data in database.
         * <p>
         * @return Redirect outcome
         */
        String editContactData ();
 
        /**
-        * Getter for cellphone id
+        * Getter for mobile id
         * <p>
-        * @return Cellphone id
+        * @return Mobile id
         */
-       Long getCellphoneId ();
+       Long getMobileId ();
 
        /**
-        * Setter for cellphone id
+        * Setter for mobile id
         * <p>
-        * @param cellphoneId Cellphone id
+        * @param mobileId Mobile id
         */
-       void setCellphoneId (final Long cellphoneId);
+       void setMobileId (final Long mobileId);
 
        /**
         * Getter for fax id
@@ -118,32 +118,32 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        void setBirthday (final Date birthday);
 
        /**
-        * Getter for ellphone number's carrier
+        * Getter for mobile number's carrier
         * <p>
-        * @return Cellphone number's carrier
+        * @return Mobile number's carrier
         */
-       MobileProvider getCellphoneCarrier ();
+       MobileProvider getMobileCarrier ();
 
        /**
-        * Setter for cellphone number's carrier prefix
+        * Setter for mobile number's carrier prefix
         * <p>
-        * @param cellphoneCarrier Cellphone number's carrier prefix
+        * @param mobileCarrier Mobile number's carrier prefix
         */
-       void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
+       void setMobileCarrier (final MobileProvider mobileCarrier);
 
        /**
-        * Getter for ellphone number
+        * Getter for mobile number
         * <p>
-        * @return Cellphone number
+        * @return Mobile number
         */
-       Long getCellphoneNumber ();
+       Long getMobileNumber ();
 
        /**
-        * Setter for ellphone number
+        * Setter for mobile number
         * <p>
-        * @param cellphoneNumber Cellphone number
+        * @param mobileNumber Mobile number
         */
-       void setCellphoneNumber (final Long cellphoneNumber);
+       void setMobileNumber (final Long mobileNumber);
 
        /**
         * City
@@ -422,14 +422,14 @@ public interface AddressbookAdminContactWebRequestController extends Serializabl
        String generatePhoneNumber (final DialableNumber phoneNumber);
 
        /**
-        * Returns a text representation of given cellphone number or null if not
+        * Returns a text representation of given mobile number or null if not
         * set.
         * <p>
-        * @param cellphoneNumber Cellphone number
+        * @param mobileNumber Mobile number
         * <p>
         * @return Text respresentation or null
         */
-       String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
+       String generateMobileNumber (final DialableMobileNumber mobileNumber);
 
        /**
         * Checks/returns whether the gender/salutation is required for this
index f9ea24c84d3fc49ec1c82cfa638a840b4095a82b..6261435f9245bda842b2292decb033b402ee3e8e 100644 (file)
@@ -44,12 +44,12 @@ import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
@@ -79,14 +79,14 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
        private Date birthday;
 
        /**
-        * Cellphone number's carrier
+        * Mobile number's carrier
         */
-       private MobileProvider cellphoneCarrier;
+       private MobileProvider mobileCarrier;
 
        /**
-        * Cellphone number
+        * Mobile number
         */
-       private Long cellphoneNumber;
+       private Long mobileNumber;
 
        /**
         * City
@@ -169,9 +169,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
        private String houseNumberExtension;
 
        /**
-        * Whether a cellphone entry has been unlinked
+        * Whether a mobile entry has been unlinked
         */
-       private boolean isCellphoneUnlinked;
+       private boolean isMobileUnlinked;
 
        /**
         * Whether a fax entry has been unlinked
@@ -460,7 +460,7 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
                // Generate phone number
                DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+               DialableMobileNumber mobile = new MobileNumber(this.getMobileCarrier(), this.getMobileNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new contact
@@ -521,18 +521,18 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                }
 
                // Is the provider set?
-               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((mobile instanceof DialableMobileNumber) && (this.getMobileCarrier() instanceof MobileProvider) && (this.getMobileNumber() != null) && (this.getMobileNumber() > 0)) {
                        // Is the number set?
-                       if (cellphone.getPhoneNumber() == null) {
+                       if (mobile.getPhoneNumber() == null) {
                                // Is null
-                               throw new NullPointerException("cellphone.phoneNumber is null"); //NOI18N
-                       } else if (cellphone.getPhoneNumber() < 1) {
+                               throw new NullPointerException("mobile.phoneNumber is null"); //NOI18N
+                       } else if (mobile.getPhoneNumber() < 1) {
                                // Abort here
-                               throw new IllegalArgumentException("cellphone.phoneNumber is zero or below."); //NOI18N
+                               throw new IllegalArgumentException("mobile.phoneNumber is zero or below."); //NOI18N
                        }
 
-                       // Set cellphone number
-                       contact.setContactCellphoneNumber(cellphone);
+                       // Set mobile number
+                       contact.setContactMobileNumber(mobile);
                }
 
                // Trace message
@@ -576,8 +576,8 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                contact.setContactCity(this.getCity());
                contact.setContactCountry(this.getCountry());
 
-               // Update contact's cellphone number
-               this.isCellphoneUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getCellphoneCarrier(), this.getCellphoneNumber());
+               // Update contact's mobile number
+               this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileCarrier(), this.getMobileNumber());
 
                // Update contact's land-line number
                this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
@@ -586,7 +586,7 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Send it to the EJB
-               this.contactBean.updateContactData(contact, this.isCellphoneUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
+               this.contactBean.updateContactData(contact, this.isMobileUnlinked, this.isLandLineUnlinked, this.isFaxUnlinked);
 
                // All fine
                return "contact_data_saved"; //NOI18N
@@ -605,23 +605,23 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
        }
 
        @Override
-       public MobileProvider getCellphoneCarrier () {
-               return this.cellphoneCarrier;
+       public MobileProvider getMobileCarrier () {
+               return this.mobileCarrier;
        }
 
        @Override
-       public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
-               this.cellphoneCarrier = cellphoneCarrier;
+       public void setMobileCarrier (final MobileProvider mobileCarrier) {
+               this.mobileCarrier = mobileCarrier;
        }
 
        @Override
-       public Long getCellphoneNumber () {
-               return this.cellphoneNumber;
+       public Long getMobileNumber () {
+               return this.mobileNumber;
        }
 
        @Override
-       public void setCellphoneNumber (Long cellphoneNumber) {
-               this.cellphoneNumber = cellphoneNumber;
+       public void setMobileNumber (final Long mobileNumber) {
+               this.mobileNumber = mobileNumber;
        }
 
        @Override
@@ -1014,8 +1014,8 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                this.setPhoneAreaCode(null);
                this.setPhoneCountry(null);
                this.setPhoneNumber(null);
-               this.setCellphoneCarrier(null);
-               this.setCellphoneNumber(null);
+               this.setMobileCarrier(null);
+               this.setMobileNumber(null);
                this.setFaxAreaCode(null);
                this.setFaxCountry(null);
                this.setFaxNumber(null);
@@ -1059,8 +1059,8 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                this.setBirthday(contact.getContactBirthday());
                this.setComment(contact.getContactComment());
 
-               // Get cellphone, phone and fax instance
-               DialableCellphoneNumber cellphone = contact.getContactCellphoneNumber();
+               // Get mobile, phone and fax instance
+               DialableMobileNumber mobile = contact.getContactMobileNumber();
                DialableFaxNumber fax = contact.getContactFaxNumber();
                DialableLandLineNumber phone = contact.getContactLandLineNumber();
 
@@ -1071,9 +1071,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                        this.setPhoneNumber(phone.getPhoneNumber());
                }
 
-               if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof MobileProvider)) {
-                       this.setCellphoneCarrier(cellphone.getCellphoneProvider());
-                       this.setCellphoneNumber(cellphone.getPhoneNumber());
+               if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) {
+                       this.setMobileCarrier(mobile.getMobileProvider());
+                       this.setMobileNumber(mobile.getPhoneNumber());
                }
 
                if ((fax instanceof DialableFaxNumber) && (fax.getPhoneAreaCode() > 0)) {
index 2d5ee2bf9b33d3b64be5c5824f90810ca332764a..17aba7c50e9499bdd883a146bc28c3d2669b5816 100644 (file)
@@ -145,32 +145,32 @@ public interface AddressbookContactWebSessionController extends Serializable {
        void setBirthday (final Date birthday);
 
        /**
-        * Getter for ellphone number's carrier
+        * Getter for mobile number's carrier
         * <p>
-        * @return Cellphone number's carrier
+        * @return Mobile number's carrier
         */
-       MobileProvider getCellphoneCarrier ();
+       MobileProvider getMobileCarrier ();
 
        /**
-        * Setter for cellphone number's carrier prefix
+        * Setter for mobile number's carrier prefix
         * <p>
-        * @param cellphoneCarrier Cellphone number's carrier prefix
+        * @param mobileCarrier Mobile number's carrier prefix
         */
-       void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
+       void setMobileCarrier (final MobileProvider mobileCarrier);
 
        /**
-        * Getter for ellphone number
+        * Getter for mobile number
         * <p>
-        * @return Cellphone number
+        * @return Mobile number
         */
-       Long getCellphoneNumber ();
+       Long getMobileNumber ();
 
        /**
-        * Setter for ellphone number
+        * Setter for mobile number
         * <p>
-        * @param cellphoneNumber Cellphone number
+        * @param mobileNumber Mobile number
         */
-       void setCellphoneNumber (final Long cellphoneNumber);
+       void setMobileNumber (final Long mobileNumber);
 
        /**
         * City
index 1cd635e3e49ce86dd897e73b175e9e98030bdb58..333b55200eb6f5850845b0160526385ac8765e6a 100644 (file)
@@ -22,7 +22,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Observes;
 import javax.faces.view.facelets.FaceletException;
@@ -37,7 +36,6 @@ import org.mxchange.addressbook.beans.phone.AddressbookAdminPhoneWebRequestContr
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 
@@ -66,11 +64,6 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
        @Inject
        private AddressbookAdminPhoneWebRequestController adminPhoneController;
 
-       /**
-        * All cell phone numbers
-        */
-       private final List<DialableCellphoneNumber> cellphoneNumbers;
-
        /**
         * General contact controller
         */
@@ -100,7 +93,6 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
                }
 
                // Init lists/maps
-               this.cellphoneNumbers = new LinkedList<>();
                this.contacts = new HashMap<>(10);
        }
 
@@ -121,15 +113,6 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
                        throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
                }
 
-               // Get contact
-               Contact contact = event.getAddedContact();
-
-               // Is cellphone set?
-               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
-                       // Unique-add it
-                       this.uniqueAddCellphoneNumber(contact.getContactCellphoneNumber());
-               }
-
                // Clear this bean
                this.clear();
        }
@@ -174,9 +157,9 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
        }
 
        @Override
-       public List<Contact> allCellphoneContacts () {
+       public List<Contact> allMobileContacts () {
                // Get id
-               Long phoneId = this.adminPhoneController.getCellPhone().getPhoneId();
+               Long phoneId = this.adminPhoneController.getMobileNumber().getPhoneId();
 
                // Is cache there?
                if (this.contacts.containsKey(phoneId)) {
@@ -188,8 +171,8 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
 
                        // "Walk" through all contacts
                        for (final Contact contact : this.contactController.allContacts()) {
-                               // Is cellphone instance the same?
-                               if (Objects.equals(contact.getContactCellphoneNumber(), this.adminPhoneController.getCellPhone())) {
+                               // Is mobile instance the same?
+                               if (Objects.equals(contact.getContactMobileNumber(), this.adminPhoneController.getMobileNumber())) {
                                        // Found one
                                        list.add(contact);
                                }
@@ -203,15 +186,6 @@ public class AddressbookContactPhoneWebSessionBean extends BaseAddressbookContro
                }
        }
 
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               // All phone numbers
-               this.cellphoneNumbers.addAll(this.adminPhoneBean.allCellphoneNumbers());
-       }
-
        /**
         * Clears this bean
         */
index 00e70a74668f8d7abc5715db576c438d9cf7b87a..f946ac1f6eca43ab83e268614baf492d3dc98abd 100644 (file)
@@ -42,7 +42,7 @@ public interface AddressbookContactPhoneWebSessionController extends Serializabl
         * <p>
         * @return List of all linked contacts
         */
-       List<Contact> allCellphoneContacts ();
+       List<Contact> allMobileContacts ();
 
        /**
         * Event observer for newly added users by adminstrator
index ffb7490f4385d8a21cffd38c002f609c1dd6c075..edc5beb3edc95a28fa673dd2965205fd4fd68727 100644 (file)
@@ -23,7 +23,7 @@ import javax.inject.Named;
 import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
 import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
 import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jusercore.model.user.User;
@@ -206,9 +206,9 @@ public class AddressbookWebRequestHelper implements AddressbookWebRequestControl
                }
 
                // Is cellphone set?
-               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+               if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // Yes, then set it in admin controller
-                       this.adminPhoneController.setCellPhone(contact.getContactCellphoneNumber());
+                       this.adminPhoneController.setCellPhone(contact.getContactMobileNumber());
                }
 
                // Is land-line set?
index 3ad2697ee0a729c293e6799a77c6d65a0a8ff97d..644401b8779b358151819cae58f3cbf3607a0741 100644 (file)
@@ -24,7 +24,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 
@@ -50,7 +50,7 @@ public class AddressbookAdminPhoneWebRequestBean extends BaseAddressbookControll
        /**
         * Cell phone number
         */
-       private DialableCellphoneNumber cellPhone;
+       private DialableMobileNumber cellPhone;
 
        /**
         * Fax number
@@ -80,12 +80,12 @@ public class AddressbookAdminPhoneWebRequestBean extends BaseAddressbookControll
        }
 
        @Override
-       public DialableCellphoneNumber getCellPhone () {
+       public DialableMobileNumber getMobileNumber () {
                return this.cellPhone;
        }
 
        @Override
-       public void setCellPhone (final DialableCellphoneNumber cellPhone) {
+       public void setCellPhone (final DialableMobileNumber cellPhone) {
                this.cellPhone = cellPhone;
        }
 
index a0ef024920e8fdf11c2fad2e164a4f1684f5dbed..074568ab535548747c3ea27f9c3b861a75c0c622 100644 (file)
@@ -18,9 +18,9 @@ package org.mxchange.addressbook.beans.phone;
 
 import java.io.Serializable;
 import javax.ejb.Local;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 
 /**
  * An interface for a request web controller (bean) for administrative phone
@@ -31,12 +31,19 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 @Local
 public interface AddressbookAdminPhoneWebRequestController extends Serializable {
 
+       /**
+        * Setter for dialable cellphone number instance
+        * <p>
+        * @param cellPhone Dialable cellphone number instance
+        */
+       void setCellPhone (final DialableMobileNumber cellPhone);
+
        /**
         * Getter for dialable cellphone number instance
         * <p>
         * @return Dialable cellphone number instance
         */
-       DialableCellphoneNumber getCellPhone ();
+       DialableMobileNumber getMobileNumber ();
 
        /**
         * Setter for dialable land-line number instance
@@ -66,11 +73,4 @@ public interface AddressbookAdminPhoneWebRequestController extends Serializable
         */
        DialableFaxNumber getFax ();
 
-       /**
-        * Setter for dialable cellphone number instance
-        * <p>
-        * @param cellPhone Dialable cellphone number instance
-        */
-       void setCellPhone (final DialableCellphoneNumber cellPhone);
-
 }
index 6146c723f5283af8cffb6f29007bdd3184be5617..ee4006277df294f64b76682ace943abae0d44adf 100644 (file)
@@ -44,7 +44,7 @@ public interface AddressbookAdminUserWebRequestController extends Serializable {
        String addUser ();
 
        /**
-        * Edits cuirrently loaded user's data in database.
+        * Edits currently loaded user's data in database.
         * <p>
         * @return Redirect outcome
         */
index f9606de4ec02565c5f2e95a6b51321af670b8ba9..5430427237c2dbec139825bbdc712a8b65fb94cf 100644 (file)
@@ -29,6 +29,7 @@ import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController;
 import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
+import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
 import org.mxchange.jusercore.events.user.password_change.UserUpdatedPasswordEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -173,8 +174,11 @@ public class AddressbookUserPasswordWebRequestBean extends BaseAddressbookContro
                user.setUserEncryptedPassword(encryptedPassword);
 
                try {
+                       // Get base URL
+                       String baseUrl = FacesUtils.generateBaseUrl();
+
                        // All is set, then update password
-                       PasswordHistory passwordHistory = this.userBean.updateUserPassword(user);
+                       PasswordHistory passwordHistory = this.userBean.updateUserPassword(user, baseUrl);
 
                        // Fire event
                        this.userUpdatedPasswordEvent.fire(new UserUpdatedPasswordEvent(passwordHistory));
index 02cff527015df8268268118d63247f9a999b5018..2d507114aadb8d0904597778e8439a97c659ab51 100644 (file)
@@ -29,7 +29,7 @@ import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
 import org.mxchange.jphone.phonenumbers.DialableNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote;
 
 /**
@@ -86,7 +86,7 @@ public class AddressbookCellphoneConverter implements Converter {
                }
 
                // Init instance
-               DialableCellphoneNumber cellphone = null;
+               DialableMobileNumber cellphone = null;
 
                try {
                        // Try to parse the value as long
@@ -96,7 +96,7 @@ public class AddressbookCellphoneConverter implements Converter {
                        // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: userId{0}", userId)); //NOI18N
 
                        // Try to get cellphone instance from it
-                       cellphone = this.phoneBean.findCellphoneById(cellphoneId);
+                       cellphone = this.phoneBean.findMobileNumberById(cellphoneId);
 
                        // Debug message
                        // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: cellphone={0}", cellphone)); //NOI18N
index 569b0624d8badfab1e26c7feed5b9d0106812dc1..4e040639b85285b3cd85fd4cdd31c6169708291d 100644 (file)
@@ -23,7 +23,7 @@
                                <ui:param name="isShowPage" value="#{true}" />
                        </ui:include>
 
-                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{contactPhoneController.allCellphoneContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
+                       <h:dataTable id="contact_cellphone_link" var="contact" value="#{contactPhoneController.allMobileContacts()}" summary="#{msg.TABLE_SUMMARY_ADMIN_SHOW_CELLPHONE_LINKS}" headerClass="table_header_column" styleClass="table_medium">
                                <f:facet name="header">
                                        <h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_CELLPHONE_LINKS}">
                                                <f:param value="#{adminPhoneController.cellPhone.phoneId}" />