public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException
{
response.setContentType("text/html");
Context context = getContext(request);
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));
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)
{
context.put(CTX_OPTION_USE_EMAIL_AS_USERNAME, "TRUE");
}
if (this.optionForceGeneratedPasswords)
{
context.put(CTX_OPTION_GENERATE_PASSWORDS, "TRUE");
}
super.doView(request, response);
}