com.arsdigita.cms.ui.permissions
Class CMSPermissionsPane

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.SimpleContainer
                      extended bycom.arsdigita.cms.ui.permissions.CMSPermissionsPane
All Implemented Interfaces:
com.arsdigita.bebop.event.ActionListener, Cloneable, com.arsdigita.cms.ui.permissions.CMSPermissionsConstants, com.arsdigita.bebop.Component, com.arsdigita.bebop.Container, EventListener, com.arsdigita.util.Lockable, com.arsdigita.bebop.event.RequestListener, com.arsdigita.bebop.Resettable

public class CMSPermissionsPane
extends com.arsdigita.bebop.SimpleContainer
implements com.arsdigita.bebop.Resettable, com.arsdigita.bebop.event.ActionListener, com.arsdigita.bebop.event.RequestListener, com.arsdigita.cms.ui.permissions.CMSPermissionsConstants

A pane used to administer the permissions of one ACSObject. This is a reusable component that can be embedded into a page to provide a generic UI. The page must have the "?po_id=" parameter to supply to ACSObject id of the item one is managing permissions for.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/ui/permissions/CMSPermissionsPane.java#14 $
Author:
sdeusch@arsdigita.com

Field Summary
static String BUNDLE_NAME
           
static com.arsdigita.kernel.permissions.PrivilegeDescriptor[] DEFAULT_PRIVILEGES
          These are our five default privileges.
static int DIRECT
           
static String DIRECT_PERMISSIONS
           
static String INDIRECT_PERMISSIONS
           
static int INHERITED
           
static com.arsdigita.globalization.GlobalizedMessage MAIN_SITE
           
static com.arsdigita.globalization.GlobalizedMessage NO_RESULTS
           
static String OBJECT_ID
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_DENIED_TITLE
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_LEFT
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_RIGHT
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_TITLE
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_INDEX
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_NONE
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_PANEL_TITLE
           
static com.arsdigita.globalization.GlobalizedMessage PAGE_TITLE
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_ACTIONS
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_DIRECT_EXPLANATION
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_DIRECT_HEADING
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_GRANTEE
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_CONTEXT
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_EXPLANATION
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_HEADING
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INHERITED
           
static com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_NO_PARENT_CONTEXT
           
static com.arsdigita.globalization.GlobalizedMessage PERMISSIONS_INDEX
           
static com.arsdigita.globalization.GlobalizedMessage PERMISSIONS_INDEX_NAVBAR
           
static com.arsdigita.globalization.GlobalizedMessage PERSONAL_SITE
           
static String PRIV_SET
           
static com.arsdigita.globalization.GlobalizedMessage REMOVE_ALL_CONFIRM
           
static String RETRIEVE_USERS
           
static com.arsdigita.globalization.GlobalizedMessage SAVE_BUTTON
           
static com.arsdigita.globalization.GlobalizedMessage SEARCH_BUTTON
           
static com.arsdigita.globalization.GlobalizedMessage SEARCH_LABEL
           
static String SEARCH_QUERY
           
 
Fields inherited from class com.arsdigita.bebop.SimpleContainer
versionId
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Resettable
versionId
 
Fields inherited from interface com.arsdigita.bebop.event.ActionListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.event.RequestListener
versionId
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
CMSPermissionsPane(com.arsdigita.kernel.ui.ACSObjectSelectionModel model)
          Default constructor creates components that show the default privileges as defined in PermissionsConstants interface
CMSPermissionsPane(com.arsdigita.kernel.permissions.PrivilegeDescriptor[] privs, Map privNameMap, com.arsdigita.kernel.ui.ACSObjectSelectionModel model)
          Creates a PermissionsPane with components showing the privileges that are passed in as argument.
 
