]> git.mxchange.org Git - addressbook-war.git/commitdiff
New "feature" controller introduced: (please cherry-pick this)
authorRoland Häder <roland@mxchange.org>
Fri, 10 Jun 2016 10:03:45 +0000 (12:03 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 28 Jul 2016 19:59:00 +0000 (21:59 +0200)
- no more tons of separate and same-looking methods, just one central and very flexible method isFeatureEnabled()
- renamed all context parameters
- added features "imprint", "terms" and "privacy"

Signed-off-by: Roland Häder <roland@mxchange.org>
35 files changed:
src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java
src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionController.java
src/java/org/mxchange/addressbook/beans/email_address/AddressbookEmailChangeWebSessionBean.java
src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/beans/features/AddressbookFeaturesWebApplicationController.java [new file with mode: 0644]
src/java/org/mxchange/addressbook/beans/login/AddressbookUserLoginWebSessionBean.java
src/java/org/mxchange/addressbook/beans/login/AddressbookUserLoginWebSessionController.java
src/java/org/mxchange/addressbook/beans/register/AddressbookUserRegisterWebSessionBean.java
src/java/org/mxchange/addressbook/beans/register/AddressbookUserRegisterWebSessionController.java
src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java [deleted file]
web/WEB-INF/templates/generic/gender_selection_box.tpl
web/WEB-INF/templates/guest/guest_base.tpl
web/WEB-INF/templates/guest/guest_footer.tpl
web/WEB-INF/templates/guest/guest_menu.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
web/WEB-INF/templates/login/user/user_menu.tpl
web/WEB-INF/web.xml
web/admin/user/admin_user_export.xhtml
web/admin/user/admin_user_show.xhtml
web/guest/user/login.xhtml
web/guest/user/lost_passwd.xhtml
web/guest/user/register.xhtml
web/guest/user/register_page2.xhtml
web/guest/user/resend_link.xhtml
web/guest/user/user_list.xhtml
web/imprint.xhtml
web/privacy.xhtml
web/terms.xhtml
web/user/login_change_email_address.xhtml
web/user/login_change_password.xhtml
web/user/login_change_personal_data.xhtml
web/user/login_contact_data_saved.xhtml

index e360eeea2e562e1e70b1b827ac32586e544d07ed..61b8ac508c437a1c59d3f141f4de83380313e91d 100644 (file)
@@ -541,6 +541,17 @@ public class AddressbookAdminContactWebRequestBean extends BaseAddressbookContro
                this.contactId = contactId;
        }
 
+       @Override
+       public String getControllerType () {
+               return "admin"; //NOI18N
+       }
+
+       @Override
+       @Deprecated
+       public void setControllerType (final String controllerType) {
+               throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
+       }
+
        @Override
        public Country getCountry () {
                return this.country;
index 49b39b5f5aea51dde507744b979200035e08a530..bcf3acc125ec76e0fb978c36fd7caaec13f6fc8f 100644 (file)
@@ -243,6 +243,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
        @Override
        public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("contactController.afterAdminAddedContact(): event={0} - CALLED!", event)); //NOI18N
+
                // The event must be valid
                if (null == event) {
                        // Throw NPE
@@ -267,6 +270,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
        @Override
        public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("contactController.afterAdminAddedUserEvent(): event={0} - CALLED!", event)); //NOI18N
+
                // event should not be null
                if (null == event) {
                        // Throw NPE
@@ -354,6 +360,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
                // Add email address to list
                this.emailAddressList.add(event.getUpdatedContact().getContactEmailAddress());
+
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println("contactController.afterAdminUpdatedContactDataEvent(): EXIT!"); //NOI18N
        }
 
        @Override
@@ -424,6 +433,9 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
 
                // Add contact to list
                this.contactList.add(contact);
+
+               // Trace message
+               //* NOISY-DEBUG: */ System.out.println("ContactWebBean:afterAdminUpdatedContactDataEvent: EXIT!"); //NOI18N
        }
 
        @Override
@@ -656,6 +668,17 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController
                this.comment = comment;
        }
 
+       @Override
+       public String getControllerType () {
+               return "general"; //NOI18N
+       }
+
+       @Override
+       @Deprecated
+       public void setControllerType (final String controllerType) {
+               throw new UnsupportedOperationException("Setting controller type is not supported."); //NOI18N
+       }
+
        @Override
        public Country getCountry () {
                return this.country;
index 7ba90cbc0b691a87c27128d72ecd7bde1ab5b538..faa7d0f098ff5c32928ff77cd7ce7fdf83451c92 100644 (file)
@@ -430,6 +430,22 @@ public interface AddressbookContactWebSessionController extends Serializable {
         */
        void setZipCode (final Integer zipCode);
 
+       /**
+        * Getter for controller type
+        * <p>
+        * @return controller type
+        */
+       String getControllerType ();
+
+       /**
+        * Setter for controller type
+        * <p>
+        * @param controllerType Controller type
+        * @deprecated Don't use this method.
+        */
+       @Deprecated
+       void setControllerType (final String controllerType);
+
        /**
         * Checks whether contact instance's email address is used
         * <p>
@@ -468,4 +484,12 @@ public interface AddressbookContactWebSessionController extends Serializable {
         */
        String doChangePersonalContactData ();
 
+       /**
+        * Returns a list of all selectable contacts for user creation. Contacts
+        * from already existing users are excluded in this list.
+        * <p>
+        * @return A list of all selectable contacts
+        */
+       List<Contact> selectableContacts ();
+
 }
index 456052cf243d222a808e4f4b0b98ea6062a42ccd..15589bd02db97dc336ab62755c9c73d9574863cf 100644 (file)
@@ -27,6 +27,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController;
 import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcoreee.utils.FacesUtils;
@@ -70,6 +71,12 @@ public class AddressbookEmailChangeWebSessionBean extends BaseAddressbookControl
         */
        private final EmailChangeSessionBeanRemote emailBean;
 
+       /**
+        * Features controller
+        */
+       @Inject
+       private AddressbookFeaturesWebApplicationController featureController;
+
        /**
         * Login bean (controller)
         */
@@ -112,6 +119,9 @@ public class AddressbookEmailChangeWebSessionBean extends BaseAddressbookControl
                        // Password not matching
                        this.showFacesMessage("login_change_email_address_form:currentPassword", new UserPasswordMismatchException(this.loginController.getLoggedInUser())); //NOI18N
                        return ""; //NOI18N
+               } else if (!this.featureController.isFeatureEnabled("edit_user_data")) { //NOI18N
+                       // Editing is not allowed
+                       throw new IllegalStateException("User tried to edit personal data"); //NOI18N
                }
 
                // Get user instance
