]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Tue, 8 Mar 2016 21:08:41 +0000 (22:08 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 8 Mar 2016 21:08:41 +0000 (22:08 +0100)
- renamed method
- the password validator is currently not working as it currently need the web controller, not the EJB
- updated jar(s)

lib/jcontacts-core.jar
lib/jphone-core.jar
src/java/org/mxchange/jjobs/beans/user/UserWebSessionBean.java
src/java/org/mxchange/jjobs/converter/country/CountryConverter.java
src/java/org/mxchange/jjobs/validators/password/UserPasswordValidator.java
web/WEB-INF/templates/login/login_enter_current_password.tpl

index a9baa32fa6cfb062f87ed9a9ccba1ebe106e8244..e905316a232cc3f743e47c1d041b3c782fa666f1 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 4a792881003d7be6485b4aba1e0a4aa6cf1d4c0e..221f558c88c722e38e98a8f00c55f365f4cf1498 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index edda10868c6cd3df4dcb3d3bb67151a663270e10..9d7054774392eaa58bc6787b823f9ee50d39fc12 100644 (file)
@@ -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)) {
index 2ceb8be58f037ecf3a31ebd09339778c4da217d4..7a580678c05db351fed35d2928da1d559f8196b6 100644 (file)
@@ -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<Country> countryList = this.countryController.allCountries();
+               List<Country> countryList = this.countryBean.allCountries();
 
                // Init value
                Country country = null;
index 924f3bbcec7622f5f238e2f58accc66147587ae8..3673c7cf5a7c3c810374103efcd53ea545f3b50b 100644 (file)
  */
 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
        }
 }
index 26206e4c05a9c65940c7b9d8387745a394d9fb1f..eb11c933b1e61474774fda73d576f74b8a850c91 100644 (file)
@@ -16,7 +16,7 @@
                                <div class="table_right">
                                        <h:inputSecret class="input" id="currentPassword" size="10" maxlength="255" value="#{loginController.currentPassword}" required="true" validatorMessage="#{msg.ERROR_CURRENT_PASSWORD_MISMATCHING}">
                                                <h:message for="currentPassword" class="errors" />
-                                               <f:validator for="currentPassword" validatorId="UserPasswordValidator" />
+                                               <!-- <f:validator for="currentPassword" validatorId="UserPasswordValidator" /> //-->
                                        </h:inputSecret>
                                </div>