org.alfresco.web.bean.wizard
Class BaseInviteUsersWizard

java.lang.Object
  extended by org.alfresco.web.bean.dialog.BaseDialogBean
      extended by org.alfresco.web.bean.wizard.BaseWizardBean
          extended by org.alfresco.web.bean.wizard.BaseInviteUsersWizard
All Implemented Interfaces:
java.io.Serializable, IDialogBean, IWizardBean
Direct Known Subclasses:
InviteContentUsersWizard, InviteSpaceUsersWizard, InviteWebsiteUsersWizard

public abstract class BaseInviteUsersWizard
extends BaseWizardBean

Backing bean for the Invite Users wizard(s)

See Also:
Serialized Form

Nested Class Summary
static class BaseInviteUsersWizard.UserGroupRole
          Simple wrapper class to represent a user/group and a role combination
 
Field Summary
protected  boolean allowDuplicateAuthorities
          True to allow duplicate authorities (with a different role)
protected  TemplateMailHelperBean mailHelper
          Helper providing template based mailing facilities
protected  boolean maxUsersReturned
          Flag to determine if the maximum number of users have been returned
protected static java.lang.String MSG_USERROLES
          I18N message strings
protected  org.alfresco.service.cmr.security.PermissionService permissionService
          PermissionService bean reference
protected static java.lang.String STEP_NOTIFY
           
protected  java.util.List userGroupRoles
          list of user/group role wrapper objects
 
Fields inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
browseBean, isFinished, navigator, parameters
 
Constructor Summary
BaseInviteUsersWizard()
           
 
Method Summary
 void addAuthorityWithRole(java.lang.String authority, java.lang.String role)
          Add an authority with the specified role to the list managed by this wizard.
 void addSelection(javax.faces.event.ActionEvent event)
          Action handler called when the Add button is pressed to process the current selection
 java.lang.String buildLabelForGroupAuthorityRole(java.lang.String authority, java.lang.String role)
          Helper to build a label for a Group authority of the form: Groupname (role)
 java.lang.String buildLabelForUserAuthorityRole(java.lang.String authority, java.lang.String role)
          Helper to build a label of the form: Firstname Lastname (Role)
 java.lang.String cancel()
          Method handler called when the cancel button of the dialog is pressed
protected  java.lang.String finishImpl(javax.faces.context.FacesContext context, java.lang.String outcome)
          Performs the actual processing for the wizard.
protected  org.alfresco.service.cmr.security.AuthorityService getAuthorityService()
           
 java.util.List getEmailTemplates()
           
protected abstract  java.lang.String getEmailTemplateXPath()
           
 javax.faces.model.SelectItem[] getFilters()
          Property accessed by the Generic Picker component.
 boolean getFinishButtonDisabled()
          Determines whether the finish button on the dialog should be disabled
protected  java.util.Set getGroups(java.lang.String search)
           
protected  java.util.Set getGroups(java.lang.String search, boolean includeEveryone)
           
 boolean getHaveMaximumUsersBeenReturned()
           
 TemplateMailHelperBean getMailHelper()
           
 java.lang.String getMaximumUsersMsg()
           
protected  org.alfresco.service.namespace.NamespaceService getNamespaceService()
           
protected abstract  Node getNode()
           
 java.lang.String getNotify()
           
protected  org.alfresco.service.cmr.security.PermissionService getPermissionService()
           
protected abstract  java.util.Set getPermissionsForType()
           
protected  org.alfresco.service.cmr.security.PersonService getPersonService()
           
 javax.faces.model.SelectItem[] getRoles()
           
 java.lang.String getSummary()
           
 javax.faces.model.DataModel getUserRolesDataModel()
          Returns the properties for current user-roles JSF DataModel
 void init(java.util.Map parameters)
          Initialises the wizard
 java.lang.String next()
          Called when the next button is pressed by the user
 javax.faces.model.SelectItem[] pickerCallback(int filterIndex, java.lang.String contains)
          Query callback method executed by the Generic Picker component.
 void removeSelection(javax.faces.event.ActionEvent event)
          Action handler called when the Remove button is pressed to remove a user+role
 void setAuthorityService(org.alfresco.service.cmr.security.AuthorityService authorityService)
           
 void setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender)
           
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setNotify(java.lang.String notify)
           
 void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
           
 void setPersonService(org.alfresco.service.cmr.security.PersonService personService)
           
 
Methods inherited from class org.alfresco.web.bean.wizard.BaseWizardBean
back, buildSummary, getBackButtonLabel, getDefaultCancelOutcome, getDefaultFinishOutcome, getFinishButtonLabel, getNextButtonDisabled, getNextButtonLabel, getStepDescription, getStepTitle
 
Methods inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
doPostCommitProcessing, finish, formatErrorMessage, getActionsConfigId, getActionsContext, getAdditionalButtons, getCancelButtonLabel, getCheckOutCheckInService, getContainerDescription, getContainerSubTitle, getContainerTitle, getDictionaryService, getErrorMessageId, getErrorOutcome, getFileFolderService, getMoreActionsConfigId, getNodeService, getRuleService, getSearchService, getTransactionService, isFinished, restored, setBrowseBean, setDictionaryService, setFileFolderService, setNavigator, setNodeService, setSearchService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.web.bean.dialog.IDialogBean
finish, getActionsConfigId, getActionsContext, getAdditionalButtons, getCancelButtonLabel, getContainerDescription, getContainerSubTitle, getContainerTitle, getMoreActionsConfigId, isFinished, restored
 

Field Detail

MSG_USERROLES

protected static final java.lang.String MSG_USERROLES
I18N message strings

See Also:
Constant Field Values

STEP_NOTIFY

protected static final java.lang.String STEP_NOTIFY
See Also:
Constant Field Values

permissionService

protected transient org.alfresco.service.cmr.security.PermissionService permissionService
PermissionService bean reference


mailHelper

protected TemplateMailHelperBean mailHelper
Helper providing template based mailing facilities


userGroupRoles

protected java.util.List userGroupRoles
list of user/group role wrapper objects


allowDuplicateAuthorities

protected boolean allowDuplicateAuthorities
True to allow duplicate authorities (with a different role)


maxUsersReturned

protected boolean maxUsersReturned
Flag to determine if the maximum number of users have been returned

Constructor Detail

BaseInviteUsersWizard

public BaseInviteUsersWizard()
Method Detail

getPermissionsForType

protected abstract java.util.Set getPermissionsForType()
Returns:
a cached list of available permissions for the type being dealt with

getNode

protected abstract Node getNode()
Returns:
Returns the node that the permissions are being applied to

getEmailTemplates

public java.util.List getEmailTemplates()
Returns:
Returns the list of email templates for user notification

getEmailTemplateXPath

protected abstract java.lang.String getEmailTemplateXPath()

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Overrides:
setNamespaceService in class BaseDialogBean
Parameters:
namespaceService - The NamespaceService to set.

getNamespaceService

protected org.alfresco.service.namespace.NamespaceService getNamespaceService()
Overrides:
getNamespaceService in class BaseDialogBean

setMailSender

public void setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender)
Parameters:
mailSender - The JavaMailSender to set.

setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Parameters:
permissionService - The PermissionService to set.

getPermissionService

protected org.alfresco.service.cmr.security.PermissionService getPermissionService()

setPersonService

public void setPersonService(org.alfresco.service.cmr.security.PersonService personService)
Parameters:
personService - The PersonService to set.

getPersonService

protected org.alfresco.service.cmr.security.PersonService getPersonService()

setAuthorityService

public void setAuthorityService(org.alfresco.service.cmr.security.AuthorityService authorityService)
Parameters:
authorityService - The authorityService to set.

getAuthorityService

protected org.alfresco.service.cmr.security.AuthorityService getAuthorityService()

init

public void init(java.util.Map parameters)
Initialises the wizard

Specified by:
init in interface IDialogBean
Overrides:
init in class BaseDialogBean
Parameters:
parameters - Map of parameters for the dialog

finishImpl

protected java.lang.String finishImpl(javax.faces.context.FacesContext context,
                                      java.lang.String outcome)
                               throws java.lang.Exception
Description copied from class: BaseDialogBean
Performs the actual processing for the wizard. NOTE: This method is called within the context of a transaction so no transaction handling is required

Specified by:
finishImpl in class BaseDialogBean
Parameters:
context - FacesContext
outcome - The default outcome
Returns:
The outcome
Throws:
java.lang.Exception
See Also:
BaseDialogBean.finishImpl(javax.faces.context.FacesContext, java.lang.String)

cancel

public java.lang.String cancel()
Description copied from interface: IDialogBean
Method handler called when the cancel button of the dialog is pressed

Specified by:
cancel in interface IDialogBean
Overrides:
cancel in class BaseDialogBean
Returns:
The outcome to return

getFinishButtonDisabled

public boolean getFinishButtonDisabled()
Description copied from interface: IDialogBean
Determines whether the finish button on the dialog should be disabled

Specified by:
getFinishButtonDisabled in interface IDialogBean
Overrides:
getFinishButtonDisabled in class BaseDialogBean
Returns:
true if the button should be disabled
See Also:
BaseDialogBean.getFinishButtonDisabled()

getUserRolesDataModel

public javax.faces.model.DataModel getUserRolesDataModel()
Returns the properties for current user-roles JSF DataModel

Returns:
JSF DataModel representing the current user-roles

pickerCallback

public javax.faces.model.SelectItem[] pickerCallback(int filterIndex,
                                                     java.lang.String contains)
Query callback method executed by the Generic Picker component. This method is part of the contract to the Generic Picker, it is up to the backing bean to execute whatever query is appropriate and return the results.

Parameters:
filterIndex - Index of the filter drop-down selection
contains - Text from the contains textbox
Returns:
An array of SelectItem objects containing the results to display in the picker.

getGroups

protected java.util.Set getGroups(java.lang.String search)

getGroups

protected java.util.Set getGroups(java.lang.String search,
                                  boolean includeEveryone)

addSelection

public void addSelection(javax.faces.event.ActionEvent event)
Action handler called when the Add button is pressed to process the current selection


addAuthorityWithRole

public void addAuthorityWithRole(java.lang.String authority,
                                 java.lang.String role)
Add an authority with the specified role to the list managed by this wizard.

Parameters:
authority - Authority to add (cannot be null)
role - Role for the authorities (cannot be null)

removeSelection

public void removeSelection(javax.faces.event.ActionEvent event)
Action handler called when the Remove button is pressed to remove a user+role


getFilters

public javax.faces.model.SelectItem[] getFilters()
Property accessed by the Generic Picker component.

Returns:
the array of filter options to show in the users/groups picker

getRoles

public javax.faces.model.SelectItem[] getRoles()
Returns:
The list of available roles for the users/groups

getNotify

public java.lang.String getNotify()
Returns:
Returns the notify listbox selection.

setNotify

public void setNotify(java.lang.String notify)
Parameters:
notify - The notify listbox selection to set.

next

public java.lang.String next()
Description copied from interface: IWizardBean
Called when the next button is pressed by the user

Specified by:
next in interface IWizardBean
Overrides:
next in class BaseWizardBean
Returns:
Reserved for future use

getMailHelper

public TemplateMailHelperBean getMailHelper()
Returns:
TemplateMailHelperBean instance for this wizard

buildLabelForUserAuthorityRole

public java.lang.String buildLabelForUserAuthorityRole(java.lang.String authority,
                                                       java.lang.String role)
Helper to build a label of the form: Firstname Lastname (Role)


buildLabelForGroupAuthorityRole

public java.lang.String buildLabelForGroupAuthorityRole(java.lang.String authority,
                                                        java.lang.String role)
Helper to build a label for a Group authority of the form: Groupname (role)


getSummary

public java.lang.String getSummary()
Returns:
summary text for the wizard

getHaveMaximumUsersBeenReturned

public boolean getHaveMaximumUsersBeenReturned()
Returns:
flag to indicate whether maximum users have been returned

getMaximumUsersMsg

public java.lang.String getMaximumUsersMsg()
Returns:
Message to display when the maximum number of users have been returned


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.