diff --git a/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/features/AddressbookFeatureWebApplicationBean.java
new file mode 100644 (file)
index 0000000..602ff4c
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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.addressbook.beans.features;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.faces.context.FacesContext;
+import javax.inject.Named;
+import org.mxchange.pizzaapplication.beans.BasePizzaController;
+
+/**
+ * A feature bean
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Named ("featureController")
+@ApplicationScoped
+public class AddressbookFeatureWebApplicationBean extends BasePizzaController implements AddressbookFeaturesWebApplicationController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 64_237_512_690_168_674L;
+
+       @Override
+       public boolean isFeatureEnabled (final String feature) {
+               // The parameter must be set
+               if (null == feature) {
+                       // Throw NPE
+                       throw new NullPointerException("feature is null"); //NOI18N
+               } else if (feature.isEmpty()) {
+                       // Is empty
+                       throw new IllegalArgumentException("feature is empty"); //NOI18N
+               }
+
+               // Get context parameter
+               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
+
+               // Is it set?
+               boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
+
+               // Return value
+               return isEnabled;
+       }
+
+}
diff --git a/src/java/org/mxchange/addressbook/beans/features/AddressbookFeaturesWebApplicationController.java b/src/java/org/mxchange/addressbook/beans/features/AddressbookFeaturesWebApplicationController.java
new file mode 100644 (file)
index 0000000..d8eac96
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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.addressbook.beans.features;
+
+import java.io.Serializable;
+import javax.ejb.Local;
+
+/**
+ * An interface for country beans
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Local
+public interface AddressbookFeaturesWebApplicationController extends Serializable {
+
+       /**
+        * Checks if given feature is enabled.
+        * <p>
+        * @param feature Feature to be checked
+        * <p>
+        * @return Whether given feature is enabled
+        */
+       boolean isFeatureEnabled (final String feature);
+
+}
index ef7f22a22044aadb293bea154ceb9a97fa06f651..7cc02845e89f351539b544d3125f49ce62453fa5 100644 (file)
@@ -238,11 +238,6 @@ public class AddressbookUserLoginWebSessionBean extends BaseAddressbookControlle
                return UserUtils.ifPasswordMatches(container, this.getLoggedInUser());
        }
 
