]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Rewritten a lot:
authorRoland Häder <roland@mxchange.org>
Thu, 12 May 2016 16:18:23 +0000 (18:18 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 13 May 2016 19:42:19 +0000 (21:42 +0200)
- introduced isUserNameRequired() which should make it sure to have registrations with no user name and password. This also includes no login area (not possible)
- the user then will get a random user name with format "userXXXXX" and a random password. So it is still possible that the "feature" login area for users can come back.
- so no "recover password" is possible, too. Therefore such links can be removed from the menu.
- introduced isMultiplePageEnabled() which is used as a "switch" between single-page and multiple-page registration
- introduced isPublicUserProfileEnabled() which is used to disabled/enable the feature "public user profiles" which is sometimes not wanted ...
- introduced isResendConfirmationLinkEnabled() which disabled the corresponding feature
- showing a "choose profile-mode" while no public user profile is enabled makes no sense ... So better "hide" this option.
- introduced general (abstract) controller Base<project-name>Controller which currently holds a method for checking if for a named controller debug mode is enabled
- renamed doRegister() to doFinishRegistration()
- removed no longer used i18n strings (they may have come back by cherry-picking)
- registration page 1/2 should be "basicly finished" now, single is also available
- index page is now jlandingpage-specific as registration page is in index.xhtml (careful, cherry-picking this!)
- added controller method doRegisterMultiPage1()
- added a lot more language strings
- renamed variables
- added context parameters for above new methods
- added needed navigation cases (careful with cherry-picking again)
- sorted imports (minor)
- fixed i18n string (usage)

Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
45 files changed:
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/BasePizzaController.java [new file with mode: 0644]
src/java/org/mxchange/pizzaapplication/beans/basket/PizzaBasketWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/category/PizzaAdminCategoryWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/category/PizzaCategoryWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/checkout/PizzaCheckoutWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaAdminCountryWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/country/PizzaCountryWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/email_address/PizzaEmailChangeWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/gender/PizzaGenderWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/localization/PizzaLocalizationSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/phone/PizzaAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/product/PizzaAdminProductWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/product/PizzaProductWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/profilemode/PizzaProfileModeWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/receipt/PizzaReceiptWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/register/PizzaUserRegisterWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/register/PizzaUserRegisterWebSessionController.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/faces-config.xml
web/WEB-INF/templates/contact/form_contact_data.tpl
web/WEB-INF/templates/guest/guest_menu.tpl
web/WEB-INF/templates/guest/guest_privacy_terms.tpl
web/WEB-INF/templates/guest/user/guest_registration_form.tpl
web/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl
web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl [new file with mode: 0644]
web/WEB-INF/web.xml
web/customer/empty_basket.xhtml
web/guest/user/login.xhtml
web/guest/user/lost_passwd.xhtml
web/guest/user/register.xhtml
web/guest/user/register_page2.xhtml [new file with mode: 0644]
web/guest/user/user_profile.xhtml

index ddebaa54d25bfeeb7203e3e6d5e22065a9758065..e5fb087af4dd5bd7b8e089d429a157e99a773b6e 100644 (file)
@@ -2,74 +2,75 @@
 <Scene Scope="Project" version="2">
     <Scope Scope="Faces Configuration Only"/>
     <Scope Scope="Project">
-        <Node id="admin/customer/admin_customer_delete.xhtml" x="150" y="1350" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="400" y="750" zoom="true"/>
-        <Node id="customer/checkout2.xhtml" x="1400" y="750" zoom="true"/>
-        <Node id="admin/contact/admin_contact_show.xhtml" x="1400" y="600" zoom="true"/>
-        <Node id="privacy.xhtml" x="650" y="900" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="1900" y="150" zoom="true"/>
-        <Node id="guest/user/show_addressbook.xhtml" x="1650" y="450" zoom="true"/>
-        <Node id="admin/user/admin_user_show.xhtml" x="650" y="150" zoom="true"/>
-        <Node id="admin/index.xhtml" x="400" y="900" zoom="true"/>
-        <Node id="user/login_own_addressbooks.xhtml" x="1150" y="300" zoom="true"/>
-        <Node id="customer/register.xhtml" x="900" y="300" zoom="true"/>
-        <Node id="user/login_user_data_saved.xhtml" x="2650" y="300" zoom="true"/>
-        <Node id="item_added.xhtml" x="1650" y="300" zoom="true"/>
-        <Node id="admin/category/admin_category_list.xhtml" x="1900" y="600" zoom="true"/>
-        <Node id="admin/admin_logout.xhtml" x="650" y="450" zoom="true"/>
-        <Node id="user/login_data_saved.xhtml" x="1650" y="750" zoom="true"/>
-        <Node id="admin/user/admin_user_unlock.xhtml" x="2650" y="150" zoom="true"/>
-        <Node id="customer/lost_passwd.xhtml" x="1150" y="150" zoom="true"/>
-        <Node id="guest/user/user_list.xhtml" x="900" y="600" zoom="true"/>
-        <Node id="index.xhtml" x="150" y="1650" zoom="true"/>
-        <Node id="user/login_edit_user_data.xhtml" x="900" y="1200" zoom="true"/>
-        <Node id="customer/checkout_done.xhtml" x="650" y="1200" zoom="true"/>
-        <Node id="*" x="2400" y="150" zoom="true"/>
-        <Node id="customer/login.xhtml" x="900" y="1050" zoom="true"/>
-        <Node id="admin/customer/admin_customer_unlock.xhtml" x="900" y="150" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="1650" y="150" zoom="true"/>
-        <Node id="user/login_index.xhtml" x="1400" y="300" zoom="true"/>
-        <Node id="admin/product/admin_product_edit.xhtml" x="1650" y="600" zoom="true"/>
-        <Node id="guest/user/lost_passwd.xhtml" x="2150" y="150" zoom="true"/>
-        <Node id="guest/user/register_done.xhtml" x="400" y="1350" zoom="true"/>
-        <Node id="guest/user/show_addressbook_entries.xhtml" x="650" y="1050" zoom="true"/>
-        <Node id="admin/country/admin_country_list.xhtml" x="150" y="900" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="900" y="750" zoom="true"/>
-        <Node id="admin/customer/admin_customer_edit.xhtml" x="150" y="150" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="400" y="300" zoom="true"/>
-        <Node id="user/login_change_password.xhtml" x="400" y="450" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="400" y="1200" zoom="true"/>
-        <Node id="customer/checkout.xhtml" x="650" y="300" zoom="true"/>
-        <Node id="guest/user/user_profile.xhtml" x="400" y="150" zoom="true"/>
-        <Node id="admin/product/admin_product_delete.xhtml" x="1150" y="900" zoom="true"/>
-        <Node id="basket.xhtml" x="900" y="450" zoom="true"/>
-        <Node id="admin/user/admin_user_delete.xhtml" x="1400" y="450" zoom="true"/>
-        <Node id="exception.xhtml" x="150" y="1200" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="1400" y="900" zoom="true"/>
-        <Node id="admin/category/admin_category_delete.xhtml" x="400" y="1050" zoom="true"/>
-        <Node id="admin/user/admin_user_edit.xhtml" x="1900" y="450" zoom="true"/>
-        <Node id="terms.xhtml" x="150" y="750" zoom="true"/>
-        <Node id="admin/contact/admin_contact_edit.xhtml" x="650" y="1350" zoom="true"/>
-        <Node id="admin/contact/admin_contact_list.xhtml" x="2900" y="150" zoom="true"/>
-        <Node id="admin/user/admin_user_list.xhtml" x="150" y="1500" zoom="true"/>
-        <Node id="admin/country/admin_country_delete.xhtml" x="1150" y="750" zoom="true"/>
-        <Node id="user/login_change_personal_data.xhtml" x="1900" y="300" zoom="true"/>
-        <Node id="admin/category/admin_category_edit.xhtml" x="1400" y="150" zoom="true"/>
-        <Node id="logout.xhtml" x="1150" y="450" zoom="true"/>
-        <Node id="admin/country/admin_country_edit.xhtml" x="2150" y="300" zoom="true"/>
-        <Node id="user/login_add_addressbook.xhtml" x="400" y="600" zoom="true"/>
-        <Node id="user/login_contact_data_saved.xhtml" x="150" y="450" zoom="true"/>
-        <Node id="admin/contact/admin_contact_delete.xhtml" x="650" y="750" zoom="true"/>
-        <Node id="imprint.xhtml" x="1150" y="600" zoom="true"/>
-        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="150" y="1050" zoom="true"/>
-        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="400" y="1500" 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="600" zoom="true"/>
-        <Node id="guest/user/register.xhtml" x="2400" y="300" zoom="true"/>
-        <Node id="user/login_change_email_address.xhtml" x="2150" y="450" zoom="true"/>
-        <Node id="admin/product/admin_product_list.xhtml" x="150" y="300" zoom="true"/>
-        <Node id="admin/customer/admin_customer_show.xhtml" x="900" y="900" zoom="true"/>
-        <Node id="customer/empty_basket.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/customer/admin_customer_delete.xhtml" x="1150" y="150" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_list.xhtml" x="400" y="450" zoom="true"/>
+        <Node id="customer/checkout2.xhtml" x="150" y="750" zoom="true"/>
+        <Node id="admin/contact/admin_contact_show.xhtml" x="900" y="450" zoom="true"/>
+        <Node id="privacy.xhtml" x="2150" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_show.xhtml" x="900" y="150" zoom="true"/>
+        <Node id="guest/user/show_addressbook.xhtml" x="150" y="1500" zoom="true"/>
+        <Node id="admin/user/admin_user_show.xhtml" x="150" y="600" zoom="true"/>
+        <Node id="admin/index.xhtml" x="650" y="1350" zoom="true"/>
+        <Node id="user/login_own_addressbooks.xhtml" x="900" y="750" zoom="true"/>
+        <Node id="customer/register.xhtml" x="650" y="450" zoom="true"/>
+        <Node id="user/login_user_data_saved.xhtml" x="1150" y="750" zoom="true"/>
+        <Node id="admin/category/admin_category_list.xhtml" x="900" y="600" zoom="true"/>
+        <Node id="item_added.xhtml" x="400" y="900" zoom="true"/>
+        <Node id="admin/admin_logout.xhtml" x="150" y="1050" zoom="true"/>
+        <Node id="user/login_data_saved.xhtml" x="400" y="1350" zoom="true"/>
+        <Node id="admin/user/admin_user_unlock.xhtml" x="1400" y="300" zoom="true"/>
+        <Node id="customer/lost_passwd.xhtml" x="1650" y="450" zoom="true"/>
+        <Node id="guest/user/user_list.xhtml" x="400" y="300" zoom="true"/>
+        <Node id="index.xhtml" x="2150" y="450" zoom="true"/>
+        <Node id="user/login_edit_user_data.xhtml" x="900" y="300" zoom="true"/>
+        <Node id="customer/checkout_done.xhtml" x="1400" y="150" zoom="true"/>
+        <Node id="customer/login.xhtml" x="400" y="750" zoom="true"/>
+        <Node id="*" x="400" y="1500" zoom="true"/>
+        <Node id="admin/customer/admin_customer_unlock.xhtml" x="2400" y="150" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_edit.xhtml" x="1650" y="300" zoom="true"/>
+        <Node id="user/login_index.xhtml" x="1150" y="1050" zoom="true"/>
+        <Node id="admin/product/admin_product_edit.xhtml" x="650" y="150" zoom="true"/>
+        <Node id="guest/user/lost_passwd.xhtml" x="2400" y="300" zoom="true"/>
+        <Node id="guest/user/register_done.xhtml" x="150" y="450" zoom="true"/>
+        <Node id="guest/user/show_addressbook_entries.xhtml" x="150" y="1200" zoom="true"/>
+        <Node id="admin/country/admin_country_list.xhtml" x="2650" y="150" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_unlink.xhtml" x="900" y="1200" zoom="true"/>
+        <Node id="admin/customer/admin_customer_edit.xhtml" x="650" y="300" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_delete.xhtml" x="650" y="900" zoom="true"/>
+        <Node id="user/login_change_password.xhtml" x="400" y="150" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_list.xhtml" x="1400" y="900" zoom="true"/>
+        <Node id="customer/checkout.xhtml" x="1150" y="300" zoom="true"/>
+        <Node id="guest/user/user_profile.xhtml" x="2650" y="300" zoom="true"/>
+        <Node id="admin/product/admin_product_delete.xhtml" x="150" y="1350" zoom="true"/>
+        <Node id="basket.xhtml" x="1400" y="600" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_delete.xhtml" x="400" y="600" zoom="true"/>
+        <Node id="exception.xhtml" x="400" y="1050" zoom="true"/>
+        <Node id="admin/user/admin_user_delete.xhtml" x="1650" y="600" zoom="true"/>
+        <Node id="admin/category/admin_category_delete.xhtml" x="650" y="750" zoom="true"/>
+        <Node id="admin/user/admin_user_edit.xhtml" x="1900" y="600" zoom="true"/>
+        <Node id="guest/user/register_page2.xhtml" x="150" y="1650" zoom="true"/>
+        <Node id="terms.xhtml" x="1400" y="750" zoom="true"/>
+        <Node id="admin/contact/admin_contact_list.xhtml" x="150" y="300" zoom="true"/>
+        <Node id="admin/contact/admin_contact_edit.xhtml" x="1900" y="300" zoom="true"/>
+        <Node id="admin/user/admin_user_list.xhtml" x="1650" y="750" zoom="true"/>
+        <Node id="admin/country/admin_country_delete.xhtml" x="650" y="1200" zoom="true"/>
+        <Node id="user/login_change_personal_data.xhtml" x="650" y="1050" zoom="true"/>
+        <Node id="admin/category/admin_category_edit.xhtml" x="150" y="900" zoom="true"/>
+        <Node id="admin/country/admin_country_edit.xhtml" x="1150" y="600" zoom="true"/>
+        <Node id="logout.xhtml" x="2400" y="450" zoom="true"/>
+        <Node id="user/login_add_addressbook.xhtml" x="2150" y="300" zoom="true"/>
+        <Node id="user/login_contact_data_saved.xhtml" x="900" y="900" zoom="true"/>
+        <Node id="admin/contact/admin_contact_delete.xhtml" x="400" y="1200" zoom="true"/>
+        <Node id="imprint.xhtml" x="1150" y="450" zoom="true"/>
+        <Node id="admin/mobile_provider/admin_mobile_provider_edit.xhtml" x="650" y="600" zoom="true"/>
+        <Node id="admin/cellphone/admin_contact_cellphone_show.xhtml" x="1150" y="900" zoom="true"/>
+        <Node id="guest/user/login.xhtml" x="2900" y="150" zoom="true"/>
+        <Node id="admin/customer/admin_customer_list.xhtml" x="1400" y="450" zoom="true"/>
+        <Node id="guest/user/register.xhtml" x="1900" y="150" zoom="true"/>
+        <Node id="user/login_change_email_address.xhtml" x="150" y="150" zoom="true"/>
+        <Node id="admin/product/admin_product_list.xhtml" x="1650" y="150" zoom="true"/>
+        <Node id="admin/customer/admin_customer_show.xhtml" x="1900" y="450" zoom="true"/>
+        <Node id="customer/empty_basket.xhtml" x="900" y="1050" zoom="true"/>
     </Scope>
     <Scope Scope="All Faces Configurations"/>
 </Scene>
index e2fc3d2717baffc5c63a1c049cb316d43e7946a1..01981fa723b7ab6454ef9642c22e99d2fa6bbadf 100644 (file)
@@ -153,6 +153,8 @@ LOGIN_NO_PASSWORD_MESSAGE=Sie haben kein Passwort eingegeben.
 LOGIN_NO_USER_NAME_MESSAGE=Sie haben keinen Benutzernamen eingegeben.
 USER_NOT_LOGGED_IN=Sie sind nicht angemeldet.
 LOGIN_OWN_PROFILE_INVISIBLE=Ihr Profil ist auf "durchsichtig" gestellt.
+LINK_GUEST_LOGIN_LOST_PASSWORD=Passwort vergessen?
+LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD=Passwort wiederherstellen
 TABLE_HEADER_ERROR_USER_NOT_LOGGED_IN=Sie m\u00fcssen angemeldet sein
 USER_IS_NOT_LOGGED_IN_FULL=Damit diese Funktion nutzen k\u00f6nnen, m\u00fcssen Sie sich anmelden und in Ihren Account eingeloggt sein.
 LOGIN_EDIT_USER_DATA_TITLE=Was m\u00f6chten Sie \u00e4ndern?
@@ -487,3 +489,13 @@ LINK_GUEST_PRIVACY_STATEMENTS=Datenschutzbestimmungen
 ADMIN_ADD_OR_ENTER_CONTACT_DATA=... oder geben Sie die Kontaktdaten des Recruiters ein:
 ADMIN_PERSONAL_DATA_EMAIL_ADDRESS=Email-Adresse:
 ERROR_CONTACT_ID_NOT_FOUND=Fehler: Kontaktdaten nicht gefunden.
+GUEST_REGISTRATION_PAGE1_TITLE=Anmeldeseite 1
+GUEST_REGISTRATION_PAGE2_TITLE=Anmeldeseite 2
+BUTTON_CONTINUE_REGISTER_PAGE2=Weiter zur Anmeldeseite 2
+ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED=Fehler: Mehrfach-Seite f\u00fcr Anmeldung nicht aktiv, bitte Link nicht aufrufen.
+PAGE_TITLE_USER_REGISTER_PAGE2=Anmeldeseite 2
+CONTENT_TITLE_USER_REGISTER_PAGE2=Anmeldeseite 2:
+ERROR_GUEST_USER_LOGIN_DEACTIVATED=Fehler: Der Benutzerbereich wurde administrativ deaktiviert (keine Benutzernamen bei Anmeldung).
+ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED=Fehler: Wiederherstellen des Passwortes wurde administrativ deaktiviert.
+ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Fehler: Erneutes Aussenden des Best\u00e4tigungslinked ist administrativ deaktiviert.
+ERROR_GUEST_USER_PROFILE_DEACTIVATED=Fehler: \u00d6ffentliche Benutzerprofile sind administrativ deaktiviert.
index ff8e68cb98f3d77b887932d34b958acd074a6fa4..8acdba379f5dbeb662617b2f7326762f1a2627ac 100644 (file)
@@ -450,3 +450,13 @@ LINK_GUEST_PRIVACY_STATEMENTS=privacy statements
 ADMIN_ADD_OR_ENTER_CONTACT_DATA=... or enter the recruiter's contact data:
 ADMIN_PERSONAL_DATA_EMAIL_ADDRESS=Email address:
 ERROR_CONTACT_ID_NOT_FOUND=Error: contact data not found
+GUEST_REGISTRATION_PAGE1_TITLE=Registration page 1
+GUEST_REGISTRATION_PAGE2_TITLE=Registration page 2
+BUTTON_CONTINUE_REGISTER_PAGE2=Continue to registration page 2
+ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED=Error: Multiple registration page not active, please don't call this page.
+PAGE_TITLE_USER_REGISTER_PAGE2=Register page 2
+CONTENT_TITLE_USER_REGISTER_PAGE2=Register page 2:
+ERROR_GUEST_USER_LOGIN_DEACTIVATED=Error: User area is deactivated by administrators, no user name while registration.
+ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED=Error: password recovery is deactivated by administrators.
+ERROR_GUEST_USER_RESEND_CONFIRMATION_DEACTIVATED=Error: Resending confirmation link is deactivated by administrators.
+ERROR_GUEST_USER_PROFILE_DEACTIVATED=Error: Public user profiles are deactivated by administrators.
diff --git a/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java b/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java
new file mode 100644 (file)
index 0000000..dd42687
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.pizzaapplication.beans;
+
+import java.io.Serializable;
+import javax.faces.context.FacesContext;
+
+/**
+ * A general controller
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public abstract class BasePizzaController implements Serializable {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 50_837_597_127_567_140L;
+
+       /**
+        * Checks whether debug mode is enabled for given controller
+        * <p>
+        * @param controllerName Name of controller
+        * <p>
+        * @return Whether debug mode is enabled
+        */
+       protected boolean isDebugModeEnabled (final String controllerName) {
+               // Parameters should be valid
+               if (null == controllerName) {
+                       // Throw NPE
+                       throw new NullPointerException("controllerName is null"); //NOI18N
+               } else if (controllerName.isEmpty()) {
+                       // Is empty
+                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
+               }
+
+               // Try to get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
+
+               // Is it set and true?
+               boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.equals("true"))); //NOI18N
+
+               // Return it
+               return isEnabled;
+       }
+
+}
index f61972e2a8c63b4013662b185dfb324031ee5068..455fda2175fe4d3bde30006b20257b38a207a432 100644 (file)
@@ -32,6 +32,7 @@ import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote;
 import org.mxchange.jshopcore.model.basket.ShopBasket;
 import org.mxchange.jshopcore.model.basket.items.BasketItem;
 import org.mxchange.jshopcore.model.product.Product;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A bean for the basket
