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.IUserLayoutFolderDescription;
013: import org.jasig.portal.layout.node.UserLayoutFolderDescription;
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 FolderDescription 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 1.0 $Revision: 36690 $ $Date: 2006-08-25 14:03:25 -0700 (Fri, 25 Aug 2006) $
027: */
028: public class ALFolderDescription extends UserLayoutFolderDescription
029: implements IALFolderDescription {
030:
031: protected ALNodeProperties alproperties;
032:
033: public ALFolderDescription() {
034: super ();
035: alproperties = new ALNodeProperties();
036: }
037:
038: public ALFolderDescription(IUserLayoutFolderDescription d) {
039: super (d);
040: if (d instanceof IALFolderDescription) {
041: alproperties = new ALNodeProperties(
042: (IALFolderDescription) d);
043: } else {
044: this .alproperties = new ALNodeProperties();
045: }
046: }
047:
048: public ALFolderDescription(Element xmlNode) throws PortalException {
049: super (xmlNode);
050: alproperties = new ALNodeProperties();
051: }
052:
053: /**
054: * Set fragment id
055: *
056: * @param fragmentId a <code>String</code> value
057: */
058: public void setFragmentId(String fragmentId) {
059: this .alproperties.setFragmentId(fragmentId);
060: }
061:
062: /**
063: * Get fragment id
064: *
065: * @return a <code>String</code> value
066: */
067: public String getFragmentId() {
068: return this .alproperties.getFragmentId();
069: }
070:
071: /**
072: * Set fragment node id
073: *
074: * @param fragmentNodeId a <code>String</code> value
075: */
076: public void setFragmentNodeId(String fragmentNodeId) {
077: this .alproperties.setFragmentNodeId(fragmentNodeId);
078: }
079:
080: /**
081: * Get fragment node id
082: *
083: * @return a <code>String</code> value
084: */
085: public String getFragmentNodeId() {
086: return this .alproperties.getFragmentNodeId();
087: }
088:
089: /**
090: * Sets the group identificator for this node.
091: * @param group a <code>String</code> group identificator value
092: */
093: public void setGroup(String group) {
094: this .alproperties.setGroup(group);
095: }
096:
097: /**
098: * Gets the priority value for this node.
099: */
100: public String getGroup() {
101: return this .alproperties.getGroup();
102: }
103:
104: /**
105: * Sets the hashtable of restrictions bound to this node
106: * @param restrictions a <code>Hashtable</code> of restriction expressions
107: */
108: public void setRestrictions(Hashtable restrictions) {
109: this .alproperties.setRestrictions(restrictions);
110: }
111:
112: /**
113: * Gets the hashtable of restrictions bound to this node
114: * @return a set of restriction expressions
115: */
116: public Hashtable getRestrictions() {
117: return this .alproperties.getRestrictions();
118: }
119:
120: /**
121: * Adds the restriction for this node.
122: * @param restriction a <code>IUserLayoutRestriction</code> a restriction
123: */
124: public void addRestriction(IUserLayoutRestriction restriction) {
125: this .alproperties.addRestriction(restriction);
126: }
127:
128: /**
129: * Gets a restriction by the type.
130: * @param restrictionName a <code>String</code> name of the restriction
131: * @return a IUserLayoutRestriction
132: */
133: public IUserLayoutRestriction getRestriction(String restrictionName) {
134: return this .alproperties.getRestriction(restrictionName);
135: }
136:
137: /**
138: * Gets a restrictions list by a restriction path.
139: * @param restrictionPath a <code>String</code> restriction path
140: * @return a IUserLayoutRestriction
141: */
142: public Vector getRestrictionsByPath(String restrictionPath) {
143: return this .alproperties.getRestrictionsByPath(restrictionPath);
144: }
145:
146: public void addRestrictionChildren(Element node, Document root) {
147: this.alproperties.addRestrictionChildren(node, root);
148: }
149: }
|