|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.SimpleContainer
com.arsdigita.bebop.PropertyEditor
com.arsdigita.cms.ui.SecurityPropertyEditor
Extends PropertyEditor
to provide
access control features. Each link may be associated with a ComponentAccess
object; if the current
does not have sufficient privileges, the link will be hidden.
The simple use pattern for this component is as follows:
SecurityPropertyEditor editor = new SecurityPropertyEditor(); editor.setDisplayComponent(new FooComponent()); NameEditForm n = new NameEditForm(); ComponentAccess ca1 = new ComponentAccess(n); ca1.addAccessCheck(WORKFLOW_ADMIN); ca1.addAccessCheck(CATEGORY_ADMIN); editor.add("name", "Edit Name", ca, n.getCancelButton()); AddressEditForm a = new AddressEditForm(); ComponentAccess ca2 = new ComponentAccess(a); editor.add("address", "Edit Address", ca2, a.getCancelButton());
Nested Class Summary | |
protected static class |
SecurityPropertyEditor.AccessListModel
Performs access checks for each property; skips the properties that the user is not allowed to access |
protected static class |
SecurityPropertyEditor.AccessListModelBuilder
Returns an SecurityPropertyEditor.AccessListModel during each
request |
Nested classes inherited from class com.arsdigita.bebop.PropertyEditor |
com.arsdigita.bebop.PropertyEditor.DefaultModel, com.arsdigita.bebop.PropertyEditor.DefaultModelBuilder, com.arsdigita.bebop.PropertyEditor.IdentityCellRenderer |
Field Summary | |
static String |
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.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Constructor Summary | |
SecurityPropertyEditor()
Construct a new, empty PropertyEditor . |
|
SecurityPropertyEditor(com.arsdigita.bebop.Component display)
Construct a new, PropertyEditor with the given
display component |
Method Summary | |
void |
add(String key,
String label,
com.arsdigita.toolbox.ui.ComponentAccess ca)
Add a form to the set of forms which could be used to edit the properties. |
void |
add(String key,
String label,
com.arsdigita.toolbox.ui.ComponentAccess ca,
com.arsdigita.bebop.form.Submit cancelButton)
Add a form to the set of forms which could be used to edit the properties |
void |
addComponent(String key,
com.arsdigita.toolbox.ui.ComponentAccess ca)
Add a component to the property editor. |
void |
addComponent(String key,
String label,
com.arsdigita.toolbox.ui.ComponentAccess ca)
Add a component to the list of links. |
void |
addListeners(com.arsdigita.bebop.FormSection form,
com.arsdigita.bebop.form.Submit cancelButton)
Add all required listeners to the form to ensure that if the form is submitted successfully or cancelled, the display pane will be shown. |
void |
addSecurityListener(com.arsdigita.bebop.FormSection form)
Add a submission listener to the form that will hide all components and show the display pane. |
protected Map |
getAccessMap()
Return the map of keys to access checks |
void |
setComponentAccess(String key,
com.arsdigita.toolbox.ui.ComponentAccess access)
Specify a new ComponentAccess for a component which has already
been added to the SecurityPropertyEditor . |
Methods inherited from class com.arsdigita.bebop.PropertyEditor |
add, add, add, add, addCancelListener, addComponent, addComponent, addProcessListener, addVisibilityListener, getComponent, getDisplayComponent, getDisplayPane, getLabelsMap, getList, getModel, getModelBuilder, getSelectedComponentKey, lock, register, setDisplayComponent, setModelBuilder, showComponent, showDisplayPane |
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, 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 |
Field Detail |
public static final String versionId
Constructor Detail |
public SecurityPropertyEditor()
PropertyEditor
. The PropertyEditor.setDisplayComponent(Component)
method must be called before this
component is locked.
public SecurityPropertyEditor(com.arsdigita.bebop.Component display)
PropertyEditor
with the given
display component
display
- The display componentMethod Detail |
public void addComponent(String key, com.arsdigita.toolbox.ui.ComponentAccess ca)
PropertyEditor.showComponent(PageState,
String)
to display the component, and to call PropertyEditor.showDisplayPane(PageState)
when the component needs to be hidden.
key
- The symbolic key for the component; must be unique
for this PropertyEditor
ca
- The ComponentAccess
object which contains
the child component, along with security restrictionspublic void addComponent(String key, String label, com.arsdigita.toolbox.ui.ComponentAccess ca)
key
- The symbolic key for the component; must be unique
for this PropertyEditor
label
- The label for the linkca
- The component accesspublic void setComponentAccess(String key, com.arsdigita.toolbox.ui.ComponentAccess access)
ComponentAccess
for a component which has already
been added to the SecurityPropertyEditor
.
key
- the key under which the component was addedaccess
- the ComponentAccess
instance that will
determine when the link for the specified component should be visiblepublic void add(String key, String label, com.arsdigita.toolbox.ui.ComponentAccess ca)
key
- The symbolic key for the form; must be unique
for this PropertyEditor
label
- The label for the linkca
- The form ComponentAccesspublic void add(String key, String label, com.arsdigita.toolbox.ui.ComponentAccess ca, com.arsdigita.bebop.form.Submit cancelButton)
key
- The symbolic key for the form; must be unique
for this PropertyEditor
label
- The label for the linkca
- The form ComponentAccesscancelButton
- The Cancel button on the form.public void addSecurityListener(com.arsdigita.bebop.FormSection form)
PropertyEditor
.
form
- The formpublic void addListeners(com.arsdigita.bebop.FormSection form, com.arsdigita.bebop.form.Submit cancelButton)
PropertyEditor
.
form
- The formcancelButton
- the "Cancel" button on the formprotected final Map getAccessMap()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |