]> git.mxchange.org Git - jjobs-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>
Sun, 7 Aug 2016 10:55:29 +0000 (12:55 +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>
28 files changed:
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java
src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java [new file with mode: 0644]
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/user_list.xhtml
web/imprint.xhtml
web/privacy.xhtml
web/terms.xhtml
web/user/login_change_personal_data.xhtml
web/user/login_contact_data_saved.xhtml

index 74ea93c823a9d1801aeb17153e9b8ea48a021dd1..1109322a2fcdb0fa4f522a358f7e4fcfff075d2e 100644 (file)
@@ -536,6 +536,17 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement
                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 6f8982e4424d674c928fe1a6135b244d7534e323..92c9c2364e5f22187ec787d75a19a8728f5af66d 100644 (file)
@@ -614,6 +614,17 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job
                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 7e9561f141ff9d96f518ccbf51edc3d1fd2c0e56..ad0a0e4233a7e7decaaaa10b678546010603325f 100644 (file)
@@ -415,6 +415,22 @@ public interface JobsContactWebSessionController 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>
@@ -453,4 +469,12 @@ public interface JobsContactWebSessionController 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 227f39bfe80e25db01215ecd46527cf5fe656d04..781e798e64fe13a02571e86df133bc3299ed8dac 100644 (file)
@@ -29,6 +29,7 @@ import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
+import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
 import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
@@ -70,6 +71,12 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements
         */
        private final EmailChangeSessionBeanRemote emailBean;
 
+       /**
+        * Features controller
+        */
+       @Inject
+       private JobsFeaturesWebApplicationController featureController;
+
        /**
         * Login bean (controller)
         */
@@ -112,6 +119,9 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements
                        // Password not matching
                        this.showFacesMessage("form_login_change_email_address:currentPassword", new UserPasswordMismatchException(this.userLoginController.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
index 5b4f1797c798760868d37dd3fec280627d5da1ee..c2456e700528ac184f58dc13eeb96e5d741a0d59 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;
@@ -32,6 +31,7 @@ import org.mxchange.jcontacts.contact.UserContact;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jusercore.events.registration.RegisteredUserEvent;
@@ -70,6 +70,12 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
        @Inject
        private JobsContactWebSessionController contactController;
 
+       /**
+        * Features controller
+        */
+       @Inject
+       private JobsFeaturesWebApplicationController featureController;
+
        /**
         * Reemote register session bean
         */
@@ -106,6 +112,12 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
 
        @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();
 
@@ -116,7 +128,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                } 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 JobsUserRegisterWebSessionBean extends BaseJobsController implement
 
        @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();
 
@@ -181,7 +199,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                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 JobsUserRegisterWebSessionBean extends BaseJobsController implement
                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 600149f81b90ee305f675a315dd3089cfbf82ea1..16116dbe35a80fe698bf9b93aa73c01fbe540765 100644 (file)
@@ -42,18 +42,4 @@ public interface JobsUserRegisterWebSessionController extends Serializable {
         */
        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 6cd1f020640bb6d84b0c6e19f7ed84607ec37401..81f5d7b0c22c8b09ff6d9fcae230c2a4dd055414 100644 (file)
@@ -38,9 +38,9 @@ import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
 import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
+import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
-import org.mxchange.jjobs.beans.register.JobsUserRegisterWebSessionController;
 import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
@@ -84,27 +84,16 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
        private JobsContactWebSessionController contactController;
 
        /**
-        * Localization controller
-        */
-       @Inject
-       private JobsLocalizationSessionController localizationController;
-
-       /**
-        * Login bean (controller)
+        * Features controller
         */
        @Inject
-       private JobsUserLoginWebSessionController loginController;
+       private JobsFeaturesWebApplicationController featureController;
 
        /**
-        * Registration controller
+        * Localization controller
         */
        @Inject
-       private JobsUserRegisterWebSessionController registerController;
-
-       /**
-        * A list of all selectable contacts
-        */
-       private List<Contact> selectableContacts;
+       private JobsLocalizationSessionController localizationController;
 
        /**
         * Event being fired when user updated personal data
@@ -467,7 +456,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                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();
 
@@ -730,7 +719,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
 
        @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 {
diff --git a/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java b/src/java/org/mxchange/pizzaapplication/beans/features/PizzaFeaturesWebApplicationController.java
new file mode 100644 (file)
index 0000000..05892d0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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 java.io.Serializable;
+import javax.ejb.Local;
+
+/**
+ * An interface for country beans
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Local
+public interface PizzaFeaturesWebApplicationController 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 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 022de70fc737743f48efcd890ecb4869d93b09aa..870c4ffaf4892b984ebc5c63f5c087b9497d7221 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 d64728e632c983ce3309f9b52b7def554410b681..dc3cd1805b4dc4403d0c79402e5f9d2afc5d4601 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 f8961247288e00a2146ec9ca36ad50ad422dd0b4..0bb7007a9f0ef4dfcb073bf739df9eec536d0be6 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_APPLICATIONS_TITLE}" />
index da0d52cf9c0d5315e5ff307d5eb3e0b22e7516f9..5741b53eeb5d4f0e9697c2b7f29e8aeaa81278ed 100644 (file)
         <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>
-        <param-value>false</param-value>
+        <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 "resend confirmation link" ius enabled.</description>
-        <param-name>is_resend_confirm_link_enabled</param-name>
+        <description>Whether recovery of user passwords is enabled.</description>
+        <param-name>is_feature_user_password_recovery_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>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>
+        <description>Whether gender is required for administrative contact controller.</description>
+        <param-name>is_feature_admin_gender_enabled</param-name>
+        <param-value>true</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>true</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>true</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>
     <context-param>
index 517d04db3f033ed887000f4975d45660df3b254f..1063e00233fa494de456517e4fb63ed3e434392b 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 0d33f603d12fb0d5fb7a1fb83552663da23e0dd9..ca7e8ddaf5342162ed3ce9f27ae94b758e2bb5f3 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 7c5cd4a11e7d44beb0ba996656a77d0aab4e0322..d28bc0ce85bb0f2dea06f89069dab0302c681dfa 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 df867ca2249e01ad504f27e43a11f94b86238285..2ff7f1eca8b0f16745d47c5ccf64a042d9cb3750 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="form_lost_password">
                                                <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 031f3b69f18c5770114ac0c2f5ed67682715102c..18ffc7a2534ba42611e784230477cab702f36b2b 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <div class="table_big">
-                               <div class="table_header">
-                                       #{msg.TABLE_HEADER_USER_LIST}
-                               </div>
+                       <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: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:dataTable>
+                               </div>
 
-                                       <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:dataTable>
-                       </div>
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_USER_LIST_DISABLED}" rendered="#{featureController.isFeatureEnabled('user_list')}" />
                </ui:define>
        </ui:composition>
 </html>
index 8965e3f6d2e42d8ad2af74fa8bc728ea8c72db36..5b07b596363aaf3f3ac5df3457350f15c406d551 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 b50e729cdfc09ec68917bca059484813f33a242b..52ae8127293703cd136d440ab96e139de7df0b69 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 e8270e846e7be6f03786fca9909b88100dbc118c..69708a0f27b9985b310da7ce35c502b2eea814fe 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 6b0f256947353a0736b3379d6f2b1e7793b5e1fa..560a90b56ad9e9fb745dfa0f4276192e6434c398 100644 (file)
@@ -24,9 +24,9 @@
                                        <h:form id="form_login_change_personal">
                                                <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}" />
                                                </div>
                                        </h:form>
                                </div>
-                               <<<<<<< HEAD
-                               =======
                        </ui:fragment>
 
                        <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
 
                        <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
                                <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
-                               >>>>>>> be1ec6b... Continued a bit: (please cherry-pick)
                        </ui:fragment>
 
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
index 98dd25c1b8272ebf9a3282c773760b2df47ab6e6..f33cf16a0af105f38350595e81d505dee8d360be 100644 (file)
@@ -25,6 +25,8 @@
                                <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
                        </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>