com.bea.security.entitlements.admin.util
Class Utils

java.lang.Object
  extended bycom.bea.security.entitlements.admin.util.Utils

public class Utils
extends java.lang.Object

The utils class for the entitlements admin console. This is the place holder for static re-usable methods. Getting the appropriate resource bundle based on locale for example

Author:
narliss

Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String getFacesParamValue(java.lang.String name)
          Get parameters passed in from a jsf page.
static java.lang.String getMessageResourceString(java.lang.String bundleName, java.lang.String key, java.lang.Object[] params, java.util.Locale locale)
          Get the appropriate message from the appropriate localized resource string This method can be used to pull text from the appropriate localized message file programatically if needed.
static java.lang.Object getSessionBean(java.lang.String neededBean)
          Programatically access a session bean from another session bean.
static SessionState getSessionState()
          Since we are re-using the session state in so many other places this will simplify getting access to it
static java.lang.String getTreeNodeNameFromMetaObjectImpl(com.bea.ales.rbac.MetaObject pset, java.lang.String type)
          Return tree node name for a given rbac meta object
static java.lang.String getTreeNodeNameFromRBACPermissionSet(com.bea.ales.rbac.RBAC_PermissionSet pset)
          Return tree node name for a given rbac permission set
static java.lang.String getTreeNodeNameFromRBACRole(com.bea.ales.rbac.RBAC_Role role)
          Return tree node name for a given rbac Role
static boolean isAttributeInList(AttributeElement attr, java.util.List attrList)
          Check to see if a given Attribute Element is defined in a list
static boolean matchFilter(java.lang.String strToMatch, java.lang.String filterStr)
          Match filters
static java.util.regex.Pattern toRegularPattern(java.lang.String filter)
          Covery a given filter to a regular expression pattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getFacesParamValue

public static java.lang.String getFacesParamValue(java.lang.String name)
Get parameters passed in from a jsf page. This method will retrieve parameters from the faces context object. Parameters can be added to the context on a JSF page using the tags.

Returns:
param value

getMessageResourceString

public static java.lang.String getMessageResourceString(java.lang.String bundleName,
                                                        java.lang.String key,
                                                        java.lang.Object[] params,
                                                        java.util.Locale locale)
Get the appropriate message from the appropriate localized resource string This method can be used to pull text from the appropriate localized message file programatically if needed.

Parameters:
bundleName - the name of the resource bundle to load without the local
key - the name of the message to load return from the bundle.
params - message formatting parameters
locale - the locale that the message should be returned in.
Returns:
message resource string

getSessionBean

public static java.lang.Object getSessionBean(java.lang.String neededBean)
Programatically access a session bean from another session bean.

Returns:
the object version of the requested bean.

getSessionState

public static SessionState getSessionState()
Since we are re-using the session state in so many other places this will simplify getting access to it

Returns:
instance of current session state

getTreeNodeNameFromMetaObjectImpl

public static java.lang.String getTreeNodeNameFromMetaObjectImpl(com.bea.ales.rbac.MetaObject pset,
                                                                 java.lang.String type)
Return tree node name for a given rbac meta object

Parameters:
pset - meta object name to use
Returns:
outpot of Utils.getMessageResourceString if root if format "All s", other wise relative name of metaObject

getTreeNodeNameFromRBACPermissionSet

public static java.lang.String getTreeNodeNameFromRBACPermissionSet(com.bea.ales.rbac.RBAC_PermissionSet pset)
Return tree node name for a given rbac permission set

Parameters:
pset - permission sets name to use
Returns:
outpot of Utils.getMessageResourceString if root, other wise relative name of permission set

getTreeNodeNameFromRBACRole

public static java.lang.String getTreeNodeNameFromRBACRole(com.bea.ales.rbac.RBAC_Role role)
Return tree node name for a given rbac Role

Returns:
outpot of Utils.getMessageResourceString if root, other wise relative name of role

isAttributeInList

public static boolean isAttributeInList(AttributeElement attr,
                                        java.util.List attrList)
Check to see if a given Attribute Element is defined in a list

Parameters:
attr - attribute to check
attrList - list to check within
Returns:
true if exists, false otherwise

matchFilter

public static boolean matchFilter(java.lang.String strToMatch,
                                  java.lang.String filterStr)
Match filters

Parameters:
strToMatch - string to match
filterStr - filter to match
Returns:
true if same, false otherwise

toRegularPattern

public static java.util.regex.Pattern toRegularPattern(java.lang.String filter)
Covery a given filter to a regular expression pattern

Parameters:
filter - string to convert
Returns:
return a regular pattern object for a given filter


Copyright © 2007 BEA Systems Inc. All Rights Reserved.