From c97488e8ca0ae7e42b0ad5d76cf2c3749581ee35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 11:29:15 +0200 Subject: [PATCH] Please cherry-pick: - let's get rid of all these debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jjobs/beans/BaseJobsController.java | 12 ------- .../JobsConfirmationLinkWebRequestBean.java | 4 +-- .../JobsAdminContactWebRequestBean.java | 4 +-- .../JobsAdminContactPhoneWebRequestBean.java | 4 +-- .../phone/JobsContactPhoneWebSessionBean.java | 4 +-- ...ean.java => JobsWebRequestHelperBean.java} | 8 ++--- ...va => JobsWebRequestHelperController.java} | 2 +- .../JobsLocalizationSessionBean.java | 32 ++++++------------- .../phone/JobsAdminPhoneWebRequestBean.java | 4 +-- .../user/JobsAdminUserWebRequestBean.java | 25 +++++++-------- .../JobsAdminUserWebRequestController.java | 2 +- .../JobsUserActivityWebApplicationBean.java | 4 +-- .../JobsEmailAddressValidator.java | 21 ++++++++++-- .../validator/names/JobsNameValidator.java | 7 +--- .../password/JobsUserPasswordValidator.java | 6 ---- .../JobsPrivacyTermsCheckboxValidator.java | 6 ---- .../validator/user/JobsUserIdValidator.java | 6 ++-- 17 files changed, 61 insertions(+), 90 deletions(-) rename src/java/org/mxchange/jjobs/beans/helper/{JobsWebViewHelperBean.java => JobsWebRequestHelperBean.java} (98%) rename src/java/org/mxchange/jjobs/beans/helper/{JobsWebViewHelperController.java => JobsWebRequestHelperController.java} (97%) diff --git a/src/java/org/mxchange/jjobs/beans/BaseJobsController.java b/src/java/org/mxchange/jjobs/beans/BaseJobsController.java index 6bff292d..03acfab3 100644 --- a/src/java/org/mxchange/jjobs/beans/BaseJobsController.java +++ b/src/java/org/mxchange/jjobs/beans/BaseJobsController.java @@ -137,9 +137,6 @@ public abstract class BaseJobsController implements Serializable { * @return Whether the entered password is to weak */ protected boolean isWeakPassword (final String password) { - // Log message - System.out.println(this.getClass().getSimpleName() + ":isWeakPassword: password=" + password + " - CALLED!"); - // Is parameter set? if (null == password) { // Throw NPE @@ -149,15 +146,9 @@ public abstract class BaseJobsController implements Serializable { // Get score value double passwordScore = UserUtils.calculatePasswordScore(password); - // Log message - System.out.println(this.getClass().getSimpleName() + ".isWeakPassword: passwordScore=" + passwordScore); - // Is the score within range? boolean isWeak = (passwordScore <= this.getIntegerContextParameter("min_user_password_score")); //NOI18N - // Log message - System.out.println(this.getClass().getSimpleName() + ".isWeakPassword: isWeak=" + isWeak + " - EXIT!"); - // Return it return isWeak; } @@ -170,9 +161,6 @@ public abstract class BaseJobsController implements Serializable { * @param cause Causing exception */ protected void showFacesMessage (final String clientId, final Throwable cause) { - // Trace message - System.out.println(MessageFormat.format("showFacesMessage: clientId={0},cause={1} - CALLED!", clientId, cause)); - // Get context and add message this.showFacesMessage(clientId, cause.getMessage()); } diff --git a/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java index d49aae87..6a2565d2 100644 --- a/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java @@ -31,7 +31,6 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jjobs.beans.BaseJobsController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jjobs.beans.user.JobsUserWebSessionController; import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; @@ -40,6 +39,7 @@ import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * A web request bean for confirmation link handling @@ -59,7 +59,7 @@ public class JobsConfirmationLinkWebRequestBean extends BaseJobsController imple * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * Confirmation key diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java index b4c59825..29a39907 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java @@ -42,7 +42,6 @@ import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; import org.mxchange.jcountry.data.Country; import org.mxchange.jjobs.beans.BaseJobsController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jphone.phonenumbers.DialableNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; @@ -52,6 +51,7 @@ import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent; import org.mxchange.jcontacts.events.contact.deleted.ObservableAdminDeletedContactEvent; import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * An administrative user controller (bean) @@ -83,7 +83,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * Birth day diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java index b54c6728..3f20b39c 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java @@ -37,7 +37,6 @@ import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEv import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote; import org.mxchange.jcountry.data.Country; import org.mxchange.jjobs.beans.BaseJobsController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController; import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException; import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException; @@ -57,6 +56,7 @@ import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLi import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * An administrative contact phone controller (bean) @@ -113,7 +113,7 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsController impl * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * Event being fired when a fax number has been unlinked diff --git a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java index 73a31688..7a55240b 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/phone/JobsContactPhoneWebSessionBean.java @@ -29,7 +29,6 @@ import javax.inject.Named; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jphone.phonenumbers.DialableNumber; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; @@ -40,6 +39,7 @@ import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContac import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent; import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent; import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * An administrative contact phone controller (bean) @@ -59,7 +59,7 @@ public class JobsContactPhoneWebSessionBean extends BaseJobsController implement * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * General contact controller diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java similarity index 98% rename from src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java rename to src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java index f9d6da6e..5aaa40e9 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java @@ -17,7 +17,7 @@ package org.mxchange.jjobs.beans.helper; import java.text.MessageFormat; -import javax.faces.view.ViewScoped; +import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.inject.Named; import org.mxchange.jcontacts.contact.Contact; @@ -37,8 +37,8 @@ import org.mxchange.jusercore.model.user.User; * @author Roland Häder */ @Named ("beanHelper") -@ViewScoped -public class JobsWebViewHelperBean extends BaseJobsController implements JobsWebViewHelperController { +@RequestScoped +public class JobsWebRequestHelperBean extends BaseJobsController implements JobsWebRequestHelperController { /** * Call-stack instance (5 may show BeanELResolver.getValue as caller) @@ -102,7 +102,7 @@ public class JobsWebViewHelperBean extends BaseJobsController implements JobsWeb /** * Default constructor */ - public JobsWebViewHelperBean () { + public JobsWebRequestHelperBean () { // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[3].getClassName(), Thread.currentThread().getStackTrace()[3].getMethodName()); // System.out.println(MessageFormat.format("{0}: Constructed, caller: {1}", this.getClass().getSimpleName(), caller)); } diff --git a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java similarity index 97% rename from src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java rename to src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java index bff572bd..d289fb7b 100644 --- a/src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperController.java +++ b/src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperController.java @@ -28,7 +28,7 @@ import org.mxchange.jusercore.model.user.User; *

