]> git.mxchange.org Git - addressbook-war.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 09:07:04 +0000 (11:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 09:07:04 +0000 (11:07 +0200)
- added bean (controller) for SMS provider data retrieval
- expanded phone, fax and cellphone form fields so they better fit for ongoing rewrite
- updated jars
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcoreee.jar
lib/jphone-core.jar
nbproject/faces-config.NavData
src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebBean.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/beans/smsprovider/SmsProviderWebController.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/beans/user/UserWebBean.java
src/java/org/mxchange/addressbook/beans/user/UserWebController.java
web/WEB-INF/templates/generic/form_personal_data.tpl

index 7b88b148a9b687ad7c8259e8bd8fc3a6689750ee..093433c9bcb8dc508c42f20a649f82a3d7f6cbdc 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index 0cc0e98f7639332412ce960fccca191ceb400225..f7da496b94a16d7157abd650b5df779de84fa779 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index a28edad9c8a5ce6fb0bee9d303f1f3709eb044f6..f1818296af74640d985e4899bb0929b4b2a1c44a 100644 (file)
@@ -1,55 +1,55 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scene Scope="Project" version="2">
-       <Scope Scope="Faces Configuration Only">
-               <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
-               <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
-               <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
-               <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
-               <Node id="*" x="1150" y="150" zoom="true"/>
-               <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
-               <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
-               <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
-               <Node id="index.xhtml" x="900" y="150" zoom="true"/>
-               <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
-               <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
-               <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
-               <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
-       </Scope>
-       <Scope Scope="Project">
-               <Node id="admin/admin_logout.xhtml" x="400" y="600" zoom="true"/>
-               <Node id="user/login.xhtml" x="900" y="150" zoom="true"/>
-               <Node id="login/login_edit_address.xhtml" x="150" y="300" zoom="true"/>
-               <Node id="login/login_edit_user_data.xhtml" x="1150" y="150" zoom="true"/>
-               <Node id="login/login_other_addressbooks.xhtml" x="650" y="450" zoom="true"/>
-               <Node id="user/lost_passwd.xhtml" x="900" y="300" zoom="true"/>
-               <Node id="*" x="650" y="150" zoom="true"/>
-               <Node id="terms.xhtml" x="150" y="600" zoom="true"/>
-               <Node id="login/login_own_addressbooks.xhtml" x="400" y="150" zoom="true"/>
-               <Node id="user/register_done.xhtml" x="1150" y="300" zoom="true"/>
-               <Node id="bye.xhtml" x="650" y="300" zoom="true"/>
-               <Node id="user/login_error.xhtml" x="1400" y="150" zoom="true"/>
-               <Node id="privacy.xhtml" x="400" y="750" zoom="true"/>
-               <Node id="admin/admin_index.xhtml" x="400" y="450" zoom="true"/>
-               <Node id="index.xhtml" x="650" y="600" zoom="true"/>
-               <Node id="login/login_user_list.xhtml" x="150" y="150" zoom="true"/>
-               <Node id="imprint.xhtml" x="900" y="450" zoom="true"/>
-               <Node id="login/login_index.xhtml" x="150" y="750" zoom="true"/>
-               <Node id="user/register.xhtml" x="400" y="300" zoom="true"/>
-               <Node id="user/resend_link.xhtml" x="150" y="450" zoom="true"/>
-       </Scope>
-       <Scope Scope="All Faces Configurations">
-               <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
-               <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
-               <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
-               <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
-               <Node id="*" x="1150" y="150" zoom="true"/>
-               <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
-               <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
-               <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
-               <Node id="index.xhtml" x="900" y="150" zoom="true"/>
-               <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
-               <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
-               <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
-               <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
-       </Scope>
+    <Scope Scope="Faces Configuration Only">
+        <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="*" x="1150" y="150" zoom="true"/>
+        <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="index.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
+    </Scope>
+    <Scope Scope="Project">
+        <Node id="admin/admin_logout.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="user/login.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="login/login_edit_address.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="login/login_edit_user_data.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="login/login_other_addressbooks.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="user/lost_passwd.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="*" x="650" y="150" zoom="true"/>
+        <Node id="terms.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="login/login_own_addressbooks.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="user/register_done.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="bye.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="user/login_error.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="privacy.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="admin/admin_index.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="index.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="login/login_user_list.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="imprint.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="login/login_index.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="user/register.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="user/resend_link.xhtml" x="150" y="450" zoom="true"/>
+    </Scope>
+    <Scope Scope="All Faces Configurations">
+        <Node id="admin/admin_logout.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="user/login.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="admin/index.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="user/lost_passwd.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="*" x="1150" y="150" zoom="true"/>
+        <Node id="terms.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="bye.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="privacy.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="index.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="imprint.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/category.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="user/register.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/product.xhtml" x="900" y="300" zoom="true"/>
+    </Scope>
 </Scene>
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 (file)
index 0000000..667fe02
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+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
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@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<SmsProvider> 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<SmsProvider> 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 (file)
index 0000000..707185d
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+ */
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
+
+/**
+ * An interface for country beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface SmsProviderWebController extends Serializable {
+
+       /**
+        * A list of all countries
+        * <p>
+        * @return All countries
+        */
+       public List<SmsProvider> allSmsProvider ();
+}
index 3bc0d362d812ec8d934cef8ae6f55f3efd7c45d9..f861daab8af3f5939ac7351e6a4bb9e799e1b90a 100644 (file)
@@ -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
index ac76a10a49433ea7b63575a17ed25c6f0fc465dd..2d88e45e983f9a511190453024d332a218490434 100644 (file)
@@ -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
         * <p>
