From: Roland Haeder Date: Tue, 8 Mar 2016 21:08:41 +0000 (+0100) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b62288632d54ae41bddc5e884ac8c77c0146d47;p=jjobs-war.git Continued a bit: - renamed method - the password validator is currently not working as it currently need the web controller, not the EJB - updated jar(s) --- diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index a9baa32f..e905316a 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index 4a792881..221f558c 100644 Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ diff --git a/src/java/org/mxchange/jjobs/beans/user/UserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/UserWebSessionBean.java index edda1086..9d705477 100644 --- a/src/java/org/mxchange/jjobs/beans/user/UserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/UserWebSessionBean.java @@ -285,13 +285,13 @@ public class UserWebSessionBean implements UserWebSessionController { user.getUserContact().setContactCountry(this.getCountry()); // Is there a phone number? - if (user.getUserContact().getContactPhoneNumber() instanceof DialableLandLineNumber) { + if (user.getUserContact().getContactLandLineNumber() instanceof DialableLandLineNumber) { // Debug message - System.out.println(MessageFormat.format("UserWebBean:doChangePersonalData: phoneId={0}", user.getUserContact().getContactPhoneNumber().getPhoneId())); //NOI18N + System.out.println(MessageFormat.format("UserWebBean:doChangePersonalData: phoneId={0}", user.getUserContact().getContactLandLineNumber().getPhoneId())); //NOI18N // Yes, then update as well - user.getUserContact().getContactPhoneNumber().setPhoneAreaCode(this.getPhoneAreaCode()); - user.getUserContact().getContactPhoneNumber().setPhoneNumber(this.getPhoneNumber()); + user.getUserContact().getContactLandLineNumber().setPhoneAreaCode(this.getPhoneAreaCode()); + user.getUserContact().getContactLandLineNumber().setPhoneNumber(this.getPhoneNumber()); } // Is there a fax number? @@ -453,7 +453,7 @@ public class UserWebSessionBean implements UserWebSessionController { } // Set phone number - contact.setContactPhoneNumber(phone); + contact.setContactLandLineNumber(phone); } // Don't set null or wrong references @@ -963,7 +963,7 @@ public class UserWebSessionBean implements UserWebSessionController { // Get cellphone, phone and fax instance DialableCellphoneNumber cellphone = user.getUserContact().getContactCellphoneNumber(); DialableFaxNumber fax = user.getUserContact().getContactFaxNumber(); - DialableLandLineNumber phone = user.getUserContact().getContactPhoneNumber(); + DialableLandLineNumber phone = user.getUserContact().getContactLandLineNumber(); // - contact data if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) { diff --git a/src/java/org/mxchange/jjobs/converter/country/CountryConverter.java b/src/java/org/mxchange/jjobs/converter/country/CountryConverter.java index 2ceb8be5..7a580678 100644 --- a/src/java/org/mxchange/jjobs/converter/country/CountryConverter.java +++ b/src/java/org/mxchange/jjobs/converter/country/CountryConverter.java @@ -42,7 +42,7 @@ public class CountryConverter implements Converter { /** * Country bean */ - private JobsCountrySingletonBeanRemote countryController; + private JobsCountrySingletonBeanRemote countryBean; /** * Logger instance @@ -62,8 +62,8 @@ public class CountryConverter implements Converter { // Lookup logger this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N - // ... and country controller - this.countryController = (JobsCountrySingletonBeanRemote) context.lookup("java:global/jjobs-ejb/country!org.mxchange.jcountry.data.JobsCountrySingletonBeanRemote"); //NOI18N + // ... and country bean + this.countryBean = (JobsCountrySingletonBeanRemote) context.lookup("java:global/jjobs-ejb/country!org.mxchange.jcountry.data.JobsCountrySingletonBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw it throw new RuntimeException("context.lookup() failed.", ex); //NOI18N @@ -73,7 +73,7 @@ public class CountryConverter implements Converter { @Override public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { // Trace message - this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},this.countryController={3} - CALLED!", context, component, submittedValue, this.countryController)); //NOI18N + this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2},countryBean{3} - CALLED!", context, component, submittedValue, this.countryBean)); //NOI18N // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { @@ -85,7 +85,7 @@ public class CountryConverter implements Converter { } // Get full list - List countryList = this.countryController.allCountries(); + List countryList = this.countryBean.allCountries(); // Init value Country country = null; diff --git a/src/java/org/mxchange/jjobs/validators/password/UserPasswordValidator.java b/src/java/org/mxchange/jjobs/validators/password/UserPasswordValidator.java index 924f3bbc..3673c7cf 100644 --- a/src/java/org/mxchange/jjobs/validators/password/UserPasswordValidator.java +++ b/src/java/org/mxchange/jjobs/validators/password/UserPasswordValidator.java @@ -16,14 +16,19 @@ */ package org.mxchange.jjobs.validators.password; +import java.text.MessageFormat; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; -import javax.inject.Inject; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; import org.mxchange.jcoreee.validator.string.BaseStringValidator; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; import org.mxchange.jjobs.beans.login.UserLoginWebSessionController; import org.mxchange.jusercore.container.login.LoginContainer; import org.mxchange.jusercore.container.login.UserLoginContainer; @@ -42,16 +47,38 @@ public class UserPasswordValidator extends BaseStringValidator implements Valida */ private static final long serialVersionUID = 48_581_795_687_317L; + /** + * Logger instance + */ + @Log + private LoggerBeanLocal loggerBeanLocal; + /** * User login controller */ - @Inject private UserLoginWebSessionController loginController; + /** + * Default constructor + */ + public UserPasswordValidator () { + // Try to get it + try { + // Get initial context + Context context = new InitialContext(); + + // Lookup logger + this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw it + throw new RuntimeException("context.lookup() failed.", ex); //NOI18N + } + } + @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { // Trace message - //this.getLogger().logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N + this.loggerBeanLocal.logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N // The required field String[] requiredFileds = {"currentPassword"}; //NOI18N @@ -69,6 +96,6 @@ public class UserPasswordValidator extends BaseStringValidator implements Valida } // Trace message - //this.getLogger().logTrace("validate: EXIT!"); //NOI18N + this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N } } diff --git a/web/WEB-INF/templates/login/login_enter_current_password.tpl b/web/WEB-INF/templates/login/login_enter_current_password.tpl index 26206e4c..eb11c933 100644 --- a/web/WEB-INF/templates/login/login_enter_current_password.tpl +++ b/web/WEB-INF/templates/login/login_enter_current_password.tpl @@ -16,7 +16,7 @@
- +