org.apache.jetspeed.portlets.security
Class SecurityApplicationUtils

java.lang.Object
  extended byorg.apache.jetspeed.portlets.security.SecurityApplicationUtils

public class SecurityApplicationUtils
extends Object

Utility class for the security application.

Author:
David Le Strat

Field Summary
private static org.apache.commons.logging.Log log
          The logger.
private static String PATH_DELIMITER
          Node path delimiter.
 
Constructor Summary
SecurityApplicationUtils()
           
 
Method Summary
static org.apache.myfaces.custom.tree.model.DefaultTreeModel buildRoleTreeModel()
           Build the role tree model.
private static org.apache.myfaces.custom.tree.model.DefaultTreeModel buildTreeModel(String prefsRoot)
           Build the tree model.
static org.apache.myfaces.custom.tree.DefaultMutableTreeNode findTreeNode(RoleTreeTable treeModel, String nodePath)
           Finds a tree node in the tree model given the nodePath of the node to find.
protected static org.apache.myfaces.custom.tree.DefaultMutableTreeNode findTreeNodeAtDepth(String nodePath, Iterator children)
           Finds the current child matching the sub node path where the node path is the path matching the level of the children.
protected static String getNodePathAtDepth(String nodePath, int depth)
           Gets a subset of the node path at the given depth.
protected static int getNodePathDepth(String nodePath)
           The depth represented in the node path.
private static void processPreferences(Preferences prefs, org.apache.myfaces.custom.tree.DefaultMutableTreeNode parent)
           Recursively processes the preferences to build the role tree model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The logger.


PATH_DELIMITER

private static final String PATH_DELIMITER
Node path delimiter.

See Also:
Constant Field Values
Constructor Detail

SecurityApplicationUtils

public SecurityApplicationUtils()
Method Detail

buildRoleTreeModel

public static org.apache.myfaces.custom.tree.model.DefaultTreeModel buildRoleTreeModel()

Build the role tree model.

Returns:
The tree model.

buildTreeModel

private static org.apache.myfaces.custom.tree.model.DefaultTreeModel buildTreeModel(String prefsRoot)

Build the tree model.

Returns:
The tree model.

processPreferences

private static void processPreferences(Preferences prefs,
                                       org.apache.myfaces.custom.tree.DefaultMutableTreeNode parent)

Recursively processes the preferences to build the role tree model.

Parameters:
prefs - The preferences.
parent - The parent to add the role item to.

findTreeNode

public static org.apache.myfaces.custom.tree.DefaultMutableTreeNode findTreeNode(RoleTreeTable treeModel,
                                                                                 String nodePath)

Finds a tree node in the tree model given the nodePath of the node to find.

Parameters:
treeModel - The tree model.
nodePath - The path of the node to find.
Returns:
The DefaultMutableTreeNode.

findTreeNodeAtDepth

protected static org.apache.myfaces.custom.tree.DefaultMutableTreeNode findTreeNodeAtDepth(String nodePath,
                                                                                           Iterator children)

Finds the current child matching the sub node path where the node path is the path matching the level of the children.

Parameters:
nodePath - The node path to find the child at.
children - The children at the given level.
Returns:

getNodePathAtDepth

protected static String getNodePathAtDepth(String nodePath,
                                           int depth)

Gets a subset of the node path at the given depth.

Parameters:
nodePath - The node path.
depth - The depth where depth starts at 0;
Returns:
The subset of the node path.

getNodePathDepth

protected static int getNodePathDepth(String nodePath)

The depth represented in the node path.

Parameters:
nodePath - The node path.
Returns:
The depth.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.