-       @Override
-       public boolean isGuest () {
-               return (!this.isUserLoggedIn());
-       }
-
        @Override
        public boolean isInvisible () {
                // Check on login
index f5ee4f8bf3d567c4e033f6a2810aa6a66267fae9..25159a2cab5c9a1eab80832f0102dc57b50719d8 100644 (file)
@@ -90,13 +90,6 @@ public interface AddressbookUserLoginWebSessionController extends Serializable {
         */
        boolean isUserLoggedIn ();
 
-       /**
-        * Is this truly a guest?
-        * <p>
-        * @return Whether the user is truly a guest
-        */
-       boolean isGuest ();
-
        /**
         * Whether the currently logged-in user is invisible
         * <p>
index 450f50c8fb9b17495df37a6b162243a065b123e6..a3dbfe7499a8639d83410504dfba384e25892d6d 100644 (file)
@@ -20,7 +20,6 @@ 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;
@@ -29,6 +28,7 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionController;
+import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController;
 import org.mxchange.addressbook.beans.user.AddressbookAdminUserWebRequestController;
 import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController;
 import org.mxchange.jcontacts.contact.Contact;
@@ -70,6 +70,12 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
        @Inject
        private AddressbookContactWebSessionController contactController;
 
+       /**
+        * Features controller
+        */
+       @Inject
+       private AddressbookFeaturesWebApplicationController featureController;
+
        /**
         * Reemote register session bean
         */
@@ -106,6 +112,12 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
 
        @Override
        public String doFinishRegistration () {
+               // Is registration enabled?
+               if (!this.featureController.isFeatureEnabled("user_registration")) { //NOI18N
+                       // Is not enabled
+                       throw new FaceletException("Registration is disabled."); //NOI18N
+               }
+
                // Get user instance
                User user = this.userController.createUserInstance(true);
 
@@ -116,7 +128,7 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
                } else if (!this.userController.isRequiredPersonalDataSet()) {
                        // Not all required fields are set
                        throw new FaceletException("Not all required fields are set."); //NOI18N
-               } else if ((this.userController.isUserNameRequired()) && (this.userController.isUserNameRegistered(user))) {
+               } else if ((this.featureController.isFeatureEnabled("user_name_required")) && (this.userController.isUserNameRegistered(user))) { //NOI18N
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) {
@@ -174,6 +186,12 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
 
        @Override
        public String doRegisterMultiPage1 () {
+               // Is registration enabled?
+               if (!this.featureController.isFeatureEnabled("user_registration")) { //NOI18N
+                       // Is not enabled
+                       throw new FaceletException("Registration is disabled."); //NOI18N
+               }
+
                // Get user instance
                User user = this.userController.createUserInstance(false);
 
@@ -181,7 +199,7 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
                if (null == user) {
                        // user must be set
                        throw new NullPointerException("user is null after createUserInstance() was called"); //NOI18N
-               } else if ((this.userController.isUserNameRequired()) && (this.userController.isUserNameRegistered(user))) {
+               } else if ((this.featureController.isFeatureEnabled("user_name_required")) && (this.userController.isUserNameRegistered(user))) { //NOI18N
                        // User name is already used
                        throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                } else if (!this.contactController.isSameEmailAddressEntered()) {
@@ -206,28 +224,4 @@ public class AddressbookUserRegisterWebSessionBean extends BaseAddressbookContro
                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 d076d5ae856ff1343366eab38216d4e618027c55..14947d43944fd6551748303a98faebacb3b9eeff 100644 (file)
@@ -42,18 +42,4 @@ public interface AddressbookUserRegisterWebSessionController extends Serializabl
         */
        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 ffb8f66aa29e40393f61a9bf6cd986ff9d630603..8e60563acdaa396c321db681bd6d8f4934a8bea5 100644 (file)
@@ -35,9 +35,9 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.addressbook.beans.contact.AddressbookContactWebSessionController;
+import org.mxchange.addressbook.beans.features.AddressbookFeaturesWebApplicationController;
 import org.mxchange.addressbook.beans.localization.AddressbookLocalizationSessionController;
 import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
-import org.mxchange.addressbook.beans.register.AddressbookUserRegisterWebSessionController;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
@@ -82,27 +82,16 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
        private AddressbookContactWebSessionController contactController;
 
        /**
-        * Localization controller
-        */
-       @Inject
-       private AddressbookLocalizationSessionController localizationController;
-
-       /**
-        * Login bean (controller)
+        * Features controller
         */
        @Inject
-       private AddressbookUserLoginWebSessionController loginController;
+       private AddressbookFeaturesWebApplicationController featureController;
 
        /**
-        * Registration controller
+        * Localization controller
         */
        @Inject
-       private AddressbookUserRegisterWebSessionController registerController;
-
-       /**
-        * A list of all selectable contacts
-        */
-       private List<Contact> selectableContacts;
+       private AddressbookLocalizationSessionController localizationController;
 
        /**
         * Event being fired when user updated personal data
@@ -432,7 +421,7 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                user.setUserProfileMode(this.getUserProfileMode());
 
                // Is multiple registration page
-               if (!this.registerController.isMultiplePageEnabled()) {
+               if ((createContactData) || (!this.featureController.isFeatureEnabled("user_register_multiple_page"))) { //NOI18N
                        // Create contact instance
                        Contact contact = this.contactController.createContactInstance();
 
@@ -488,7 +477,10 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                        throw new FaceletException("Not all required fields are set."); //NOI18N
                } else if (!this.userLoginController.ifCurrentPasswordMatches()) {
                        // Password not matching
-                       throw new FaceletException(new UserPasswordMismatchException(this.loginController.getLoggedInUser()));
+                       throw new FaceletException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()));
+               } else if (!this.featureController.isFeatureEnabled("edit_user_data")) {
+                       // Editing is not allowed
+                       throw new IllegalStateException("User tried to edit personal data"); //NOI18N
                }
 
                // Get user instance
@@ -658,7 +650,7 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
 
        @Override
        public boolean isRequiredPersonalDataSet () {
-               if (this.registerController.isMultiplePageEnabled()) {
+               if (this.featureController.isFeatureEnabled("user_register_multiple_page")) { //NOI18N
                        // Multiple registration page
                        return this.contactController.isRequiredPersonalDataSet();
                } else {
@@ -704,14 +696,14 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
        }
 
        @Override
-       public User lookupUserById (final Long userId) throws UserNotFoundException {
+       public User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException {
                // Parameter must be valid
-               if (null == userId) {
+               if (null == emailAddress) {
                        // Throw NPE
-                       throw new NullPointerException("userId is null"); //NOI18N
-               } else if (userId < 1) {
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
+               } else if (emailAddress.isEmpty()) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("userId={0} is not valid.", userId)); //NOI18N
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
                }
 
                // Init variable
@@ -722,8 +714,17 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                        // Get next user
                        User next = iterator.next();
 
-                       // Is the user id found?
-                       if (Objects.equals(next.getUserId(), userId)) {
+                       // Contact should be set
+                       if (next.getUserContact() == null) {
+                               // Contact is null
+                               throw new NullPointerException(MessageFormat.format("next.userContact is null for user id {0}", next.getUserId())); //NOI18N
+                       } else if (next.getUserContact().getContactEmailAddress() == null) {
+                               // Email address should be set
+                               throw new NullPointerException(MessageFormat.format("next.userContact.contactEmailAddress is null for user id {0}", next.getUserId())); //NOI18N //NOI18N
+                       }
+
+                       // Is the email address found?
+                       if (Objects.equals(next.getUserContact().getContactEmailAddress(), emailAddress)) {
                                // Copy to other variable
                                user = next;
                                break;
@@ -733,7 +734,7 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                // Is it still null?
                if (null == user) {
                        // Not visible for the current user
-                       throw new UserNotFoundException(userId);
+                       throw new UserEmailAddressNotFoundException(emailAddress);
                }
 
                // Return it
@@ -741,14 +742,14 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
        }
 
        @Override
-       public User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException {
+       public User lookupUserById (final Long userId) throws UserNotFoundException {
                // Parameter must be valid
-               if (null == emailAddress) {
+               if (null == userId) {
                        // Throw NPE
-                       throw new NullPointerException("emailAddress is null"); //NOI18N
-               } else if (emailAddress.isEmpty()) {
+                       throw new NullPointerException("userId is null"); //NOI18N
+               } else if (userId < 1) {
                        // Not valid
-                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("userId={0} is not valid.", userId)); //NOI18N
                }
 
                // Init variable
@@ -759,17 +760,8 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                        // Get next user
                        User next = iterator.next();
 
-                       // Contact should be set
-                       if (next.getUserContact() == null) {
-                               // Contact is null
-                               throw new NullPointerException(MessageFormat.format("next.userContact is null for user id {0}", next.getUserId())); //NOI18N
-                       } else if (next.getUserContact().getContactEmailAddress() == null) {
-                               // Email address should be set
-                               throw new NullPointerException(MessageFormat.format("next.userContact.contactEmailAddress is null for user id {0}", next.getUserId())); //NOI18N //NOI18N
-                       }
-
-                       // Is the email address found?
-                       if (Objects.equals(next.getUserContact().getContactEmailAddress(), emailAddress)) {
+                       // Is the user id found?
+                       if (Objects.equals(next.getUserId(), userId)) {
                                // Copy to other variable
                                user = next;
                                break;
@@ -779,7 +771,7 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp
                // Is it still null?
                if (null == user) {
                        // Not visible for the current user
-                       throw new UserEmailAddressNotFoundException(emailAddress);
+                       throw new UserNotFoundException(userId);
                }
 
                // Return it
diff --git a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java b/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeatureWebApplicationBean.java
deleted file mode 100644 (file)
index e590cda..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2016 Cho-Time GmbH
- *
- * 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.features;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.faces.context.FacesContext;
-import javax.inject.Named;
-import org.mxchange.pizzaapplication.beans.BasePizzaController;
-
-/**
- * A feature bean
- * <p>
- * @author Roland Haeder<rhaeder@cho-time.de>
- */
-@Named ("featureController")
-@ApplicationScoped
-public class PizzaFeatureWebApplicationBean extends BasePizzaController implements PizzaFeaturesWebApplicationController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 64_237_512_690_168_674L;
-
-       @Override
-       public boolean isFeatureEnabled (final String feature) {
-               // The parameter must be set
-               if (null == feature) {
-                       // Throw NPE
-                       throw new NullPointerException("feature is null"); //NOI18N
-               } else if (feature.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("feature is empty"); //NOI18N
-               }
-
-               // Get context parameter
-               String contextParameter = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(String.format("is_feature_%s_enabled", feature)); //NOI18N
-
-               // Is it set?
-               boolean isEnabled = ((contextParameter instanceof String) && (contextParameter.toLowerCase().equals("true"))); //NOI18N
-
-               // Return value
-               return isEnabled;
-       }
-
-}
index 6134e37c1e57125ee7669dc79474a6c0187ff185..dfa9efcb4f43000e18e5e5e0482033368c01b13c 100644 (file)
@@ -6,7 +6,7 @@
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
 
        <ui:fragment rendered="#{not empty targetController}">
-               <h:selectOneMenu styleClass="select" id="gender" value="#{targetController.gender}" required="true" requiredMessage="#{msg.FIELD_GENDER_REQUIRED}">
+               <h:selectOneMenu styleClass="select" id="gender" value="#{targetController.gender}" required="#{featureController.isFeatureEnabled(targetController.controllerType + '_gender')}" requiredMessage="#{msg.FIELD_GENDER_REQUIRED}">
                        <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
                        <f:selectItems value="#{genderController.selectableGenders}" var="gender" itemValue="#{gender}" itemLabel="#{msg[gender.messageKey]}" />
                </h:selectOneMenu>
index 5b50c7c3d682359099b11e163ee53875eae7272f..16c4f0b57825ff831707cfff7d6bb532bb523c1c 100644 (file)
@@ -9,7 +9,9 @@
        </ui:define>
 
        <ui:define name="menu">
-               <ui:include src="/WEB-INF/templates/guest/guest_menu.tpl" />
+               <ui:fragment rendered="#{featureController.isFeatureEnabled('guest_menu')}">
+                       <ui:include src="/WEB-INF/templates/guest/guest_menu.tpl" />
+               </ui:fragment>
        </ui:define>
 
        <ui:define name="footer">
index 30b4b95f869a4ccead2208ee4d33d04829e4283e..5fffa6f7bc22597a555a2461104b6a218db6b096 100644 (file)
                                <h:link outcome="index" title="#{msg.LINK_GUEST_HOME_TITLE}" value="#{msg.LINK_GUEST_HOME}" />
                        </li>
 
-                       <li class="footer_link">
-                               <h:link outcome="user_resend_link" title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" value="#{msg.LINK_GUEST_RESEND_LINK}" />
-                       </li>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_resend_confirmation_link')}">
+                               <li class="footer_link">
+                                       <h:link outcome="user_resend_link" title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" value="#{msg.LINK_GUEST_RESEND_LINK}" />
+                               </li>
+                       </ui:fragment>
 
-                       <li class="footer_link">
-                               <h:link outcome="imprint" title="#{msg.LINK_GUEST_IMPRINT_TITLE}" value="#{msg.LINK_GUEST_IMPRINT}" />
-                       </li>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('imprint')}">
+                               <li class="footer_link">
+                                       <h:link outcome="imprint" title="#{msg.LINK_GUEST_IMPRINT_TITLE}" value="#{msg.LINK_GUEST_IMPRINT}" />
+                               </li>
+                       </ui:fragment>
 
-                       <li class="footer_link">
-                               <h:link outcome="terms" title="#{msg.LINK_GUEST_TERMS_TITLE}" value="#{msg.LINK_GUEST_TERMS}" />
-                       </li>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('terms')}">
+                               <li class="footer_link">
+                                       <h:link outcome="terms" title="#{msg.LINK_GUEST_TERMS_TITLE}" value="#{msg.LINK_GUEST_TERMS}" />
+                               </li>
+                       </ui:fragment>
 
-                       <li class="footer_link">
-                               <h:link outcome="privacy" title="#{msg.LINK_GUEST_PRIVACY_TITLE}" value="#{msg.LINK_GUEST_PRIVACY}" />
-                       </li>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('privacy')}">
+                               <li class="footer_link">
+                                       <h:link outcome="privacy" title="#{msg.LINK_GUEST_PRIVACY_TITLE}" value="#{msg.LINK_GUEST_PRIVACY}" />
+                               </li>
+                       </ui:fragment>
 
                        <li class="footer_copyright">Copyright (c) 2016 by Roland Häder</li>
                </ul>
index 716799b691c49fe9352a9a014b333a8c21c8bc39..1b5b506925d198d23f8213e04be5e12d4b935573 100644 (file)
                        </div>
 
                        <ul>
-                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                        <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>
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration')}">
+                                       <li>
+                                               <h:link title="#{msg.LINK_GUEST_REGISTER_TITLE}" outcome="user_register" value="#{msg.LINK_GUEST_REGISTER}" />
+                                       </li>
+                               </ui:fragment>
 
-                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required') and featureController.isFeatureEnabled('user_password_recovery')}">
                                        <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()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_resend_confirmation_link')}">
                                        <li>
                                                <h:link title="#{msg.LINK_GUEST_RESEND_LINK_TITLE}" outcome="user_resend_link" value="#{msg.LINK_GUEST_RESEND_LINK}" />
                                        </li>
index 465fc01f785cdbcb0a6f50fce396303af1ffc52d..42a0d45240c7f019f952d9c7305f5aa3f7eb1153 100644 (file)
@@ -18,7 +18,7 @@
                                                <h:outputText value="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}" />
                                        </legend>
 
-                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                                <div class="table_row">
                                                        <div class="table_left">
                                                                <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
@@ -34,7 +34,7 @@
 
                                        <ui:include src="/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl" />
 
-                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                                <div class="para"></div>
 
                                                <div class="table_row">
index d26fd581dcb9a1f1b79c28419c4f79ad02a5ae71..e3e3b3a81f18bc6b3f06a29110db8c0565fd9ce1 100644 (file)
@@ -19,7 +19,7 @@
                                                <h:outputText value="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}" />
                                        </legend>
 
-                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                                <div class="table_row">
                                                        <div class="table_left">
                                                                <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
@@ -35,7 +35,7 @@
 
                                        <ui:include src="/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl" />
 
-                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                                <div class="para"></div>
 
                                                <div class="table_row">
index 0ba9fd390f51fdda67219efe8528fe2bff89392c..c07943f6a21daad96f7579f48990fd0d92d0e2f0 100644 (file)
                                <li>
                                        <h:link title="#{msg.LINK_USER_LIST_TITLE}" outcome="user_list" value="#{msg.LINK_USER_LIST}" />
                                </li>
+
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_list')}">
+                                       <li>
+                                               <h:link title="#{msg.LINK_USER_LIST_TITLE}" outcome="user_list" value="#{msg.LINK_USER_LIST}" />
+                                       </li>
+                               </ui:fragment>
                        </ul>
 
-                       <div class="menu_header">
-                               <h:outputText value="#{msg.MENU_EDIT_PROFILE_TITLE}" />
-                       </div>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                               <div class="menu_header">
+                                       <h:outputText value="#{msg.MENU_EDIT_PROFILE_TITLE}" />
+                               </div>
 
-                       <ul>
-                               <li>
-                                       <h:link title="#{msg.LINK_LOGIN_EDIT_USER_DATA_TITLE}" outcome="user_edit_user_data" value="#{msg.LINK_LOGIN_EDIT_USER_DATA}" />
-                               </li>
-                       </ul>
+                               <ul>
+                                       <li>
+                                               <h:link title="#{msg.LINK_LOGIN_EDIT_USER_DATA_TITLE}" outcome="user_edit_user_data" value="#{msg.LINK_LOGIN_EDIT_USER_DATA}" />
+                                       </li>
+                               </ul>
+                       </ui:fragment>
 
                        <div class="menu_header">
                                <h:outputText value="#{msg.MENU_ADDRESSBOOKS_TITLE}" />
index 66625f78e0dcc5f0d31ee4ff5c4b3dac4217c19c..e9fee727aded58206c2bf6ed8b7dc9f4f0bfd226 100644 (file)
@@ -3,32 +3,78 @@
     <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>Addressbook Application v1.0</display-name>
     <context-param>
-        <description>Whether debug mode is for registration controller enabled.</description>
-        <param-name>is_debug_register_enabled</param-name>
+        <description>Whether the multi-page registration page or a single registration page is active</description>
+        <param-name>is_feature_user_register_multiple_page</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether a user name is required for this application.</description>
+        <param-name>is_feature_user_name_required_enabled</param-name>
+        <param-value>true</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 the multi-page registration page or a single registration page is active</description>
-        <param-name>is_multi_register_page</param-name>
+        <description>Whether "resend confirmation link" is enabled.</description>
+        <param-name>is_feature_user_resend_confirm_link_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether default timezon is set from system's timezone</description>
+        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</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>
+        <description>Whether registration page is enabled.</description>
+        <param-name>is_feature_user_registration_enabled</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>
+        <description>Whether the guest menu is enabled/shown to the user.</description>
+        <param-name>is_feature_guest_menu_enabled</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether recovery of user passwords is enabled.</description>
+        <param-name>is_feature_user_password_recovery_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>
+        <description>Wether the gender is required for using the general contact controller.</description>
+        <param-name>is_feature_general_gender_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
     <context-param>
-        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
+        <description>Whether gender is required for administrative contact controller.</description>
+        <param-name>is_feature_admin_gender_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether users are allowed to edit their user data.</description>
+        <param-name>is_feature_user_edit_data_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether the user list is accessible and visible.</description>
+        <param-name>is_feature_user_list_enabled</param-name>
+        <param-value>false</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether imprint page is enabled.</description>
+        <param-name>is_feature_imprint_enabled</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether terms page is enabled.</description>
+        <param-name>is_feature_terms_enabled</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <description>Whether privacy page is enabled.</description>
+        <param-name>is_feature_privacy_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
     <servlet>
index 26e95343a9261a58e32a910ffd5f611aff4aebc9..5c051974951f6e574759cff2a35f7d35a6888825 100644 (file)
@@ -28,7 +28,7 @@
                                                </h:link>
                                        </p:column>
 
-                                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                                <p:column>
                                                        <f:facet name="header">
                                                                <h:outputText value="#{msg.ADMIN_EXPORT_USER_NAME_TITLE}" />
index 7a8950d8ca2feb3acc728c3edc632104e93bcb7e..f8ff648e44211f3db70f05a91314938bec0b7b9a 100644 (file)
@@ -36,7 +36,7 @@
                                        <h:outputText id="userId" styleClass="data_field" value="#{beanHelper.user.userId}" />
                                </h:column>
 
-                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                        <h:column>
                                                <h:outputLabel for="userName" styleClass="data_label" value="#{msg.ADMIN_USER_NAME}" />
 
index cf68e3689b0037631cf331ad24d22e373ae94181..3fd70d0e60312fa8210751d0bd8bdf1bff9ef300 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
-                               <div class="para">
-                                       <h:outputText value="#{msg.GUEST_USER_NO_ACCOUNT_YET_QUESTION}" />
-                                       <h:link id="user_register" outcome="user_register" title="#{msg.LINK_GUEST_USER_NO_ACCOUNT_TITLE}" value="#{msg.LINK_GUEST_USER_NO_ACCOUNT_YET}" />
-                               </div>
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration')}">
+                                       <div class="para">
+                                               <h:outputText value="#{msg.GUEST_USER_NO_ACCOUNT_YET_QUESTION}" />
+                                               <h:outputText value="&#160;" />
+                                               <h:link id="user_register" outcome="user_register" title="#{msg.LINK_GUEST_USER_NO_ACCOUNT_TITLE}" value="#{msg.LINK_GUEST_USER_NO_ACCOUNT_YET}" />
+                                       </div>
+                               </ui:fragment>
 
                                <div class="para">
                                        <ui:include src="/WEB-INF/templates/guest/user/guest_login_form.tpl" />
                                </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 rendered="#{featureController.isFeatureEnabled('user_name_required') and featureController.isFeatureEnabled('user_password_recovery')}">
+                                       <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>
 
-                       <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_name_required')}">
                                <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_LOGIN_DEACTIVATED}" />
                        </ui:fragment>
                </ui:define>
