public UIAccountProfiles() throws Exception {
super();
String username = Util.getPortalRequestContext().getRemoteUser();
OrganizationService service = this.getApplicationComponent(OrganizationService.class);
User useraccount = service.getUserHandler().findUserByName(username);
UIFormStringInput userName = new UIFormStringInput("userName", "userName", username);
userName.setReadOnly(true);
addUIFormInput(userName.addValidator(MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30)
.addValidator(ResourceValidator.class)
.addValidator(ExpressionValidator.class, Utils.USER_NAME_VALIDATOR_REGEX, "ResourceValidator.msg.Invalid-char"));
addUIFormInput(new UIFormStringInput("firstName", "firstName", useraccount.getFirstName())
.addValidator(StringLengthValidator.class, 1, 45).addValidator(MandatoryValidator.class)
.addValidator(PersonalNameValidator.class));
addUIFormInput(new UIFormStringInput("lastName", "lastName", useraccount.getLastName())
.addValidator(StringLengthValidator.class, 1, 45).addValidator(MandatoryValidator.class)
.addValidator(PersonalNameValidator.class));
addUIFormInput(new UIFormStringInput("displayName", "displayName", useraccount.getDisplayName()).addValidator(
StringLengthValidator.class, 0, 90).addValidator(UserConfigurableValidator.class, "displayname",
UserConfigurableValidator.KEY_PREFIX + "displayname", false));
addUIFormInput(new UIFormStringInput("email", "email", useraccount.getEmail()).addValidator(MandatoryValidator.class)
.addValidator(UserConfigurableValidator.class, UserConfigurableValidator.EMAIL));
}