-        * @return the cellphoneNumber
+        * @return Cellphone number's carrier
         */
-       public DialableCellphoneNumber getCellphoneNumber ();
+       public SmsProvider getCellphoneCarrier ();
 
        /**
-        * Cellphone number
+        * Setter for cellphone number's carrier prefix
         * <p>
-        * @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
+        * <p>
+        * @return Cellphone number
+        */
+       public Long getCellphoneNumber ();
+
+       /**
+        * Setter for ellphone number
+        * <p>
+        * @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
+        * <p>
+        * @return Fax number's area code
+        */
+       public Integer getFaxAreaCode ();
+
+       /**
+        * Setter for fax number's area code
+        * <p>
+        * @param faxAreaCode Fax number's area code
+        */
+       public void setFaxAreaCode (final Integer faxAreaCode);
+
+       /**
+        * Getter for fax's country instance
+        * <p>
+        * @return Fax' country instance
+        */
+       public Country getFaxCountry ();
+
+       /**
+        * Setter for fax's country instance
         * <p>
-        * @return the faxNumber
+        * @param faxCountry Fax' country instance
         */
-       public DialableFaxNumber getFaxNumber ();
+       public void setFaxCountry (final Country faxCountry);
 
        /**
-        * Fax number
+        * Getter for fax number
         * <p>
-        * @param faxNumber the faxNumber to set
+        * @return Fax number
         */
-       public void setFaxNumber (final DialableFaxNumber faxNumber);
+       public Long getFaxNumber ();
+
+       /**
+        * Setter for fax number
+        * <p>
+        * @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
+        * <p>
+        * @return Phone number's area code
+        */
+       public Integer getPhoneAreaCode ();
+
+       /**
+        * Setter for phone number's area code
+        * <p>
+        * @param phoneAreaCode Phone number's area code
+        */
+       public void setPhoneAreaCode (final Integer phoneAreaCode);
+
+       /**
+        * Getter for phone number's country instance
+        * <p>
+        * @return Phone number's country instance
+        */
+       public Country getPhoneCountry ();
+
+       /**
+        * Setter for phone number's country instance
+        * <p>
+        * @param phoneCountry Phone number's country instance
+        */
+       public void setPhoneCountry (final Country phoneCountry);
+
+       /**
+        * Getter for phone number
         * <p>
-        * @return the phoneNumber
+        * @return Phone number
         */
-       public DialableLandLineNumber getPhoneNumber ();
+       public Long getPhoneNumber ();
 
        /**
-        * Phone number
+        * Setter for phone number
         * <p>
-        * @param phoneNumber the phoneNumber to set
+        * @param phoneNumber Phone number
         */
-       public void setPhoneNumber (final DialableLandLineNumber phoneNumber);
+       public void setPhoneNumber (final Long phoneNumber);
 
        /**
         * Street
index 64dd22003df858cde40de5950d69b5b3bd1a8ae0..8dd416e1a3cea8d6fcf9ecf47c1fbf748b49f8cb 100644 (file)
 
                        <div class="table_row">
                                <div class="table_left">
-                                       <h:outputLabel for="phoneNumber" value="#{msg.PERSONAL_DATA_PHONE_NUMBER}" />
+                                       <h:outputLabel value="#{msg.PERSONAL_DATA_PHONE_NUMBER}" />
                                </div>
 
                                <div class="table_right">
-                                       <h:inputText class="input" id="phoneNumber" size="20" maxlength="255" value="#{userController.phoneNumber}" />
+                                       <h:selectOneMenu class="select" id="phoneCountryCode" value="#{userController.phoneCountry}">
+                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText class="input" id="phoneAreaCode" size="5" maxlength="10" value="#{userController.phoneAreaCode}">
+                                               <f:validator for="phoneAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText class="input" id="phoneNumber" size="10" maxlength="20" value="#{userController.phoneNumber}">
+                                               <f:validator for="phoneNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
                                </div>
 
                                <div class="clear"></div>
                                </div>
 
                                <div class="table_right">
-                                       <h:inputText class="input" id="faxNumber" size="20" maxlength="255" value="#{userController.faxNumber}" />
+                                       <h:selectOneMenu class="select" id="faxCountryCode" value="#{userController.faxCountry}">
+                                               <f:selectItems value="#{country.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText class="input" id="faxAreaCode" size="5" maxlength="10" value="#{userController.faxAreaCode}">
+                                               <f:validator for="faxAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText class="input" id="faxNumber" size="10" maxlength="20" value="#{userController.faxNumber}">
+                                               <f:validator for="faxNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
                                </div>
 
                                <div class="clear"></div>
                                </div>
 
                                <div class="table_right">
-                                       <h:inputText class="input" id="cellphoneNumber" size="20" maxlength="255" value="#{userController.cellphoneNumber}" />
+                                       <h:selectOneMenu class="select" id="cellphoneCarrier" value="#{userController.cellphoneCarrier}">
+                                               <f:selectItems value="#{cellphone.allSmsProvider()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText class="input" id="cellphoneNumber" size="10" maxlength="20" value="#{userController.cellphoneNumber}">
+                                               <f:validator for="cellphoneNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
                                </div>
 
                                <div class="clear"></div>