org.apache.jetspeed.administration
Interface PortalAdministration


public interface PortalAdministration

PortalAdministration Aggregate portal administration functions: - Emails - Registration - Password Generation

Version:
$Id: $
Author:
David Sean Taylor

Method Summary
 java.lang.String generatePassword()
          Generate a unique password
 java.lang.String getBaseFolderPath(java.lang.String userName, java.util.Locale locale, java.lang.String serverName)
          Returns PSML base folder path for specified user by running full profiler and portal site rules.
 java.util.Map getNewLoginInfo(java.lang.String guid)
           
 java.lang.String getPortalURL(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.lang.String path)
          Provide a common way to get portal URLs Necessary for generating return URLs for features such as forgotten password.
 java.lang.String getUserFolderPath(java.lang.String userName, java.util.Locale locale, java.lang.String serverName)
          Returns PSML user folder path for specified user by running full profiler and portal site rules.
 boolean isAdminUser(javax.portlet.PortletRequest request)
          Returns true if the current request user principal's name is the name of the portal admin user.
 boolean isUserInAdminRole(javax.portlet.PortletRequest request)
          Returns true if the current request user principal is in the portal admin role.
 User lookupUserFromEmail(java.lang.String email)
          Lookup a user given an email address
 void putNewLoginInfo(java.lang.String guid, java.util.Map info)
           
 void registerUser(java.lang.String userName, java.lang.String password)
          Register a new user using all default values
 void registerUser(java.lang.String userName, java.lang.String password, java.util.List roles, java.util.List groups, java.util.Map userInfo, java.util.Map rules, java.lang.String template)
           
 void registerUser(java.lang.String userName, java.lang.String password, java.util.List roles, java.util.List groups, java.util.Map userInfo, java.util.Map rules, java.lang.String template, java.lang.String subsiteFolder)
           
 void registerUser(java.lang.String userName, java.lang.String password, java.util.List roles, java.util.List groups, java.util.Map userInfo, java.util.Map rules, java.lang.String folderTemplate, java.lang.String subsite, java.util.Locale locale, java.lang.String serverName)
          Registers and creates a new user, assigning userInfo, roles, groups, profiling rules and a folder template.
 void removeNewLoginInfo(java.lang.String guid)
           
 void sendEmail(javax.portlet.PortletConfig portletConfig, java.lang.String emailAddress, java.lang.String localizedSubject, java.lang.String templatePath, java.util.Map userAttributes)
          Helper to send an email to a recipient
 void sendEmail(java.lang.String from, java.lang.String subject, java.lang.String to, java.lang.String text)
          Helper to send an email to a recipient without the portal default sender, and without mail merge
 

Method Detail

registerUser

void registerUser(java.lang.String userName,
                  java.lang.String password,
                  java.util.List roles,
                  java.util.List groups,
                  java.util.Map userInfo,
                  java.util.Map rules,
                  java.lang.String folderTemplate,
                  java.lang.String subsite,
                  java.util.Locale locale,
                  java.lang.String serverName)
                  throws RegistrationException
Registers and creates a new user, assigning userInfo, roles, groups, profiling rules and a folder template. If any values are null, defaults are used from the system wide configuration.

Parameters:
userName - Unique user principal identifier
password - Password for this user
roles - A list of roles to assign to this user
groups - A list of groups to assign to this user
userInfo - Portlet API User Information Attributes name value pairs (PLT.D)
rules - A map of name value pairs of profiling rules. Well known rules names are 'page' and 'menu'
folderTemplate - The full PSML path name of a folder to be deep copied as the new user's set of folders, pages, links
subsite - The subsite folder to place the new user in
locale - Optional locale used to compute new user folder path if subsite not specified
serverName - Server name used to compute new user folder path if subsite not specified
Throws:
RegistrationException
Since:
2.1.2

registerUser

void registerUser(java.lang.String userName,
                  java.lang.String password,
                  java.util.List roles,
                  java.util.List groups,
                  java.util.Map userInfo,
                  java.util.Map rules,
                  java.lang.String template,
                  java.lang.String subsiteFolder)
                  throws RegistrationException
Throws:
RegistrationException

registerUser

