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
 String generatePassword()
          Generate a unique password
 Map getNewLoginInfo(String guid)
           
 String getPortalURL(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, String path)
          Provide a common way to get portal URLs Necessary for generating return URLs for features such as forgotten password.
 User lookupUserFromEmail(String email)
          Lookup a user given an email address
 void putNewLoginInfo(String guid, Map info)
           
 void registerUser(String userName, String password)
          Register a new user using all default values
 void registerUser(String userName, String password, List roles, List groups, Map userInfo, Map rules, String template)
           
 void registerUser(String userName, String password, List roles, List groups, Map userInfo, Map rules, String template, String subsiteFolder)
          Registers and creates a new user, assigning userInfo, roles, groups, profiling rules and a folder template.
 void removeNewLoginInfo(String guid)
           
 void sendEmail(javax.portlet.PortletConfig portletConfig, String emailAddress, String localizedSubject, String templatePath, Map userAttributes)
          Helper to send an email to a recipient
 void sendEmail(String from, String subject, String to, String text)
          Helper to send an email to a recipient without the portal default sender, and without mail merge
 

Method Detail

registerUser

void registerUser(String userName,
                  String password,
                  List roles,
                  List groups,
                  Map userInfo,
                  Map rules,
                  String template,
                  String subsiteFolder)
                  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
Throws:
RegistrationException
Since:
2.1.2

registerUser

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

registerUser

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

Parameters:
userName -
password -
Throws:
RegistrationException

generatePassword

String generatePassword()
Generate a unique password

Returns:
unique password

sendEmail

void sendEmail(javax.portlet.PortletConfig portletConfig,
               String emailAddress,
               String localizedSubject,
               String templatePath,
               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(String from,
               String subject,
               String to,
               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(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

String getPortalURL(javax.portlet.PortletRequest request,
                    javax.portlet.PortletResponse response,
                    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

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

putNewLoginInfo

void putNewLoginInfo(String guid,
                     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(String guid)
Parameters:
guid - the ID which will be removed from the storage when the info is no longer valid


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.