001: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal.layout.restrictions;
007:
008: import org.jasig.portal.PortalException;
009: import org.jasig.portal.layout.IUserLayout;
010: import org.jasig.portal.layout.node.ILayoutNode;
011: import org.jasig.portal.layout.node.IUserLayoutNodeDescription;
012:
013: /**
014: * The Restriction Manager Interface
015: *
016: * @author <a href="mailto:mvi@immagic.com">Michael Ivanov</a>
017: * @version $Revision: 36684 $
018: */
019: public interface IRestrictionManager {
020:
021: /**
022: * Sets the user layout.
023: * @param layout a <code>IUserLayout</code> user layout to be checked
024: * @exception PortalException if an error occurs
025: */
026: public void setUserLayout(IUserLayout layout)
027: throws PortalException;
028:
029: /**
030: * Checks the restriction specified by the parameters below.
031: * @param nodeId a <code>String</code> node ID
032: * @param restrictionName a restriction name
033: * @param restrictionPath a <code>String</code> restriction path
034: * @param propertyValue a <code>String</code> property value to be checked
035: * @return a boolean value
036: * @exception PortalException if an error occurs
037: */
038: public boolean checkRestriction(String nodeId,
039: String restrictionName, String restrictionPath,
040: String propertyValue) throws PortalException;
041:
042: /**
043: * Checks the local restriction specified by the parameters below.
044: * @param nodeId a <code>String</code> node ID
045: * @param restrictionName a restriction name
046: * @param propertyValue a <code>String</code> property value to be checked
047: * @return a boolean value
048: * @exception PortalException if an error occurs
049: */
050: public boolean checkRestriction(String nodeId,
051: String restrictionName, String propertyValue)
052: throws PortalException;
053:
054: /**
055: * Checks the necessary restrictions while adding a new node
056: * @param node a <code>ILayoutNode</code> a new node to be added
057: * @param parentId a <code>String</code> parent node ID
058: * @param nextSiblingId a <code>String</code> next sibling node ID
059: * @return a boolean value
060: * @exception PortalException if an error occurs
061: */
062: public boolean checkAddRestrictions(ILayoutNode node,
063: String parentId, String nextSiblingId)
064: throws PortalException;
065:
066: /**
067: * Checks the necessary restrictions while moving a node.
068: * @param nodeId a <code>String</code> node ID of a node to be moved
069: * @param newParentId a <code>String</code> new parent node ID
070: * @param nextSiblingId a <code>String</code> next sibling node ID
071: * @return a boolean value
072: * @exception PortalException if an error occurs
073: */
074: public boolean checkMoveRestrictions(String nodeId,
075: String newParentId, String nextSiblingId)
076: throws PortalException;
077:
078: /**
079: * Checks the necessary restrictions while deleting a node.
080: * @param nodeId a <code>String</code> node ID of a node to be deleted
081: * @return a boolean value
082: * @exception PortalException if an error occurs
083: */
084: public boolean checkDeleteRestrictions(String nodeId)
085: throws PortalException;
086:
087: /**
088: * Recursively checks the depth restrictions beginning with a given node.
089: * @param nodeId a <code>String</code> node ID
090: * @param newParentId a <code>String</code> new parent node ID
091: * @return a boolean value
092: * @exception PortalException if an error occurs
093: */
094: public boolean checkDepthRestrictions(String nodeId,
095: String newParentId) throws PortalException;
096:
097: /**
098: * Recursively checks the depth restrictions beginning with a given node.
099: * @param nodeId a <code>String</code> node ID
100: * @param depth a depth on which the node is going to be attached
101: * @return a boolean value
102: * @exception PortalException if an error occurs
103: */
104: public boolean checkDepthRestrictions(String nodeId, int depth)
105: throws PortalException;
106:
107: /**
108: * Checks the necessary restrictions while updating a node.
109: * @param nodeDescription a <code>IUserLayoutNodeDescription</code> node description of a node to be updated
110: * @return a boolean value
111: * @exception PortalException if an error occurs
112: */
113: public boolean checkUpdateRestrictions(
114: IUserLayoutNodeDescription nodeDescription)
115: throws PortalException;
116:
117: }
|