]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Mon, 10 Apr 2017 20:07:13 +0000 (22:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 10 Apr 2017 20:07:13 +0000 (22:07 +0200)
- not just cellphones, let's support any mobile phone
- tpzo fixed

src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestController.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java
src/java/org/mxchange/pizzaapplication/converter/cellphone/PizzaCellphoneConverter.java
web/admin/cellphone/admin_cellphone_show.xhtml

index dc5b2478c022e832c4e11cdd76c73ff8cee35faf..4880528ade522306577ced6208914d77e67d9b2f 100644 (file)
@@ -43,7 +43,7 @@ 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.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -321,11 +321,11 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                this.setZipCode(contact.getContactZipCode());
 
                // Is the cell phone set?
-               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+               if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // ... cellphone data
-                       this.setCellphoneId(contact.getContactCellphoneNumber().getPhoneId());
-                       this.setCellphoneCarrier(contact.getContactCellphoneNumber().getCellphoneProvider());
-                       this.setCellphoneNumber(contact.getContactCellphoneNumber().getPhoneNumber());
+                       this.setCellphoneId(contact.getContactMobileNumber().getPhoneId());
+                       this.setCellphoneCarrier(contact.getContactMobileNumber().getCellphoneProvider());
+                       this.setCellphoneNumber(contact.getContactMobileNumber().getPhoneNumber());
                }
 
                // Is the fax set?
@@ -372,7 +372,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
 
                // Generate phone number
                DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+               DialableMobileNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new instance
@@ -435,7 +435,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
                }
 
                // Is the provider set?
