portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r354125 - in /portals/jetspeed-2/trunk/applications/j2-admin/src: java/org/apache/jetspeed/portlets/registration/ java/org/apache/jetspeed/portlets/registration/resources/ webapp/WEB-INF/ webapp/WEB-INF/view/userreg/
Date Mon, 05 Dec 2005 18:46:22 GMT
Author: taylor
Date: Mon Dec  5 10:46:19 2005
New Revision: 354125

URL: http://svn.apache.org/viewcvs?rev=354125&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-215

Final Patch from Chris Schaefer 
THis should pretty much close this issue for the 2.0 release

Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/ForgottenPasswordResources_en.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources_en.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistration.vm
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistrationEmail_en.vm

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java Mon Dec  5 10:46:19 2005
@@ -106,18 +106,6 @@
 
     /** localized emailSubject */
     private String emailSubject = null;
-
-    //TODO do this in a DB
-    Map hackMap;
-
-    class UserPassword
-    {
-
-        String user;
-
-        String password;
-    }
-
     
     public void init(PortletConfig config) throws PortletException
     {
@@ -140,22 +128,22 @@
         String appRoot = "root";
         
         
-        hackMap = new HashMap();
     }
 
     private boolean isValidGUID(String guid)
     {
-        // lookup the guid here 
-        UserPassword m = (UserPassword) hackMap.get(guid);
-        if (m != null) { return true; }
+        Map map = admin.getNewLoginInfo(guid);
+        
+        if (map != null) { return true; }
         return false;
     }
 
     private boolean updatePasswordFromGUID(String guid)
     {
-        UserPassword m = (UserPassword) hackMap.get(guid);
-        String userName = (String) m.user;
-        String newPassword = (String) m.password;
+        Map map = admin.getNewLoginInfo(guid);
+        
+        String userName = (String) map.get("user.name");
+        String newPassword = (String) map.get("password");
 
         // Here's where a break should be.   The following code should be put into the RETURN portlet
         try
@@ -163,7 +151,7 @@
             userManager.setPassword(userName, null, newPassword);
             userManager.setPasswordUpdateRequired(userName, true);
             // if we got here stuff is changed... removed the key from the map
-            hackMap.remove(guid);
+            admin.removeNewLoginInfo(guid);
         } catch (SecurityException e)
         {
             return false;
@@ -279,31 +267,32 @@
             userAttributes.put(CTX_NEW_PASSWORD, newPassword);
             userAttributes.put(CTX_USER_NAME, userName);
 
-/*
- *         this code is my first attempt to get things working with a template locator... it's not going to work given the way things are partitioned in the jetspeed
 
-        TemplateLocator templateLocator;
-        try
-        {
-            templateLocator = new JetspeedTemplateLocator(l, appRoot);
-        } catch (FileNotFoundException e)
-        {
-            throw new PortletException("can't init TemplateLocator:"+e.getMessage());
-        }
+/*          this code is my first attempt to get things working with a template locator... it's not going to work given the way things are partitioned in the jetspeed
+
+            
+            TemplateLocator templateLocator;
+            
+            templateLocator = (TemplateLocator) Jetspeed.getComponentManager().getComponent("TemplateLocator");
+            
+            List l = new ArrayList();
+            String appRoot = "/WEB-INF/view/userreg/";
+            templateLocator = (TemplateLocator) getPortletContext().getAttribute("TemplateLocator");
+            
             LocatorDescriptor ld = templateLocator.createLocatorDescriptor(null);
             RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
     
             CapabilityMap capabilityMap = requestContext.getCapabilityMap();
             ld.setMediaType(capabilityMap.getPreferredMediaType().getName());
             
-            Locale locale = requestContext.getLocale();
+            //Locale locale = requestContext.getLocale();
             ld.setCountry(locale.getCountry());
             ld.setLanguage(locale.getLanguage());
             
             TemplateDescriptor td = templateLocator.locateTemplate( ld);
             
             this.template = td.getAbsolutePath();
-            */
+*/            
             
             String language = locale.getLanguage();
             String templ = this.template;
@@ -313,23 +302,23 @@
                 String fixedTempl = templ.substring(0, period) + "_" + language + "." + templ.substring(period + 1);
                 if (new File(getPortletContext().getRealPath(fixedTempl)).exists())
                 {
-                    this.template = fixedTempl;
+                    templ = fixedTempl;
                 }
             }
             
-            if (this.template == null) 
+            if (templ == null) 
             { 
                 throw new Exception("email template not available"); 
             }
             admin.sendEmail(this.getPortletConfig(), email,
-                    getEmailSubject(request),this.template, userAttributes);
+                    getEmailSubject(request),templ, userAttributes);
 
             //TODO this is currently hacked with a hashmap... needs to move to either a DB table
             // or to some sort of credential