Method Summary
 void actionPerformed(com.arsdigita.bebop.event.ActionEvent e)
           
 com.arsdigita.bebop.SimpleContainer getAdminListingPanel()
           
 com.arsdigita.bebop.SimpleComponent getContextPanel()
          Returns a bebop panel with a link to the permissions administration page of the object's direct ancestor (parent).
 com.arsdigita.bebop.SimpleContainer getDirectPermissionsPanel()
          Returns the bebop component with a table for the direct permission on the privileges defined in the constructor
 com.arsdigita.bebop.SimpleContainer getInheritedPermissionsPanel()
          Returns the bebop component with a table for the inherited permission on the privileges defined in the constructor.
 com.arsdigita.bebop.SimpleContainer getNoSearchResultPanel()
          Returns a bebop panel indicating that the user search yielded no results.
 com.arsdigita.kernel.ACSObject getObject(com.arsdigita.bebop.PageState s)
          Utility method to get the ACSObject from the page state
 com.arsdigita.bebop.SimpleContainer getPermissionGrantPanel()
          Returns a panel with a form with 2 checkbox groups, one for parties to choose, one for privileges to assign.
 com.arsdigita.bebop.SimpleContainer getPermissionsHeader()
          Returns a bebop container with the title to this object and a navigation bar, specific for the UI at /permissions/.
 String getPrivilegeName(String privilege)
           
 String[] getPrivileges()
          Returns a string array of privilege names as defined in the constructor
 com.arsdigita.kernel.Party getRequestingUser(com.arsdigita.bebop.PageState s)
          Utility method to get the authenicated user or group
 com.arsdigita.bebop.Label getTitle()
          Returns the title "Permissions on object articles", e.g.
 com.arsdigita.bebop.SegmentedPanel getUniversalPermissionsPanel()
          This is an outstanding item.
 com.arsdigita.bebop.Form getUserSearchForm()
          Returns a bebop form for user and group search.
 void pageRequested(com.arsdigita.bebop.event.RequestEvent e)
           
 void register(com.arsdigita.bebop.Page p)
          Overwrite this method to construct your default Permissions Pane with the components you need.
 void reset(com.arsdigita.bebop.PageState ps)
          Implementation of interface bebop.Resettable.
 void showAdmin(com.arsdigita.bebop.PageState s)
          Shows the administration page of permissions to one object.
 void showCustom(com.arsdigita.bebop.PageState state, boolean custom)
           
 void showGrant(com.arsdigita.bebop.PageState s)
          Show the Grant privileges panel
 void showNoResults(com.arsdigita.bebop.PageState s)
          Shows panel with no results to user search.
 
Methods inherited from class com.arsdigita.bebop.SimpleContainer
add, add, children, contains, generateChildrenXML, generateParent, generateXML, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked, lock
 

Field Detail

DEFAULT_PRIVILEGES

public static final com.arsdigita.kernel.permissions.PrivilegeDescriptor[] DEFAULT_PRIVILEGES
These are our five default privileges.


BUNDLE_NAME

public static final String BUNDLE_NAME
See Also:
Constant Field Values

SEARCH_LABEL

public static final com.arsdigita.globalization.GlobalizedMessage SEARCH_LABEL

SEARCH_BUTTON

public static final com.arsdigita.globalization.GlobalizedMessage SEARCH_BUTTON

SAVE_BUTTON

public static final com.arsdigita.globalization.GlobalizedMessage SAVE_BUTTON

NO_RESULTS

public static final com.arsdigita.globalization.GlobalizedMessage NO_RESULTS

PERM_TABLE_DIRECT_HEADING

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_DIRECT_HEADING

PERM_TABLE_DIRECT_EXPLANATION

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_DIRECT_EXPLANATION

PERM_TABLE_INDIRECT_HEADING

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_HEADING

PERM_TABLE_INDIRECT_EXPLANATION

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_EXPLANATION

PERM_TABLE_INDIRECT_CONTEXT

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INDIRECT_CONTEXT

PERM_TABLE_GRANTEE

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_GRANTEE

PERM_TABLE_ACTIONS

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_ACTIONS

REMOVE_ALL_CONFIRM

public static final com.arsdigita.globalization.GlobalizedMessage REMOVE_ALL_CONFIRM

PERM_TABLE_INHERITED

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_INHERITED

PERM_TABLE_NO_PARENT_CONTEXT

public static final com.arsdigita.globalization.GlobalizedMessage PERM_TABLE_NO_PARENT_CONTEXT

PAGE_TITLE

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_TITLE

MAIN_SITE

public static final com.arsdigita.globalization.GlobalizedMessage MAIN_SITE

PERSONAL_SITE

public static final com.arsdigita.globalization.GlobalizedMessage PERSONAL_SITE

PERMISSIONS_INDEX

public static final com.arsdigita.globalization.GlobalizedMessage PERMISSIONS_INDEX

PERMISSIONS_INDEX_NAVBAR

public static final com.arsdigita.globalization.GlobalizedMessage PERMISSIONS_INDEX_NAVBAR

PAGE_GRANT_TITLE

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_TITLE

PAGE_GRANT_LEFT

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_LEFT

PAGE_GRANT_RIGHT

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_GRANT_RIGHT

PAGE_DENIED_TITLE

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_DENIED_TITLE

PAGE_OBJECT_INDEX

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_INDEX

PAGE_OBJECT_PANEL_TITLE

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_PANEL_TITLE

PAGE_OBJECT_NONE

public static final com.arsdigita.globalization.GlobalizedMessage PAGE_OBJECT_NONE

DIRECT

public static final int DIRECT
See Also:
Constant Field Values

INHERITED

public static final int INHERITED
See Also:
Constant Field Values

OBJECT_ID

public static final String OBJECT_ID
See Also:
Constant Field Values

DIRECT_PERMISSIONS

public static final String DIRECT_PERMISSIONS
See Also:
Constant Field Values

INDIRECT_PERMISSIONS

public static final String INDIRECT_PERMISSIONS
See Also:
Constant Field Values

SEARCH_QUERY

public static final String SEARCH_QUERY
See Also:
Constant Field Values

PRIV_SET

public static final String PRIV_SET
See Also:
Constant Field Values

RETRIEVE_USERS

public static final String RETRIEVE_USERS
See Also:
Constant Field Values
Constructor Detail

CMSPermissionsPane

public CMSPermissionsPane(com.arsdigita.kernel.ui.ACSObjectSelectionModel model)
Default constructor creates components that show the default privileges as defined in PermissionsConstants interface


CMSPermissionsPane

public CMSPermissionsPane(com.arsdigita.kernel.permissions.PrivilegeDescriptor[] privs,
                          Map privNameMap,
                          com.arsdigita.kernel.ui.ACSObjectSelectionModel model)
Creates a PermissionsPane with components showing the privileges that are passed in as argument.

Method Detail

register

public void register(com.arsdigita.bebop.Page p)
Overwrite this method to construct your default Permissions Pane with the components you need. You can subclass anonymously overwriting just the register method. Note: the getXXX methods are lazy instantiators, i.e. they produce the components only if not already there. (You can even overwrite the getXXX components with your own implementation, e.g., if you want to show a List instead of a Table for the direct permissions, but still use a Table for the inherited permissions.

Specified by:
register in interface com.arsdigita.bebop.Component

reset

public void reset(com.arsdigita.bebop.PageState ps)
Implementation of interface bebop.Resettable. Use reset to reset permissions component to initial state, e.g. if you embed it into another container.

Specified by:
reset in interface com.arsdigita.bebop.Resettable

getRequestingUser

public com.arsdigita.kernel.Party getRequestingUser(com.arsdigita.bebop.PageState s)
Utility method to get the authenicated user or group


getObject

public com.arsdigita.kernel.ACSObject getObject(com.arsdigita.bebop.PageState s)
Utility method to get the ACSObject from the page state


getTitle

public com.arsdigita.bebop.Label getTitle()
Returns the title "Permissions on object articles", e.g.


getPrivileges

public String[] getPrivileges()
Returns a string array of privilege names as defined in the constructor


getDirectPermissionsPanel

public com.arsdigita.bebop.SimpleContainer getDirectPermissionsPanel()
Returns the bebop component with a table for the direct permission on the privileges defined in the constructor

See Also:
getInheritedPermissionsPanel()

getInheritedPermissionsPanel

public com.arsdigita.bebop.SimpleContainer getInheritedPermissionsPanel()
Returns the bebop component with a table for the inherited permission on the privileges defined in the constructor. The table is non-editable.

See Also:
getDirectPermissionsPanel()

getAdminListingPanel

public com.arsdigita.bebop.SimpleContainer getAdminListingPanel()

getUniversalPermissionsPanel

public com.arsdigita.bebop.SegmentedPanel getUniversalPermissionsPanel()
This is an outstanding item.


getUserSearchForm

public com.arsdigita.bebop.Form getUserSearchForm()
Returns a bebop form for user and group search.


getPermissionGrantPanel

public com.arsdigita.bebop.SimpleContainer getPermissionGrantPanel()
Returns a panel with a form with 2 checkbox groups, one for parties to choose, one for privileges to assign.


getPermissionsHeader

public com.arsdigita.bebop.SimpleContainer getPermissionsHeader()
Returns a bebop container with the title to this object and a navigation bar, specific for the UI at /permissions/.


getNoSearchResultPanel

public com.arsdigita.bebop.SimpleContainer getNoSearchResultPanel()
Returns a bebop panel indicating that the user search yielded no results. It is customized in the xsl stylesheet.


getContextPanel

public com.arsdigita.bebop.SimpleComponent getContextPanel()
Returns a bebop panel with a link to the permissions administration page of the object's direct ancestor (parent).


showNoResults

public void showNoResults(com.arsdigita.bebop.PageState s)
Shows panel with no results to user search.


showGrant

public void showGrant(com.arsdigita.bebop.PageState s)
Show the Grant privileges panel


showAdmin

public void showAdmin(com.arsdigita.bebop.PageState s)
Shows the administration page of permissions to one object.


actionPerformed

public void actionPerformed(com.arsdigita.bebop.event.ActionEvent e)
Specified by:
actionPerformed in interface com.arsdigita.bebop.event.ActionListener

showCustom

public void showCustom(com.arsdigita.bebop.PageState state,
                       boolean custom)

getPrivilegeName

public String getPrivilegeName(String privilege)

pageRequested

public void pageRequested(com.arsdigita.bebop.event.RequestEvent e)
Specified by:
pageRequested in interface com.arsdigita.bebop.event.RequestListener


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC