From 995b0e4dcbb9e1ba4a885f4d14f53644de0010fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 26 Jun 2017 23:43:34 +0200 Subject: [PATCH] Rewrite continued: - Now all project-specific abstract web beans (controllers) inherit from BaseFacesBean to have these nice showFacesMessage() methods. - Also all project-specific abstract EJBs inherit now only BaseDataBean (one was missing in an old project) - So, if you have a WAR project, inherit from BaseFacesBean, if you have an EJB project, inherit from BaseDatabaseBean MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../beans/BasePizzaController.java | 33 +++++-------------- .../contact/PizzaContactWebSessionBean.java | 2 +- .../PizzaContactPhoneWebSessionBean.java | 2 +- .../customer/PizzaCustomerWebSessionBean.java | 4 +-- .../PizzaEmailChangeWebSessionBean.java | 2 +- .../PizzaResendLinkWebSessionBean.java | 2 +- 6 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java b/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java index 08c63e25..a8efc2c9 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/BasePizzaController.java @@ -16,16 +16,16 @@ */ package org.mxchange.pizzaapplication.beans; -import java.io.Serializable; -import org.mxchange.jcoreee.bean.BaseBean; -import org.mxchange.jusercore.model.user.UserUtils; +import java.util.Locale; +import java.util.ResourceBundle; +import org.mxchange.jcoreee.bean.faces.BaseFacesBean; /** * A general controller *

* @author Roland Häder */ -public abstract class BasePizzaController extends BaseBean implements Serializable { +public abstract class BasePizzaController extends BaseFacesBean { /** * Serial number @@ -38,28 +38,13 @@ public abstract class BasePizzaController extends BaseBean implements Serializab protected BasePizzaController () { } - /** - * Checks if given password is to weak to be used - *

- * @param password Clear-text password - *

- * @return Whether the entered password is to weak - */ - protected boolean isWeakPassword (final String password) { - // Is parameter set? - if (null == password) { - // Throw NPE - throw new NullPointerException("password is null"); //NOI18N - } - - // Get score value - double passwordScore = UserUtils.calculatePasswordScore(password); - - // Is the score within range? - boolean isWeak = (passwordScore <= this.getIntegerContextParameter("min_user_password_score")); //NOI18N + @Override + protected ResourceBundle loadResourceBundle (final Locale locale) { + // Load resource bundle + ResourceBundle bundle = ResourceBundle.getBundle("org.mxchange.localization.bundle", locale); // Return it - return isWeak; + return bundle; } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java index b1923b55..7512bd4e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java @@ -34,9 +34,9 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; +import org.mxchange.jcontacts.contact.ContactUtils; import org.mxchange.jcontacts.contact.UserContact; import org.mxchange.jcontacts.contact.title.PersonalTitle; -import org.mxchange.jcontacts.contact.ContactUtils; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java index 127c44f6..58b75602 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebSessionBean.java @@ -339,7 +339,7 @@ public class PizzaContactPhoneWebSessionBean extends BasePizzaController impleme * Clears this bean */ private void clear () { - // Clear all data + // @TODO Clear all data } } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java index 69a6f35d..3cf3633d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java @@ -32,12 +32,12 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; +import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; +import org.mxchange.jcustomercore.events.customer.added.ObservableAdminAddedCustomerEvent; import org.mxchange.jcustomercore.model.customer.Customer; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController; import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote; -import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; -import org.mxchange.jcustomercore.events.customer.added.ObservableAdminAddedCustomerEvent; /** * A customer bean which hides the customer instance diff --git a/src/java/org/mxchange/pizzaapplication/beans/email_address/PizzaEmailChangeWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/email_address/PizzaEmailChangeWebSessionBean.java index 620fd923..0f247b71 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/email_address/PizzaEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/email_address/PizzaEmailChangeWebSessionBean.java @@ -32,8 +32,8 @@ import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; import org.mxchange.jusercore.model.email_address.EmailAddressChange; -import org.mxchange.jusercore.model.user.email_address.UserEmailChangeSessionBeanRemote; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.email_address.UserEmailChangeSessionBeanRemote; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.features.PizzaFeaturesWebApplicationController; import org.mxchange.pizzaapplication.beans.login.user.PizzaUserLoginWebSessionController; diff --git a/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionBean.java index d21076b2..7538e398 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/resendlink/PizzaResendLinkWebSessionBean.java @@ -33,8 +33,8 @@ import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException; import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; -import org.mxchange.jusercore.model.user.resendlink.ResendLinkSessionBeanRemote; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.resendlink.ResendLinkSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.localization.PizzaLocalizationSessionController; -- 2.39.5