-            UserPassword up = new UserPassword();
-            up.user = userName;
-            up.password = newPassword;
-            hackMap.put(urlGUID, up);
+            Map map = new HashMap();
+            map.put("user.name",userName);
+            map.put("password",newPassword);
+            admin.putNewLoginInfo(urlGUID, map);
 
             publishRenderMessage(
                     request,

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java Mon Dec  5 10:46:19 2005
@@ -17,14 +17,15 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 import javax.portlet.ActionRequest;
@@ -42,14 +43,13 @@
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
-import org.apache.portals.bridges.frameworks.model.ModelBean;
 import org.apache.portals.bridges.velocity.AbstractVelocityMessagingPortlet;
 import org.apache.portals.gems.util.ValidationHelper;
 import org.apache.velocity.context.Context;
 
 /**
  * This portlet allows a logged on user to change its password.
- *
+ * 
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @author <a href="mailto:chris@bluesunrise.com">Chris Schaefer</a>
  * @version $Id: $
@@ -65,7 +65,7 @@
 
     private static final String USER_ATTRIBUTE_EMAIL = "user.business-info.online.email";
 
-    // Messages 
+    // Messages
     private static final String MSG_MESSAGE = "MSG";
 
     private static final String MSG_USERINFO = "user";
@@ -73,7 +73,7 @@
     private static final String MSG_REGED_USER_MSG = "registeredUserMsg";
 
     // Init Parameters
-    private static final String IP_ROLES = "roles"; // comma separated    
+    private static final String IP_ROLES = "roles"; // comma separated
 
     private static final String IP_GROUPS = "groups"; // comma separated
 
@@ -100,6 +100,10 @@
 
     private static final String CTX_USERINFO = "user";
 
+    private static final String CTX_FIELDS = "fieldsInOrder";
+
+    private static final String CTX_OPTIONALS = "optionalMap";
+
     private static final String CTX_REGED_USER_MSG = "registeredUserMsg";
 
     private static final String CTX_OPTION_GENERATE_PASSWORDS = "CTX_Option_Generate_Passwords";
@@ -133,7 +137,10 @@
     /** will force the passwords to be generated instead of picked by the user */
     private boolean optionForceGeneratedPasswords = false;
 
-    /** will use cause the portlet to use a user request username instead otherwise forces emailaddress */
+    /**
+     * will use cause the portlet to use a user request username instead
+     * otherwise forces emailaddress
+     */
     private boolean optionForceEmailAsUsername = true;
 
     /** will check to make sure the email address is unique to the system */
@@ -169,21 +176,24 @@
 
         this.emailTemplate = config.getInitParameter(IP_EMAIL_TEMPLATE);
 
-        // user attributes ? 
+        // user attributes ?
 
-        this.optionForceEmailsToBeSystemUnique = Boolean.getBoolean(config
-                .getInitParameter(IP_OPTION_EMAILS_SYSTEM_UNIQUE));
-        this.optionForceGeneratedPasswords = Boolean.getBoolean(config
-                .getInitParameter(IP_OPTION_GENERATE_PASSWORDS));
-        this.optionForceEmailAsUsername = Boolean.getBoolean(config
-                .getInitParameter(IP_OPTION_USE_EMAIL_AS_USERNAME));
+        this.optionForceEmailsToBeSystemUnique = Boolean.valueOf(
+                config.getInitParameter(IP_OPTION_EMAILS_SYSTEM_UNIQUE))
+                .booleanValue();
+        this.optionForceGeneratedPasswords = Boolean.valueOf(
+                config.getInitParameter(IP_OPTION_GENERATE_PASSWORDS))
+                .booleanValue();
+        this.optionForceEmailAsUsername = Boolean.valueOf(
+                config.getInitParameter(IP_OPTION_USE_EMAIL_AS_USERNAME))
+                .booleanValue();
         if (this.optionForceEmailAsUsername)
         {
             // just to be sure
             this.optionForceEmailsToBeSystemUnique = true;
         }
         this.returnUrlPath = config.getInitParameter(IP_RETURN_URL);
-        this.redirectPath = config.getInitParameter(IP_REDIRECT_PATH);        
+        this.redirectPath = config.getInitParameter(IP_REDIRECT_PATH);
     }
 
     public void doView(RenderRequest request, RenderResponse response)
