]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit:
authorRoland Häder <roland@mxchange.org>
Fri, 20 May 2016 15:36:54 +0000 (17:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 21 May 2016 11:07:48 +0000 (13:07 +0200)
- first @Oberserves, then final
- added simple birthday input field
- added i18n strings
- added birthday to export as well
- added observer method afterUserConfirmedAccount() to update lists for
- added javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE to make sure time-zone problems are fixed
- fixed some messages, wrong stuff there

Signed-off-by: Roland Häder <roland@mxchange.org>
nbproject/faces-config.NavData
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
web/WEB-INF/templates/contact/form_contact_data.tpl
web/WEB-INF/web.xml
web/admin/contact/admin_contact_export.xhtml

index 2d20ca6128755bcdfb3a5fb254397b001fdc4957..d01e4f2082090c9e56bc48cc1c2f8eb8cfb967d4 100644 (file)
@@ -2,81 +2,81 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="admin/customer/admin_customer_delete.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="customer/checkout2.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="admin/contact/admin_contact_show.xhtml" x="1650" y="300" zoom="true"/>
-        <Node id="privacy.xhtml" x="1400" y="900" zoom="true"/>
-        <Node id="guest/user/show_addressbook.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="2650" y="300" zoom="true"/>
-        <Node id="admin/user/admin_user_show.xhtml" x="400" y="1500" zoom="true"/>
-        <Node id="admin/index.xhtml" x="1900" y="300" zoom="true"/>
-        <Node id="user/login_own_addressbooks.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="user/login_user_data_saved.xhtml" x="400" y="1200" zoom="true"/>
-        <Node id="customer/register.xhtml" x="1650" y="750" zoom="true"/>
-        <Node id="admin/category/admin_category_list.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="item_added.xhtml" x="400" y="1350" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="user/login_data_saved.xhtml" x="900" y="1200" zoom="true"/>
-        <Node id="admin/user/admin_user_unlock.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="customer/lost_passwd.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="index.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="guest/user/user_list.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="user/login_edit_user_data.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="customer/checkout_done.xhtml" x="1900" y="450" zoom="true"/>
-        <Node id="customer/login.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="*" x="2150" y="600" zoom="true"/>
-        <Node id="admin/customer/admin_customer_unlock.xhtml" x="900" y="1350" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="user/login_index.xhtml" x="2150" y="150" zoom="true"/>
-        <Node id="admin/product/admin_product_edit.xhtml" x="650" y="1050" zoom="true"/>
-        <Node id="guest/user/lost_passwd.xhtml" x="900" y="1050" zoom="true"/>
-        <Node id="guest/user/register_done.xhtml" x="1150" y="750" zoom="true"/>
-        <Node id="guest/user/show_addressbook_entries.xhtml" x="2400" y="300" zoom="true"/>
-        <Node id="user/login.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="admin/customer/admin_customer_delete.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="customer/checkout2.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="admin/contact/admin_contact_show.xhtml" x="2400" y="300" zoom="true"/>
+        <Node id="privacy.xhtml" x="900" y="1350" zoom="true"/>
+        <Node id="guest/user/show_addressbook.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="650" y="1200" zoom="true"/>
+        <Node id="admin/user/admin_user_show.xhtml" x="900" y="750" zoom="true"/>
+        <Node id="admin/index.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="user/login_own_addressbooks.xhtml" x="400" y="1200" zoom="true"/>
+        <Node id="customer/register.xhtml" x="1400" y="300" zoom="true"/>
+        <Node id="user/login_user_data_saved.xhtml" x="2150" y="300" zoom="true"/>
+        <Node id="item_added.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/category/admin_category_list.xhtml" x="1150" y="1050" zoom="true"/>
+        <Node id="admin/admin_logout.xhtml" x="2900" y="150" zoom="true"/>
+        <Node id="user/login_data_saved.xhtml" x="650" y="1350" zoom="true"/>
+        <Node id="admin/user/admin_user_unlock.xhtml" x="400" y="1350" zoom="true"/>
+        <Node id="customer/lost_passwd.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="index.xhtml" x="150" y="1350" zoom="true"/>
+        <Node id="guest/user/user_list.xhtml" x="2150" y="600" zoom="true"/>
+        <Node id="user/login_edit_user_data.xhtml" x="2400" y="450" zoom="true"/>
+        <Node id="customer/checkout_done.xhtml" x="150" y="1650" zoom="true"/>
+        <Node id="customer/login.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="*" x="2150" y="450" zoom="true"/>
+        <Node id="admin/customer/admin_customer_unlock.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="user/login_index.xhtml" x="650" y="900" zoom="true"/>
+        <Node id="admin/product/admin_product_edit.xhtml" x="1900" y="450" zoom="true"/>
+        <Node id="guest/user/lost_passwd.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="guest/user/register_done.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="guest/user/show_addressbook_entries.xhtml" x="1400" y="750" zoom="true"/>
+        <Node id="user/login.xhtml" x="2150" y="150" zoom="true"/>
         <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="admin/country/admin_country_list.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="login/login_edit_user_data.xhtml" x="1650" y="450" zoom="true"/>
-        <Node id="admin/customer/admin_customer_edit.xhtml" x="2400" y="150" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="2900" y="150" zoom="true"/>
-        <Node id="user/login_change_password.xhtml" x="1150" y="900" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1650" y="900" zoom="true"/>
-        <Node id="admin/contact/admin_contact_export.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="customer/checkout.xhtml" x="1650" y="600" zoom="true"/>
-        <Node id="guest/user/user_profile.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="admin/product/admin_product_delete.xhtml" x="1150" y="1200" zoom="true"/>
-        <Node id="guest/user/confirm_account.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="basket.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="150" y="600" zoom="true"/>
-        <Node id="admin/user/admin_user_delete.xhtml" x="150" y="1200" zoom="true"/>
-        <Node id="exception.xhtml" x="2650" y="150" zoom="true"/>
-        <Node id="admin/category/admin_category_delete.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="login/login_index.xhtml" x="1900" y="600" zoom="true"/>
-        <Node id="admin/user/admin_user_edit.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="guest/user/register_page2.xhtml" x="900" y="900" zoom="true"/>
-        <Node id="terms.xhtml" x="2150" y="450" zoom="true"/>
-        <Node id="admin/contact/admin_contact_edit.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="admin/contact/admin_contact_list.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="admin/user/admin_user_list.xhtml" x="2150" y="300" zoom="true"/>
-        <Node id="admin/country/admin_country_delete.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="user/login_change_personal_data.xhtml" x="2400" y="450" zoom="true"/>
-        <Node id="admin/category/admin_category_edit.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="admin/country/admin_country_edit.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="logout.xhtml" x="150" y="1350" zoom="true"/>
-        <Node id="user/login_add_addressbook.xhtml" x="150" y="1650" zoom="true"/>
-        <Node id="user/login_contact_data_saved.xhtml" x="1400" y="1050" zoom="true"/>
-        <Node id="user/user_profile.xhtml" x="1400" y="750" zoom="true"/>
-        <Node id="admin/contact/admin_contact_delete.xhtml" x="150" y="1500" zoom="true"/>
-        <Node id="imprint.xhtml" x="1400" y="600" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="650" y="600" zoom="true"/>
-        <Node id="guest/user/login.xhtml" x="1150" y="1050" zoom="true"/>
-        <Node id="admin/customer/admin_customer_list.xhtml" x="650" y="1350" zoom="true"/>
-        <Node id="guest/user/register.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="user/login_change_email_address.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="admin/product/admin_product_list.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="admin/country/admin_country_list.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="login/login_edit_user_data.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="admin/customer/admin_customer_edit.xhtml" x="2650" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="1400" y="600" zoom="true"/>
+        <Node id="user/login_change_password.xhtml" x="2650" y="300" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="customer/checkout.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="admin/contact/admin_contact_export.xhtml" x="2400" y="150" zoom="true"/>
+        <Node id="guest/user/user_profile.xhtml" x="900" y="900" zoom="true"/>
+        <Node id="admin/product/admin_product_delete.xhtml" x="400" y="1500" zoom="true"/>
+        <Node id="guest/user/confirm_account.xhtml" x="1650" y="750" zoom="true"/>
+        <Node id="basket.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="exception.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="150" y="1200" zoom="true"/>
+        <Node id="admin/user/admin_user_delete.xhtml" x="900" y="1200" zoom="true"/>
+        <Node id="admin/category/admin_category_delete.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="login/login_index.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="guest/user/register_page2.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="admin/user/admin_user_edit.xhtml" x="1400" y="1050" zoom="true"/>
+        <Node id="terms.xhtml" x="1150" y="900" zoom="true"/>
+        <Node id="admin/contact/admin_contact_edit.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="admin/contact/admin_contact_list.xhtml" x="1650" y="900" zoom="true"/>
+        <Node id="admin/user/admin_user_list.xhtml" x="1150" y="1200" zoom="true"/>
+        <Node id="admin/country/admin_country_delete.xhtml" x="1650" y="600" zoom="true"/>
+        <Node id="user/login_change_personal_data.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="admin/category/admin_category_edit.xhtml" x="1400" y="900" zoom="true"/>
+        <Node id="logout.xhtml" x="1150" y="450" zoom="true"/>
+        <Node id="admin/country/admin_country_edit.xhtml" x="900" y="1050" zoom="true"/>
+        <Node id="user/login_add_addressbook.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="user/login_contact_data_saved.xhtml" x="650" y="1050" zoom="true"/>
+        <Node id="admin/contact/admin_contact_delete.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="user/user_profile.xhtml" x="150" y="1500" zoom="true"/>
+        <Node id="imprint.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="1650" y="300" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="guest/user/login.xhtml" x="1900" y="300" zoom="true"/>
+        <Node id="admin/customer/admin_customer_list.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="guest/user/register.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="user/login_change_email_address.xhtml" x="1650" y="450" zoom="true"/>
+        <Node id="admin/product/admin_product_list.xhtml" x="1400" y="450" zoom="true"/>
         <Node id="admin/customer/admin_customer_show.xhtml" x="1900" y="750" zoom="true"/>
-        <Node id="customer/empty_basket.xhtml" x="650" y="1200" zoom="true"/>
+        <Node id="customer/empty_basket.xhtml" x="1900" y="600" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index 9b7a938b0e4edd76c269502e09751f1bf26b8445..a9b55ee04eb0d461d87960bebdcf3ccfebbcc755 100644 (file)
@@ -523,3 +523,5 @@ ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING=Bei sehr gro\u00dfen Datenmengen kann es e
 BUTTON_ADMIN_EXPORT_CONTACTS_CSV=Alle Daten als CSV-Datei exportieren
 LINK_ADMIN_EXPORT_CONTACT=Daten exportieren
 LINK_ADMIN_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren
+PERSONAL_DATA_BIRTHDAY=Geburtsdatum (dd.mm.jjjj):
+BIRTHDAY_PATTERN=dd.MM.yyyy
index 5bb27e6291653abbd3075e7c9b1f0215baba6dd7..c458fadf28995903a3de4c7056226e2ef458e60b 100644 (file)
@@ -508,3 +508,5 @@ ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING=Big data amount may lead to timeouts. You
 BUTTON_ADMIN_EXPORT_CONTACTS_CSV=Export all data as CSV file
 LINK_ADMIN_EXPORT_CONTACT=Export data
 LINK_ADMIN_EXPORT_CONTACT_TITLE=Export contact data
+PERSONAL_DATA_BIRTHDAY=Birthday (mm-dd-yyyy):
+BIRTHDAY_PATTERN=MM-dd-yyyy
index b1a7c55b64a6ff47af8facae2d46e062d4162dbb..3ed20d676fd8de8aa60bbe95e849337873f86206 100644 (file)
@@ -48,6 +48,7 @@ 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.mobileprovider.MobileProvider;
+import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -308,10 +309,10 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getUpdatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.updatedUser is null"); //NOI18N
+                       throw new NullPointerException("event.updatedContact is null"); //NOI18N
                } else if (event.getUpdatedContact().getContactId() == null) {
                        // userId is null
-                       throw new NullPointerException("event.updatedUser.userId is null"); //NOI18N
+                       throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N
                } else if (event.getUpdatedContact().getContactId() < 1) {
                        // Not avalid id
                        throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N
@@ -354,10 +355,10 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getRegisteredUser() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.user is null"); //NOI18N
+                       throw new NullPointerException("event.registeredUser is null"); //NOI18N
                } else if (event.getRegisteredUser().getUserId() == null) {
                        // userId is null
-                       throw new NullPointerException("event.user.userId is null"); //NOI18N
+                       throw new NullPointerException("event.registeredUser.userId is null"); //NOI18N
                } else if (event.getRegisteredUser().getUserId() < 1) {
                        // Not avalid id
                        throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getRegisteredUser(), event.getRegisteredUser().getUserId())); //NOI18N
@@ -382,6 +383,49 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                //* NOISY-DEBUG: */ System.out.println("ContactWebBean:afterRegistration: EXIT!"); //NOI18N
        }
 
+       @Override
+       public void afterUserConfirmedAccount (@Observes final UserConfirmedAccountEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactWebBean:afterAdminUpdatedContactDataEvent: event={0} - CALLED!", event)); //NOI18N
+
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getConfirmedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.confirmedUser is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.confirmedUser.userId is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getConfirmedUser(), event.getConfirmedUser().getUserId())); //NOI18N
+               }
+
+               // "Cache" contact instance
+               Contact contact = event.getConfirmedUser().getUserContact();
+
+               // Get iterator from list
+               Iterator<Contact> iterator = this.contactList.iterator();
+
+               // "Walk" through all entries
+               while (iterator.hasNext()) {
+                       // Get next element
+                       Contact next = iterator.next();
+
+                       // Is id number the same?
+                       if (Objects.equals(contact.getContactId(), next.getContactId())) {
+                               // Found entry, so remove it and abort
+                               this.contactList.remove(next);
+                               break;
+                       }
+               }
+
+               // Add contact to list
+               this.contactList.add(contact);
+       }
+
        @Override
        public void afterUserLogin (@Observes final UserLoggedInEvent event) {
                // Trace message
@@ -393,10 +437,10 @@ public class PizzaContactWebSessionBean extends BasePizzaController implements P
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getLoggedInUser() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.user is null"); //NOI18N
+                       throw new NullPointerException("event.loggedInUser is null"); //NOI18N
                } else if (event.getLoggedInUser().getUserId() == null) {
                        // userId is null
-                       throw new NullPointerException("event.user.userId is null"); //NOI18N
+                       throw new NullPointerException("event.loggedInUser.userId is null"); //NOI18N
                } else if (event.getLoggedInUser().getUserId() < 1) {
                        // Not avalid id
                        throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedInUser(), event.getLoggedInUser().getUserId())); //NOI18N
index 71ad174170840e79c931efb0cceb59d26158219b..6b4f000b8f14703605df03806afb8636d5cb8603 100644 (file)
@@ -27,6 +27,7 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcustomercore.events.customer.added.AdminAddedCustomerEvent;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -64,6 +65,13 @@ public interface PizzaContactWebSessionController extends Serializable {
         */
        void afterAdminAddedUserEvent (final AdminAddedUserEvent event);
 
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterUserConfirmedAccount (final UserConfirmedAccountEvent event);
+
        /**
         * Updates all data from bean in given contact instance
         * <p>
index 5eb5083332558e555a5dfa0203928fac4dd02f9e..6aaa25a2e8e4574a4cf9f2769d7bb0e026e5a5c5 100644 (file)
@@ -262,7 +262,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements
        }
 
        @Override
-       public void afterRegistrationEvent (final @Observes UserRegisteredEvent event) {
+       public void afterRegistrationEvent (@Observes final UserRegisteredEvent event) {
                // Trace message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("AdminUserWebBean:afterRegistration: event={0} - CALLED!", event)); //NOI18N
 
index d986447ecf5ed522033fda065d7cf6639aec9f02..8ec13932046c904c5a384fd481b122b5f505581c 100644 (file)
@@ -36,6 +36,7 @@ import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -312,7 +313,47 @@ public class PizzaUserWebSessionBean extends BasePizzaController implements Pizz
        }
 
        @Override
-       public void afterUserLogin (final @Observes UserLoggedInEvent event) {
+       public void afterUserConfirmedAccount (@Observes final UserConfirmedAccountEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("ContactWebBean:afterAdminUpdatedContactDataEvent: event={0} - CALLED!", event)); //NOI18N
+
+               // event should not be null
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getConfirmedUser() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("event.confirmedUser is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() == null) {
+                       // userId is null
+                       throw new NullPointerException("event.confirmedUser.userId is null"); //NOI18N
+               } else if (event.getConfirmedUser().getUserId() < 1) {
+                       // Not avalid id
+                       throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getConfirmedUser(), event.getConfirmedUser().getUserId())); //NOI18N
+               }
+
+               // Get iterator from list
+               Iterator<User> iterator = this.userList.iterator();
+
+               // "Walk" through all entries
+               while (iterator.hasNext()) {
+                       // Get next element
+                       User next = iterator.next();
+
+                       // Is id number the same?
+                       if (Objects.equals(event.getConfirmedUser().getUserId(), next.getUserId())) {
+                               // Found entry, so remove it and abort
+                               this.userList.remove(next);
+                               break;
+                       }
+               }
+
+               // Add contact to list
+               this.userList.add(event.getConfirmedUser());
+       }
+
+       @Override
+       public void afterUserLogin (@Observes final UserLoggedInEvent event) {
                // Trace message
                //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: event={0} - CALLED!", event)); //NOI18N
 
index bb2d8ef3a91ecabf842ee58c9e846b94b02f5208..63cbf2f4e274192e9db86167e9b6788ad60ab882 100644 (file)
@@ -20,6 +20,7 @@ import java.io.Serializable;
 import java.util.List;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
+import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -64,6 +65,13 @@ public interface PizzaUserWebSessionController extends Serializable {
         */
        void afterAdminUpdatedUserDataEvent (final AdminUpdatedUserDataEvent event);
 
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterUserConfirmedAccount (final UserConfirmedAccountEvent event);
+
        /**
         * Listens to fired event when user updated personal data
         * <p>
index 55d2234c5aa601718b89bdd488970a93e7458f0e..1e826c36afc01ff69bb1a2e5ce7a83d82b2b64f0 100644 (file)
@@ -3,7 +3,8 @@
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
 
        <div class="para notice">
                #{msg.PERSONAL_DATA_MINIMUM_NOTICE}
                                <div class="clear"></div>
                        </div>
 
+                       <div class="table_row">
+                               <div class="table_left">
+                                       <h:outputLabel for="birthday" value="#{msg.PERSONAL_DATA_BIRTHDAY}" />
+                               </div>
+
+                               <div class="table_right">
+                                       <h:inputText styleClass="input" id="birthday" value="#{contactController.birthday}" required="true" size="10" validator="BirthdayValidator">
+                                               <f:convertDateTime for="birthday" pattern="#{msg.BIRTHDAY_PATTERN}" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <h:message for="birthday" errorClass="errors" fatalClass="errors" warnClass="errors" showDetail="false" />
+
                        <div class="table_row">
                                <div class="table_left">
                                        <h:outputLabel for="country" value="#{msg.PERSONAL_DATA_COUNTRY_CODE}" />
index f5133bf9a95ddd46261645a9e30d4c093f3a34f4..710ed1c1434ecec9b0ef80b25d0649a3b4908a22 100644 (file)
         <param-name>is_resend_confirm_link_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
+    <context-param>
+        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
+        <param-value>true</param-value>
+    </context-param>
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
index 91b6c58c51d26ab0bba52c8f53e98aa01d690fbf..af009469bc7f812e4207d3600035f20bdff8a244 100644 (file)
                                                <h:outputText value="#{contact.contactEmailAddress}" />
                                        </p:column>
 
+                                       <p:column>
+                                               <f:facet name="header">
+                                                       <h:outputText value="#{msg.ADMIN_CONTACT_BIRTHDAY}" />
+                                               </f:facet>
+
+                                               <h:outputText id="contactBirthday" value="#{contact.contactBirthday}">
+                                                       <f:convertDateTime for="contactBirthday" type="date" dateStyle="medium" />
+                                               </h:outputText>
+                                       </p:column>
+
                                        <p:column>
                                                <f:facet name="header">
                                                        <h:outputText value="#{msg.ADMIN_CONTACT_CELLPHONE_NUMBER}" />
                                                </f:facet>
 
                                                <h:outputText id="contactCreated" value="#{contact.contactCreated.time}">
-                                                       <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" />
+                                                       <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" locale="#{localizationController.locale}" />
                                                </h:outputText>
                                        </p:column>
                                </p:dataTable>