From: Roland Häder Date: Mon, 26 Jun 2017 21:43:31 +0000 (+0200) Subject: Rewrite continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8826bf82cf941520140c7c804620703440ea7a1d;p=addressbook-war.git 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 Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java b/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java index 70901442..9707462d 100644 --- a/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java +++ b/src/java/org/mxchange/addressbook/beans/BaseAddressbookController.java @@ -16,16 +16,16 @@ */ package org.mxchange.addressbook.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 BaseAddressbookController extends BaseBean implements Serializable { +public abstract class BaseAddressbookController extends BaseFacesBean { /** * Serial number @@ -36,30 +36,17 @@ public abstract class BaseAddressbookController extends BaseBean implements Seri * Protected constructor */ protected BaseAddressbookController () { + // Call super constructor + super(); } - /** - * 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/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java index 3d95cba4..873ff7a8 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookAdminContactWebRequestBean.java @@ -35,9 +35,9 @@ import org.mxchange.addressbook.beans.helper.AddressbookWebRequestHelperControll import org.mxchange.jcontacts.contact.AdminContactSessionBeanRemote; 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.AdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java index b23b6d17..95484045 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java @@ -37,9 +37,9 @@ import org.mxchange.addressbook.beans.login.user.AddressbookUserLoginWebSessionC import org.mxchange.addressbook.beans.user.AddressbookUserWebSessionController; 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/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java index a650688e..76f8d904 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/phone/AddressbookAdminContactPhoneWebRequestBean.java @@ -581,7 +581,7 @@ public class AddressbookAdminContactPhoneWebRequestBean extends BaseAddressbookC * Clears this bean */ private void clear () { - // Clear all data + // @TODO Clear all data } } diff --git a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java index ca732f4b..af3dca3d 100644 --- a/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/email_address/AddressbookEmailChangeWebSessionBean.java @@ -35,8 +35,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; /** * A web session-scoped bean for changing email addresses