index a62806856bc0d6d17363c9081e561ca00533e6b5..a38e12f9c703f256c1b2a8712e121c6c253488ea 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required') and featureController.isFeatureEnabled('user_password_recovery')}">
                                <div class="para" id="user_lost_password_content">
                                        <h:form id="lost_password_form">
                                                <div class="table">
@@ -67,7 +67,7 @@
                                </div>
                        </ui:fragment>
 
-                       <ui:fragment rendered="#{not userController.isUserNameRequired()}">
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_name_required') or not featureController.isFeatureEnabled('user_password_recovery')}">
                                <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
                        </ui:fragment>
                </ui:define>
index c71ad8812ed73d7c697611ac11b7d56cb8a8bdb5..2ee42d82190bb63490b99e53e2604387553852fe 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <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}
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_registration')}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
+                                       <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:fragment rendered="#{featureController.isFeatureEnabled('user_register_multiple_page')}">
+                                               <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_page1.tpl" />
+                                       </ui:fragment>
+
+                                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_register_multiple_page')}">
+                                               <ui:include src="/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl" />
+                                       </ui:fragment>
                                </div>
                        </ui:fragment>
 
-                       <div class="registration_form">
-                               <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:fragment rendered="#{not featureController.isFeatureEnabled('user_registration')}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_REGISTRATION_DISABLED}" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 1b00e64ae18612bed9fbc834cf2ea7efb01fa09e..e00f554292871dae0f97309a4535b6dea1f78d35 100644 (file)
@@ -15,8 +15,8 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{registerController.isMultiplePageEnabled()}">
-                               <ui:fragment rendered="#{userController.isUserNameRequired()}">
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_register_multiple_page')}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_name_required')}">
                                        <div class="para">
                                                #{msg.GUEST_ALREADY_USER_CONTINUE_LOGIN_1}
                                                <h:link outcome="user_login" value="#{msg.CLICK_HERE}" />
