org.jasig.portal.layout.restrictions
Class UserLayoutRestriction

java.lang.Object
  extended by org.jasig.portal.layout.restrictions.UserLayoutRestriction
All Implemented Interfaces:
IUserLayoutRestriction
Direct Known Subclasses:
ALRestriction

public abstract class UserLayoutRestriction
extends java.lang.Object
implements IUserLayoutRestriction

UserLayoutRestriction summary sentence goes here.

Version:
$Revision: 1.13.4.1 $
Author:
Michael Ivanov

Field Summary
private  java.lang.String name
           
protected  java.lang.String nodePath
           
private  java.lang.String restrictionExpression
           
 
Fields inherited from interface org.jasig.portal.layout.restrictions.IUserLayoutRestriction
CHILDREN_RESTRICTION_PATH, LOCAL_RESTRICTION_PATH, PARENT_RESTRICTION_PATH
 
Constructor Summary
UserLayoutRestriction()
           
UserLayoutRestriction(java.lang.String name)
           
UserLayoutRestriction(java.lang.String name, java.lang.String nodePath)
           
 
Method Summary
 boolean checkRestriction(ILayoutNode node)
          Checks the restriction on a given node
abstract  boolean checkRestriction(java.lang.String propertyValue)
          Checks the restriction for the given property value
 java.lang.String getName()
          Returns the name of the current restriction
 java.lang.String getRestrictionExpression()
          Gets the restriction expression
 java.lang.String getRestrictionPath()
          Gets the tree path for the current restriction
 java.lang.String getUniqueKey()
          Gets the restriction name
static java.lang.String getUniqueKey(java.lang.String restrictionName)
          Gets the local restriction name based on a restriction type
static java.lang.String getUniqueKey(java.lang.String restrictionName, java.lang.String nodePath)
          Gets the restriction name based on a restriction name and a node path
protected abstract  void parseRestrictionExpression()
          Parses the restriction expression of the current node
 void setName(java.lang.String name)
          Sets the name of the current restriction
 void setRestrictionExpression(java.lang.String restrictionExpression)
          Sets the restriction expression
 void setRestrictionPath(java.lang.String nodePath)
          Sets the restriction path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

restrictionExpression

private java.lang.String restrictionExpression

nodePath

protected java.lang.String nodePath
Constructor Detail

UserLayoutRestriction

public UserLayoutRestriction()

UserLayoutRestriction

public UserLayoutRestriction(java.lang.String name)

UserLayoutRestriction

public UserLayoutRestriction(java.lang.String name,
                             java.lang.String nodePath)
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the current restriction

Specified by:
setName in interface IUserLayoutRestriction
Parameters:
a - String name

getName

public java.lang.String getName()
Returns the name of the current restriction

Specified by:
getName in interface IUserLayoutRestriction
Returns:
a String name

setRestrictionPath

public void setRestrictionPath(java.lang.String nodePath)
Sets the restriction path

Specified by:
setRestrictionPath in interface IUserLayoutRestriction
Parameters:
restrictionPath - a String path

parseRestrictionExpression

protected abstract void parseRestrictionExpression()
                                            throws PortalException
Parses the restriction expression of the current node

Throws:
PortalException

checkRestriction

public abstract boolean checkRestriction(java.lang.String propertyValue)
                                  throws PortalException
Checks the restriction for the given property value

Specified by:
checkRestriction in interface IUserLayoutRestriction
Parameters:
propertyValue - a String property value to be checked
Returns:
a boolean value
Throws:
PortalException

checkRestriction

public boolean checkRestriction(ILayoutNode node)
                         throws PortalException
Checks the restriction on a given node

Specified by:
checkRestriction in interface IUserLayoutRestriction
Parameters:
node - a ILayoutNode node
Returns:
a boolean value
Throws:
PortalException

getUniqueKey

public java.lang.String getUniqueKey()
Gets the restriction name

Specified by:
getUniqueKey in interface IUserLayoutRestriction
Returns:
a String restriction name

getUniqueKey

public static java.lang.String getUniqueKey(java.lang.String restrictionName,
                                            java.lang.String nodePath)
Gets the restriction name based on a restriction name and a node path

Parameters:
restrictionName - a restriction name
nodePath - a String node path
Returns:
a String restriction name

getUniqueKey

public static java.lang.String getUniqueKey(java.lang.String restrictionName)
Gets the local restriction name based on a restriction type

Parameters:
restrictionName - a restriction name
Returns:
a String restriction name

setRestrictionExpression

public void setRestrictionExpression(java.lang.String restrictionExpression)
Sets the restriction expression

Specified by:
setRestrictionExpression in interface IUserLayoutRestriction
Parameters:
restrictionExpression - a String expression

getRestrictionExpression

public java.lang.String getRestrictionExpression()
Gets the restriction expression

Specified by:
getRestrictionExpression in interface IUserLayoutRestriction
Returns:
a String expression

getRestrictionPath

public java.lang.String getRestrictionPath()
Gets the tree path for the current restriction

Specified by:
getRestrictionPath in interface IUserLayoutRestriction
Returns:
a String tree path