Chapter 3. User Portlet

Thomas Heute

3.1. Introduction

The user portlet is dedicated to create and manage users and their profiles.

3.2. Functionalities

Managing users using the user module consists in:

  1. Allowing a user to register a new profile with a login and password
  2. Allowing a user to log in the sytem and be recognized as member of user groups
  3. Allowing a user to update a profile with more information like his real name, instant messenger informations...
  4. Allowing an administrator to see the list of users, from there he can assign roles to a user
  5. Allowing as administrator to assign roles to a user
  6. Allowing a user to logout

3.3. Configuration

The following xml block is the standard configuration for the UserPortlet found in portal-core.war/WEB-INF/portlet.xml:

   <portlet>
         <portlet-name>UserPortlet</portlet-name>
         <portlet-class>org.jboss.portal.core.portlet.user.UserPortlet</portlet-class>
         <supported-locale>en</supported-locale>
         <supported-locale>fr</supported-locale>
         <resource-bundle>Resource</resource-bundle>
         <supports>
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
         </supports>
         <portlet-info>
         <title>User portlet</title>
         </portlet-info>
         <init-param>
         <description>Whether we should use ssl on login and throughout the Portal. 1=yes;0=no</description>
         <name>useSSL</name>
         <value>0</value>
         </init-param>
         <init-param>
         <description>Subscription mode</description>
         <name>subscriptionMode</name>
         <!--         <value>emailVerification</value>-->
         <value>automatic</value>
         </init-param>
         <init-param>
         <description>Domain of your website for email verification.</description>
         <name>emailDomain</name>
         <value>JBoss.com</value>
         </init-param>
         <init-param>
         <description>Email displayed in the TO field</description>
         <name>emailFrom</name>
         <value>jbossportal@example.com</value>
         </init-param>
         <init-param>
         <description>Default role of registered users</description>
         <name>defaultRole</name>
         <value>Users</value>
         </init-param>
         </portlet>

The following attributes can be modified in the xml descriptor:

  1. useSSL

    Allows for user logins to be passed thru a SSL.

    1. 0

      Set to zero to disable.

    2. 1

      Set to 1 to enable. You must have SSL configured properly in tomcat for this to work.

  2. subscriptionMode
    1. automatic

      The user can register and is automatically enabled

    2. emailVerification

      The user is disabled until he clicks on a link sent to his email address.

  3. emailDomain

    Your domain name or the name of your website for the email verification form text.

  4. emailFrom

    Email address that will appear in the "From" header when the email verification is sent.

  5. defaultRole

    Default role assigned to new users