@@ -29,7 +29,7 @@
                                </div>
                        </ui:fragment>
 
-                       <ui:fragment rendered="#{not registerController.isMultiplePageEnabled()}">
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_register_multiple_page')}">
                                <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_REGISTER_MULTIPLE_PAGE_NOT_ENABLED}" />
                        </ui:fragment>
                </ui:define>
index f0b675dbe0a0da37b87a1b35f3150b79177e938f..68d8c6e6bdd068debf6622bab56ec7add39d1571 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{registerController.isResendConfirmationLinkEnabled()}">
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_resend_confirmation_link')}">
                                <h:form id="form_resend_link">
                                        <div class="table">
                                                <div class="table_header">
@@ -56,8 +56,8 @@
                                </h:form>
                        </ui:fragment>
 
-                       <ui:fragment rendered="#{not registerController.isResendConfirmationLinkEnabled()}">
-                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RECOVER_PASSWORD_DEACTIVATED}" />
+                       <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_resend_confirmation_link')}">
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_GUEST_USER_RESEND_LINK_DEACTIVATED}" />
                        </ui:fragment>
                </ui:define>
        </ui:composition>
index 618584e0c8fd653b9561ad8d82f29587ada8551d..afcb44da7620c95686a2e5159476585db83d8561 100644 (file)
@@ -2,9 +2,9 @@
 <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/#{userLoginController.baseTemplatePathName}_base.tpl">
                <ui:define name="login_title">#{msg.PAGE_TITLE_USER_LIST}</ui:define>
                </ui:define>
 
                <ui:define name="content">
