From: Roland Haeder Date: Mon, 10 Apr 2017 20:07:13 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c1d22015e1be6ed1792782f54868f0a890b34c14;p=pizzaservice-war.git Continued a bit: - not just cellphones, let's support any mobile phone - tpzo fixed --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java index dc5b2478..4880528a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java @@ -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 diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java index f9dafccd..bff7a90a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestController.java @@ -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. *

* @return Redirect outcome */ @@ -448,7 +448,7 @@ public interface PizzaAdminContactWebRequestController extends Serializable { *

* @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 diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java index d337c840..a73d1a6c 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java @@ -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()); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java index 8658520e..9ee4755d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java @@ -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 cellphoneNumbers; + private final List 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 allCellphoneContacts () { + public List 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); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java index 433e6f21..f4343a8e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionController.java @@ -42,7 +42,7 @@ public interface PizzaContactPhoneWebSessionController extends Serializable { *

* @return List of all linked contacts */ - List allCellphoneContacts (); + List allMobileContacts (); /** * Event observer for newly added users by adminstrator diff --git a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java index 57d50f17..7ad29210 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java +++ b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java @@ -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()); } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestBean.java index a9243f90..c3571915 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestBean.java @@ -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; } diff --git a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestController.java index 99d20e1c..7fab3442 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminPhoneWebRequestController.java @@ -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 *

- * @return Dialable cellphone number instance + * @return Dialable mobile number instance */ - DialableCellphoneNumber getCellPhone (); + DialableMobileNumber getMobileNumber (); /** * Setter for dialable land-line number instance *

* @param landLine Dialable land-line number instance */ - void setLandLine (final DialableLandLineNumber landLine); + void setLandLineNumber (final DialableLandLineNumber landLine); /** * Getter for dialable land-line number instance *

* @return Dialable land-line number instance */ - DialableLandLineNumber getLandLine (); + DialableLandLineNumber getLandLineNumber (); /** * Setter for dialable fax number instance *

* @param fax Dialable fax number instance */ - void setFax (final DialableFaxNumber fax); + void setFaxNumber (final DialableFaxNumber fax); /** * Getter for dialable fax number instance *

* @return Dialable fax number instance */ - DialableFaxNumber getFax (); + DialableFaxNumber getFaxNumber (); /** - * Setter for dialable cellphone number instance + * Setter for dialable mobile number instance *

- * @param cellPhone Dialable cellphone number instance + * @param mobileNumber Dialable mobile number instance */ - void setCellPhone (final DialableCellphoneNumber cellPhone); + void setMobileNumber (final DialableMobileNumber mobileNumber); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java index 59887386..03a26a61 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java @@ -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. *

* @return Redirect outcome */ diff --git a/src/java/org/mxchange/pizzaapplication/converter/cellphone/PizzaCellphoneConverter.java b/src/java/org/mxchange/pizzaapplication/converter/cellphone/PizzaCellphoneConverter.java index 0416846f..038b1b6a 100644 --- a/src/java/org/mxchange/pizzaapplication/converter/cellphone/PizzaCellphoneConverter.java +++ b/src/java/org/mxchange/pizzaapplication/converter/cellphone/PizzaCellphoneConverter.java @@ -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 diff --git a/web/admin/cellphone/admin_cellphone_show.xhtml b/web/admin/cellphone/admin_cellphone_show.xhtml index 569b0624..4e040639 100644 --- a/web/admin/cellphone/admin_cellphone_show.xhtml +++ b/web/admin/cellphone/admin_cellphone_show.xhtml @@ -23,7 +23,7 @@ - +