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.alm;
007:
008: import java.util.Hashtable;
009: import java.util.Vector;
010:
011: import org.jasig.portal.PortalException;
012: import org.jasig.portal.layout.node.IUserLayoutChannelDescription;
013: import org.jasig.portal.layout.node.UserLayoutChannelDescription;
014: import org.jasig.portal.layout.restrictions.IUserLayoutRestriction;
015: import org.w3c.dom.Document;
016: import org.w3c.dom.Element;
017:
018: /**
019: * An extension of the ChannelDescription for the Aggregated Layout implementation.
020: *
021: * Prior to uPortal 2.5, this class existed in the package org.jasig.portal.layout.
022: * It was moved to its present package to reflect that it is part of Aggregated
023: * Layouts.
024: *
025: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com"">pkharchenko@interactivebusiness.com"</a>}
026: * @version $Revision: 36690 $ $Date: 2006-08-25 14:03:25 -0700 (Fri, 25 Aug 2006) $
027: */
028: public class ALChannelDescription extends UserLayoutChannelDescription
029: implements IALChannelDescription {
030:
031: protected ALNodeProperties alproperties = new ALNodeProperties();
032:
033: public ALChannelDescription() {
034: super ();
035: }
036:
037: public ALChannelDescription(Element xmlNode) throws PortalException {
038: super (xmlNode);
039: }
040:
041: public ALChannelDescription(IUserLayoutChannelDescription d) {
042: super (d);
043: if (d instanceof IALChannelDescription) {
044: this .alproperties = new ALNodeProperties(
045: (IALChannelDescription) d);
046: } else {
047: this .alproperties = new ALNodeProperties();
048: }
049: }
050:
051: /**
052: * Set fragment id
053: *
054: * @param fragmentId a <code>String</code> value
055: */
056: public void setFragmentId(String fragmentId) {
057: this .alproperties.setFragmentId(fragmentId);
058: }
059:
060: /**
061: * Get fragment id
062: *
063: * @return a <code>String</code> value
064: */
065: public String getFragmentId() {
066: return this .alproperties.getFragmentId();
067: }
068:
069: /**
070: * Set fragment node id
071: *
072: * @param fragmentNodeId a <code>String</code> value
073: */
074: public void setFragmentNodeId(String fragmentNodeId) {
075: this .alproperties.setFragmentNodeId(fragmentNodeId);
076: }
077:
078: /**
079: * Get fragment node id
080: *
081: * @return a <code>String</code> value
082: */
083: public String getFragmentNodeId() {
084: return this .alproperties.getFragmentNodeId();
085: }
086:
087: /**
088: * Sets the group identificator for this node.
089: * @param group a <code>String</code> group identificator value
090: */
091: public void setGroup(String group) {
092: this .alproperties.setGroup(group);
093: }
094:
095: /**
096: * Gets the priority value for this node.
097: */
098: public String getGroup() {
099: return this .alproperties.getGroup();
100: }
101:
102: /**
103: * Sets the hashtable of restrictions bound to this node
104: * @param restrictions a <code>Hashtable</code> of restriction expressions
105: */
106: public void setRestrictions(Hashtable restrictions) {
107: this .alproperties.setRestrictions(restrictions);
108: }
109:
110: /**
111: * Gets the hashtable of restrictions bound to this node
112: * @return a set of restriction expressions
113: */
114: public Hashtable getRestrictions() {
115: return this .alproperties.getRestrictions();
116: }
117:
118: /**
119: * Adds the restriction for this node.
120: * @param restriction a <code>IUserLayoutRestriction</code> a restriction
121: */
122: public void addRestriction(IUserLayoutRestriction restriction) {
123: this .alproperties.addRestriction(restriction);
124: }
125:
126: /**
127: * Gets a restriction by the type.
128: * @param restrictionName a <code>String</code> name of the restriction
129: * @return a IUserLayoutRestriction
130: */
131: public IUserLayoutRestriction getRestriction(String restrictionName) {
132: return this .alproperties.getRestriction(restrictionName);
133: }
134:
135: /**
136: * Gets a restrictions list by a restriction path.
137: * @param restrictionPath a <code>String</code> restriction path
138: * @return a IUserLayoutRestriction
139: */
140: public Vector getRestrictionsByPath(String restrictionPath) {
141: return this .alproperties.getRestrictionsByPath(restrictionPath);
142: }
143:
144: public void addRestrictionChildren(Element node, Document root) {
145: this.alproperties.addRestrictionChildren(node, root);
146: }
147: }
|