com.arsdigita.ui.permissions
Class PermissionsPane

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.ui.permissions.PermissionsPane
All Implemented Interfaces:
ActionListener, Cloneable, Component, Container, EventListener, Lockable, com.arsdigita.ui.permissions.PermissionsConstants, Resettable

public class PermissionsPane
extends SimpleContainer
implements Resettable, ActionListener, com.arsdigita.ui.permissions.PermissionsConstants

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. This component attaches a UserAuthenticationListener to restrict access to users who are logged in.

Version:
$Id: //core-platform/dev/src/com/arsdigita/ui/permissions/PermissionsPane.java#17 $

Field Summary
static String BUNDLE_NAME
           
static PrivilegeDescriptor[] DEFAULT_PRIVILEGES
          These are our five default privileges.
static int DIRECT
           
static String DIRECT_PERMISSIONS
           
static String INDIRECT_PERMISSIONS
           
static int INHERITED
           
static GlobalizedMessage MAIN_SITE
           
static GlobalizedMessage NO_RESULTS
           
static String OBJECT_ID
           
static GlobalizedMessage PAGE_DENIED_TITLE
           
static GlobalizedMessage PAGE_GRANT_LEFT
           
static GlobalizedMessage PAGE_GRANT_RIGHT
           
static GlobalizedMessage PAGE_GRANT_TITLE
           
static GlobalizedMessage PAGE_OBJECT_INDEX
           
static GlobalizedMessage PAGE_OBJECT_NONE
           
static GlobalizedMessage PAGE_OBJECT_PANEL_TITLE
           
static GlobalizedMessage PAGE_TITLE
           
static GlobalizedMessage PERM_TABLE_ACTIONS
           
static GlobalizedMessage PERM_TABLE_DIRECT_EXPLANATION
           
static GlobalizedMessage PERM_TABLE_DIRECT_HEADING
           
static GlobalizedMessage PERM_TABLE_GRANTEE
           
static GlobalizedMessage PERM_TABLE_INDIRECT_CONTEXT
           
static GlobalizedMessage PERM_TABLE_INDIRECT_EXPLANATION
           
static GlobalizedMessage PERM_TABLE_INDIRECT_HEADING
           
static GlobalizedMessage PERM_TABLE_INHERITED
           
static GlobalizedMessage PERM_TABLE_NO_PARENT_CONTEXT
           
static GlobalizedMessage PERMISSIONS_INDEX
           
static GlobalizedMessage PERMISSIONS_INDEX_NAVBAR
           
static GlobalizedMessage PERSONAL_SITE
           
static String PRIV_SET
           
static GlobalizedMessage REMOVE_ALL_CONFIRM
           
static String RETRIEVE_USERS
           
static GlobalizedMessage SAVE_BUTTON
           
static GlobalizedMessage SEARCH_BUTTON
           
static 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.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
PermissionsPane()
          Default constructor creates components that show the default privileges as defined in PermissionsConstants interface