* @author Roland Häder */ -public interface JobsWebViewHelperController extends Serializable { +public interface JobsWebRequestHelperController extends Serializable { /** * Copies currently set fax number's data to admin phone controller diff --git a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java index f95bf02a..75bcc4f1 100644 --- a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java @@ -90,21 +90,17 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getLoggedOutUser(), event.getLoggedOutUser().getUserId())); //NOI18N } - // Trace message - //* NOISY-DEBUG: */ System.out.println("LandingLocalizationSessionBean:afterUserLogin - EXIT!"); //NOI18N + // Clear this bean as well + this.clear(); } @Override public String getLanguage () { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::getLanguage(): locale.language={0} - EXIT!", this.getLocale().getLanguage())); //NOI18N return this.getLocale().getLanguage().toLowerCase(); } @Override public void setLanguage (final String language) { - // Log trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::setLanguage: language={0} - CALLED!", language)); //NOI18N - // Is the language null? if (null == language) { // This may sometimes happen, so abort here @@ -120,26 +116,18 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J // Get new locale with upper-case country code Locale loc = new Locale(splits[0], splits[1]); - // Log debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::setLanguage: loc={0}", loc)); //NOI18N - // Set it here and in the JSF context this.setLocale(loc); FacesContext.getCurrentInstance().getViewRoot().setLocale(loc); - - // Log trace message - //* NOISY-DEBUG: */ System.out.println("JobsLocalizationSessionBean::setLanguage: EXIT!"); //NOI18N } @Override public Locale getLocale () { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::getLocale(): locale={0} - EXIT!", this.locale)); //NOI18N return this.locale; } @Override public void setLocale (final Locale locale) { - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::setLocale(): locale={0} - CALLED!", locale)); //NOI18N this.locale = locale; } @@ -157,20 +145,20 @@ public class JobsLocalizationSessionBean extends BaseJobsController implements J */ @PostConstruct public void init () { - // Log trace message - //* NOISY-DEBUG: */ System.out.println("JobsLocalizationSessionBean::init: CALLED!"); //NOI18N - // Create locale instance from context Locale loc = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale(); - // Log debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("JobsLocalizationSessionBean::init: loc={0}", loc)); //NOI18N - // Set it here this.setLocale(loc); + } - // Log trace message - //* NOISY-DEBUG: */ System.out.println("JobsLocalizationSessionBean::init: EXIT!"); //NOI18N + /** + * Clears this bean + */ + private void clear () { + // Clear all fields + this.setLanguage(null); + this.setLocale(null); } } diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index 6c742628..ee37c9e0 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -30,7 +30,6 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcountry.data.Country; import org.mxchange.jjobs.beans.BaseJobsController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; import org.mxchange.jphone.events.fax.deleted.AdminFaxNumberDeletedEvent; import org.mxchange.jphone.events.fax.removed.AdminFaxNumberRemovedFromListEvent; @@ -54,6 +53,7 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.jphone.phonenumbers.phone.AdminPhoneSessionBeanRemote; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * Administrative controller (bean) for phone numbers @@ -83,7 +83,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * Choosen fax number diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index 99b8fe5f..c2b32f45 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -34,15 +34,22 @@ import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController; import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController; import org.mxchange.jusercore.container.login.UserLoginContainer; +import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; +import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; import org.mxchange.jusercore.events.user.delete.AdminDeletedUserEvent; +import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent; import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent; +import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; import org.mxchange.jusercore.events.user.locked.AdminLockedUserEvent; +import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent; import org.mxchange.jusercore.events.user.unlocked.AdminUnlockedUserEvent; +import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent; import org.mxchange.jusercore.events.user.update.AdminUpdatedUserDataEvent; +import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; @@ -57,13 +64,6 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; import org.mxchange.jusercore.model.user.status.UserAccountStatus; -import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; -import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; -import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent; -import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent; -import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent; -import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent; -import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent; /** * A user controller (bean) @@ -101,7 +101,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * Regular contact controller @@ -358,13 +358,10 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J // Get user instance User registeredUser = event.getRegisteredUser(); - // Debug message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("UserWebBean:afterRegistration: registeredUser={0}", registeredUser)); //NOI18N + // @TODO Nothing to do with the user here? + // Clear all data this.clear(); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("UserWebBean:afterRegistration: EXIT!"); //NOI18N } @Override diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java index 38a3ab94..d5599e85 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java @@ -17,8 +17,8 @@ package org.mxchange.jjobs.beans.user; import java.io.Serializable; -import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent; +import org.mxchange.jusercore.model.user.User; /** * An interface for user beans diff --git a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java index 0ff70e10..7fa87f57 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java @@ -33,7 +33,6 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jjobs.beans.BaseJobsController; -import org.mxchange.jjobs.beans.helper.JobsWebViewHelperController; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.activity.LogableUserActivity; import org.mxchange.jusercore.model.user.activity.UserActivityLog; @@ -52,6 +51,7 @@ import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserP import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent; import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent; import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent; +import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController; /** * A controller (bean) for user activity log @@ -71,7 +71,7 @@ public class JobsUserActivityWebApplicationBean extends BaseJobsController imple * Bean helper */ @Inject - private JobsWebViewHelperController beanHelper; + private JobsWebRequestHelperController beanHelper; /** * EJB for user activity log diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java index 5985a731..1fe96ee9 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/JobsEmailAddressValidator.java @@ -68,9 +68,6 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // The required field String[] requiredFields = {"emailAddress", "emailAddressRepeat", "resendEmailAddress"}; //NOI18N @@ -93,6 +90,24 @@ public class JobsEmailAddressValidator extends BaseStringValidator implements Va // Not matching throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message)); } + + // Get client id (aka form id) + String clientId = component.getClientId(); + + // Is the email address already registered? + if ((!clientId.endsWith("resendEmailAddress")) && (this.contactBean.isEmailAddressRegistered(emailAddress))) { //NOI18N + // Generate message + String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N + + // No, then abort here + throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); + } else if ((clientId.endsWith("resendEmailAddress")) && (!this.contactBean.isEmailAddressRegistered(emailAddress))) { //NOI18N + // Generate message + String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N + + // No, then abort here + throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); + } } } diff --git a/src/java/org/mxchange/jjobs/validator/names/JobsNameValidator.java b/src/java/org/mxchange/jjobs/validator/names/JobsNameValidator.java index 507b45b6..1b8912ab 100644 --- a/src/java/org/mxchange/jjobs/validator/names/JobsNameValidator.java +++ b/src/java/org/mxchange/jjobs/validator/names/JobsNameValidator.java @@ -38,16 +38,11 @@ public class JobsNameValidator extends BaseStringValidator implements Validator @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // All accepted, required fields String[] requiredFields = {"firstName", "familyName", "city", "street", "addressbookName"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } + } diff --git a/src/java/org/mxchange/jjobs/validator/password/JobsUserPasswordValidator.java b/src/java/org/mxchange/jjobs/validator/password/JobsUserPasswordValidator.java index ec513437..fa771d3d 100644 --- a/src/java/org/mxchange/jjobs/validator/password/JobsUserPasswordValidator.java +++ b/src/java/org/mxchange/jjobs/validator/password/JobsUserPasswordValidator.java @@ -56,9 +56,6 @@ public class JobsUserPasswordValidator extends BaseStringValidator implements Va @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // The required field String[] requiredFields = {"currentPassword"}; //NOI18N @@ -76,9 +73,6 @@ public class JobsUserPasswordValidator extends BaseStringValidator implements Va throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N } */ - - // Trace message - // NOISY-DEBUG: this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N } } diff --git a/src/java/org/mxchange/jjobs/validator/privacy_terms/JobsPrivacyTermsCheckboxValidator.java b/src/java/org/mxchange/jjobs/validator/privacy_terms/JobsPrivacyTermsCheckboxValidator.java index 76f26adf..ddaec6a8 100644 --- a/src/java/org/mxchange/jjobs/validator/privacy_terms/JobsPrivacyTermsCheckboxValidator.java +++ b/src/java/org/mxchange/jjobs/validator/privacy_terms/JobsPrivacyTermsCheckboxValidator.java @@ -38,16 +38,10 @@ public class JobsPrivacyTermsCheckboxValidator extends BaseBooleanValidator impl @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { - // Trace message - //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N - // All accepted, required fields String[] requiredFields = {"privacy", "terms"}; //NOI18N // Pre-validation (example: not null, not a string, empty string ...) super.preValidate(context, component, value, requiredFields, false); - - // Trace message - //* NOISY-DEBUG: */ System.out.println("validate: EXIT!"); //NOI18N } } diff --git a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java index 99ca192e..66daec0f 100644 --- a/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java +++ b/src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java @@ -82,7 +82,7 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator */ public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) { // Trace message - // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("UserIdValidator:afterRegistrationEvent: event={0} - CALLED!", event)); //NOI18N + // NOISY-DEBUG: this.loggerBeanLocal.logTrace(MessageFormat.format("UserIdValidator:afterUserRegistrationEvent: event={0} - CALLED!", event)); //NOI18N // event should not be null if (null == event) { @@ -103,13 +103,13 @@ public class JobsUserIdValidator extends BaseLongValidator implements Validator User registeredUser = event.getRegisteredUser(); // Debug message - // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("UserIdValidator:afterRegistrationEvent: registeredUser={0}", registeredUser)); //NOI18N + // NOISY-DEBUG: this.loggerBeanLocal.logDebug(MessageFormat.format("UserIdValidator:afterUserRegistrationEvent: registeredUser={0}", registeredUser)); //NOI18N // Update cache JobsUserIdValidator.cachedStatus.add(registeredUser.getUserId()); // Trace message - // NOISY-DEBUG: this.loggerBeanLocal.logTrace("UserIdValidator:afterRegistrationEvent: EXIT!"); //NOI18N + // NOISY-DEBUG: this.loggerBeanLocal.logTrace("UserIdValidator:afterUserRegistrationEvent: EXIT!"); //NOI18N } @Override -- 2.39.5