org.alfresco.web.bean.wcm
Class SetPermissionsDialog

java.lang.Object
  extended by org.alfresco.web.bean.dialog.BaseDialogBean
      extended by org.alfresco.web.bean.wcm.BasePermissionsDialog
          extended by org.alfresco.web.bean.wcm.UpdatePermissionsDialog
              extended by org.alfresco.web.bean.wcm.SetPermissionsDialog
All Implemented Interfaces:
java.io.Serializable, IDialogBean

public class SetPermissionsDialog
extends UpdatePermissionsDialog

Class for SetPermissions dialog

See Also:
Serialized Form

Nested Class Summary
static class SetPermissionsDialog.UserGroupPerm
          Simple wrapper class to represent a user/group and a permission combination
 
Field Summary
 
Fields inherited from class org.alfresco.web.bean.wcm.BasePermissionsDialog
permissionService
 
Fields inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
browseBean, isFinished, navigator, parameters
 
Constructor Summary
SetPermissionsDialog()
           
 
Method Summary
 void addAuthorityWithPerm(java.lang.String authority, java.lang.String permsission)
          Add an authority with the specified permission to the list .
 void addSelection(javax.faces.event.ActionEvent event)
          Action handler called when the Add button is pressed to process the current selection
 java.lang.String buildLabelForGroupAuthorityPerm(java.lang.String authority, java.lang.String role)
          Helper to build a label for a Group authority of the form: Groupname (permission)
 java.lang.String buildLabelForUserAuthorityPerm(java.lang.String authority, java.lang.String role)
          Helper to build a label of the form: Firstname Lastname (permission)
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()
          Getter for authorityService
 java.lang.String getContainerTitle()
          Returns the title to be used for the dialog
 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
 javax.faces.model.SelectItem[] getPermissions()
           
protected  org.alfresco.service.cmr.security.PersonService getPersonService()
          Getter for personService
 javax.faces.model.DataModel getUserPermsDataModel()
          Returns the properties for current user-roles JSF DataModel
 void init(java.util.Map parameters)
          Initialises the dialog bean
 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+permission
 void setAuthorityService(org.alfresco.service.cmr.security.AuthorityService authorityService)
           
 void setPersonService(org.alfresco.service.cmr.security.PersonService personService)
           
 
Methods inherited from class org.alfresco.web.bean.wcm.UpdatePermissionsDialog
createLock, getActiveNode, getAuthenticationService, getAvmLockingService, setActiveNode, setAuthenticationService, setAvmLockingService
 
Methods inherited from class org.alfresco.web.bean.wcm.BasePermissionsDialog
getAvmBrowseBean, getPermissionService, setAvmBrowseBean, setPermissionService
 
Methods inherited from class org.alfresco.web.bean.dialog.BaseDialogBean
cancel, doPostCommitProcessing, finish, formatErrorMessage, getActionsConfigId, getActionsContext, getAdditionalButtons, getCancelButtonLabel, getCheckOutCheckInService, getContainerDescription, getContainerSubTitle, getDefaultCancelOutcome, getDefaultFinishOutcome, getDictionaryService, getErrorMessageId, getErrorOutcome, getFileFolderService, getFinishButtonLabel, getMoreActionsConfigId, getNamespaceService, getNodeService, getRuleService, getSearchService, getTransactionService, isFinished, restored, setBrowseBean, setDictionaryService, setFileFolderService, setNamespaceService, setNavigator, setNodeService, setSearchService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetPermissionsDialog

public SetPermissionsDialog()
Method Detail

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()
Getter for authorityService

Returns:
authorityService

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()
Getter for personService

Returns:
personService

init

public void init(java.util.Map parameters)
Description copied from interface: IDialogBean
Initialises the dialog bean

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

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

getContainerTitle

public java.lang.String getContainerTitle()
Description copied from interface: IDialogBean
Returns the title to be used for the dialog

If this returns null the DialogManager will lookup the title via the dialog configuration

Specified by:
getContainerTitle in interface IDialogBean
Overrides:
getContainerTitle in class BaseDialogBean
Returns:
The title or null if the title is to be acquired via configuration

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

Overrides:
finishImpl in class BasePermissionsDialog
Parameters:
context - FacesContext
outcome - The default outcome
Returns:
The outcome
Throws:
java.lang.Exception

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

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.

addSelection

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


addAuthorityWithPerm

public void addAuthorityWithPerm(java.lang.String authority,
                                 java.lang.String permsission)
Add an authority with the specified permission to the list .

Parameters:
authority - Authority to add (cannot be null)
permsission - Permission 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+permission


getUserPermsDataModel

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

Returns:
JSF DataModel representing the current user-permission

buildLabelForUserAuthorityPerm

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


buildLabelForGroupAuthorityPerm

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


getPermissions

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


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