From 029b70a8f8e8b10ef3b0ceb7765e03fc191273d2 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 11:07:04 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20bean=20(controller)=20f?= =?utf8?q?or=20SMS=20provider=20data=20retrieval=20-=20expanded=20phone,?= =?utf8?q?=20fax=20and=20cellphone=20form=20fields=20so=20they=20better=20?= =?utf8?q?fit=20for=20ongoing=20rewrite=20-=20updated=20jars=20Signed-off-?= =?utf8?q?by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcoreee.jar | Bin 18176 -> 18204 bytes lib/jphone-core.jar | Bin 17075 -> 19467 bytes nbproject/faces-config.NavData | 104 ++++++------ .../beans/smsprovider/SmsProviderWebBean.java | 82 +++++++++ .../smsprovider/SmsProviderWebController.java | 36 ++++ .../addressbook/beans/user/UserWebBean.java | 160 ++++++++++++++---- .../beans/user/UserWebController.java | 110 +++++++++--- .../templates/generic/form_personal_data.tpl | 34 +++- 8 files changed, 419 insertions(+), 107 deletions(-) create mode 100644 src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebBean.java create mode 100644 src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebController.java diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 7b88b148a9b687ad7c8259e8bd8fc3a6689750ee..093433c9bcb8dc508c42f20a649f82a3d7f6cbdc 100644 GIT binary patch delta 1071 zcmY+CO-NKx6vzMf&BxW}bH>Jx(Hff>9jBa98z)o8YQA(bM|3i+nX)hlB3eXkiol#G zE9nF520;XF+O!Ih(iTDOs+FsP+O%lVA~0JCL3Yj)$sXMMJMVwb{oi{Jr*L09xi5@t z#$wfhB4BiQ+Gx~{4^Ov0(kNc^@%*ciW>qV~jI4+ml+_+`Y?iwBLKk%s`zVKTDJUXCe<8JlUQLD~)oh`?7*s)K? ze#CUdk&s9hAtlkRqX%gnRvaiouf#zeI{Ku_M8b2c`b(`mBQYQ`NSPA#v`ZqZ-j#;R zD^N+YfkPM~$-rUI6RNhUosLk+h=C(GYM=r+b;@ztQh~f$cIQ>1$UWzG_K67%rEoxC zGn^kWx!4Rw6%Z zE4*Y)c488e@_{L#zL(vbV5=zI0ys$L_M;esv^<0$j$#+`h+ve8c#@PMAC$fyUiIWU}a%k<(qo$K)Kl_s& zwVd3;YGW$LxSkp-{jamt&s3flGTk2Sq04OXLU)^wbNnk~&tF&p9wStn_3!DmDzBO7 z^F@`OcJcOTk4M`dFx8(zSBsidg`RrT=F97rTa#qLBeU*7e0uG3(}oS@%F$e-%F2-rIZTgTk!+s*AM?9A_{^=Lm~^}!f0ZQAyMkW57Cgo z!j$7kw7NQD(4tjGOspuiWVfZnCY7C+VCs2!%=%d^qMv0xlC7i<*oX1UEGz%D` zC;TXf8y=+5IXX}XFMa)N#83nudFCRFVq!EDnAj}TWd3pNHmjdN2}-F(-VUIQN?}$` zHdf--QGrU>$S6S#@zCiFT&D7ZbecV+48ZoAT+<|KB=$<|lh`kDK%!QnP7o8+!nzIE z+}r-^i=cx$xaal%&uenQnJ{>qyl%gZvCDTamGN`M7i$KO*NyVk>oYW3Gg5sBm8(Qs zp8DoYO;*<2k*r$^{jw6OrRF*s{OPbc(9v);=Prcn7#713hVS7nhNeiI;Z~%VVJe!h zeniZ9$%t^fc4 diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index 0cc0e98f7639332412ce960fccca191ceb400225..f7da496b94a16d7157abd650b5df779de84fa779 100644 GIT binary patch literal 19467 zcmeHPYiwM{bv}2wGt0jJ21{wvV_Xi@Zs z+waWW$K1==-OGoQ#t4ah+Rg1=NCq1r)I5EVa2Z2h8OKhwNNgd z&zu<vl!96_u)W{3%squ4AQTSBXs_T{V z<3ir9G!W@%9afL6Vj*wU%3E}MX!HmFel$kJuXA;X16?ywu!`1$qJ2Yj)kv;rRjWVx z@O$3}?elcdq#l!cP3kjf|EgV^V`CUEZ#>zZF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t?zb@B7tj6B1p;VX>> zVKwfKiEtxD7p*8zLX2eY`^GeBY&)6b_NJXeG_G{Si7q)5MrS&|(xljl!%7_U?LuB# qUx?7L@r7n#%hQ}DjhBhlA1#Uee3i!9(X7^xR0{sz!qGiZr~d}CND|Ee diff --git a/nbproject/faces-config.NavData b/nbproject/faces-config.NavData index a28edad9..f1818296 100644 --- a/nbproject/faces-config.NavData +++ b/nbproject/faces-config.NavData @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebBean.java b/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebBean.java new file mode 100644 index 00000000..667fe020 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebBean.java @@ -0,0 +1,82 @@ +package org.mxchange.addressbook.beans.smsprovider; + +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import java.util.Collections; +import java.util.List; +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jphone.phonenumbers.smsprovider.AddressbookSmsProviderSingletonBeanRemote; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; + +/** + * A country bean + *