@@ -191,14 +201,33 @@
     {
         response.setContentType("text/html");
         Context context = getContext(request);
-        context.put(CTX_USERINFO, this.receiveRenderMessage(request,
-                MSG_USERINFO));
+
+        Object userinfoObject = this
+                .receiveRenderMessage(request, MSG_USERINFO);
+        context.put(CTX_USERINFO, userinfoObject);
+        context.put(CTX_FIELDS, getListOfNonSpecialFormKeys());
+        context.put(CTX_OPTIONALS, getOptionalMap());
         context.put(CTX_MESSAGE, consumeRenderMessage(request, MSG_MESSAGE));
-        
-        // if this is non-null, then we know that we registered
-        context.put(CTX_REGED_USER_MSG, consumeRenderMessage(request,
-                MSG_REGED_USER_MSG));
+        String guid = request.getParameter("newUserGUID");
+        if (guid != null)
+        {
+            // we'll ignore the possibility of an invalid guid for now.
+
+            // NOTE this would be a good place to put the actual registration if
+            // that's the process you want to have happen.
 
+            ResourceBundle resource = getPortletConfig().getResourceBundle(
+                    request.getLocale());
+            context.put(CTX_REGED_USER_MSG, resource
+                    .getString("success.login_above"));
+        } else
+        {
+            // not a returning url, but perhaps we just got redirected from the
+            // form ?
+            // if this is non-null, then we know that we registered
+            context.put(CTX_REGED_USER_MSG, consumeRenderMessage(request,
+                    MSG_REGED_USER_MSG));
+        }
         // next two control the existence of some of the fields in the form
         if (this.optionForceEmailAsUsername)
         {
@@ -212,63 +241,203 @@
         super.doView(request, response);
     }
 
-    private Object getBeanFromSession(PortletRequest request, ModelBean mb)
+    private static final Boolean required = new Boolean(true);
+
+    private static final Boolean optional = new Boolean(false);
+
+    private static final Integer IS_STRING = new Integer(1);
+
+    private static final Integer IS_EMAIL = new Integer(2);
+
+    private static final Integer IS_PHONE = new Integer(3);
+
+    private static final Integer IS_URL = new Integer(4);
+
+    private static final Integer IS_BDATE = new Integer(5);
+
+    protected List getListOfNonSpecialFormKeys()
     {
-        return request.getPortletSession().getAttribute(makeModelBeanKey(mb));
+        List l = new ArrayList();
+        for (int i = 0; i < formKeys.length; i++)
+        {
+            String key = (String) formKeys[i][0];
+            if (key.equals("user.name"))
+            {
+                // don't put this in
+            } else if (key.equals("user.business-info.online.email"))
+            {
+                // don't put this in
+            } else if (key.equals("password"))
+            {
+                // don't put this in
+            } else if (key.equals("verifyPassword"))
+            {
+                // don't put this in
+            } else
+            {
+                // but DO add this
+                l.add(key);
+            }
+        }
+        return l;
     }
 
-    private void clearBeanFromSession(PortletRequest request, ModelBean mb)
+    protected Map getOptionalMap()
     {
-        System.out.println("Clearing bean " + makeModelBeanKey(mb));
-        request.getPortletSession().removeAttribute(makeModelBeanKey(mb));
+        Map m = new HashMap();
+        for (int i = 0; i < formKeys.length; i++)
+        {
+            boolean isRequired = ((Boolean) formKeys[i][1]).booleanValue();
+            if (!isRequired)
+            {
+                m.put(formKeys[i][0], "");
+            }
+        }
+        return m;
     }
+    // PLT name, required, max length,  validation type 
+    
+    protected static Object[][] formKeys =
+    { 
+        // the next four items are special cases
+        
+        // this is the offical email used by jetspeed.  You can chnage it, but you have to look around in the code
+        {"user.business-info.online.email", required ,      new Integer(80),        IS_EMAIL},
+        
+        // username is required here 
+        // chould be commented out if email is used as username...
+        {"user.name",         required ,      new Integer(80),        IS_STRING},
+        
+        // These last two are special cases you must have them
+        // comment them out here if you use the generated password option
+        {"password", required, new Integer(80), IS_STRING},
+        {"verifyPassword", required, new Integer(80), IS_STRING},
+    
+        // the following can be placed in any order, and will appear in that order on the page
+        
+        //      All of the following are optional and are stored as user attributes if collected.
+        
+        /*
+        {"user.bdate",          optional ,      new Integer(25),        IS_BDATE},    // Note: store as a string which is a number, time in milliseconds since 1970... see Portlet Spec. 
+        {"user.gender",         optional ,      new Integer(10),        IS_STRING},
+        {"user.employer",         optional ,      new Integer(80),        IS_STRING},
+        */
+        
+        {"user.department",         optional ,      new Integer(80),        IS_STRING},
+        /*
+        {"user.jobtitle",         optional ,      new Integer(80),        IS_STRING},
+        {"user.name.prefix",         optional ,      new Integer(10),        IS_STRING},
+        */
+        {"user.name.given",         optional ,      new Integer(30),        IS_STRING},
+        {"user.name.family",         optional ,      new Integer(30),        IS_STRING},
+        /*
+        {"user.name.middle",         optional ,      new Integer(30),        IS_STRING},
+        {"user.name.suffix",         optional ,      new Integer(10),        IS_STRING},
+        {"user.name.nickName",         optional ,      new Integer(30),        IS_STRING},
+        {"user.home-info.postal.name",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.street",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.city",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.stateprov",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.postalcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.country",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.postal.organization",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.telephone.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.telephone.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.telephone.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.home-info.telecom.telephone.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.telephone.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.fax.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.fax.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.fax.number",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.fax.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.fax.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.mobile.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.mobile.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.mobile.number",optional ,      new Integer(80),        IS_PHONE},
+        {"user.home-info.telecom.mobile.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.mobile.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.pager.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.pager.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.pager.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.home-info.telecom.pager.ext",            optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.telecom.pager.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.home-info.online.email",         optional ,      new Integer(80),        IS_EMAIL},
+        {"user.home-info.online.uri",         optional ,      new Integer(80),        IS_URL},
+        */
+        {"user.business-info.postal.name",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.street",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.city",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.stateprov",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.postalcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.country",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.postal.organization",         optional ,      new Integer(80),        IS_STRING},
+        /*
+        {"user.business-info.telecom.telephone.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.telephone.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.telephone.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.business-info.telecom.telephone.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.telephone.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.fax.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.fax.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.fax.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.business-info.telecom.fax.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.fax.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.mobile.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.mobile.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.mobile.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.business-info.telecom.mobile.ext",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.mobile.comment",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.pager.intcode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.pager.loccode",         optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.pager.number",         optional ,      new Integer(80),        IS_PHONE},
+        {"user.business-info.telecom.pager.ext",            optional ,      new Integer(80),        IS_STRING},
+        {"user.business-info.telecom.pager.comment",         optional ,      new Integer(80),        IS_STRING},
+//      --- special case see above  user.business-info.online.email 
+        {"user.business-info.online.uri", optional ,      new Integer(80),        IS_URL},
+        */
+    };
 
-    private void putBeanInSession(PortletRequest request, ModelBean mb,
-            Object bean)
+    protected boolean validateFormValue(String value, Integer length,
+            Integer validationType)
     {
-        if (bean instanceof Serializable)
+
+        if (validationType.equals(IS_STRING))
+        {
+            if (!ValidationHelper.isAny(value, true, length.intValue())) { return false; }
+        } else if (validationType.equals(IS_EMAIL))
+        {
+            if (!ValidationHelper
+                    .isEmailAddress(value, true, length.intValue())) { return false; }
+        } else if (validationType.equals(IS_PHONE))
+        {
+            if (!ValidationHelper.isPhoneNumber(value, true, length.intValue())) { return false; }
+        } else if (validationType.equals(IS_URL))
         {
-            request.getPortletSession()
-                    .setAttribute(makeModelBeanKey(mb), bean);
+            if (!ValidationHelper.isURL(value, true, length.intValue())) { return false; }
+        } else if (validationType.equals(IS_BDATE))
+        {
+            if (!ValidationHelper.isValidDatetime(value)) { return false; }
+        } else
+        {
+            // unkown type assume string for now
+            if (!ValidationHelper.isAny(value, true, length.intValue())) { return false; }
         }
+        return true;
+
     }
 
-    private String makeModelBeanKey(ModelBean mb)
+    protected String convertIfNeed(String key, String value)
     {
-        return "ModelBean:" + mb.getBeanName();
+        if ("user.bdate".equals(key))
+        {
+            // this one needs conversion
+            Date d = ValidationHelper.parseDate(value);
+            long timeInmS = d.getTime();
+            return "" + timeInmS;
+        }
+        return value;
     }
 
-    /*   
-     protected Object formToBean(ActionRequest request, String view, ModelBean mb) throws PortletException
-     {
-
-     // try to get the bean from the session first
-     Object bean = getBeanFromSession(request, mb);
-     if (bean == null)
-     {
-     bean = model.createBean(mb);
-     if (bean == null) { throw new PortletException("Portlet Action error in creating bean for view: " + view); }
-     putBeanInSession(request, mb, bean);
-     }
-
-     Map params = request.getParameterMap();
-     try
-     {
-     BeanUtils.populate(bean, params);
-     }
-     catch (Exception e)
-     {
-     throw new PortletException("Portlet Action error in  populating bean: " + mb.getBeanName(), e);
-     }
-     return bean;
-     }
-     */
-
-    protected static String[] formValues =
-    { "user.name.family", "user.name.given", "user.business-info.online.email",
-            "user.name", "password", "verifyPassword", "user.department",
-            "user.employer"};
-
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException
     {
@@ -277,183 +446,246 @@
         Map userAttributes = new HashMap();
 
         Map userInfo = new HashMap();
+        ResourceBundle resource = getPortletConfig().getResourceBundle(
+                actionRequest.getLocale());
 
-        for (int i = 0; i < formValues.length; i++)
+        try
         {
-            String key = formValues[i];
-            String value = actionRequest.getParameter(key);
-            if (value != null)
+
+            for (int i = 0; i < formKeys.length; i++)
             {
-                userInfo.put(key, value);
-                if (key.startsWith("user."))
+                try
+                {
+                    String key = (String) formKeys[i][0];
+                    Boolean isRequired = (Boolean) formKeys[i][1];
+                    String value = actionRequest.getParameter(key);
+                    if ((value != null) && (value.length() > 0))
+                    {
+
+                        userInfo.put(key, value);
+
+                        // do some validation
+                        if (!validateFormValue(value, (Integer) formKeys[i][2],
+                                (Integer) formKeys[i][3]))
+                        {
+                            errors.add(resource
+                                    .getString("error.invalid-format." + key));
+                        }
+
+                        if (key.startsWith("user."))
+                        {
+                            value = convertIfNeed(key, value);
+                            // we'll assume that these map back to PLT.D values
+                            userAttributes.put(key, value);
+                        }
+                    } else
+                    {
+                        // don't have that value or it's too short... is it
+                        // required ?
+                        if (isRequired.booleanValue())
+                        {
+                            errors.add(resource.getString("error.lacking."
+                                    + key));
+                        }
+                        // place an empty version in userInfo anyway
+                        // so that the template will display the correct fields
+                        userInfo.put(key, "");
+                    }
+                } catch (MissingResourceException mre)
                 {
-                    // we'll assume that these map back to PLT.D  values
-                    userAttributes.put(key, value);
+                    errors.add(resource.getString("error.failed_to_add")
+                            + mre.toString());
                 }
+
             }
-        }
+            // publish the whole map so we can reload the form values on error.
+            publishRenderMessage(actionRequest, MSG_USERINFO, userInfo);
 
-        ResourceBundle resource = getPortletConfig().getResourceBundle(actionRequest.getLocale());
+            // These next checks may duplicate previous checks.
+            // however this is a double check given the nature of the values and
+            // how they are used.
+            if (this.optionForceEmailAsUsername)
+            {
+                // email is something special
+                if (!ValidationHelper.isEmailAddress((String) userInfo
+                        .get(USER_ATTRIBUTE_EMAIL), true, 80))
+                {
+                    errors.add(resource.getString("error.invalid-format."
+                            + USER_ATTRIBUTE_EMAIL));
+                }
+            } else
+            {
+                if (!ValidationHelper.isAny((String) userInfo.get("user.name"),
+                        true, 80))
+                {
+                    errors.add(resource.getString("error.lacking.user.name"));
+                }
+            }
 
-        publishRenderMessage(actionRequest, MSG_USERINFO, userInfo);
-        
-        if (!ValidationHelper.isAny((String) userInfo.get("user.name.given"),
-                true, 30))
-        {
-            errors.add(resource.getString("error.lacking.first_name"));
-        }
-        if (!ValidationHelper.isAny((String) userInfo.get("user.name.family"),
-                true, 30))
-        {
-            errors.add(resource.getString("error.lacking.last_name"));
-        }
-        if (!ValidationHelper.isAny((String) userInfo.get("user.name"), true,
-                80))
-        {
-            errors.add(resource.getString("error.lacking.username"));
-        }
-        if (!ValidationHelper.isEmailAddress((String) userInfo
-                .get(USER_ATTRIBUTE_EMAIL), true, 80))
-        {
-            errors.add(resource.getString("error.email_invalid_format"));
-        }
-        if (!this.optionForceGeneratedPasswords)
-        {
-            if (!ValidationHelper.isAny((String) userInfo.get("password"),
-                    true, 25))
+            // if we're not generating make sure it's real
+            if (!this.optionForceGeneratedPasswords)
             {
-                errors.add(resource.getString("error.lacking.password"));
+                if (!ValidationHelper.isAny((String) userInfo.get("password"),
+                        true, 25))
+                {
+                    errors.add(resource.getString("error.lacking.password"));
+                }
             }
-        }
 
-        if (optionForceEmailAsUsername)
-        {
-            // force user.name to be same as email
-            userInfo.put("user.name", userInfo.get(USER_ATTRIBUTE_EMAIL));
-        }
+            if (optionForceEmailAsUsername)
+            {
+                // force user.name to be same as email
+                userInfo.put("user.name", userInfo.get(USER_ATTRIBUTE_EMAIL));
+            }
 
-        boolean userIdExistsFlag = true;
-        try
-        {
-            User user = userManager.getUser((String) userInfo.get("user.name"));
-        } catch (SecurityException e)
-        {
-            userIdExistsFlag = false;
-        }
-        //
-        if (userIdExistsFlag)
-        {
-            errors.add(resource.getString("error.userid_already_exists"));
-            publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
-            return;
-        }
-        if (optionForceEmailsToBeSystemUnique)
-        {
-            boolean emailExistsFlag = true;
-            User user = null;
+            boolean userIdExistsFlag = true;
             try
             {
-                user = admin.lookupUserFromEmail((String) userInfo
-                        .get(USER_ATTRIBUTE_EMAIL));
-            } catch (AdministrationEmailException e1)
+                User user = userManager.getUser((String) userInfo
+                        .get("user.name"));
+            } catch (SecurityException e)
             {
-                emailExistsFlag = false;
+                userIdExistsFlag = false;
             }
-            if ((emailExistsFlag) || (user != null))
+            //
+            if (userIdExistsFlag)
             {
-                errors.add(resource.getString("error.email_already_exists"));
+                errors.add(resource.getString("error.userid_already_exists"));
                 publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
                 return;
             }
-
-        }
-
-        try
-        {
-            if (optionForceGeneratedPasswords)
-            {
-                String password = admin.generatePassword();
-                userInfo.put("user.password", password);
-            } 
-            else
+            if (optionForceEmailsToBeSystemUnique)
             {
-                if (userInfo.get("password").equals(
-                        userInfo.get("verifyPassword")))
+                boolean emailExistsFlag = true;
+                User user = null;
+                try
                 {
-
-                } 
-                else
+                    user = admin.lookupUserFromEmail((String) userInfo
+                            .get(USER_ATTRIBUTE_EMAIL));
+                } catch (AdministrationEmailException e1)
+                {
+                    emailExistsFlag = false;
+                }
+                if ((emailExistsFlag) || (user != null))
                 {
-                    errors.add(resource.getString("error.two_passwords_do_not_match"));
+                    errors
+                            .add(resource
+                                    .getString("error.email_already_exists"));
                     publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
                     return;
                 }
-            }
-        } 
-        catch (Exception e)
-        {
-            errors.add(resource.getString("error.failed_to_add") + e.toString());
-            publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
-        }
-        // make sure no errors have occurred
-        if (errors.size() > 0)
-        {
-            publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
-            return;
-        }
-
-        // Ok, we think we're good to go, let's create the user!
-        try
-        {
-            admin.registerUser((String) userInfo.get("user.name"),
-                    (String) userInfo.get("password"), this.roles, this.groups,
-                    userAttributes, // note use of only PLT.D  values here.
-                    rules, null); // passing in null causes use of default template
-
-            String urlGUID = ForgottenPasswordPortlet.makeGUID(
-                    (String) userInfo.get("user.name"), (String) userInfo
-                            .get("password"));
-
-            userInfo.put(CTX_RETURN_URL, generateReturnURL(actionRequest,
-                    actionResponse, urlGUID));
-
 
-            Locale locale = actionRequest.getLocale();
+            }
 
-            String language = locale.getLanguage();
-            String templ = this.emailTemplate;
-            int period = templ.lastIndexOf(".");
-            if (period > 0)
+            try
             {
-                String fixedTempl = templ.substring(0, period) + "_" + language + "." + templ.substring(period + 1);
-                if (new File(getPortletContext().getRealPath(fixedTempl)).exists())
+                if (optionForceGeneratedPasswords)
                 {
-                    this.emailTemplate = fixedTempl;
+                    String password = admin.generatePassword();
+                    userInfo.put("password", password);
+                } else
+                {
+                    if (userInfo.get("password").equals(
+                            userInfo.get("verifyPassword")))
+                    {
+
+                    } else
+                    {
+                        errors.add(resource
+                                .getString("error.two_passwords_do_not_match"));
+                        publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
+                        return;
+                    }
                 }
+            } catch (Exception e)
+            {
+                errors.add(resource.getString("error.failed_to_add")
+                        + e.toString());
+                publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
             }
-            
-            if (this.emailTemplate == null) 
-            { 
-                throw new Exception("email template not available"); 
+            // make sure no errors have occurred
+            if (errors.size() > 0)
+            {
+                publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
+                return;
             }
 
-            admin.sendEmail(getPortletConfig(), (String) userInfo
-                    .get(USER_ATTRIBUTE_EMAIL), getEmailSubject(actionRequest),
-                    this.emailTemplate, userInfo);
+            // Ok, we think we're good to go, let's create the user!
+            try
+            {
+                admin.registerUser((String) userInfo.get("user.name"),
+                        (String) userInfo.get("password"), this.roles,
+                        this.groups, userAttributes, // note use of only
+                                                        // PLT.D values here.
+                        rules, null); // passing in null causes use of default
+                                        // template
+
+                String urlGUID = ForgottenPasswordPortlet.makeGUID(
+                        (String) userInfo.get("user.name"), (String) userInfo
+                                .get("password"));
+
+                userInfo.put(CTX_RETURN_URL, generateReturnURL(actionRequest,
+                        actionResponse, urlGUID));
+
+                Locale locale = actionRequest.getLocale();
+
+                String language = locale.getLanguage();
+                String templ = this.emailTemplate;
+                int period = templ.lastIndexOf(".");
+                if (period > 0)
+                {
+                    String fixedTempl = templ.substring(0, period) + "_"
+                            + language + "." + templ.substring(period + 1);
+                    if (new File(getPortletContext().getRealPath(fixedTempl))
+                            .exists())
+                    {
+                        this.emailTemplate = fixedTempl;
+                    }
+                }
+
+                if (templ == null) { throw new Exception(
+                        "email template not available"); }
+
+                admin.sendEmail(getPortletConfig(), (String) userInfo
+                        .get(USER_ATTRIBUTE_EMAIL),
+                        getEmailSubject(actionRequest), templ, userInfo);
+
+                if ((this.optionForceEmailAsUsername)
+                        || (this.optionForceGeneratedPasswords))
+                {
+                    publishRenderMessage(actionRequest, MSG_REGED_USER_MSG,
+                            resource.getString("success.check_your_email"));
+                } else
+                {
+                    publishRenderMessage(actionRequest, MSG_REGED_USER_MSG,
+                            resource.getString("success.login_above"));
+                }
 
-            publishRenderMessage(actionRequest, MSG_REGED_USER_MSG,resource.getString("success.login_above"));
+                // put an empty map to "erase" all the user info going forward
+                publishRenderMessage(actionRequest, MSG_USERINFO, new HashMap());
 
-            // put an empty map to "erase" all the user info going forward
-            publishRenderMessage(actionRequest, MSG_USERINFO, new HashMap());
-            
-            actionResponse.sendRedirect(this.generateRedirectURL(actionRequest, actionResponse));
+                actionResponse.sendRedirect(this.generateRedirectURL(
+                        actionRequest, actionResponse));
 
-        } 
-        catch (Exception e)
+            } catch (Exception e)
+            {
+                errors.add(resource.getString("error.failed_to_add")
+                        + e.toString());
+                publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
+            }
+        } catch (MissingResourceException mre)
+        {
+            errors.add(resource.getString("error.failed_to_add")
+                    + mre.toString());
+            publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
+        } catch (Exception e)
         {
-            errors.add(resource.getString("error.failed_to_add") + e.toString());
+            errors
+                    .add(resource.getString("error.failed_to_add")
+                            + e.toString());
             publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
         }