@@ -40,7 +41,7 @@ import org.mxchange.jshopcore.model.product.Product;
  */
 @Named ("basketController")
 @SessionScoped
-public class PizzaBasketWebSessionBean implements PizzaBasketWebSessionController {
+public class PizzaBasketWebSessionBean extends BasePizzaController implements PizzaBasketWebSessionController {
 
        /**
         * Serial number
index e7a21692ddd99022e3a52f14afe6bcf8a5d56b5e..6448a9548df3ada57e0389c631f39e970fe841c0 100644 (file)
@@ -32,6 +32,7 @@ import org.mxchange.jshopcore.exceptions.CategoryTitleAlreadyUsedException;
 import org.mxchange.jshopcore.model.category.AdminCategorySessionBeanRemote;
 import org.mxchange.jshopcore.model.category.Category;
 import org.mxchange.jshopcore.model.category.ProductCategory;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * Main application class
@@ -40,7 +41,7 @@ import org.mxchange.jshopcore.model.category.ProductCategory;
  */
 @Named ("adminCategoryController")
 @RequestScoped
-public class PizzaAdminCategoryWebRequestBean implements PizzaAdminCategoryWebRequestController {
+public class PizzaAdminCategoryWebRequestBean extends BasePizzaController implements PizzaAdminCategoryWebRequestController {
 
        /**
         * Serial number
index d89f0f7d1bf668996d868ce2ab6a7ee27e01c42c..ab1c69ae10a0b0536c93f6e5649603dedd1b60f4 100644 (file)
@@ -31,6 +31,7 @@ import javax.naming.NamingException;
 import org.mxchange.jshopcore.events.category.AddedCategoryEvent;
 import org.mxchange.jshopcore.model.category.Category;
 import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * General (product) category controller
@@ -39,7 +40,7 @@ import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
  */
 @Named ("categoryController")
 @ApplicationScoped
-public class PizzaCategoryWebApplicationBean implements PizzaCategoryWebApplicationController {
+public class PizzaCategoryWebApplicationBean extends BasePizzaController implements PizzaCategoryWebApplicationController {
 
        /**
         * Serial number
index 4e8322553ea4d3586c2255f4d5e2987b61cb49d7..ab7e6e41e5dd059fc47a1ef402a7f2b033b5f160 100644 (file)
@@ -37,6 +37,7 @@ import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
 import org.mxchange.jshopcore.wrapper.CheckoutWrapper;
 import org.mxchange.jshopcore.wrapper.WrapableCheckout;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.basket.PizzaBasketWebSessionController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController;
 import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionController;
@@ -49,7 +50,7 @@ import org.mxchange.pizzaapplication.beans.receipt.PizzaReceiptWebSessionControl
  */
 @Named ("checkoutController")
 @SessionScoped
-public class PizzaCheckoutWebSessionBean implements PizzaCheckoutWebSessionController {
+public class PizzaCheckoutWebSessionBean extends BasePizzaController implements PizzaCheckoutWebSessionController {
 
        /**
         * Serial number
index dccf55e738c7aca4430bd038d2f92c9cf725f514..6fc5064897b3c367595910398e9ce8c08b58cd9d 100644 (file)
@@ -47,6 +47,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.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController;
 
 /**
@@ -56,7 +57,7 @@ import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController
  */
 @Named ("adminContactController")
 @RequestScoped
-public class PizzaAdminContactWebRequestBean implements PizzaAdminContactWebRequestController {
+public class PizzaAdminContactWebRequestBean extends BasePizzaController implements PizzaAdminContactWebRequestController {
 
        /**
         * Serial number
index 887b59b2be63bb12f74010e03447dc03f7cea787..51a7f625d2a8d9c0338ba5497ed4646b6c406d04 100644 (file)
@@ -52,6 +52,7 @@ import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
 
 /**
@@ -61,7 +62,7 @@ import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionControl
  */
 @Named ("contactController")
 @SessionScoped
-public class PizzaContactWebSessionBean implements PizzaContactWebSessionController {
+public class PizzaContactWebSessionBean extends BasePizzaController implements PizzaContactWebSessionController {
 
        /**
         * Serial number
@@ -173,12 +174,6 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl
         */
        private boolean isLandLineUnlinked;
 
-       /**
-        * Login bean (controller)
-        */
-       @Inject
-       private PizzaUserLoginWebSessionController userLoginController;
-
        /**
         * Phone number area code
         */
@@ -199,6 +194,12 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl
         */
        private String street;
 
+       /**
+        * Login bean (controller)
+        */
+       @Inject
+       private PizzaUserLoginWebSessionController userLoginController;
+
        /**
         * ZIP code
         */
index 8690f7d201f0f0567c64420fce6b1db4fd37968e..862b7751ecd25a3738e1bea8188d89cc31e2f57e 100644 (file)
@@ -34,6 +34,7 @@ import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
 import org.mxchange.jcountry.events.AdminAddedCountryEvent;
 import org.mxchange.jcountry.events.AdminEventCountryAdded;
 import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * An administrative country bean
@@ -42,7 +43,7 @@ import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
  */
 @Named ("adminCountryController")
 @RequestScoped
-public class PizzaAdminCountryWebRequestBean implements PizzaAdminCountryWebRequestController {
+public class PizzaAdminCountryWebRequestBean extends BasePizzaController implements PizzaAdminCountryWebRequestController {
 
        /**
         * Serial number
index 1e1bc4ac87597c815512563e8f44950b85bd3d90..43faccbaae2bc067f643ee95cbd0023923c91b6f 100644 (file)
@@ -30,6 +30,7 @@ import javax.naming.NamingException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jcountry.data.CountrySingletonBeanRemote;
 import org.mxchange.jcountry.events.AdminAddedCountryEvent;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A country bean
@@ -38,7 +39,7 @@ import org.mxchange.jcountry.events.AdminAddedCountryEvent;
  */
 @Named ("countryController")
 @ApplicationScoped
-public class PizzaCountryWebApplicationBean implements PizzaCountryWebApplicationController {
+public class PizzaCountryWebApplicationBean extends BasePizzaController implements PizzaCountryWebApplicationController {
 
        /**
         * Serial number
index 9e51f31c3c30977d79a814a9775f306f1c16c1d0..df11ef7fc934ea2db34a5976db80953fe06fba28 100644 (file)
@@ -35,6 +35,7 @@ import org.mxchange.jcustomercore.events.customer.added.CustomerAdminAddedEvent;
 import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;
 import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
 import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController;
 import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote;
@@ -47,7 +48,7 @@ import org.mxchange.pizzaapplication.model.customer.PizzaCustomer;
  */
 @Named ("adminCustomerController")
 @RequestScoped
-public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRequestController {
+public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implements PizzaAdminCustomerWebRequestController {
 
        /**
         * Serial number
index 0b3d545666088ad00f800ab988527f85e085bfbf..632083a2ed9f01e8d706325d6ee7d0ab8ea4c188 100644 (file)
@@ -35,6 +35,7 @@ import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
 import org.mxchange.jcustomercore.events.customer.added.AdminAddedCustomerEvent;
 import org.mxchange.jcustomercore.model.customer.Customer;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController;
 import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote;
 
@@ -45,7 +46,7 @@ import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBea
  */
 @Named ("customerController")
 @SessionScoped
-public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionController {
+public class PizzaCustomerWebSessionBean extends BasePizzaController implements PizzaCustomerWebSessionController {
 
        /**
         * Serial number
index fff019e148e7a9bca8267ac1153004ec6566623f..960c5bc110301550e8415b14729b56f31cba58a5 100644 (file)
@@ -32,6 +32,7 @@ import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 import org.mxchange.jusercore.model.email_address.EmailAddressChange;
 import org.mxchange.jusercore.model.email_address.EmailChangeSessionBeanRemote;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
 
 /**
@@ -41,7 +42,7 @@ import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionControl
  */
 @Named ("emailChangeController")
 @SessionScoped
-public class PizzaEmailChangeWebSessionBean implements PizzaEmailChangeWebSessionController {
+public class PizzaEmailChangeWebSessionBean extends BasePizzaController implements PizzaEmailChangeWebSessionController {
 
        /**
         * Serial number
index 28e2d20c79c31edd1cf741020632d29dc2c18034..7b0938ed22c976929c6593063f40cac2ebcd7a25 100644 (file)
@@ -21,6 +21,7 @@ import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcontacts.contact.gender.GenderUtils;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A gender bean (controller)
@@ -29,7 +30,7 @@ import org.mxchange.jcontacts.contact.gender.GenderUtils;
  */
 @Named ("genderController")
 @ApplicationScoped
-public class PizzaGenderWebApplicationBean implements PizzaGenderWebApplicationController {
+public class PizzaGenderWebApplicationBean extends BasePizzaController implements PizzaGenderWebApplicationController {
 
        /**
         * Serial number
index 648cf36dcf3b70fe993876d1df805824e7c12cf8..4496bfc5dc4883f1263b081f3a3e08e1abbb8092 100644 (file)
@@ -21,7 +21,7 @@ import javax.annotation.PostConstruct;
 import javax.faces.bean.SessionScoped;
 import javax.faces.context.FacesContext;
 import javax.inject.Named;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A session bean for handling localization/internationalization changes. This
@@ -33,7 +33,7 @@ import org.mxchange.jcoreee.database.BaseDatabaseBean;
  */
 @Named ("localizationController")
 @SessionScoped
-public class PizzaLocalizationSessionBean extends BaseDatabaseBean implements PizzaLocalizationSessionController {
+public class PizzaLocalizationSessionBean extends BasePizzaController implements PizzaLocalizationSessionController {
 
        /**
         * Serial number
index e4d5ecb772a6687f9cd5c78a45799e0839326fef..cab8d9361dfa05599ac59b5f84f350746aa3990b 100644 (file)
@@ -39,6 +39,7 @@ import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
 
 /**
@@ -48,7 +49,7 @@ import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
  */
 @Named ("loginController")
 @SessionScoped
-public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionController {
+public class PizzaUserLoginWebSessionBean extends BasePizzaController implements PizzaUserLoginWebSessionController {
 
        /**
         * Serial number
index 4c2c3f47ff8c666fd29c24a7a072a8c79c569e8e..1e008b357165bb9da1578b3746a1c3cea928f28b 100644 (file)
@@ -35,6 +35,7 @@ import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException;
 import org.mxchange.jphone.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote;
 import org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * Administrative bean (controller) for mobile provider
@@ -43,7 +44,7 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
  */
 @Named ("adminMobileProviderController")
 @RequestScoped
-public class PizzaAdminMobileProviderWebRequestBean implements PizzaAdminMobileProviderWebRequestController {
+public class PizzaAdminMobileProviderWebRequestBean extends BasePizzaController implements PizzaAdminMobileProviderWebRequestController {
 
        /**
         * Serial number
index ce478f68e6d5340b479962b746a50b09a4bfb7aa..26d84c586bc5ba259220cfb8591b8194eb0fddea 100644 (file)
@@ -30,6 +30,7 @@ import javax.naming.NamingException;
 import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A general bean for mobile providers
@@ -38,7 +39,7 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBe
  */
 @Named ("mobileProviderController")
 @SessionScoped
-public class PizzaMobileProviderWebRequestBean implements PizzaMobileProviderWebRequestController {
+public class PizzaMobileProviderWebRequestBean extends BasePizzaController implements PizzaMobileProviderWebRequestController {
 
        /**
         * Serial number
index 12ab8240a5367ba2a2c473953fac1050b01da725..70d904f589f2ea83e821de0a430c1672b8c25bb7 100644 (file)
@@ -30,6 +30,7 @@ import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * Administrative bean (controller) for contact's phone numbers
@@ -38,7 +39,7 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
  */
 @Named ("adminContactPhoneController")
 @RequestScoped
-public class PizzaAdminContactPhoneWebRequestBean implements PizzaAdminContactPhoneWebRequestController {
+public class PizzaAdminContactPhoneWebRequestBean extends BasePizzaController implements PizzaAdminContactPhoneWebRequestController {
 
        /**
         * Serial number
index d477617b42439778d73d54c8ec976ed3a5030758..a2d385d9b00e8a994e11af300ba35acde2140adb 100644 (file)
@@ -36,6 +36,7 @@ import org.mxchange.jshopcore.model.category.Category;
 import org.mxchange.jshopcore.model.product.AdminProductSessionBeanRemote;
 import org.mxchange.jshopcore.model.product.GenericProduct;
 import org.mxchange.jshopcore.model.product.Product;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * Main application class
@@ -44,7 +45,7 @@ import org.mxchange.jshopcore.model.product.Product;
  */
 @Named ("adminProductController")
 @RequestScoped
-public class PizzaAdminProductWebRequestBean implements PizzaAdminProductWebRequestController {
+public class PizzaAdminProductWebRequestBean extends BasePizzaController implements PizzaAdminProductWebRequestController {
 
        /**
         * Serial number
index a5ffce83628c18589260a6be5ce04b7337e41719..15c868264d35278a91fd423de0d0d64a2f2bdb40 100644 (file)
@@ -30,6 +30,7 @@ import javax.naming.NamingException;
 import org.mxchange.jshopcore.events.product.AddedProductEvent;
 import org.mxchange.jshopcore.model.product.Product;
 import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * General product controller
@@ -38,7 +39,7 @@ import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
  */
 @Named ("productController")
 @ApplicationScoped
-public class PizzaProductWebApplicationBean implements PizzaProductWebApplicationController {
+public class PizzaProductWebApplicationBean extends BasePizzaController implements PizzaProductWebApplicationController {
 
        /**
         * Serial number
index 64133a6f7d2a80d81e6f594b4fb03bc9f58024b3..85b82e56452038055f9bb07cf30fa2be453f8d1c 100644 (file)
@@ -24,6 +24,7 @@ import javax.inject.Named;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
 import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
 
@@ -34,7 +35,7 @@ import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
  */
 @Named (value = "profileController")
 @RequestScoped
-public class PizzaUserProfileWebRequestBean implements PizzaUserProfileWebRequestController {
+public class PizzaUserProfileWebRequestBean extends BasePizzaController implements PizzaUserProfileWebRequestController {
 
        /**
         * Serial number
@@ -56,24 +57,24 @@ public class PizzaUserProfileWebRequestBean implements PizzaUserProfileWebReques
        @Override
        public boolean isProfileLinkVisibleById (final Long userId) {
                // Init user instance
-               User u = null;
+               User user = null;
 
                try {
                        // Try to get it
-                       u = this.userController.lookupUserById(userId);
+                       user = this.userController.lookupUserById(userId);
                } catch (final UserNotFoundException ex) {
                        // Throw again
                        throw new FaceletException(ex);
                }
 
                // Is it null?
-               if (null == u) {
+               if (null == user) {
                        // Not found, not visible.
                        return false;
                }
 
                // Ask other method
-               return this.isProfileLinkVisibleByUser(u);
+               return this.isProfileLinkVisibleByUser(user);
        }
 
        @Override
index e60ab41cff54628551576456e00af7ca58bb76df..e2f057a08401eed994466303005a8d16c64924a9 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.pizzaapplication.beans.profilemode;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Named;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * A profile mode bean
@@ -27,7 +28,7 @@ import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
  */
 @Named ("profileModeController")
 @ApplicationScoped
-public class PizzaProfileModeWebApplicationBean implements PizzaProfileModeWebApplicationController {
+public class PizzaProfileModeWebApplicationBean extends BasePizzaController implements PizzaProfileModeWebApplicationController {
 
        /**
         * Serial number
index 5ed9f623c2f0cb1675a91641e48f21d2def41fb5..40f9823f10f18557220a66d3ae86d152627898bc 100644 (file)
@@ -24,6 +24,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.receipt.ReceiptBeanRemote;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 
 /**
  * Checkout controller
@@ -32,7 +33,7 @@ import org.mxchange.jshopcore.model.receipt.ReceiptBeanRemote;
  */
 @Named ("receiptController")
 @SessionScoped
-public class PizzaReceiptWebSessionBean implements PizzaReceiptWebSessionController {
+public class PizzaReceiptWebSessionBean extends BasePizzaController implements PizzaReceiptWebSessionController {
 
        /**
         * Serial number
index c0fc0af88eb6206c6a6110a8a3953bedec3462bd..df60314ea588843931866c85eff548ba455cc6dd 100644 (file)
@@ -20,6 +20,7 @@ import java.text.MessageFormat;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
+import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -35,6 +36,7 @@ import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController;
 import org.mxchange.pizzaapplication.beans.user.PizzaAdminUserWebRequestController;
 import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
@@ -46,7 +48,7 @@ import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController;
  */
 @Named ("registerController")
 @SessionScoped
-public class PizzaUserRegisterWebSessionBean implements PizzaUserRegisterWebSessionController {
+public class PizzaUserRegisterWebSessionBean extends BasePizzaController implements PizzaUserRegisterWebSessionController {
 
        /**
         * Serial number
@@ -100,14 +102,14 @@ public class PizzaUserRegisterWebSessionBean implements PizzaUserRegisterWebSess
        }
 
        @Override
-       public String doRegister () {
+       public String doFinishRegistration () {
                // Get user instance
                User user = this.userController.createUserInstance();
 
                // Is the user already used?
                if (null == user) {
                        // user must be set
-                       throw new NullPointerException("user is null"); //NOI18N
+                       throw new NullPointerException("user is null after createUserInstance() was called"); //NOI18N
                } else if (!this.userController.isRequiredPersonalDataSet()) {
                        // Not all required fields are set
                        throw new FaceletException("Not all required fields are set."); //NOI18N
@@ -131,8 +133,14 @@ public class PizzaUserRegisterWebSessionBean implements PizzaUserRegisterWebSess
                // Set it here
                user.setUserEncryptedPassword(encryptedPassword);
 
-               // For debugging/programming only:
-               user.setUserAccountStatus(UserAccountStatus.CONFIRMED);
+               // Is developer mode?
+               if (this.isDebugModeEnabled("register")) { //NOI18N
+                       // For debugging/programming only:
+                       user.setUserAccountStatus(UserAccountStatus.CONFIRMED);
+               } else {
+                       // No debugging of this part
+                       user.setUserAccountStatus(UserAccountStatus.UNCONFIRMED);
+               }
 
                try {
                        // Call bean
@@ -152,4 +160,34 @@ public class PizzaUserRegisterWebSessionBean implements PizzaUserRegisterWebSess
                }
        }
 
+       @Override
+       public String doRegisterMultiPage1 () {
+               // Now only redirect to next page as the JSF does it
+               return "register_page2"; //NOI18N
+       }
+
+       @Override
+       public boolean isMultiplePageEnabled () {
+               // Get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_multi_register_page"); //NOI18N
+
+               // Is it set?
+               boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+               // Return value
+               return isEnabled;
+       }
+
+       @Override
+       public boolean isResendConfirmationLinkEnabled () {
+               // Get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_resend_confirm_link_enabled"); //NOI18N
+
+               // Is it set?
+               boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+               // Return value
+               return isEnabled;
+       }
+
 }
index e9c960ff4d1c14eba7734966a08fda5be3ade8f4..fdd0d7bcb7b445cc944b09c27f5288e26e995658 100644 (file)
@@ -31,6 +31,29 @@ public interface PizzaUserRegisterWebSessionController extends Serializable {
         * <p>
         * @return Redirection target
         */
-       String doRegister ();
+       String doFinishRegistration ();
+
+       /**
+        * Handles registration request send from first page. The (maybe) entered
+        * user name and email address is not used and that privacy and T&C are
+        * accepted.
+        * <p>
+        * @return Redirect
+        */
+       String doRegisterMultiPage1 ();
+
+       /**
+        * Checks wether multi-page or single-page registration is active
+        * <p>
+        * @return Whether multi (true) or single page (false) is active
+        */
+       boolean isMultiplePageEnabled ();
+
+       /**
+        * Checks whether the "resend confirmation link" feature is enabled
+        * <p>
+        * @return Whether "resend confirmation link" is enabled
+        */
+       boolean isResendConfirmationLinkEnabled ();
 
 }
index 35f814dca27e73b2127723b35f2102252d4bc22d..c6785841822f9092cc017aa75dd8d75970533cd0 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.pizzaapplication.beans.user;
 
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import java.text.MessageFormat;
 import java.util.Objects;
 import javax.annotation.PostConstruct;
@@ -57,7 +58,7 @@ import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionControl
  */
 @Named ("adminUserController")
 @RequestScoped
-public class PizzaAdminUserWebRequestBean implements PizzaAdminUserWebRequestController {
+public class PizzaAdminUserWebRequestBean extends BasePizzaController implements PizzaAdminUserWebRequestController {
 
        /**
         * Serial number
index 1e95d03ee4a7d52421c54437df15619ad1b78eca..105f9ddc856ca90fbadcd5b1fd1dfd4622827bf2 100644 (file)
@@ -26,6 +26,7 @@ import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.Any;
+import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -34,6 +35,7 @@ import javax.naming.InitialContext;
 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.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -45,9 +47,12 @@ import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
 import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController;
 import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController;
+import org.mxchange.pizzaapplication.beans.register.PizzaUserRegisterWebSessionController;
 
 /**
  * A user bean (controller)
@@ -56,7 +61,7 @@ import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionControl
  */
 @Named ("userController")
 @SessionScoped
-public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
+public class PizzaUserWebSessionBean extends BasePizzaController implements PizzaUserWebSessionController {
 
        /**
         * Serial number
@@ -80,6 +85,13 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
        @Inject
        private PizzaUserLoginWebSessionController loginController;
 
+       /**
+        * Registration controller
+        */
+       @Inject
+       private PizzaUserRegisterWebSessionController
+       registerController;
+
        /**
         * A list of all selectable contacts
         */
@@ -163,6 +175,27 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
                }
        }
 
+       @Override
+       public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
+               // The event must be valid
+               if (null == event) {
+                       // Throw NPE
+                       throw new NullPointerException("event is null"); //NOI18N
+               } else if (event.getAddedContact() == null) {
+                       // Throw again ...
+                       throw new NullPointerException("event.addedContact is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() == null) {
+                       // ... and again
+                       throw new NullPointerException("event.addedContact.customerId is null"); //NOI18N
+               } else if (event.getAddedContact().getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("event.addedContact.customerId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
+               }
+
+               // Call other method
+               this.selectableContacts.add(event.getAddedContact());
+       }
+
        @Override
        public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
                // Trace message
@@ -351,7 +384,24 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
                // Create new user instance
                User localUser = new LoginUser();
 
-               // Update all data ...
+               // Is user name required?
+               if (!this.isUserNameRequired()) {
+                       // Generate pseudo-random user name
+                       String randomName = this.userBean.generateRandomUserName();
+
+                       // Set it and inivisible profile
+                       this.setUserName(randomName);
+                       this.setUserProfileMode(ProfileMode.INVISIBLE);
+
+                       // Generate random password
+                       String randomPassword = UserUtils.createRandomPassword(PizzaUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+
+                       // Set random password
+                       this.setUserPassword(randomPassword);
+                       this.setUserPasswordRepeat(randomPassword);
+               }
+
+               // Set user name and mode
                localUser.setUserName(this.getUserName());
                localUser.setUserProfileMode(this.getUserProfileMode());
 
@@ -586,6 +636,24 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
                return isFound;
        }
 
+       @Override
+       public boolean isPublicUserProfileEnabled () {
+               // Get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_public_profile_enabled"); //NOI18N
+
+               // Is it set?
+               boolean isPublicUserProfileEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+               // This requires user names being enabled, too.
+               if ((isPublicUserProfileEnabled) && (!this.isUserNameRequired())) {
+                       // Not valid state, users must be able to modify their profile, especially when it is public
+                       throw new IllegalStateException("Public user profiles are enabled but user name requirement is disabled, this is not possible."); //NOI18N
+               }
+
+               // Return value
+               return isPublicUserProfileEnabled;
+       }
+
        @Override
        public boolean isRequiredChangePersonalDataSet () {
                return ((this.getUserProfileMode() != null) &&
@@ -595,11 +663,17 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
 
        @Override
        public boolean isRequiredPersonalDataSet () {
-               return ((this.getUserName() != null) &&
-                               (this.getUserProfileMode() != null) &&
-                               (this.contactController.isRequiredPersonalDataSet()) &&
-                               (this.getUserPassword() != null) &&
-                               (this.getUserPasswordRepeat() != null));
+               if (this.registerController.isMultiplePageEnabled()) {
+                       // Multiple registration page
+                       return this.contactController.isRequiredPersonalDataSet();
+               } else {
+                       // Single registration page
+                       return (((this.getUserName() != null) || (!this.isUserNameRequired())) &&
+                                       (this.getUserProfileMode() != null) &&
+                                       (this.contactController.isRequiredPersonalDataSet()) &&
+                                       (this.getUserPassword() != null) &&
+                                       (this.getUserPasswordRepeat() != null));
+               }
        }
 
        @Override
@@ -617,6 +691,18 @@ public class PizzaUserWebSessionBean implements PizzaUserWebSessionController {
                return ((this.userNameList instanceof List) && (this.userNameList.contains(user.getUserName())));
        }
 
+       @Override
+       public boolean isUserNameRequired () {
+               // Get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter("is_user_name_required"); //NOI18N
+
+               // Is it set?
+               boolean isUserNameRequired = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+               // Return value
+               return isUserNameRequired;
+       }
+
        @Override
        public boolean isVisibleUserFound () {
                return ((this.visibleUserList instanceof List) && (this.visibleUserList.size() > 0));
index 1821a80863c65a8ed7b0bba32a16fe76fac17e72..ff5d8b508c3adca565cfa8d7695385f5a244634c 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.pizzaapplication.beans.user;
 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.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
@@ -40,6 +41,14 @@ public interface PizzaUserWebSessionController extends Serializable {
         */
        public static final Integer MINIMUM_PASSWORD_LENGTH = 5;
 
+       /**
+        * Observes events being fired when an administrator has added a new
+        * contact.
+        * <p>
+        * @param event Event being fired
+        */
+       void afterAdminAddedContact (final AdminAddedContactEvent event);
+
        /**
         * Event observer for newly added users by adminstrator
         * <p>
@@ -262,4 +271,20 @@ public interface PizzaUserWebSessionController extends Serializable {
         */
        String doChangePersonalData ();
 
+       /**
+        * Checks whether this application requires a user name to be entered.
+        * Otherwise a random name like "userXXXXX" is generated
+        * <p>
+        * @return Whether this application requires a user name
+        */
+       boolean isUserNameRequired ();
+
+       /**
+        * Checks wether public user profiles are enabled. This requires that user
+        * names are also enabled.
+        * <p>
+        * @return Whether public user profiles are enabled
+        */
+       boolean isPublicUserProfileEnabled ();
+
 }
index 3814d681c968070ed6df8479a2c1883b546fc618..7754be67a0bf663304a5189dd0f22329d894d0a4 100644 (file)
                        <from-outcome>register_done</from-outcome>
                        <to-view-id>/guest/user/register_done.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>register_page2</from-outcome>
+                       <to-view-id>/guest/user/register_page2.xhtml</to-view-id>
+               </navigation-case>
        </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/admin_logout.xhtml</from-view-id>
index dd60568754f6b5b16144cd2d5361b584bc0e9b34..55d2234c5aa601718b89bdd488970a93e7458f0e 100644 (file)
                </fieldset>
        </div>
 
-       <div class="para">
-               <fieldset id="user_profile">
-                       <legend title="#{msg.USER_PROFILE_LEGEND_TITLE}">#{msg.USER_PROFILE_LEGEND}</legend>
-
-                       <div class="table_row">
-                               <div class="table_left">
-                                       <h:outputLabel for="profileMode" value="#{msg.USER_PROFILE_MODE}" />
-                               </div>
-
-                               <div class="table_right">
-                                       <ui:include src="/WEB-INF/templates/generic/profile_mode_selection_box.tpl" />
-                               </div>
-
-                               <div class="clear"></div>
-                       </div>
-
-                       <div class="table_row">
-                               <div class="para notice">
-                                       <ul>
-                                               <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_INVISIBLE}</li>
-                                               <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS}</li>
-                                               <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC}</li>
-                                       </ul>
-                               </div>
-                       </div>
-               </fieldset>
-       </div>
+       <ui:fragment rendered="#{userController.isPublicUserProfileEnabled()}">
+               <div class="para">
+                       <fieldset id="user_profile">
+                               <legend title="#{msg.USER_PROFILE_LEGEND_TITLE}">#{msg.USER_PROFILE_LEGEND}</legend>
+
+                               <div class="table_row">
+                                       <div class="table_left">
+                                               <h:outputLabel for="profileMode" value="#{msg.USER_PROFILE_MODE}" />
+                                       </div>
+
+                                       <div class="table_right">
+                                               <ui:include src="/WEB-INF/templates/generic/profile_mode_selection_box.tpl" />
+                                       </div>
+
+                                       <div class="clear"></div>
+                               </div>
+
+                               <div class="table_row">
+                                       <div class="para notice">
+                                               <ul>
+                                                       <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_INVISIBLE}</li>
+                                                       <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS}</li>
+                                                       <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC}</li>
+                                               </ul>
+                                       </div>
+                               </div>
+                       </fieldset>
+               </div>
+       </ui:fragment>
 </ui:composition>
index 3a5153f7aebf49c6bf15b73c53a0583da6e32a46..4b00f1c5d99ec4de673ed61e4c60cebebca90b42 100644 (file)
                        </div>
 
                        <ul>
-                               <li>
-                                       <h:link title="#{msg.LINK_GUEST_LOGIN_TITLE}" outcome="user_login" value="#{msg.LINK_GUEST_LOGIN}" />
-                               </li>
+                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <li>
+                                               <h:link title="#{msg.LINK_GUEST_LOGIN_TITLE}" outcome="user_login" value="#{msg.LINK_GUEST_LOGIN}" />
+                                       </li>
+                               </ui:fragment>
 
                                <li>
                                        <h:link title="#{msg.LINK_GUEST_REGISTER_TITLE}" outcome="user_register" value="#{msg.LINK_GUEST_REGISTER}" />
                                </li>
 
-                               <li>
-                                       <h:link title="#{msg.LINK_GUEST_PASSWORD_TITLE}" outcome="user_lost_passwd" value="#{msg.LINK_GUEST_PASSWORD}" />
-                               </li>
+                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <li>
+                                               <h:link title="#{msg.LINK_GUEST_PASSWORD_TITLE}" outcome="user_lost_passwd" value="#{msg.LINK_GUEST_PASSWORD}" />
+                                       </li>
+                               </ui:fragment>
+
+                               <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
+                                       <li>
+                                               <h:link title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" outcome="user_resend_link" value="#{msg.LINK_GUEST_RESEND_LINK}" />
+                                       </li>
+                               </ui:fragment>
                        </ul>
                </div>
        </div>
index e4b3f3981a8233d151305ea4ac12d5396828c37b..385dfc850f6529318e74558eb1a05c6f2b83c943 100644 (file)
@@ -34,7 +34,7 @@
 
                                <div class="table_right75">
                                        #{msg.GUEST_AGREE_READ_TERMS_CONDITIONS_1}
-                                       <h:link outcome="terms" target="_blank" value="#{msg.TERMS_CONDITIONS}" />
+                                       <h:link outcome="terms" target="_blank" value="#{msg.LINK_GUEST_TERMS_CONDITIONS}" />
                                        #{msg.GUEST_AGREE_READ_TERMS_CONDITIONS_2}
                                </div>
 
index 1331e0efd4bacc66f4189043edd28aa7b67dfd55..e8d70a7674333e8e85befb24531a0be23bcdc05b 100644 (file)
@@ -5,11 +5,10 @@
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
-
-       <h:form id="register_form">
+       <h:form id="register_page2_form">
                <div class="table">
                        <div class="table_header">
-                               #{msg.GUEST_REGISTRATION_TITLE}
+                               #{msg.GUEST_REGISTRATION_PAGE2_TITLE}
                        </div>
 
                        <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
@@ -93,7 +92,7 @@
 
                        <div class="table_footer">
                                <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                               <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doRegister()}" />
+                               <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
                        </div>
                </div>
        </h:form>
index 55c2ebddbcf300b6eef94bb33d747771062cbd0d..a1c7223d913add429e17bb712700531da80afb93 100644 (file)
@@ -6,29 +6,29 @@
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
 
-       <h:form id="register_form">
+       <h:form id="register_page1_form">
                <div class="table">
                        <div class="table_header">
-                               #{msg.GUEST_REGISTRATION_TITLE}
+                               #{msg.GUEST_REGISTRATION_PAGE1_TITLE}
                        </div>
 
-                       <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
-
                        <div class="para">
                                <fieldset id="login_data">
                                        <legend title="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND_TITLE}">#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}</legend>
 
-                                       <div class="table_row">
-                                               <div class="table_left">
-                                                       <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
-                                               </div>
+                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
+                                                       </div>
 
-                                               <div class="table_right">
-                                                       <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
-                                               </div>
+                                                       <div class="table_right">
+                                                               <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
+                                                       </div>
 
-                                               <div class="clear"></div>
-                                       </div>
+                                                       <div class="clear"></div>
+                                               </div>
+                                       </ui:fragment>
 
                                        <div class="table_row">
                                                <div class="table_left">
                                                <div class="clear"></div>
                                        </div>
 
-                                       <div class="para"></div>
+                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                               <div class="para"></div>
 
-                                       <div class="table_row">
-                                               <div class="table_left">
-                                                       <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
-                                               </div>
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+                                                       </div>
 
-                                               <div class="table_right">
-                                                       <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+                                                       <div class="table_right">
+                                                               <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+                                                       </div>
+
+                                                       <div class="clear"></div>
                                                </div>
 
-                                               <div class="clear"></div>
-                                       </div>
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+                                                       </div>
 
-                                       <div class="table_row">
-                                               <div class="table_left">
-                                                       <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
-                                               </div>
+                                                       <div class="table_right">
+                                                               <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+                                                       </div>
 
-                                               <div class="table_right">
-                                                       <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+                                                       <div class="clear"></div>
                                                </div>
 
-                                               <div class="clear"></div>
-                                       </div>
-
-                                       <div class="para notice">
-                                               #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
-                                       </div>
+                                               <div class="para notice">
+                                                       #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
+                                               </div>
+                                       </ui:fragment>
                                </fieldset>
                        </div>
 
@@ -90,7 +92,7 @@
 
                        <div class="table_footer">
                                <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                               <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doRegister()}" />
+                               <h:commandButton styleClass="submit" type="submit" id="continueRegisterPage1" value="#{msg.BUTTON_CONTINUE_REGISTER_PAGE2}" action="#{registerController.doRegisterMultiPage1()}" />
                        </div>
                </div>
        </h:form>
diff --git a/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl b/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl
new file mode 100644 (file)
index 0000000..d4e1e9d
--- /dev/null
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       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">
+
+       <h:form id="register_single_form">
+               <div class="table">
+                       <div class="table_header">
+                               #{msg.GUEST_REGISTRATION_TITLE}
+                       </div>
+
+                       <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+
+                       <div class="para">
+                               <fieldset id="login_data">
+                                       <legend title="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND_TITLE}">#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}</legend>
+
+                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
+                                                       </div>
+
+                                                       <div class="table_right">
+                                                               <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
+                                                       </div>
+
+                                                       <div class="clear"></div>
+                                               </div>
+                                       </ui:fragment>
+
+                                       <div class="table_row">
+                                               <div class="table_left">
+                                                       <h:outputLabel for="emailAddress" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL}" />
+                                               </div>
+
+                                               <div class="table_right">
+                                                       <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" />
+                                               </div>
+
+                                               <div class="clear"></div>
+                                       </div>
+
+                                       <div class="table_row">
+                                               <div class="table_left">
+                                                       <h:outputLabel for="emailAddressRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL_REPEAT}" />
+                                               </div>
+
+                                               <div class="table_right">
+                                                       <h:inputText styleClass="input" id="emailAddressRepeat" size="20" maxlength="255" value="#{contactController.emailAddressRepeat}" required="true" />
+                                               </div>
+
+                                               <div class="clear"></div>
+                                       </div>
+
+                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                               <div class="para"></div>
+
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+                                                       </div>
+
+                                                       <div class="table_right">
+                                                               <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+                                                       </div>
+
+                                                       <div class="clear"></div>
+                                               </div>
+
+                                               <div class="table_row">
+                                                       <div class="table_left">
+                                                               <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+                                                       </div>
+
+                                                       <div class="table_right">
+                                                               <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+                                                       </div>
+
+                                                       <div class="clear"></div>
+                                               </div>
+
+                                               <div class="para notice">
+                                                       #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
+                                               </div>
+                                       </ui:fragment>
+                               </fieldset>
+                       </div>
+
+                       <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+
+                       <div class="table_footer">
+                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                               <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doFinishRegistration()}" />
+                       </div>
+               </div>
+       </h:form>
+</ui:composition>
index 0a3b07d3048fcbb0f23a3ed007708c5b79594962..7cee705d4f3566cf69a208855d84bc2ec959dd2e 100644 (file)
@@ -3,8 +3,29 @@
     <description>An online address book application to share private and business memebers between all members. It is also possible that the user's profile can be made visible to outside.</description>
     <display-name>JLandingPage Application v1.0</display-name>
     <context-param>
-        <param-name>javax.faces.PROJECT_STAGE</param-name>
-        <param-value>Development</param-value>
+        <description>Whether debug mode is for registration controller enabled.</description>
+        <param-name>is_debug_register_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether the multi-page registration page or a single registration page is active</description>
+        <param-name>is_multi_register_page</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether a user name is required on registration</description>
+        <param-name>is_user_name_required</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether the public user profile is enabled.</description>
+        <param-name>is_public_profile_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether "resend confirmation link" ius enabled.</description>
+        <param-name>is_resend_confirm_link_enabled</param-name>
+        <param-value>false</param-value>
     </context-param>
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
index 956a6edd97d4f6280cfc1dd3818001ad95b2b6a6..770172b2e64c07dd794eddc2c20fa0bd860f85d8 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       Here goes your content.
+                       <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
+                               Here goes your content.
+                       </ui:fragment>
+
+                       <ui:fragment rendered="#{not registerController.isResendConfirmationLinkEnabled()}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 90ee53ce7c6aedcfcd7a2138691a35a3993ae55c..5d90669c73030fd595c751af76403636df879656 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <div class="para">
-                               <!-- TODO Internatialize this somehow //-->
-                               Noch kein Kunde? Einfach beim Bestellen anmelden oder <h:link id="customer_register" outcome="customer_register" title="Als Kunde anmelden">hier</h:link> anmelden.
-                       </div>
+                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <div class="para">
+                                       <!-- TODO Internatialize this somehow //-->
+                                       Noch kein Benutzerkonto? Einfach <h:link id="user_register" outcome="user_register" title="Als Benutzer anmelden">hier</h:link> anmelden.
+                               </div>
 
-                       <div class="para">
-                               <ui:include src="/WEB-INF/templates/guest/guest_login_form.tpl" />
-                       </div>
+                               <div class="para">
+                                       <ui:include src="/WEB-INF/templates/guest/user/guest_login_form.tpl" />
+                               </div>
 
-                       <div class="para">
-                               <h:link id="customer_lost_password" outcome="user_lost_passwd" title="Passwort wiederherstellen" value="Passwort vergessen?" />
-                       </div>
+                               <div class="para">
+                                       <h:link id="user_lost_password" outcome="user_lost_passwd" title="#{msg.LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD}" value="#{msg.LINK_GUEST_LOGIN_LOST_PASSWORD}" />
+                               </div>
+                       </ui:fragment>
+
+                       <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_LOGIN_DEACTIVATED}" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 0d088f3ecccd05b2d75bebb8cfb03215dde71256..1890b69d2a2cd286de3aedd183c7a50641dfef36 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <div class="para" id="user_lost_password_content">
-                               <h:form id="lost_password_form">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       #{msg.GUEST_LOST_PASSWORD_TITLE}
-                                               </div>
+                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <div class="para" id="user_lost_password_content">
+                                       <h:form id="lost_password_form">
+                                               <div class="table">
+                                                       <div class="table_header">
+                                                               #{msg.GUEST_LOST_PASSWORD_TITLE}
+                                                       </div>
 
-                                               <fieldset id="login_data">
-                                                       <legend title="#{msg.GUEST_LOST_PASSWORD_LEGEND_TITLE}">#{msg.GUEST_LOST_PASSWORD_LEGEND}</legend>
+                                                       <fieldset id="login_data">
+                                                               <legend title="#{msg.GUEST_LOST_PASSWORD_LEGEND_TITLE}">#{msg.GUEST_LOST_PASSWORD_LEGEND}</legend>
 
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       <h:outputLabel for="id" value="#{msg.ENTER_USER_NAME}" />
+                                                               <div class="table_row">
+                                                                       <div class="table_left">
+                                                                               <h:outputLabel for="id" value="#{msg.ENTER_USER_NAME}" />
+                                                                       </div>
+
+                                                                       <div class="table_right">
+                                                                               <h:inputText styleClass="input" id="id" size="10" maxlength="20" value="#{passwordRecoveryController.userId}" />
+                                                                       </div>
+
+                                                                       <div class="clear"></div>
                                                                </div>
 
-                                                               <div class="table_right">
-                                                                       <h:inputText styleClass="input" id="id" size="10" maxlength="20" value="#{passwordRecoveryController.userId}" />
+                                                               <div class="table_header">
+                                                                       #{msg.GUEST_LOST_PASSWORD_NUMBER_OR_EMAIL}
                                                                </div>
 
-                                                               <div class="clear"></div>
-                                                       </div>
+                                                               <div class="table_row">
+                                                                       <div class="table_left">
+                                                                               <h:outputLabel for="email" value="#{msg.ENTER_EMAIL_ADDRESS}" />
+                                                                       </div>
 
-                                                       <div class="table_header">
-                                                               #{msg.GUEST_LOST_PASSWORD_NUMBER_OR_EMAIL}
-                                                       </div>
+                                                                       <div class="table_right">
+                                                                               <h:inputText styleClass="input" id="email" size="20" maxlength="255" value="#{passwordRecoveryController.emailAddress}" />
+                                                                       </div>
 
-                                                       <div class="table_row">
-                                                               <div class="table_left">
-                                                                       <h:outputLabel for="email" value="#{msg.ENTER_EMAIL_ADDRESS}" />
+                                                                       <div class="clear"></div>
                                                                </div>
 
-                                                               <div class="table_right">
-                                                                       <h:inputText styleClass="input" id="email" size="20" maxlength="255" value="#{passwordRecoveryController.emailAddress}" />
-                                                               </div>
+                                                       </fieldset>
 
-                                                               <div class="clear"></div>
+                                                       <div class="table_footer">
+                                                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                               <h:commandButton styleClass="submit" type="submit" value="#{msg.BUTTON_CONTINUE_STEP_2}" action="#{passwordRecoveryController.doLostPasswordStep2()}" />
                                                        </div>
-
-                                               </fieldset>
-
-                                               <div class="table_footer">
-                                                       <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton styleClass="submit" type="submit" value="#{msg.BUTTON_CONTINUE_STEP_2}" action="#{passwordRecoveryController.doLostPasswordStep2()}" />
                                                </div>
-                                       </div>
-                               </h:form>
-                       </div>
+                                       </h:form>
+                               </div>
+                       </ui:fragment>
+
+                       <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index ab0f910484e5148e4601aefb37a4dc9b663d52d9..e8546fec4bb687815a20b90c71e61b250770fba6 100644 (file)
@@ -3,10 +3,10 @@
 <html
        lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
        xmlns="http://www.w3.org/1999/xhtml"
-         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-         xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
 
        <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
                <ui:define name="guest_title">#{msg.PAGE_TITLE_USER_REGISTER}</ui:define>
                </ui:define>
 
                <ui:define name="content">
-                       <div class="para">
-                               #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
-                               <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
-                               #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
-                       </div>
+                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <div class="para">
+                                       #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
+                                       <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
+                                       #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
+                               </div>
+                       </ui:fragment>
 
                        <div class="registration_form">
-                               <ui:include src="/WEB-INF/templates/guest/user/guest_registration_form.tpl" />
+                               <ui:fragment rendered="#{registerController.isMultiplePageEnabled()}">
+                                       <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl" />
+                               </ui:fragment>
+
+                               <ui:fragment rendered="#{not registerController.isMultiplePageEnabled()}">
+                                       <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl" />
+                               </ui:fragment>
                        </div>
                </ui:define>
        </ui:composition>
diff --git a/web/guest/user/register_page2.xhtml b/web/guest/user/register_page2.xhtml
new file mode 100644 (file)
index 0000000..04b7ccd
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
+
+       <ui:composition template="/WEB-INF/templates/guest/guest_base.tpl">
+               <ui:define name="guest_title">#{msg.PAGE_TITLE_USER_REGISTER_PAGE2}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_USER_REGISTER_PAGE2}
+               </ui:define>
+
+               <ui:define name="content">
+                       <ui:fragment rendered="#{registerController.isMultiplePageEnabled()}">
+                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <div class="para">
+                                               #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
+                                               <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
+                                               #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_2}
+                                       </div>
+                               </ui:fragment>
+
+                               <div class="registration_form">
+                                       <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl" />
+                               </div>
+                       </ui:fragment>
+
+                       <ui:fragment rendered="#{not registerController.isMultiplePageEnabled()}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED}" />
+                       </ui:fragment>
+               </ui:define>
+       </ui:composition>
+</html>
index 59d00852becbb50ee6cd3c6c37db95d2a21d28de..cf4e580c5eccb03c4666822045dca3d5620a2d5b 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userController.isUserIdEmpty()}">
-                               <ui:include src="/WEB-INF/templates/user/userid_error.tpl" />
-                       </ui:fragment>
+                       <ui:fragment rendered="#{userController.isPublicUserProfileEnabled()}">
+                               <ui:fragment rendered="#{userController.isUserIdEmpty()}">
+                                       <ui:include src="/WEB-INF/templates/user/userid_error.tpl" />
+                               </ui:fragment>
+
+                               <ui:fragment rendered="#{not profileController.isProfileLinkVisibleById(userController.userId)}">
+                                       #{msg.ERROR_PROFILE_NOT_VISIBLE}
+                               </ui:fragment>
 
-                       <ui:fragment rendered="#{not profileController.isProfileLinkVisibleById(userController.userId)}">
-                               #{msg.ERROR_PROFILE_NOT_VISIBLE}
+                               <ui:fragment rendered="#{profileController.isProfileLinkVisibleById(userController.userId)}">
+                                       <div align="center">
+                                               <h:panelGrid styleClass="table" headerClass="table_header" footerClass="table_footer">
+                                                       <f:facet name="header">
+                                                               #{msg.PUBLIC_USER_PROFILE}
+                                                       </f:facet>
+                                               </h:panelGrid>
+                                       </div>
+                               </ui:fragment>
                        </ui:fragment>
 
-                       <ui:fragment rendered="#{profileController.isProfileLinkVisibleById(userController.userId)}">
-                               <div align="center">
-                                       <h:panelGrid styleClass="table" headerClass="table_header" footerClass="table_footer">
-                                               <f:facet name="header">
-                                                       #{msg.PUBLIC_USER_PROFILE}
-                                               </f:facet>
-                                       </h:panelGrid>
-                               </div>
+                       <ui:fragment rendered="#{not userController.isPublicUserProfileEnabled()}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_PROFILE_DEACTIVATED}" />
                        </ui:fragment>
                </ui:define>
        </ui:composition>