-                       <div class="table_big">
-                               <div class="table_header">
-                                       #{msg.TABLE_HEADER_USER_LIST}
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('user_list')}">
+                               <div class="table_big">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.TABLE_HEADER_USER_LIST}" />
+                                       </div>
+
+                                       <h:dataTable id="userList" var="user" value="#{userController.allVisibleUsers()}" headerClass="table_header_column25" summary="#{msg.TABLE_SUMMARY_USER_LIST}" rendered="#{userController.isVisibleUserFound()}">
+                                               <h:column>
+                                                       <f:facet name="header">#{msg.USER_NAME}</f:facet>
+                                                       <ui:include src="/WEB-INF/templates/user/user_profile_link.tpl">
+                                                               <ui:param name="user" value="#{user}" />
+                                                       </ui:include>
+                                               </h:column>
+
+                                               <h:column>
+                                                       <f:facet name="header">#{msg.USER_CREATED}</f:facet>
+                                                       <h:outputFormat id="userCreated" value="#{user.userCreated.time}" title="#{msg.USER_CREATED_TITLE}" />
+                                               </h:column>
+
+                                               <h:column>
+                                                       <f:facet name="header">#{msg.USER_CREATED}</f:facet>
+                                                       <h:outputFormat id="userCreated" value="#{user.userCreated.time}" title="#{msg.USER_CREATED_TITLE}" />
+                                               </h:column>
+
+                                               <h:column>
+                                                       <f:facet name="header">#{msg.USER_LIST_SHARING_ADDRESSBOOKS}</f:facet>
+                                                       <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
+                                                               <h:link outcome="login_list_sharing_addressbooks" value="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS}" title="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS_TITLE}">
+                                                                       <f:param name="userId" value="#{user.userId}" />
+                                                               </h:link>
+                                                       </ui:fragment>
+                                                       <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
+                                                               <h:outputText id="userShared" value="#{addressbookController.countAllUserSharedAddressbooks(user)}" />
+                                                       </ui:fragment>
+                                               </h:column>
+                                       </h:dataTable>
                                </div>
 
-                               <h:dataTable id="userList" var="user" value="#{userController.allVisibleUsers()}" headerClass="table_header_column25" summary="#{msg.TABLE_SUMMARY_USER_LIST}" rendered="#{userController.isVisibleUserFound()}">
-                                       <h:column>
-                                               <f:facet name="header">#{msg.USER_NAME}</f:facet>
-                                               <ui:include src="/WEB-INF/templates/user/user_profile_link.tpl">
-                                                       <ui:param name="user" value="#{user}" />
-                                               </ui:include>
-                                       </h:column>
-
-                                       <h:column>
-                                               <f:facet name="header">#{msg.USER_CREATED}</f:facet>
-                                               <h:outputFormat id="userCreated" value="#{user.userCreated.time}" title="#{msg.USER_CREATED_TITLE}" />
-                                       </h:column>
-
-                                       <h:column>
-                                               <f:facet name="header">#{msg.USER_LIST_SHARING_ADDRESSBOOKS}</f:facet>
-                                               <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
-                                                       <h:link outcome="login_list_sharing_addressbooks" value="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS}" title="#{msg.LINK_LOGIN_LIST_SHARING_ADDRESSBOOKS_TITLE}">
-                                                               <f:param name="userId" value="#{user.userId}" />
-                                                       </h:link>
-                                               </ui:fragment>
-                                               <ui:fragment rendered="#{loginController.isGuest()}">
-                                                       <h:outputText id="userShared" value="#{addressbookController.countAllUserSharedAddressbooks(user)}" />
-                                               </ui:fragment>
-                                       </h:column>
-                               </h:dataTable>
-                       </div>
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_USER_LIST_DISABLED}" rendered="#{featureController.isFeatureEnabled('user_list')}" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index f3f6ca38156f64b4b9eaea71444aaaa6ac780a5e..5578d959b6887c86a8223dd782ef07e4e5149f59 100644 (file)
@@ -15,7 +15,9 @@
                </ui:define>
 
                <ui:define name="content">
-                       TODO: Hier kommt das Impressum hin!
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('imprint')}">
+                               TODO: Hier kommt das Impressum hin!
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 805f59849a44d7fa5a2e03719611e0924e9d7c1f..6cb3893e450f283e5bf1d6c4fa700099c38ea754 100644 (file)
@@ -15,7 +15,9 @@
                </ui:define>
 
                <ui:define name="content">
-                       Hier kommen die Datenschutzbestimmungen hin.
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('privacy')}">
+                               Hier kommen die Datenschutzbestimmungen hin.
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 2b34613f1b81016980bf5ad150c065ee12db037f..1e7acae567ecec8aa754ac663ca9a24f8c927758 100644 (file)
@@ -15,7 +15,9 @@
                </ui:define>
 
                <ui:define name="content">
-                       Hier kommen die allgemeinen Geschäftsbedingungen hin.
+                       <ui:fragment rendered="#{featureController.isFeatureEnabled('terms')}">
+                               Hier kommen die allgemeinen Geschäftsbedingungen hin.
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 1a09784cdad998d752de59ddc415a01f71d1ca0a..8e86d06f3328671bd980edcc3b966e8bced78c96 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
-                               <div class="table">
-                                       <div class="table_header">
-                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
-                                       </div>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
+                                               </div>
 
-                                       <h:form id="login_change_email_address_form">
-                                               <div class="para">
-                                                       <fieldset id="change_email">
-                                                               <legend title="#{msg.LOGIN_CHANGE_EMAIL_LEGEND_TITLE}">
-                                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_LEGEND}" />
-                                                               </legend>
+                                               <h:form id="login_change_email_address_form">
+                                                       <div class="para">
+                                                               <fieldset id="change_email">
+                                                                       <legend title="#{msg.LOGIN_CHANGE_EMAIL_LEGEND_TITLE}">
+                                                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_LEGEND}" />
+                                                                       </legend>
 
-                                                               <div class="table_row">
-                                                                       <div class="table_left">
-                                                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_OLD_ADDRESS}" />
-                                                                       </div>
+                                                                       <div class="table_row">
+                                                                               <div class="table_left">
+                                                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_OLD_ADDRESS}" />
+                                                                               </div>
 
-                                                                       <div class="table_right">
-                                                                               <h:outputText value="#{contactController.emailAddress}" />
-                                                                       </div>
+                                                                               <div class="table_right">
+                                                                                       <h:outputText value="#{contactController.emailAddress}" />
+                                                                               </div>
 
-                                                                       <div class="clear"></div>
-                                                               </div>
+                                                                               <div class="clear"></div>
+                                                                       </div>
 
-                                                               <ui:include src="/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl" />
-                                                       </fieldset>
-                                               </div>
+                                                                       <ui:include src="/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl" />
+                                                               </fieldset>
+                                                       </div>
 
-                                               <ui:include src="/WEB-INF/templates/login/login_enter_current_password.tpl" />
+                                                       <ui:include src="/WEB-INF/templates/login/login_enter_current_password.tpl" />
+                                               </h:form>
+                                       </div>
 
-                                               <div class="table_footer">
-                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton class="submit" type="submit" id="change_email" value="#{msg.BUTTON_CHANGE_EMAIL_ADDRESS}" action="#{emailChangeController.doChangeEmailAddress()}" />
-                                               </div>
-                                       </h:form>
-                               </div>
-                       </ui:fragment>
+                                       <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
+                               </ui:fragment>
 
-                       <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
-                               <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
-                       </ui:fragment>
+                               <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
+                                       <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
+                               </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 1c8c6021d6a2bfe1c0b8eb29a10b19c276281e2c..dc24e90b644d204e916373d22210c63b78715bd6 100644 (file)
 
                <ui:define name="content">
                        <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
-                               <div class="table">
-                                       <div class="table_header">
-                                               <h:outputText value="#{msg.LOGIN_CHANGE_PASSWORD_TITLE}" />
-                                       </div>
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       <h:outputText value="#{msg.LOGIN_CHANGE_PASSWORD_TITLE}" />
+                                               </div>
+
+                                               <h:form id="login_form">
+                                                       <div class="para">
+                                                               <fieldset id="change_password">
+                                                                       <legend title="#{msg.LOGIN_CHANGE_PASSWORD_LEGEND_TITLE}">
+                                                                               <h:outputText value="#{msg.LOGIN_CHANGE_PASSWORD_LEGEND}" />
+                                                                       </legend>
+
+                                                                       <div class="table_row">
+                                                                               <div class="table_left">
+                                                                                       <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+                                                                               </div>
 
                                        <h:form id="login_form">
                                                <div class="para">
 
                                                <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
 
-                                               <div class="table_footer">
-                                                       <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                       <h:commandButton styleClass="submit" type="submit" id="change_password" value="#{msg.BUTTON_CHANGE_PASSWORD}" action="#{userController.changePassword()}" />
-                                               </div>
-                                       </h:form>
-                               </div>
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
                        </ui:fragment>
 
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
index 21dbf0243de64561435bd3e0d75e154d9d95de87..85693ac4596b310c88e29d44850c4b0cfe01c4f2 100644 (file)
@@ -2,10 +2,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/login/user/user_base.tpl">
                <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_CHANGE_PERSONAL_DATA}</ui:define>
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
-                               <div class="table">
-                                       <div class="table_header">
-                                               #{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE}
-                                       </div>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                                       <div class="table">
+                                               <div class="table_header">
+                                                       <h:outputText value="#{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE}" />
+                                               </div>
 
-                                       <h:form id="login_change_personal_form">
-                                               <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+                                               <h:form id="login_change_personal_form">
+                                                       <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
 
-                                               <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
+                                                       <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
 
-                                               <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+                                                       <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="change_personal_data" value="#{msg.BUTTON_CHANGE_PERSONAL_DATA}" action="#{userController.doChangePersonalData()}" />
-                                               </div>
-                                       </h:form>
-                               </div>
+                                                       <div class="table_footer">
+                                                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                               <h:commandButton styleClass="submit" type="submit" id="change_personal_data" value="#{msg.BUTTON_CHANGE_PERSONAL_DATA}" action="#{userController.doChangePersonalData()}" />
+                                                       </div>
+                                               </h:form>
+                                       </div>
+                               </ui:fragment>
+
+                               <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
                        </ui:fragment>
 
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
index db4740a303c66caaa2264607097902ece2d001b7..086090973d19c9a5a7163ee307f1863d8cba2e15 100644 (file)
@@ -2,10 +2,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/login/user/user_base.tpl">
                <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_CONTACT_DATA_SAVED}</ui:define>
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
-                               <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
-                                       <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
-                               </ui:include>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                                       <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
+                                               <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
+                                       </ui:include>
+                               </ui:fragment>
                        </ui:fragment>
 
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
+
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
                                <ui:include src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
                        </ui:fragment>