|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.springlayout.web.security.PageAccessHolder
public class PageAccessHolder
Maintains the page read /edit state for a request and potential for determining readonly fields
and page function states at run time. This class is used extensively by the layout field tags to
determine how to display a field on a page. PageAccessHolder should be accessed via the
PageAccessManager
PageAccessManager
Constructor Summary | |
---|---|
PageAccessHolder()
Default constructor. |
Method Summary | |
---|---|
void |
addReadOnlyField(java.lang.String fieldKey)
Add a readonly field to the map by field key |
AccessLevel |
getAccessLevel()
Gets the access level |
PageFunctionStateMap |
getPageFunctions()
Gets the pageFunctionMap |
PageFunctionState |
getPageFunctionState(java.lang.String functionName)
Looks up the pageFunction map from the threadLocal variable and queries it for the function name requested returning a page function state. |
boolean |
isEditMode()
Gets the edit mode for the page or request |
boolean |
isFieldReadOnly(java.lang.String path)
Determines whether a field is read only by queryiing the readonlyField map. |
boolean |
isNoAccess()
gets the noAccess Property. |
boolean |
isReadMode()
Gets the read mode for the page or request |
void |
removeReadOnlyField(java.lang.String fieldKey)
Remove a readonly field from the map |
void |
setAccessLevel(AccessLevel accessLevel)
Sets the access level |
void |
setEditMode()
Sets the pageAccessHolder to edit mode |
void |
setNoAccess()
sets the pageAccessHolder to no access |
void |
setPageFunctions(PageFunctionStateMap pageFunctions)
Sets the pageFunctionMap |
void |
setPageFunctionState(java.lang.String functionName,
PageFunctionState pageFunctionState)
Sets the pageFunctionState in the pageAccessHolder |
void |
setReadMode()
Sets the pageAccessHolder to read mode |
void |
setReadOnlyFields(java.util.Map readOnlyFields)
Sets the read only field map for the page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PageAccessHolder()
Method Detail |
---|
public AccessLevel getAccessLevel()
public void setAccessLevel(AccessLevel accessLevel)
accessLevel
- public boolean isEditMode()
public void setEditMode()
editMode
- public boolean isReadMode()
public void setReadMode()
editMode
- public boolean isNoAccess()
public void setNoAccess()
noAccess
- public void setReadOnlyFields(java.util.Map readOnlyFields)
readOnlyFields
- public void addReadOnlyField(java.lang.String fieldKey)
fieldKey
- public void removeReadOnlyField(java.lang.String fieldKey)
fieldKey
- public boolean isFieldReadOnly(java.lang.String path)
Determines whether a field is read only by queryiing the readonlyField
map. At this stage indexed field paths will be stripped of indexes to
perform a match so any indexed paths such as
incident.vessels[2].vesselName
would match against a path
of index.vessels.vesselName
in the readonlyFields map.
For this reason all fields in the readonlyFields map must also be stripped
of specific indexes. Future releases could support specific indexes if
required.
If the page is not in edit mode then returns true for every field without checking.
path
- the field path
public void setPageFunctionState(java.lang.String functionName, PageFunctionState pageFunctionState)
functionName
- name of the function to setpageFunctionState
- state of the functionpublic PageFunctionState getPageFunctionState(java.lang.String functionName)
net.sf.springlayout.web.security.PageAccessResolver#getPageFunctionState(javax.servlet.http.HttpServletRequest,
java.lang.String)
public PageFunctionStateMap getPageFunctions()
public void setPageFunctions(PageFunctionStateMap pageFunctions)
pageFunctions
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |