01: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.layout.restrictions.alm;
07:
08: import org.jasig.portal.PortalException;
09: import org.jasig.portal.layout.alm.ALNode;
10: import org.jasig.portal.layout.alm.IAggregatedLayout;
11: import org.jasig.portal.layout.restrictions.UserLayoutRestriction;
12:
13: /**
14: * The generic aggregated layout restriction class.
15: *
16: * @author Michael Ivanov
17: * @version $Revision: 35731 $ $Date: 2005-05-03 13:46:02 -0700 (Tue, 03 May 2005) $
18: * @since uPortal 2.5
19: */
20: public abstract class ALRestriction extends UserLayoutRestriction {
21:
22: public ALRestriction() {
23: super ();
24: }
25:
26: public ALRestriction(String name) {
27: super (name);
28: }
29:
30: public ALRestriction(String name, String nodePath) {
31: super (name, nodePath);
32: }
33:
34: /**
35: * Checks the restriction on a node for a given user layout and node ID
36: * @param layout a <code>IAggregatedLayout</code> layout
37: * @param nodeId a <code>String</code> node ID
38: * @return a boolean value
39: * @exception PortalException
40: */
41: public boolean checkRestriction(IAggregatedLayout layout,
42: String nodeId) throws PortalException {
43: ALNode node = layout.getLayoutNode(nodeId);
44: if (node == null)
45: throw new PortalException(
46: "The aggregated layout does not contain the node specified by ID = "
47: + nodeId);
48: return checkRestriction(node);
49: }
50:
51: }
|