import java.text.MessageFormat;
import java.util.Collections;
import java.util.Date;
-import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
Context context = new InitialContext();
// Try to lookup
- this.userBean = (UserSessionBeanRemote) context.lookup("ejb/stateless-addressbook-user"); //NOI18N
+ this.userBean = (UserSessionBeanRemote) context.lookup("java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N
} catch (final NamingException e) {
// Throw again
throw new FaceletException(e);
User user = new LoginUser();
user.setUserName(this.getUserName());
user.setUserProfileMode(this.getUserProfileMode());
- user.setUserCreated(new GregorianCalendar());
// Generate phone number
- DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber(), new GregorianCalendar());
- DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber(), new GregorianCalendar());
- DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber(), new GregorianCalendar());
+ DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber());
+ DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber());
+ DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
// Create new contact
Contact contact = new UserContact(this.getGender(), this.getFirstName(), this.getFamilyName());
contact.setContactComment(this.getComment());
// Created timestamp and ownContact
- contact.setContactCreated(new GregorianCalendar());
contact.setContactOwnContact(Boolean.TRUE);
// Set contact in user
// Trace message
//this.getLogger().logTrace(MessageFormat.format("createUserInstance: user={0} - EXIT!", user));
+
// Return it
return user;
}
}
@Override
- public boolean isRequiredPersonalDataSet () {
- return ((this.getUserName() != null) &&
- (this.getUserProfileMode() != null) &&
+ public boolean isRequiredChangePersonalDataSet () {
+ return ((this.getUserProfileMode() != null) &&
(this.getGender() != null) &&
(this.getFirstName() != null) &&
(this.getFamilyName() != null) &&
(this.getStreet() != null) &&
(this.getHouseNumber() != null) &&
(this.getZipCode() != null) &&
- (this.getCity() != null) &&
- (this.getEmailAddress() != null) &&
- (this.getEmailAddressRepeat() != null) &&
- (this.getUserPassword() != null) &&
- (this.getUserPasswordRepeat() != null));
+ (this.getCity() != null));
}
@Override
- public boolean isRequiredChangePersonalDataSet () {
- return ((this.getUserProfileMode() != null) &&
+ public boolean isRequiredPersonalDataSet () {
+ return ((this.getUserName() != null) &&
+ (this.getUserProfileMode() != null) &&
(this.getGender() != null) &&
(this.getFirstName() != null) &&
(this.getFamilyName() != null) &&
(this.getStreet() != null) &&
(this.getHouseNumber() != null) &&
(this.getZipCode() != null) &&
- (this.getCity() != null));
+ (this.getCity() != null) &&
+ (this.getEmailAddress() != null) &&
+ (this.getEmailAddressRepeat() != null) &&
+ (this.getUserPassword() != null) &&
+ (this.getUserPasswordRepeat() != null));
}
@Override
@Override
public boolean isSamePasswordEntered () {
- return (Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat()));
+ return ((!this.getUserPassword().isEmpty()) && (Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())));
}
@Override