PermissionsPane(PrivilegeDescriptor[] privs)
          Creates a PermissionsPane with components showing the privileges that are passed in as argument.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action has been performed.
 SimpleComponent getContextPanel()
          Returns a bebop panel with a link to the permissions administration page of the object's direct ancestor (parent).
 SimpleContainer getDirectPermissionsPanel()
          Returns the bebop component with a table for the direct permission on the privileges defined in the constructor
 SimpleContainer getInheritedPermissionsPanel()
          Returns the bebop component with a table for the inherited permission on the privileges defined in the constructor.
 SimpleContainer getNoSearchResultPanel()
          Returns a bebop panel indicating that the user search yielded no results.
 ACSObject getObject(PageState s)
          Utility method to get the ACSObject from the page state
 SimpleContainer getPermissionGrantPanel()
          Returns a panel with a form with 2 checkbox groups, one for parties to choose, one for privileges to assign.
 SimpleContainer getPermissionsHeader()
          Returns a bebop container with the title to this object and a navigation bar, specific for the UI at /permissions/.
 String[] getPrivileges()
          Returns a string array of privilege names as defined in the constructor
 Party getRequestingUser(PageState s)
          Utility method to get the authenicated user or group
 Label getTitle()
          Returns the title "Permissions on object articles", e.g.
 SegmentedPanel getUniversalPermissionsPanel()
          This is an outstanding item.
 Form getUserSearchForm()
          Returns a bebop form for user and group search.
 void register(Page p)
          Overwrite this method to construct your default Permissions Pane with the components you need.
 void reset(PageState ps)
          Implementation of interface bebop.Resettable.
 void showAdmin(PageState s)
          Shows the administration page of permissions to one object.
 void showGrant(PageState s)
          Show the Grant privileges panel
 void showNoResults(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 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 GlobalizedMessage SEARCH_LABEL

SEARCH_BUTTON

public static final GlobalizedMessage SEARCH_BUTTON

SAVE_BUTTON

public static final GlobalizedMessage SAVE_BUTTON

NO_RESULTS

public static final GlobalizedMessage NO_RESULTS

PERM_TABLE_DIRECT_HEADING

public static final GlobalizedMessage PERM_TABLE_DIRECT_HEADING

PERM_TABLE_DIRECT_EXPLANATION

public static final GlobalizedMessage PERM_TABLE_DIRECT_EXPLANATION

PERM_TABLE_INDIRECT_HEADING

public static final GlobalizedMessage PERM_TABLE_INDIRECT_HEADING

PERM_TABLE_INDIRECT_EXPLANATION

public static final GlobalizedMessage PERM_TABLE_INDIRECT_EXPLANATION

PERM_TABLE_INDIRECT_CONTEXT

public static final GlobalizedMessage PERM_TABLE_INDIRECT_CONTEXT

PERM_TABLE_GRANTEE

public static final GlobalizedMessage PERM_TABLE_GRANTEE

PERM_TABLE_ACTIONS

public static final GlobalizedMessage PERM_TABLE_ACTIONS

REMOVE_ALL_CONFIRM

public static final GlobalizedMessage REMOVE_ALL_CONFIRM

PERM_TABLE_INHERITED

public static final GlobalizedMessage PERM_TABLE_INHERITED

PERM_TABLE_NO_PARENT_CONTEXT

public static final GlobalizedMessage PERM_TABLE_NO_PARENT_CONTEXT

PAGE_TITLE

public static final GlobalizedMessage PAGE_TITLE

MAIN_SITE

public static final GlobalizedMessage MAIN_SITE

PERSONAL_SITE

public static final GlobalizedMessage PERSONAL_SITE

PERMISSIONS_INDEX

public static final GlobalizedMessage PERMISSIONS_INDEX

PERMISSIONS_INDEX_NAVBAR

public static final GlobalizedMessage PERMISSIONS_INDEX_NAVBAR

PAGE_GRANT_TITLE

public static final GlobalizedMessage PAGE_GRANT_TITLE

PAGE_GRANT_LEFT

public static final GlobalizedMessage PAGE_GRANT_LEFT

PAGE_GRANT_RIGHT

public static final GlobalizedMessage PAGE_GRANT_RIGHT

PAGE_DENIED_TITLE

public static final GlobalizedMessage PAGE_DENIED_TITLE

PAGE_OBJECT_INDEX

public static final GlobalizedMessage PAGE_OBJECT_INDEX

PAGE_OBJECT_PANEL_TITLE

public static final GlobalizedMessage PAGE_OBJECT_PANEL_TITLE

PAGE_OBJECT_NONE

public static final 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

PermissionsPane

public PermissionsPane()
Default constructor creates components that show the default privileges as defined in PermissionsConstants interface


PermissionsPane

public PermissionsPane(PrivilegeDescriptor[] privs)
Creates a PermissionsPane with components showing the privileges that are passed in as argument.

Method Detail

register

public void register(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 Component
Overrides:
register in class SimpleComponent

reset

public void reset(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 Resettable
Parameters:
ps - the page state

getRequestingUser

public Party getRequestingUser(PageState s)
Utility method to get the authenicated user or group


getObject

public ACSObject getObject(PageState s)
Utility method to get the ACSObject from the page state


getTitle

public 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 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 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()

getUniversalPermissionsPanel

public SegmentedPanel getUniversalPermissionsPanel()
This is an outstanding item.


getUserSearchForm

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


getPermissionGrantPanel

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


getPermissionsHeader

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


getNoSearchResultPanel

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


getContextPanel

public 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(PageState s)
Shows panel with no results to user search.


showGrant

public void showGrant(PageState s)
Show the Grant privileges panel


showAdmin

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


actionPerformed

public void actionPerformed(ActionEvent e)
Description copied from interface: ActionListener
Invoked when an action has been performed.

Specified by:
actionPerformed in interface ActionListener


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