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?
}
// Set phone number
- contact.setContactPhoneNumber(phone);
+ contact.setContactLandLineNumber(phone);
}
// Don't set null or wrong references
// 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)) {
/**
* Country bean
*/
- private JobsCountrySingletonBeanRemote countryController;
+ private JobsCountrySingletonBeanRemote countryBean;
/**
* Logger instance
// 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
@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())) {
}
// Get full list
- List<Country> countryList = this.countryController.allCountries();
+ List<Country> countryList = this.countryBean.allCountries();
// Init value
Country country = null;
*/
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;
*/
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
}
// Trace message
- //this.getLogger().logTrace("validate: EXIT!"); //NOI18N
+ this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N
}
}
<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>