+ * @author Roland Haeder + */ +@Named ("cellphone") +@ApplicationScoped +public class SmsProviderWebBean implements SmsProviderWebController { + + /** + * Serial number + */ + private static final long serialVersionUID = 176_985_298_681_742_960L; + + /** + * Remote country EJB + */ + private final AddressbookSmsProviderSingletonBeanRemote cellphoneBean; + + /** + * List of all countries + */ + private List cellphoneList; + + /** + * Default constructor + */ + public SmsProviderWebBean () { + // Try this + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup the bean + this.cellphoneBean = (AddressbookSmsProviderSingletonBeanRemote) context.lookup("ejb/addressbook-singleton-smsprovider"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } + + @Override + public List allSmsProvider () { + // Return "cached" version + return Collections.unmodifiableList(this.cellphoneList); + } + + @PostConstruct + public void init () { + this.cellphoneList = this.cellphoneBean.allSmsProvider(); + } +} diff --git a/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebController.java b/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebController.java new file mode 100644 index 00000000..707185d7 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebController.java @@ -0,0 +1,36 @@ +package org.mxchange.addressbook.beans.smsprovider; + +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import java.io.Serializable; +import java.util.List; +import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider; + +/** + * An interface for country beans + *

+ * @author Roland Haeder + */ +public interface SmsProviderWebController extends Serializable { + + /** + * A list of all countries + *

+ * @return All countries + */ + public List allSmsProvider (); +} diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 3bc0d362..f861daab 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -32,9 +32,13 @@ import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.gender.Gender; 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.smsprovider.SmsProvider; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; @@ -59,10 +63,15 @@ public class UserWebBean implements UserWebController { */ private Date birthday; + /** + * Cellphone number's carrier + */ + private SmsProvider cellphoneCarrier; + /** * Cellphone number */ - private DialableCellphoneNumber cellphoneNumber; + private Long cellphoneNumber; /** * City @@ -99,10 +108,20 @@ public class UserWebBean implements UserWebController { */ private String familyName; + /** + * Fax number's area code + */ + private Integer faxAreaCode; + + /** + * Country instance for fax number + */ + private Country faxCountry; + /** * Fax number */ - private DialableFaxNumber faxNumber; + private Long faxNumber; /** * First name @@ -119,10 +138,20 @@ public class UserWebBean implements UserWebController { */ private Short houseNumber; + /** + * Phone number area code + */ + private Integer phoneAreaCode; + + /** + * Country instance for phone number + */ + private Country phoneCountry; + /** * Phone number */ - private DialableLandLineNumber phoneNumber; + private Long phoneNumber; /** * Street @@ -219,9 +248,9 @@ public class UserWebBean implements UserWebController { // - contact data this.setEmailAddress(null); this.setEmailAddressRepeat(null); - this.setPhoneNumber(null); - this.setCellphoneNumber(null); - this.setFaxNumber(null); + this.setPhoneAreaCode(null); + this.setCellphoneCarrier(null); + this.setFaxAreaCode(null); // - other data this.setBirthday(null); @@ -245,10 +274,26 @@ public class UserWebBean implements UserWebController { this.setCity(user.getUserContact().getCity()); this.setCountry(user.getUserContact().getCountry()); + // Get cellphone, phone and fax instance + DialableCellphoneNumber cellphone = user.getUserContact().getCellphoneNumber(); + DialableFaxNumber fax = user.getUserContact().getFaxNumber(); + DialableLandLineNumber phone = user.getUserContact().getPhoneNumber(); + // - contact data - this.setPhoneNumber(user.getUserContact().getPhoneNumber()); - this.setCellphoneNumber(user.getUserContact().getCellphoneNumber()); - this.setFaxNumber(user.getUserContact().getFaxNumber()); + if (phone instanceof DialableLandLineNumber) { + this.setPhoneCountry(phone.getPhoneCountry()); + this.setPhoneAreaCode(phone.getPhoneAreaCode()); + this.setPhoneNumber(phone.getPhoneNumber()); + } + if (cellphone instanceof DialableCellphoneNumber) { + this.setCellphoneCarrier(cellphone.getCellphoneProvider()); + this.setCellphoneNumber(cellphone.getPhoneNumber()); + } + if (fax instanceof DialableFaxNumber) { + this.setFaxCountry(fax.getPhoneCountry()); + this.setFaxAreaCode(fax.getPhoneAreaCode()); + this.setFaxNumber(fax.getPhoneNumber()); + } this.setEmailAddress(user.getUserContact().getEmailAddress()); // -- other data @@ -268,6 +313,11 @@ public class UserWebBean implements UserWebController { User user = new LoginUser(); user.setUserName(this.getUserName()); + // Generate phone number + DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); + DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber()); + DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); + // Create new contact Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName()); contact.setStreet(this.getStreet()); @@ -276,9 +326,9 @@ public class UserWebBean implements UserWebController { contact.setCity(this.getCity()); contact.setCountry(this.getCountry()); contact.setEmailAddress(this.getEmailAddress()); - contact.setPhoneNumber(this.getPhoneNumber()); - contact.setFaxNumber(this.getFaxNumber()); - contact.setCellphoneNumber(this.getCellphoneNumber()); + contact.setPhoneNumber(phone); + contact.setFaxNumber(fax); + contact.setCellphoneNumber(cellphone); contact.setBirthday(this.getBirthday()); contact.setComment(this.getComment()); @@ -307,12 +357,22 @@ public class UserWebBean implements UserWebController { } @Override - public DialableCellphoneNumber getCellphoneNumber () { + public SmsProvider getCellphoneCarrier () { + return this.cellphoneCarrier; + } + + @Override + public void setCellphoneCarrier (final SmsProvider cellphoneCarrier) { + this.cellphoneCarrier = cellphoneCarrier; + } + + @Override + public Long getCellphoneNumber () { return this.cellphoneNumber; } @Override - public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { + public void setCellphoneNumber (Long cellphoneNumber) { this.cellphoneNumber = cellphoneNumber; } @@ -377,12 +437,32 @@ public class UserWebBean implements UserWebController { } @Override - public DialableFaxNumber getFaxNumber () { + public Integer getFaxAreaCode () { + return this.faxAreaCode; + } + + @Override + public void setFaxAreaCode (final Integer faxAreaCode) { + this.faxAreaCode = faxAreaCode; + } + + @Override + public Country getFaxCountry () { + return this.faxCountry; + } + + @Override + public void setFaxCountry (final Country faxCountry) { + this.faxCountry = faxCountry; + } + + @Override + public Long getFaxNumber () { return this.faxNumber; } @Override - public void setFaxNumber (final DialableFaxNumber faxNumber) { + public void setFaxNumber (final Long faxNumber) { this.faxNumber = faxNumber; } @@ -417,12 +497,32 @@ public class UserWebBean implements UserWebController { } @Override - public DialableLandLineNumber getPhoneNumber () { + public Integer getPhoneAreaCode () { + return this.phoneAreaCode; + } + + @Override + public void setPhoneAreaCode (final Integer phoneAreaCode) { + this.phoneAreaCode = phoneAreaCode; + } + + @Override + public Country getPhoneCountry () { + return this.phoneCountry; + } + + @Override + public void setPhoneCountry (final Country phoneCountry) { + this.phoneCountry = phoneCountry; + } + + @Override + public Long getPhoneNumber () { return this.phoneNumber; } @Override - public void setPhoneNumber (final DialableLandLineNumber phoneNumber) { + public void setPhoneNumber (final Long phoneNumber) { this.phoneNumber = phoneNumber; } @@ -502,18 +602,18 @@ public class UserWebBean implements UserWebController { @Override public boolean isRequiredPersonalDataSet () { - return ((this.getUserName() != null) && - (this.getGender() != null) && - (this.getFirstName() != null) && - (this.getFamilyName() != null) && - (this.getStreet() != null) && - (this.getHouseNumber() != null) && - (this.getZipCode() != null) && - (this.getCity() != null) && - (this.getEmailAddress() != null) && - (this.getEmailAddressRepeat() != null) && - (this.getUserPassword() != null) && - (this.getUserPasswordRepeat() != null)); + return ((this.getUserName() != null) + && (this.getGender() != null) + && (this.getFirstName() != null) + && (this.getFamilyName() != null) + && (this.getStreet() != null) + && (this.getHouseNumber() != null) + && (this.getZipCode() != null) + && (this.getCity() != null) + && (this.getEmailAddress() != null) + && (this.getEmailAddressRepeat() != null) + && (this.getUserPassword() != null) + && (this.getUserPasswordRepeat() != null)); } @Override diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java index ac76a10a..2d88e45e 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java @@ -20,9 +20,7 @@ import java.io.Serializable; import java.util.Date; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; -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.smsprovider.SmsProvider; import org.mxchange.jusercore.model.user.User; /** @@ -73,18 +71,32 @@ public interface UserWebController extends Serializable { public void setBirthday (final Date birthday); /** - * Cellphone number + * Getter for ellphone number's carrier *

- * @return the cellphoneNumber + * @return Cellphone number's carrier */ - public DialableCellphoneNumber getCellphoneNumber (); + public SmsProvider getCellphoneCarrier (); /** - * Cellphone number + * Setter for cellphone number's carrier prefix *

- * @param cellphoneNumber the cellphoneNumber to set + * @param cellphoneCarrier Cellphone number's carrier prefix */ - public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); + public void setCellphoneCarrier (final SmsProvider cellphoneCarrier); + + /** + * Getter for ellphone number + *

+ * @return Cellphone number + */ + public Long getCellphoneNumber (); + + /** + * Setter for ellphone number + *

+ * @param cellphoneNumber Cellphone number + */ + public void setCellphoneNumber (final Long cellphoneNumber); /** * City @@ -171,18 +183,46 @@ public interface UserWebController extends Serializable { public void setFamilyName (final String familyName); /** - * Fax number + * Getter for fax number's area code + *

+ * @return Fax number's area code + */ + public Integer getFaxAreaCode (); + + /** + * Setter for fax number's area code + *

+ * @param faxAreaCode Fax number's area code + */ + public void setFaxAreaCode (final Integer faxAreaCode); + + /** + * Getter for fax's country instance + *

+ * @return Fax' country instance + */ + public Country getFaxCountry (); + + /** + * Setter for fax's country instance *

- * @return the faxNumber + * @param faxCountry Fax' country instance */ - public DialableFaxNumber getFaxNumber (); + public void setFaxCountry (final Country faxCountry); /** - * Fax number + * Getter for fax number *

- * @param faxNumber the faxNumber to set + * @return Fax number */ - public void setFaxNumber (final DialableFaxNumber faxNumber); + public Long getFaxNumber (); + + /** + * Setter for fax number + *

+ * @param faxNumber Fax number + */ + public void setFaxNumber (final Long faxNumber); /** * First name @@ -227,18 +267,46 @@ public interface UserWebController extends Serializable { public void setHouseNumber (final Short houseNumber); /** - * Phone number + * Getter for phone number's area code + *

+ * @return Phone number's area code + */ + public Integer getPhoneAreaCode (); + + /** + * Setter for phone number's area code + *

+ * @param phoneAreaCode Phone number's area code + */ + public void setPhoneAreaCode (final Integer phoneAreaCode); + + /** + * Getter for phone number's country instance + *

+ * @return Phone number's country instance + */ + public Country getPhoneCountry (); + + /** + * Setter for phone number's country instance + *

+ * @param phoneCountry Phone number's country instance + */ + public void setPhoneCountry (final Country phoneCountry); + + /** + * Getter for phone number *

- * @return the phoneNumber + * @return Phone number */ - public DialableLandLineNumber getPhoneNumber (); + public Long getPhoneNumber (); /** - * Phone number + * Setter for phone number *

- * @param phoneNumber the phoneNumber to set + * @param phoneNumber Phone number */ - public void setPhoneNumber (final DialableLandLineNumber phoneNumber); + public void setPhoneNumber (final Long phoneNumber); /** * Street diff --git a/web/WEB-INF/templates/generic/form_personal_data.tpl b/web/WEB-INF/templates/generic/form_personal_data.tpl index 64dd2200..8dd416e1 100644 --- a/web/WEB-INF/templates/generic/form_personal_data.tpl +++ b/web/WEB-INF/templates/generic/form_personal_data.tpl @@ -123,11 +123,21 @@

- +
- + + + + + + + + + + +
@@ -139,7 +149,17 @@
- + + + + + + + + + + +
@@ -151,7 +171,13 @@
- + + + + + + +
-- 2.39.5