+
     }
 
     protected String getEmailSubject(PortletRequest request)
@@ -468,7 +700,7 @@
             this.emailSubject = null;
         }
         if (this.emailSubject == null)
-                this.emailSubject = "Registration Confirmation";
+            this.emailSubject = "Registration Confirmation";
         return this.emailSubject;
     }
 
@@ -485,17 +717,16 @@
     }
 
     protected String generateReturnURL(PortletRequest request,
-            PortletResponse response,
-            String urlGUID)
+            PortletResponse response, String urlGUID)
     {
-        String fullPath = this.returnUrlPath + "?newUserGUID=" + urlGUID; 
+        String fullPath = this.returnUrlPath + "?newUserGUID=" + urlGUID;
         // NOTE: getPortalURL will encode the fullPath for us
         String url = admin.getPortalURL(request, response, fullPath);
         return url;
     }
 
     protected String generateRedirectURL(PortletRequest request,
-              PortletResponse response)              
+            PortletResponse response)
     {
         return admin.getPortalURL(request, response, this.redirectPath);
     }

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/ForgottenPasswordResources_en.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/ForgottenPasswordResources_en.properties?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/ForgottenPasswordResources_en.properties (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/ForgottenPasswordResources_en.properties Mon Dec  5 10:46:19 2005
@@ -8,4 +8,5 @@
 failed_to_send=Failed to send password:
 page.message=If you have forgotten your password, we can create a new one and send it to you via your email address. You must enter the exact same email address with which you originally registered. 
 page.email=email address:				
-page.button=Request New Password
\ No newline at end of file
+page.button=Request New Password
+

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources.properties?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources.properties (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources.properties Mon Dec  5 10:46:19 2005
@@ -8,16 +8,88 @@
 error.two_passwords_do_not_match=The two passwords do not match, please re-type them
 error.failed_to_add=Failed to add user.
 success.login_above=You have completed the user registration process.  Please login above
+success.check_your_email= You have completed the user registration process.  An email containing your username and password has been sent to you.
 
 # stuff for the template
 page.welcome=Welcome.  Please fill out the following form to become a registered user.
 page.username=username:
-page.firstname=first name:
-page.lastname=last name:
-page.department=department:<font color="blue" size="-2">(optional)</font>
-page.employer=employer:<font color="blue" size="-2">(optional)</font>
 page.email.address=email address:
 page.password=password:
 page.passwordVerify=password (verify):
 page.button=Register Me
-       
\ No newline at end of file
+
+page.optional=<font color="blue" size="-2">(optional)</font>
+
+# special added fields
+page.user.name= username
+
+# for labeling all the PLT attribute fields        
+page.user.bdate= birthday
+page.user.gender= gender
+page.user.employer= employer
+page.user.department= department
+page.user.jobtitle= job title
+page.user.name.prefix= title
+page.user.name.given= given name
+page.user.name.family= family name
+page.user.name.middle= middle name
+page.user.name.suffix= suffix
+page.user.name.nickName= nick name
+page.user.home-info.postal.name= postal name
+page.user.home-info.postal.street= street address
+page.user.home-info.postal.city= city 
+page.user.home-info.postal.stateprov= state
+page.user.home-info.postal.postalcode= zip 
+page.user.home-info.postal.country= country 
+page.user.home-info.postal.organization= organization
+page.user.home-info.telecom.telephone.intcode= home international code
+page.user.home-info.telecom.telephone.loccode= home phone area code
+page.user.home-info.telecom.telephone.number= home phone number
+page.user.home-info.telecom.telephone.ext= home phone extension
+page.user.home-info.telecom.telephone.comment= home phone comment
+page.user.home-info.telecom.fax.intcode= home fax international code
+page.user.home-info.telecom.fax.loccode= home fax area code
+page.user.home-info.telecom.fax.number= home fax number
+page.user.home-info.telecom.fax.ext= home fax extension
+page.user.home-info.telecom.fax.comment= home fax comments
+page.user.home-info.telecom.mobile.intcode= home mobile international coe
+page.user.home-info.telecom.mobile.loccode= home mobile area code
+page.user.home-info.telecom.mobile.number= home mobile number
+page.user.home-info.telecom.mobile.ext= home mobile extension
+page.user.home-info.telecom.mobile.comment= home mobile comments
+page.user.home-info.telecom.pager.intcode= home pager international code
+page.user.home-info.telecom.pager.loccode= home pager area code
+page.user.home-info.telecom.pager.number= home pager number
+page.user.home-info.telecom.pager.ext= home pager extension
+page.user.home-info.telecom.pager.comment= home pager comment
+page.user.home-info.online.email= home email
+page.user.home-info.online.uri= home URL
+page.user.business-info.postal.name= business postal name
+page.user.business-info.postal.street= business  street address
+page.user.business-info.postal.city= business city
+page.user.business-info.postal.stateprov= business state
+page.user.business-info.postal.postalcode= business zip
+page.user.business-info.postal.country= business country
+page.user.business-info.postal.organization= business name
+page.user.business-info.telecom.telephone.intcode= business telephone international code
+page.user.business-info.telecom.telephone.loccode= business telephone area code
+page.user.business-info.telecom.telephone.number= business telephone number
+page.user.business-info.telecom.telephone.ext= business telephone extension 
+page.user.business-info.telecom.telephone.comment= business telephone comment
+page.user.business-info.telecom.fax.intcode= business fax international code
+page.user.business-info.telecom.fax.loccode= business fax area code
+page.user.business-info.telecom.fax.number= business fax number
+page.user.business-info.telecom.fax.ext= business fax extension
+page.user.business-info.telecom.fax.comment= business fax comment
+page.user.business-info.telecom.mobile.intcode= business mobile international code
+page.user.business-info.telecom.mobile.loccode= business mobile area code
+page.user.business-info.telecom.mobile.number= business mobile number
+page.user.business-info.telecom.mobile.ext= business mobile extension
+page.user.business-info.telecom.mobile.comment= business mobile comment
+page.user.business-info.telecom.pager.intcode= business pager international code
+page.user.business-info.telecom.pager.loccode= business pager area code
+page.user.business-info.telecom.pager.number= business pager number
+page.user.business-info.telecom.pager.ext= business pager extension
+page.user.business-info.telecom.pager.comment= business page comment
+page.user.business-info.online.email= business email
+page.user.business-info.online.uri= business url

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources_en.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources_en.properties?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources_en.properties (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/resources/UserRegistrationResources_en.properties Mon Dec  5 10:46:19 2005
@@ -8,16 +8,88 @@
 error.two_passwords_do_not_match=The two passwords do not match, please re-type them
 error.failed_to_add=Failed to add user.
 success.login_above=You have completed the user registration process.  Please login above
+success.check_your_email= You have completed the user registration process.  An email containing your username and password has been sent to you.
 
 # stuff for the template
 page.welcome=Welcome.  Please fill out the following form to become a registered user.
 page.username=username:
-page.firstname=first name:
-page.lastname=last name:
-page.department=department:<font color="blue" size="-2">(optional)</font>
-page.employer=employer:<font color="blue" size="-2">(optional)</font>
 page.email.address=email address:
 page.password=password:
 page.passwordVerify=password (verify):
 page.button=Register Me
-       
\ No newline at end of file
+
+page.optional=<font color="blue" size="-2">(optional)</font>
+
+# special added fields
+page.user.name= username
+
+# for labeling all the PLT attribute fields        
+page.user.bdate= birthday
+page.user.gender= gender
+page.user.employer= employer
+page.user.department= department
+page.user.jobtitle= job title
+page.user.name.prefix= title
+page.user.name.given= given name
+page.user.name.family= family name
+page.user.name.middle= middle name
+page.user.name.suffix= suffix
+page.user.name.nickName= nick name
+page.user.home-info.postal.name= postal name
+page.user.home-info.postal.street= street address
+page.user.home-info.postal.city= city 
+page.user.home-info.postal.stateprov= state
+page.user.home-info.postal.postalcode= zip 
+page.user.home-info.postal.country= country 
+page.user.home-info.postal.organization= organization
+page.user.home-info.telecom.telephone.intcode= home international code
+page.user.home-info.telecom.telephone.loccode= home phone area code
+page.user.home-info.telecom.telephone.number= home phone number
+page.user.home-info.telecom.telephone.ext= home phone extension
+page.user.home-info.telecom.telephone.comment= home phone comment
+page.user.home-info.telecom.fax.intcode= home fax international code
+page.user.home-info.telecom.fax.loccode= home fax area code
+page.user.home-info.telecom.fax.number= home fax number
+page.user.home-info.telecom.fax.ext= home fax extension
+page.user.home-info.telecom.fax.comment= home fax comments
+page.user.home-info.telecom.mobile.intcode= home mobile international coe
+page.user.home-info.telecom.mobile.loccode= home mobile area code
+page.user.home-info.telecom.mobile.number= home mobile number
+page.user.home-info.telecom.mobile.ext= home mobile extension
+page.user.home-info.telecom.mobile.comment= home mobile comments
+page.user.home-info.telecom.pager.intcode= home pager international code
+page.user.home-info.telecom.pager.loccode= home pager area code
+page.user.home-info.telecom.pager.number= home pager number
+page.user.home-info.telecom.pager.ext= home pager extension
+page.user.home-info.telecom.pager.comment= home pager comment
+page.user.home-info.online.email= home email
+page.user.home-info.online.uri= home URL
+page.user.business-info.postal.name= business postal name
+page.user.business-info.postal.street= business  street address
+page.user.business-info.postal.city= business city
+page.user.business-info.postal.stateprov= business state
+page.user.business-info.postal.postalcode= business zip
+page.user.business-info.postal.country= business country
+page.user.business-info.postal.organization= business name
+page.user.business-info.telecom.telephone.intcode= business telephone international code
+page.user.business-info.telecom.telephone.loccode= business telephone area code
+page.user.business-info.telecom.telephone.number= business telephone number
+page.user.business-info.telecom.telephone.ext= business telephone extension 
+page.user.business-info.telecom.telephone.comment= business telephone comment
+page.user.business-info.telecom.fax.intcode= business fax international code
+page.user.business-info.telecom.fax.loccode= business fax area code
+page.user.business-info.telecom.fax.number= business fax number
+page.user.business-info.telecom.fax.ext= business fax extension
+page.user.business-info.telecom.fax.comment= business fax comment
+page.user.business-info.telecom.mobile.intcode= business mobile international code
+page.user.business-info.telecom.mobile.loccode= business mobile area code
+page.user.business-info.telecom.mobile.number= business mobile number
+page.user.business-info.telecom.mobile.ext= business mobile extension
+page.user.business-info.telecom.mobile.comment= business mobile comment
+page.user.business-info.telecom.pager.intcode= business pager international code
+page.user.business-info.telecom.pager.loccode= business pager area code
+page.user.business-info.telecom.pager.number= business pager number
+page.user.business-info.telecom.pager.ext= business pager extension
+page.user.business-info.telecom.pager.comment= business page comment
+page.user.business-info.online.email= business email
+page.user.business-info.online.uri= business url

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml Mon Dec  5 10:46:19 2005
@@ -853,12 +853,14 @@
      <init-param>
         <description>This parameter sets the url to which folks will return after they receive an email</description>
         <name>returnURL</name>
-            <value>/</value>
+        <!-- the current system simply return the user to the default page where this portlet provides feedback --> 
+        <value>/</value>
      </init-param>   
      <init-param>
         <description>This parameter sets the URL to which people will go after they successfully complete their form for forgotten password</description>
         <name>redirectPath</name>
-            <value>/forgotten-password.psml</value>
+        <!-- the current system simply return the user to the default page where this portlet provides feedback --> 
+            <value>/</value>
      </init-param>   
 
     <portlet-name>ForgottenPasswordPortlet</portlet-name>
@@ -871,8 +873,8 @@
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
     </supports>
-    <supported-locale>en</supported-locale>
-    <supported-locale>ja</supported-locale>
+    <supported-locale>en</supported-locale>
+    <supported-locale>ja</supported-locale>
     <portlet-info>
       <title>Forgotten Password</title>
       <short-title>Forgotten Password</short-title>
@@ -895,8 +897,8 @@
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
     </supports>
-    <supported-locale>en</supported-locale>
-    <supported-locale>ja</supported-locale>
+    <supported-locale>en</supported-locale>
+    <supported-locale>ja</supported-locale>
     <portlet-info>
       <title>Forgotten Password Return</title>
       <short-title>forgot PS return</short-title>
@@ -931,12 +933,14 @@
      <init-param>
         <description>This parameter sets the url to which folks will return after they receive an email</description>
         <name>returnURL</name>
-            <value>/complete-registration.psml</value>
+             <!-- the current system simply return the user to the default page where this portlet provides feedback --> 
+            <value>/</value>
      </init-param>   
      <init-param>
         <description>This parameter sets the URL to which people will go after they successfully complete their form for forgotten password</description>
         <name>redirectPath</name>
-            <value>/registration-reminder.psml</value>
+             <!-- the current system simply return the user to the default page where this portlet provides feedback --> 
+            <value>/</value>
      </init-param>   
 
       <init-param>
@@ -957,13 +961,14 @@
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
     </supports>
-    <supported-locale>en</supported-locale>
-    <supported-locale>ja</supported-locale>
+    <supported-locale>en</supported-locale>
+    <supported-locale>ja</supported-locale>
     <portlet-info>
       <title>User Registration </title>
       <short-title>User Registration</short-title>
       <keywords>password, register, signup, new user </keywords>
     </portlet-info>
   </portlet>
+     
 </portlet-app>
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistration.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistration.vm?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistration.vm (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistration.vm Mon Dec  5 10:46:19 2005
@@ -18,10 +18,6 @@
 		#else
 		<tr><td>$MESSAGES.getString('page.username')</td><td><input type="text" name="user.name" value="$!{user.get("user.name")}" /></td></tr>
 		#end
-		<tr><td>$MESSAGES.getString('page.firstname')</td><td><input type="text" name="user.name.given" value="$!{user.get("user.name.given")}" /></td></tr>
-		<tr><td>$MESSAGES.getString('page.lastname')</td><td><input type="text" name="user.name.family" value="$!{user.get("user.name.family")}" /></td></tr>
-		<tr><td>$MESSAGES.getString('page.department')</td><td><input type="text" name="user.department" value="$!{user.get("user.department")}" /></td></tr>
-		<tr><td>$MESSAGES.getString('page.employer') </td><td><input type="text" name="user.employer" value="$!{user.get("user.employer")}" /></td></tr>
 		<tr><td>$MESSAGES.getString('page.email.address')</td><td><input type="text" name="user.business-info.online.email" value="$!{user.get("user.business-info.online.email")}" /></td></tr>
 		
 		#if($CTX_Option_Generate_Passwords)
@@ -30,8 +26,17 @@
 		<tr><td>$MESSAGES.getString('page.passwordVerify')</td><td><input type="password" name="verifyPassword" value="" /></td></tr>
 		#end
 		
+		#foreach( $fieldName in $fieldsInOrder )
+			#set($pagestring = "page.${fieldName}") 
+			#if( $optionalMap.get($fieldName) )
+			<tr><td>${MESSAGES.getString($pagestring)} $MESSAGES.getString("page.optional")</td><td><input type="text" name="$fieldName" value="$!{user.get($fieldName)}" /></td></tr>
+			#else
+			<tr><td>${MESSAGES.getString($pagestring)}</td><td><input type="text" name="$fieldName" value="$!{user.get($fieldName)}" /></td></tr>
+			#end		
+		#end
+		
 		<tr><td colspan="2" > <input type="submit" value="$MESSAGES.getString('page.button')" name="Register Me" /> </td></tr>
 	</table>
-    </form>
+    </form>    
     #end
 </div>

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistrationEmail_en.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistrationEmail_en.vm?rev=354125&r1=354124&r2=354125&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistrationEmail_en.vm (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/userreg/userRegistrationEmail_en.vm Mon Dec  5 10:46:19 2005
@@ -7,7 +7,8 @@
 Your username is: $!{map.get("user.name")}
 Your password is: $!{map.get("password")}
 
-You may change your password online.
+You may change your password online. Follow the link to login:
+$!{map.get("returnURL")}
 
 Thanks
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message