Author: emuckenhuber
Date: 2007-09-05 13:22:45 -0400 (Wed, 05 Sep 2007)
New Revision: 8178
Added:
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml
Removed:
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
trunk/core-identity/src/resources/resource-bundles/Identity.properties
Log:
- Internationalization and some UI improvements
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -41,7 +41,7 @@
public final static String jbp_identity_validate_email_process_name =
"jbp_identity_validate_email";
/** jBPM nodes */
- public final static String JBPM_NODE_EMAIL_VALIDATION = "email_validation";
+ public final static String JBPM_NODE_EMAIL_VALIDATION = "validate_email";
public final static String JBPM_NODE_APPROVAL = "admin_approval";
public final static String JBPM_TRANSITION_VALIDATED = "validated";
public final static String JBPM_TRANSITION_REJECTED ="rejected";
@@ -71,11 +71,20 @@
public static final String VARIABLE_EMAIL = "email";
public static final String VARIABLE_USER = "user";
+ /** Email constants */
+ public static final String EMAIL_TO = "to";
+ public static final String EMAIL_FROM = "from";
+ public static final String EMAIL_DOMAIN = "emailDomain";
+ public static final String EMAIL_TEXT = "emailText";
+
/** Default language */
public static final String DEFAULT_LOCALE = "en";
/** Default role */
public static final String DEFAULT_ROLE = "User";
+ /** Bundle prefix for dynamic value localization */
+ public static final String DYNAMIC_VALUE_PREFIX = "IDENTIY_DYNAMIC_VALUE_";
+
}
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -39,12 +39,19 @@
*/
public class JCaptchaService
{
- /** . */
+ /** The captcha service */
private static ImageCaptchaService instance = new
DefaultManageableImageCaptchaService();
public static Boolean validateResponseForID(String challengeId, String value)
{
- return instance.validateResponseForID(challengeId, value);
+ try
+ {
+ return instance.validateResponseForID(challengeId, value);
+ }
+ catch (Exception e)
+ {
+ return Boolean.FALSE;
+ }
}
public static byte[] getChallengeImage(String challengeId, Locale locale) throws
ImageFormatException, IOException
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -167,12 +167,12 @@
this.templateLocation = templateLocation;
this.mailData = mailData;
this.locale = locale;
- this.mailData.put("emailDomain", emailDomain);
+ this.mailData.put(IdentityConstants.EMAIL_DOMAIN, emailDomain);
ResourceBundle bundle = ResourceBundle.getBundle("Identity", locale);
String subject = null;
- String to = (String) mailData.get("to");
+ String to = (String) mailData.get(IdentityConstants.EMAIL_TO);
if (IdentityConstants.ACTION_REGISTER_USER.equals(templateLocation))
{
@@ -192,7 +192,6 @@
}
// Generating message
- log.info("sending mail to: "+ to + " " +subject);
this.generateEmailText();
log.debug(this.emailText);
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -63,7 +63,7 @@
private final static String xmlLocation =
"conf/identity-ui-configuration.xml";
/** XML schema location */
- private final static String schemaLocation =
"conf/identity-ui-configuration.xsd";
+ private final static String schemaLocation =
"conf/schema/identity-ui-configuration.xsd";
/** Core Identity configration */
private IdentityUIConfiguration configuration;
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -25,6 +25,7 @@
import javax.naming.InitialContext;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jbpm.graph.def.ActionHandler;
@@ -45,10 +46,17 @@
public void execute(ExecutionContext ectx) throws Exception
{
- // Getting user information
- UserContainer uc = (UserContainer)
ectx.getContextInstance().getVariable("user");
- // Creating user
- this.getIdentityManagementService().createUser(uc.getUsername(), uc.getPassword(),
uc.getProfileMap(), uc.getRoles());
+ try
+ {
+ // Getting user information
+ UserContainer uc = (UserContainer)
ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+ // Creating user
+ this.getIdentityManagementService().createUser(uc.getUsername(),
uc.getPassword(), uc.getProfileMap(), uc.getRoles());
+ }
+ catch (ClassCastException e)
+ {
+ log.error("error while creating user", e);
+ }
}
private IdentityUserManagementService getIdentityManagementService()
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -252,11 +252,11 @@
{
if (approve)
{
- token.signal("approved");
+ token.signal(IdentityConstants.JBPM_TRANSITION_APPROVED);
}
else
{
- token.signal("rejected");
+ token.signal(IdentityConstants.JBPM_TRANSITION_REJECTED);
}
}
}
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -27,23 +27,14 @@
import java.util.HashMap;
import java.util.Locale;
-import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
-import javax.portlet.PortletURL;
import org.jboss.logging.Logger;
-import org.jboss.portal.api.node.PortalNodeURL;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.core.controller.command.mapper.CommandFactory;
-import org.jboss.portal.core.controller.command.mapper.URLFactory;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityMailService;
import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
-import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portlet.JBossActionRequest;
-import org.jboss.portlet.JBossActionResponse;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
@@ -55,10 +46,10 @@
{
/** . */
private IdentityUserManagementService identityManagementService;
-
+
/** . */
private IdentityMailService identityMailService;
-
+
/** . */
private static Logger log = Logger.getLogger(SendValidationMailAction.class);
@@ -66,45 +57,53 @@
{
HashMap emailMap = new HashMap();
String hash = this.hashGen();
-
+
String action = (String)
ectx.getContextInstance().getVariable(IdentityConstants.ACTION);
String email = (String)
ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_EMAIL);
Locale locale = (Locale)
ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_LOCALE);
-
- if ( locale == null)
+
+ if (locale == null)
{
locale = new Locale(IdentityConstants.DEFAULT_LOCALE);
}
-
- UserContainer uc = (UserContainer)
ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
-
- // Register new user
- if (IdentityConstants.ACTION_REGISTER_USER.equals(action))
+
+ try
{
- emailMap.put("to", email);
- emailMap.put("username", uc.getUsername());
- emailMap.put("password", uc.getPassword());
+ UserContainer uc = (UserContainer)
ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+
+ // Register new user
+ if (IdentityConstants.ACTION_REGISTER_USER.equals(action))
+ {
+ emailMap.put(IdentityConstants.EMAIL_TO, email);
+ emailMap.put("username", uc.getUsername());
+ emailMap.put("password", uc.getPassword());
+ }
+ // Change email
+ else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
+ {
+ String emailTo =
this.getIdentityManagementService().getCurrentEmail(uc.getUsername());
+ emailMap.put(IdentityConstants.EMAIL_TO, emailTo);
+ }
+ else
+ {
+ throw new RuntimeException("no actuin defined for SendValidationMail:
" + action);
+ }
+
+ ectx.getContextInstance().setVariable(IdentityConstants.VALIDATION_HASH, hash);
+ // Building the validation URL
+ String portalURL = (String)
ectx.getContextInstance().getVariable(IdentityConstants.VALIDATION_PORTAL_URL);
+ String activationLink = portalURL + "/" +
IdentityConstants.VALIDATE_EMAIL + "/"
+ + ectx.getProcessInstance().getId() + "/" + hash;
+ emailMap.put("activationLink", activationLink);
+
+ this.getIdentityMailService().sendMail(action, emailMap, locale);
}
- // Change email
- else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
+ catch (ClassCastException e)
{
- String emailTo =
this.getIdentityManagementService().getCurrentEmail(uc.getUsername());
- emailMap.put("to", emailTo);
+ log.error("error while sending validation mail", e);
}
- else
- {
- throw new RuntimeException("wrong Action");
- }
-
- ectx.getContextInstance().setVariable(IdentityConstants.VALIDATION_HASH, hash);
-
- String portalURL = (String)
ectx.getContextInstance().getVariable(IdentityConstants.VALIDATION_PORTAL_URL);
- String activationLink = portalURL + "/" +
IdentityConstants.VALIDATE_EMAIL + "/" + ectx.getProcessInstance().getId() +
"/" + hash;
- emailMap.put("activationLink", activationLink);
+ }
- this.getIdentityMailService().sendMail(action, emailMap, locale);
- }
-
// generating a random hash
private String hashGen()
{
@@ -132,14 +131,15 @@
}
return null;
}
-
+
private IdentityMailService getIdentityMailService()
{
if (identityMailService == null)
{
try
{
- this.identityMailService = (IdentityMailService) new
InitialContext().lookup("java:/portal/IdentityMailService");
+ this.identityMailService = (IdentityMailService) new InitialContext()
+ .lookup("java:/portal/IdentityMailService");
}
catch (Exception e)
{
@@ -148,14 +148,15 @@
}
return identityMailService;
}
-
+
private IdentityUserManagementService getIdentityManagementService()
{
if (identityManagementService == null)
{
try
{
- this.identityManagementService = (IdentityUserManagementService) new
InitialContext().lookup("java:/portal/IdentityUserManagementService");
+ this.identityManagementService = (IdentityUserManagementService) new
InitialContext()
+ .lookup("java:/portal/IdentityUserManagementService");
}
catch (Exception e)
{
@@ -164,5 +165,5 @@
}
return identityManagementService;
}
-
+
}
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -214,23 +214,15 @@
if (processInstance != null)
{
Token token = processInstance.getRootToken();
- if (token != null &&
token.getNode().getName().equals("validate_email"))
+ if (token != null &&
token.getNode().getName().equals(IdentityConstants.JBPM_NODE_EMAIL_VALIDATION))
{
String hash = (String)
processInstance.getContextInstance().getVariable(IdentityConstants.VALIDATION_HASH);
if (registrationHash.equals(hash) && !
processInstance.hasEnded())
{
String action = (String)
processInstance.getContextInstance().getVariable(IdentityConstants.ACTION);
- // Processing email change request to transition changeEmail
- if(IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
- {
- token.signal("validated");
- success = IdentityConstants.VALIDATION_VALIDATED;
- }
- else
- {
- token.signal("validated");
- success = IdentityConstants.REGISTRATION_REGISTERED;
- }
+
+ token.signal(IdentityConstants.JBPM_TRANSITION_VALIDATED);
+ success = processInstance.getProcessDefinition().getName();
}
}
}
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -97,7 +97,10 @@
public boolean setValue(Object propertyName, Object value) throws
IllegalArgumentException
{
- map.put((String) propertyName, value);
+ if (value != null && value instanceof String &&
((String)value).trim().length() == 0)
+ map.put((String) propertyName, null);
+ else
+ map.put((String)propertyName, value);
return true;
}
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
@@ -36,6 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.workflow.RegistrationService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -125,11 +127,14 @@
this.metaDataService = metaDataService;
}
- public String register(ActionEvent ev)
+ public void register(ActionEvent ev)
{
+ String registrationStatus = "failed";
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ String adminSubscription = (String) ev.getComponent().getId();
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity",
ctx.getViewRoot().getLocale());
if (uiUser.getUsername() != null && uiUser.getPassword() != null)
{
- String adminSubscriptionMode = (String) ev.getComponent().getId();
try
{
Class registrationDateClass =
uiUser.getAttribute().getType("registrationdate");
@@ -156,8 +161,8 @@
Locale wLocale =
FacesContext.getCurrentInstance().getViewRoot().getLocale();
String wURL = this.getPortalURL();
- String registrationStatus = null;
- if (adminSubscriptionMode != null &&
adminSubscriptionMode.equals("admin"))
+
+ if (adminSubscription != null &&
adminSubscription.equals("admin"))
{
registrationStatus = this.registrationService.registerUser(wURL,
wUsername, wPassword, wProfileMap, wRoles,
wLocale, true);
@@ -167,25 +172,30 @@
registrationStatus = this.registrationService.registerUser(wURL,
wUsername, wPassword, wProfileMap, wRoles,
wLocale, false);
}
- log.debug(registrationStatus);
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Could not register user."));
+ log.error("", e);
}
}
- else
- {
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Missing required values."));
- }
-
/*
* Cleaning up
*/
this.uiUser = new IdentityUIUser();
- return "success";
+
+ if (registrationStatus.equals(IdentityConstants.REGISTRATION_PENDING) )
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(bundle.getString("IDENTITY_REGISTER_PENDING_TITLE")));
+ }
+ else if (registrationStatus.equals(IdentityConstants.REGISTRATION_REGISTERED))
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
+ }
+ else
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
+ }
}
private String getPortalURL()
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -27,12 +27,14 @@
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityMailService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -112,13 +114,15 @@
{
this.passwordCharacters = passwordCharacters;
}
-
+
public String doomed()
{
User user = null;
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity",
FacesContext.getCurrentInstance().getViewRoot()
+ .getLocale());
// Used by the user management to reset passwords
- if (username == null )
+ if (username == null)
{
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext ectx = ctx.getExternalContext();
@@ -126,7 +130,7 @@
this.username = (String) params.get("currentUser");
}
- if (username != null && !username.equals(""))
+ if (username != null && username.trim().length() > 0)
{
try
{
@@ -134,36 +138,38 @@
}
catch (NoSuchUserException e)
{
- FacesContext.getCurrentInstance()
- .addMessage(null, new FacesMessage("no account with this username
found."));
- return "lostPassword";
+ FacesContext.getCurrentInstance().addMessage(null,
+ new
FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_404")));
+ return "status";
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Failed to reset password."));
+ log.error("", e);
+ FacesContext.getCurrentInstance().addMessage(null,
+ new
FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_ERROR")));
return "status";
}
}
else
{
- return "lostPassword";
+ FacesContext.getCurrentInstance().addMessage(null,
+ new
FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_404")));
+ return "status";
}
if (user != null)
{
- Map mailMap = new HashMap();
+ try
+ {
+ String newPassword = this.genPassword(8);
- String newPassword = this.genPassword(8);
+ IdentityUIUser uiUser = new IdentityUIUser(user.getUserName());
+
+ Map mailMap = new HashMap();
+ mailMap.put(IdentityConstants.EMAIL_TO, (String)
uiUser.getAttribute().getValue("email").getObject());
+ mailMap.put("username", user.getUserName());
+ mailMap.put("password", newPassword);
- IdentityUIUser uiUser = new IdentityUIUser(user.getUserName());
-
- mailMap.put("to", (String)
uiUser.getAttribute().getValue("email").getObject());
- mailMap.put("username", user.getUserName());
- mailMap.put("password", newPassword);
-
- try
- {
// Update password
identityUserBean.updatePassword(user.getUserName(), newPassword);
// Sending email
@@ -172,36 +178,30 @@
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage("Failed to reset password."));
+ log.error("", e);
+ FacesContext.getCurrentInstance().addMessage(null,
+ new
FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_ERROR")));
return "status";
}
}
FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage("Email with new credentials successfully
sent."));
+ new
FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL")));
return "status";
}
- private String genPassword(int length)
+ private String genPassword(int length) throws NoSuchAlgorithmException
{
StringBuffer buffer = new StringBuffer();
- try
- {
- char[] characterMap = passwordCharacters.toCharArray();
- SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
+ char[] characterMap = passwordCharacters.toCharArray();
+ SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
- for (int i = 0; i <= length; i++)
- {
- byte[] bytes = new byte[512];
- secureRandom.nextBytes(bytes);
- double number = secureRandom.nextDouble();
- int b = ((int) (number * characterMap.length));
- buffer.append(characterMap[b]);
- }
- }
- catch (NoSuchAlgorithmException e)
+ for (int i = 0; i <= length; i++)
{
- log.error("No Such Algorithm exists ", e);
+ byte[] bytes = new byte[512];
+ secureRandom.nextBytes(bytes);
+ double number = secureRandom.nextDouble();
+ int b = ((int) (number * characterMap.length));
+ buffer.append(characterMap[b]);
}
return buffer.toString();
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
@@ -160,16 +161,31 @@
return StaticValues.getTimezone();
}
else {
+ // building dynamic value list
List list = new ArrayList();
Iterator i = uiComponent.getValues().keySet().iterator();
+
+ // if not required add a empty SelectItem
+ if(! uiComponent.isRequired())
+ list.add(new SelectItem(""));
+
while(i.hasNext())
{
String key = (String) i.next();
- list.add(new SelectItem(key, (String) uiComponent.getValues().get(key)));
+ String value = (String) uiComponent.getValues().get(key);
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity",
ctx.getViewRoot().getLocale());
+ try
+ {
+ value = bundle.getString(IdentityConstants.DYNAMIC_VALUE_PREFIX +
key.toUpperCase());
+ }
+ catch (Exception e)
+ {
+ // just take the default
+ }
+ list.add(new SelectItem(key, value ));
}
return list;
}
-
}
if ( base instanceof PortletPreferences)
{
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-05
17:22:45 UTC (rev 8178)
@@ -53,6 +53,7 @@
public static List getTimezone()
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
for (int i = 0; i < UserPortletConstants.TIME_ZONE_OFFSETS.length; i++)
{
if (UserPortletConstants.TIME_ZONE_OFFSETS[i] != null)
@@ -73,6 +74,7 @@
public static List getTheme(FacesContext ctx)
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
PortletContext pctx = (PortletContext) ctx.getExternalContext().getContext();
ThemeService themeService = (ThemeService)
pctx.getAttribute("ThemeService");
for (Iterator i = themeService.getThemes().iterator(); i.hasNext();)
@@ -93,6 +95,7 @@
public static List getLocale(FacesContext ctx)
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
Locale currentLocale = ctx.getViewRoot().getLocale();
ArrayList locales = new ArrayList(LocaleManager.getLocales());
Collections.sort(locales, new LocaleComparator());
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -24,7 +24,7 @@
<identity-ui-configuration>
- <subscription-mode>jbp_identity_validation_workflow</subscription-mode>
+ <subscription-mode>jbp_identity_validation_approval_workflow</subscription-mode>
<overwrite-workflow>false</overwrite-workflow>
<email-domain>jboss.org</email-domain>
<email-from>no-reply(a)jboss.com</email-from>
@@ -67,10 +67,6 @@
</ui-component>
<ui-component name="interests">
<property-ref>portal.user.interests</property-ref>
- <values>
- <value key="test">testing</value>
- <value key="test2">testing2</value>
- </values>
</ui-component>
<ui-component name="icq">
<property-ref>portal.user.im.icq</property-ref>
Deleted:
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-09-05
17:22:45 UTC (rev 8178)
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
- elementFormDefault="qualified">
-
-<xsd:element name="identity-ui-configuration">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class
impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
- </xsd:appinfo>
- </xsd:annotation>
-
- <xsd:choice>
- <!-- User portlet and user management portlet preferences -->
- <xsd:element name="subscription-mode" type="subscriptionMode"
default="jbp_identity_validation_workflow"/>
- <xsd:element name="admin-subscription-mode"
type="subscriptionMode" default="automatic"/>
- <xsd:element name="overwrite-workflow" type="xsd:boolean"
default="false"/>
- <xsd:element name="email-domain" minOccurs="1"
maxOccurs="1" type="xsd:string" default="example.com" />
- <xsd:element name="email-from" minOccurs="1"
maxOccurs="1" type="xsd:string"
default="no-reply(a)example.com" />
- <xsd:element name="password-generation-characters"
minOccurs="1" maxOccurs="1" type="xsd:string"/>
- <xsd:element name="default-roles" type="defaultRoles"
minOccurs="1" maxOccurs="1"/>
-
- <!-- user interface components -->
- <xsd:element name="ui-components">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="java.util.HashMap"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="ui-component" minOccurs="1"
maxOccurs="unbounded" type="UIComponent" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <!-- end: user interface components -->
- </xsd:choice>
- </xsd:complexType>
-</xsd:element>
-
-<!-- restictions for subscription-modes -->
-
-<xsd:simpleType name="subscriptionMode">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="custom" />
- <xsd:enumeration value="automatic" />
- <xsd:enumeration value="jbp_identity_validation_workflow" />
- <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
- </xsd:restriction>
-</xsd:simpleType>
-
-<xsd:complexType name="defaultRoles">
- <xsd:sequence>
- <xsd:element name="role" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
-</xsd:complexType>
-
-<xsd:complexType name="validators">
- <xsd:sequence>
- <xsd:element name="validator" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
-</xsd:complexType>
-
-<xsd:complexType name="componentValues">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry nonNullValue="true"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="value" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry/>
- <jbxb:characters>
- <jbxb:mapEntryValue/>
- </jbxb:characters>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="key"
type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntryKey/>
- </xsd:appinfo>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
-</xsd:complexType>
-
-<xsd:complexType name="UIComponent">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry
impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration"
getKeyMethod="getName" setKeyMethod="setName" />
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="property-ref" maxOccurs="1"
minOccurs="1" type="xsd:string" />
- <xsd:element name="localization-bundle" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
- <xsd:element name="validators" type="validators" />
- <xsd:element name="converter" type="xsd:string" />
- <xsd:element name="required" type="xsd:boolean"
default="false"/>
- <xsd:element name="read-only" type="xsd:boolean"
default="false" />
- <xsd:element name="values" type="componentValues">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="java.util.HashMap"/>
- </xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <!-- attribute name -->
- <xsd:attribute name="name" type="xsd:string"
use="required" />
-</xsd:complexType>
-
-</xsd:schema>
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute"
transition="timedOut" />
+ <timer name="time_to_expire" duedate="25 hours"
transition="timedOut" />
<transition name="validated" to="end">
<action
class="org.jboss.portal.core.identity.services.workflow.impl.UpdateEmailAction"/>
</transition>
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute"
transition="timedOut" />
+ <timer name="time_to_expire" duedate="49 hours"
transition="timedOut" />
<transition name="validated" to="admin_approval"/>
<transition name="timedOut" to="end"/>
</state>
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute"
transition="timedOut" />
+ <timer name="time_to_expire" duedate="49 hours"
transition="timedOut" />
<transition name="validated" to="end">
<action
class="org.jboss.portal.core.identity.services.workflow.impl.CreateUserAction"/>
</transition>
Copied:
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
(from rev 8173,
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd)
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
(rev 0)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2007-09-05
17:22:45 UTC (rev 8178)
@@ -0,0 +1,146 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ elementFormDefault="qualified">
+
+<xsd:element name="identity-ui-configuration">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class
impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+
+ <xsd:choice>
+ <!-- User portlet and user management portlet preferences -->
+ <xsd:element name="subscription-mode" type="subscriptionMode"
default="jbp_identity_validation_workflow"/>
+ <xsd:element name="admin-subscription-mode"
type="subscriptionMode" default="automatic"/>
+ <xsd:element name="overwrite-workflow" type="xsd:boolean"
default="false"/>
+ <xsd:element name="email-domain" minOccurs="1"
maxOccurs="1" type="xsd:string" default="example.com" />
+ <xsd:element name="email-from" minOccurs="1"
maxOccurs="1" type="xsd:string"
default="no-reply(a)example.com" />
+ <xsd:element name="password-generation-characters"
minOccurs="1" maxOccurs="1" type="xsd:string"/>
+ <xsd:element name="default-roles" type="defaultRoles"
minOccurs="1" maxOccurs="1"/>
+
+ <!-- user interface components -->
+ <xsd:element name="ui-components">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ui-component" minOccurs="1"
maxOccurs="unbounded" type="UIComponent" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <!-- end: user interface components -->
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
+<!-- restictions for subscription-modes -->
+
+<xsd:simpleType name="subscriptionMode">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="custom" />
+ <xsd:enumeration value="automatic" />
+ <xsd:enumeration value="jbp_identity_validation_workflow" />
+ <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:complexType name="defaultRoles">
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="validators">
+ <xsd:sequence>
+ <xsd:element name="validator" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry nonNullValue="true"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice minOccurs="1" maxOccurs="1">
+ <xsd:element name="value" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry/>
+ <jbxb:characters>
+ <jbxb:mapEntryValue/>
+ </jbxb:characters>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="key"
type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntryKey/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="UIComponent">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry
impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration"
getKeyMethod="getName" setKeyMethod="setName" />
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice>
+ <xsd:element name="property-ref" maxOccurs="1"
minOccurs="1" type="xsd:string" />
+ <xsd:element name="localization-bundle" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="validators" type="validators" />
+ <xsd:element name="converter" type="xsd:string" />
+ <xsd:element name="required" type="xsd:boolean"
default="false"/>
+ <xsd:element name="read-only" type="xsd:boolean"
default="false" />
+ <xsd:element name="values" type="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+ <!-- attribute name -->
+ <xsd:attribute name="name" type="xsd:string"
use="required" />
+</xsd:complexType>
+
+</xsd:schema>
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl 2007-09-05
17:22:45 UTC (rev 8178)
@@ -6,7 +6,7 @@
Username: ${username}
Password: ${password}
-It is highly recommended that you change the generated password at your next login.
+It is highly recommended that you change the generated password after your next login.
Best regards,
${emailDomain}
Modified:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -44,14 +44,14 @@
<f:facet name="header">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION}"/>
</f:facet>
- <h:outputText value="Pending" rendered="#{user.currentNode ==
'emailValidation'}"/>
+ <h:outputText value="Pending" rendered="#{user.currentNode ==
'validate_email'}"/>
<!-- #{user.currentNode == 'adminApproval'} -->
<h:commandLink action="#{useradministrationbean.approveRegistration}"
rendered="#{user.currentNode == 'adminApproval'}">
<h:outputText
value="#{bundle.IDENTITY_MANAGEMENT_PENDING_APPROVE}"/>
<f:param name="processId" value="#{user.processId}" />
<f:param name="action" value="approve" />
</h:commandLink>
- <h:outputText value=" | " rendered="#{user.currentNode ==
'adminApproval'}" />
+ <h:outputText value=" | " rendered="#{user.currentNode ==
'admin_approval'}" />
<h:commandLink action="#{useradministrationbean.approveRegistration}"
rendered="#{user.currentNode == 'adminApproval'}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_REJECT}"/>
<f:param name="processId" value="#{user.processId}" />
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -6,16 +6,10 @@
xmlns:c="http://java.sun.com/jstl/core">
<c:choose>
- <c:when test="#{portletRenderParameter.operation ==
'validated'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/success.xhtml" />
- </c:when>
- <c:when test="#{portletRenderParameter.operation ==
'validation_failed'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/failure.xhtml" />
- </c:when>
- <c:when test="#{portletRenderParameter.operation ==
'registered'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/register_success.xhtml"
/>
- </c:when>
- <c:otherwise>
+ <c:when test="#{portletRenderParameter.operation != null}">
+ <ui:include src="/WEB-INF/jsf/validationStatus/jbp_status.xhtml" />
+ </c:when>
+ <c:otherwise>
<c:choose>
<c:when test="#{facesContext.externalContext.remoteUser != null}">
<ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
Modified:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -8,7 +8,9 @@
<ui:composition template="/WEB-INF/jsf/lostPassword/lostTemplate.xhtml">
-<ui:define name="title" />
+<ui:define name="title">
+ <h:messages />
+</ui:define>
<ui:define name="content" />
</ui:composition>
</div>
Modified:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -9,7 +9,7 @@
<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
<ui:define name="title">
- #{bundle.IDENTITY_REGISTER_SUCCESS_TITLE}
+ <h:messages />
</ui:define>
<ui:define name="content" />
</ui:composition>
Deleted:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -1,21 +0,0 @@
-<div
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_FAILED}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Added:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml
(rev 0)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -0,0 +1,50 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <f:loadBundle var="bundle" basename="Identity" />
+
+ <div style="height: 200px; padding-top: 30px; vertical-align:top; text-align:
center;">
+
+ <b>
+ <c:choose>
+ <c:when test="#{portletRenderParameter.operation ==
'validation_failed'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_FAILED}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation ==
'jbp_identity_validate_email'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_VALIDATED}"
/>
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation ==
'jbp_identity_validation_workflow'}">
+ <h:outputText
value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation ==
'jbp_identity_validation_approval_workflow'}">
+ <h:outputText
value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation == 'custom'}">
+ <h:outputText
value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM}" />
+ </c:when>
+ </c:choose>
+ </b>
+
+ <ul>
+ <li>
+ <a href="#{metadataservice.portalContextPath}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
+ </a>
+ </li>
+ <c:if test="#{portletRenderParameter.operation ==
'jbp_identity_validation_workflow'}">
+ <!-- login link -->
+ <li>
+ <a href="#{metadataservice.portalContextPath}/auth">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_LOGIN}" />
+ </a>
+ </li>
+ </c:if>
+ </ul>
+ </div>
+
+</div>
\ No newline at end of file
Deleted:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -1,26 +0,0 @@
-<div
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText
value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- <li>
- <a href="#{metadataservice.portalContextPath}/auth">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_LOGIN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Deleted:
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml 2007-09-05
14:39:22 UTC (rev 8177)
+++
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -1,21 +0,0 @@
-<div
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_SUCCESS}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-05
14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-05
17:22:45 UTC (rev 8178)
@@ -54,7 +54,7 @@
<preference>
<!-- Use captcha verification -->
<name>captcha</name>
- <value>true</value>
+ <value>false</value>
</preference>
<preference>
<!--
@@ -62,7 +62,7 @@
requires correct mail service configuration
-->
<name>lostPassword</name>
- <value>false</value>
+ <value>true</value>
</preference>
</portlet-preferences>
</portlet>
Modified: trunk/core-identity/src/resources/resource-bundles/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05
14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05
17:22:45 UTC (rev 8178)
@@ -33,11 +33,16 @@
IDENTITY_REGISTER_TITLE=Basic user information
IDENTITY_REGISTER_TITLE_CONFIRM=Confirmation
IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirm Password
-IDENTITY_REGISTER_SUCCESS_TITLE=Your account has been sucessfully created.
+IDENTITY_REGISTER_SUCCESS_TITLE=Your account has been successfully created. You may want
to login now.
+IDENTITY_REGISTER_PENDING_TITLE=An e-mail has been sent to your e-mail address to verify
your registration.
IDENTITY_LOST_PASSWORD_TITLE=Forgot your login data?
IDENTITY_LOST_PASSWORD_DESCRIPTION=Please enter your username to reset your password
+IDENTITY_LOST_PASSWORD_ERROR=Failed to reset password.
+IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL=You will receive an e-mail with your new
password.
+IDENTITY_LOST_PASSWORD_STATUS_404=No account found.
+
IDENTITY_EDIT_PASSWORD_TITLE=Change your password
IDENTITY_EDIT_PASSWORD_CURRENT=Current password
IDENTITY_EDIT_CHANGE_PASSWORD=Change password
@@ -124,9 +129,12 @@
IDENTITY_VERIFICATION_RETURN=Return to portal
IDENTITY_VERIFICATION_LOGIN=Login
IDENTITY_VERIFICATION_STATUS_FAILED=Can not validate the e-mail address.
-IDENTITY_VERIFICATION_STATUS_SUCCESS=E-Mail address validated.
-IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=E-Mail address validated account waiting
for approval.
+IDENTITY_VERIFICATION_STATUS_VALIDATED=E-Mail address validated.
+IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=Your account has been activaed. You may log
in now.
+IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL=Your e-mail address has been verified, but
your account needs to be approved by the administrator.
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Your e-mail address has been verified.
+IDENTITY_VALIDATION_ERROR_REGISTRATION=Failed to register user.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Sorry - This username is already taken.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Error while validating username.
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=The passwords doesn't match.
@@ -134,3 +142,7 @@
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Invalid E-Mail address.
IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Invalid password
IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Captcha incorrect
+
+# Example usage for dynamic values
+#IDENTIY_DYNAMIC_VALUE_TEST=test label
+#IDENTIY_DYNAMIC_VALUE_TEST2=test label2
\ No newline at end of file