-               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((cellphone instanceof DialableMobileNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
                        // Is the number set?
                        if (cellphone.getPhoneNumber() == null) {
                                // Is null
@@ -487,7 +487,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme
        }
 
        @Override
-       public String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) {
+       public String generateCellphoneNumber (final DialableMobileNumber cellphoneNumber) {
                // Is it null?
                if (null == cellphoneNumber) {
                        // Return null
index f9dafccd47ec309aaef47ae786dd2bb784efab5c..bff7a90addbaf43afd26da0574c9d78fc7d23d18 100644 (file)
@@ -23,7 +23,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;
 
 /**
@@ -57,7 +57,7 @@ public interface PizzaAdminContactWebRequestController extends Serializable {
        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
         */
@@ -448,7 +448,7 @@ public interface PizzaAdminContactWebRequestController extends Serializable {
         * <p>
         * @return Text respresentation or null
         */
-       String generateCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
+       String generateCellphoneNumber (final DialableMobileNumber cellphoneNumber);
 
        /**
         * Checks/returns whether the gender/salutation is required for this
index d337c84055a0c2cbaefbbe5ec0e01e9ec111e1f0..a73d1a6cb6fb9e9fa2b09c96ca477aae79e227c6 100644 (file)
@@ -42,7 +42,7 @@ 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.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -451,7 +451,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
 
                // Generate phone number
                DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
-               DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+               DialableMobileNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
                DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
 
                // Create new contact
@@ -512,7 +512,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                }
 
                // Is the provider set?
-               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((cellphone instanceof DialableMobileNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
                        // Is the number set?
                        if (cellphone.getPhoneNumber() == null) {
                                // Is null
@@ -1051,7 +1051,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                this.setComment(contact.getContactComment());
 
                // Get cellphone, phone and fax instance
-               DialableCellphoneNumber cellphone = contact.getContactCellphoneNumber();
+               DialableMobileNumber cellphone = contact.getContactMobileNumber();
                DialableFaxNumber fax = contact.getContactFaxNumber();
                DialableLandLineNumber phone = contact.getContactLandLineNumber();
 
@@ -1062,7 +1062,7 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                        this.setPhoneNumber(phone.getPhoneNumber());
                }
 
-               if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof MobileProvider)) {
+               if ((cellphone instanceof DialableMobileNumber) && (cellphone.getCellphoneProvider() instanceof MobileProvider)) {
                        this.setCellphoneCarrier(cellphone.getCellphoneProvider());
                        this.setCellphoneNumber(cellphone.getPhoneNumber());
                }
index 8658520eb61270cb3bf9e52c1ec76dd7687a8a1d..9ee4755d7761fdd7b5756ae4a35518563713a789 100644 (file)
@@ -34,7 +34,7 @@ import javax.naming.NamingException;
 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.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
@@ -69,7 +69,7 @@ public class PizzaContactPhoneWebSessionBean extends BasePizzaController impleme
        /**
         * All cell phone numbers
         */
-       private final List<DialableCellphoneNumber> cellphoneNumbers;
+       private final List<DialableMobileNumber> cellphoneNumbers;
 
        /**
         * General contact controller
@@ -125,9 +125,9 @@ public class PizzaContactPhoneWebSessionBean extends BasePizzaController impleme
                Contact contact = event.getAddedContact();
 
                // Is cellphone set?
-               if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) {
+               if (contact.getContactMobileNumber() instanceof DialableMobileNumber) {
                        // Unique-add it
-                       this.uniqueAddCellphoneNumber(contact.getContactCellphoneNumber());
+                       this.uniqueAddCellphoneNumber(contact.getContactMobileNumber());
                }
 
                // Clear this bean
@@ -174,9 +174,9 @@ public class PizzaContactPhoneWebSessionBean extends BasePizzaController impleme
        }
 
        @Override
-       public List<Contact> allCellphoneContacts () {
+       public List<Contact> allMobileContacts () {
                // Get id
-               Long phoneId = this.adminPhoneController.getCellPhone().getPhoneId();
+               Long phoneId = this.adminPhoneController.getCellphone().getPhoneId();
 
                // Is cache there?
                if (this.contacts.containsKey(phoneId)) {
@@ -189,7 +189,7 @@ public class PizzaContactPhoneWebSessionBean extends BasePizzaController impleme
                        // "Walk" through all contacts
                        for (final Contact contact : this.contactController.allContacts()) {
                                // Is cellphone instance the same?
-                               if (Objects.equals(contact.getContactCellphoneNumber(), this.adminPhoneController.getCellPhone())) {
+                               if (Objects.equals(contact.getContactMobileNumber(), this.adminPhoneController.getCellphone())) {
                                        // Found one
                                        list.add(contact);
                                }
index 433e6f21e855dc8874c2c563a187347f4d57564a..f4343a8e3103e506c777d2403a2d1af1d5712a77 100644 (file)
@@ -42,7 +42,7 @@ public interface PizzaContactPhoneWebSessionController extends Serializable {
         * <p>
         * @return List of all linked contacts
         */
-       List<Contact> allCellphoneContacts ();
+       List<Contact> allMobileContacts ();
 
        /**
         * Event observer for newly added users by adminstrator
index 57d50f17336771cba7b487720540502b22cf0980..7ad292108f98160a15dd158b08d38c02b698ce76 100644 (file)
@@ -22,7 +22,7 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcustomercore.model.customer.Customer;
-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;
@@ -267,21 +267,21 @@ public class PizzaWebRequestHelper implements PizzaWebRequestController {
                }
 
                // 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.setMobileNumber(contact.getContactMobileNumber());
                }
 
                // Is land-line set?
                if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) {
                        // Yes, then set it in admin controller
-                       this.adminPhoneController.setLandLine(contact.getContactLandLineNumber());
+                       this.adminPhoneController.setLandLineNumber(contact.getContactLandLineNumber());
                }
 
                // Is fax set?
                if (contact.getContactFaxNumber() instanceof DialableFaxNumber) {
                        // Yes, then set it in admin controller
-                       this.adminPhoneController.setFax(contact.getContactFaxNumber());
+                       this.adminPhoneController.setFaxNumber(contact.getContactFaxNumber());
                }
        }
 
index a9243f90f9d72f87a1b5c89224b03a60bc1edc2f..c35719157060b28407b0b2fe6b58003d4a79f5c4 100644 (file)
@@ -23,7 +23,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 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;
 import org.mxchange.pizzaapplication.beans.BasePizzaController;
@@ -50,7 +50,7 @@ public class PizzaAdminPhoneWebRequestBean extends BasePizzaController implement
        /**
         * Cell phone number
         */
-       private DialableCellphoneNumber cellPhone;
+       private DialableMobileNumber cellPhone;
 
        /**
         * Fax number
@@ -80,32 +80,32 @@ public class PizzaAdminPhoneWebRequestBean extends BasePizzaController implement
        }
 
        @Override
-       public DialableCellphoneNumber getCellPhone () {
+       public DialableMobileNumber getMobileNumber () {
                return this.cellPhone;
        }
 
        @Override
-       public void setCellPhone (final DialableCellphoneNumber cellPhone) {
+       public void setMobileNumber (final DialableMobileNumber cellPhone) {
                this.cellPhone = cellPhone;
        }
 
        @Override
-       public DialableFaxNumber getFax () {
+       public DialableFaxNumber getFaxNumber () {
                return this.fax;
        }
 
        @Override
-       public void setFax (final DialableFaxNumber fax) {
+       public void setFaxNumber (final DialableFaxNumber fax) {
                this.fax = fax;
        }
 
        @Override
-       public DialableLandLineNumber getLandLine () {
+       public DialableLandLineNumber getLandLineNumber () {
                return this.landLine;
        }
 
        @Override
-       public void setLandLine (final DialableLandLineNumber landLine) {
+       public void setLandLineNumber (final DialableLandLineNumber landLine) {
                this.landLine = landLine;
        }
 
index 99d20e1cfa02e3493d32ecd4a90d059c94b957aa..7fab3442d612481099628e15a6795e92bda8a3d6 100644 (file)
@@ -18,9 +18,9 @@ package org.mxchange.pizzaapplication.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
@@ -32,45 +32,45 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 public interface PizzaAdminPhoneWebRequestController extends Serializable {
 
        /**
-        * Getter for dialable cellphone number instance
+        * Getter for dialable mobile number instance
         * <p>
-        * @return Dialable cellphone number instance
+        * @return Dialable mobile number instance
         */
-       DialableCellphoneNumber getCellPhone ();
+       DialableMobileNumber getMobileNumber ();
 
        /**
         * Setter for dialable land-line number instance
         * <p>
         * @param landLine Dialable land-line number instance
         */
-       void setLandLine (final DialableLandLineNumber landLine);
+       void setLandLineNumber (final DialableLandLineNumber landLine);
 
        /**
         * Getter for dialable land-line number instance
         * <p>
         * @return Dialable land-line number instance
         */
-       DialableLandLineNumber getLandLine ();
+       DialableLandLineNumber getLandLineNumber ();
 
        /**
         * Setter for dialable fax number instance
         * <p>
         * @param fax Dialable fax number instance
         */
-       void setFax (final DialableFaxNumber fax);
+       void setFaxNumber (final DialableFaxNumber fax);
 
        /**
         * Getter for dialable fax number instance
         * <p>
         * @return Dialable fax number instance
         */
-       DialableFaxNumber getFax ();
+       DialableFaxNumber getFaxNumber ();
 
        /**
-        * Setter for dialable cellphone number instance
+        * Setter for dialable mobile number instance
         * <p>
-        * @param cellPhone Dialable cellphone number instance
+        * @param mobileNumber Dialable mobile number instance
         */
-       void setCellPhone (final DialableCellphoneNumber cellPhone);
+       void setMobileNumber (final DialableMobileNumber mobileNumber);
 
 }
index 5988738605fe07bd0dc5bd819827f126f2684560..03a26a612a8b2ed68936fa731c9ddd7c17006225 100644 (file)
@@ -44,7 +44,7 @@ public interface PizzaAdminUserWebRequestController 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 0416846f2f202a6a0f4f7594bcd3e312a9137bd8..038b1b6a757ad299d7662c1ec0b74c327bcc67de 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 PizzaCellphoneConverter implements Converter {
                }
 
                // Init instance
-               DialableCellphoneNumber cellphone = null;
+               DialableMobileNumber cellphone = null;
 
                try {
                        // Try to parse the value as long
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}" />