void registerUser(java.lang.String userName,
                  java.lang.String password,
                  java.util.List roles,
                  java.util.List groups,
                  java.util.Map userInfo,
                  java.util.Map rules,
                  java.lang.String template)
                  throws RegistrationException
Throws:
RegistrationException

registerUser

void registerUser(java.lang.String userName,
                  java.lang.String password)
                  throws RegistrationException
Register a new user using all default values

Parameters:
userName -
password -
Throws:
RegistrationException

generatePassword

java.lang.String generatePassword()
Generate a unique password

Returns:
unique password

sendEmail

void sendEmail(javax.portlet.PortletConfig portletConfig,
               java.lang.String emailAddress,
               java.lang.String localizedSubject,
               java.lang.String templatePath,
               java.util.Map userAttributes)
               throws AdministrationEmailException
Helper to send an email to a recipient

Parameters:
recipient - the email address of the recipient
localizedSubject - the subject of the email as a localized string
message - the email message content
Throws:
AdministrationEmailException

sendEmail

void sendEmail(java.lang.String from,
               java.lang.String subject,
               java.lang.String to,
               java.lang.String text)
               throws AdministrationEmailException
Helper to send an email to a recipient without the portal default sender, and without mail merge

Parameters:
from - the email address of the sender
subject - the subject of the email
to - the recipient email address
text - the message text
Throws:
AdministrationEmailException

lookupUserFromEmail

User lookupUserFromEmail(java.lang.String email)
                         throws AdministrationEmailException
Lookup a user given an email address

Parameters:
email - Given email address
Returns:
a Jetspeed User, or throw exception if not found
Throws:
AdministrationEmailException

getPortalURL

java.lang.String getPortalURL(javax.portlet.PortletRequest request,
                              javax.portlet.PortletResponse response,
                              java.lang.String path)
Provide a common way to get portal URLs Necessary for generating return URLs for features such as forgotten password. The URL generated will be a combination of the Jetspeed base URL plus the path parameter appended Example: base URL = http://www.apache.org/jetspeed/portal path = /system/forgotten-password.psml Returns: http://www.apache.org/jetspeed/portal/system/forgotten-password.psml

Parameters:
request - The portlet request.
response - The portlet response, used to encode the path
path - The relative path to a portal resource
Returns:
the base Jetspeed portal URL plus the appended path parameter

getNewLoginInfo

java.util.Map getNewLoginInfo(java.lang.String guid)
Parameters:
guid - The ID which is passed throughte URL to the user
Returns:

putNewLoginInfo

void putNewLoginInfo(java.lang.String guid,
                     java.util.Map info)
Parameters:
guid - the ID which is passed through the URL to the user..
info - a Map, info from which will be used to reset the password the password in this case is NOT encrypted, but this should probably change if this information is stored on disk... ie a database

removeNewLoginInfo

void removeNewLoginInfo(java.lang.String guid)
Parameters:
guid - the ID which will be removed from the storage when the info is no longer valid

isAdminUser

boolean isAdminUser(javax.portlet.PortletRequest request)
Returns true if the current request user principal's name is the name of the portal admin user.

Parameters:
request -
Returns:

isUserInAdminRole

boolean isUserInAdminRole(javax.portlet.PortletRequest request)
Returns true if the current request user principal is in the portal admin role.

Parameters:
request -
Returns:

getUserFolderPath

java.lang.String getUserFolderPath(java.lang.String userName,
                                   java.util.Locale locale,
                                   java.lang.String serverName)
Returns PSML user folder path for specified user by running full profiler and portal site rules.

Parameters:
userName - existing portal user name
locale - optional locale, (defaults to system locale, for language profiling rules)
serverName - server name, (required for subsite profiling rules)
Returns:
PSML user folder path

getBaseFolderPath

java.lang.String getBaseFolderPath(java.lang.String userName,
                                   java.util.Locale locale,
                                   java.lang.String serverName)
Returns PSML base folder path for specified user by running full profiler and portal site rules.

Parameters:
userName - existing portal user name
locale - optional locale, (defaults to system locale, for language profiling rules)
serverName - server name, (required for subsite profiling rules)
Returns:
PSML base folder path


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.