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.node;
007:
008: import org.w3c.dom.Document;
009: import org.w3c.dom.Element;
010:
011: /**
012: * An interface describing common features of user layout nodes,
013: * that is channels and folders
014: *
015: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com"">pkharchenko@interactivebusiness.com"</a>}
016: * @version 1.0
017: */
018: public interface IUserLayoutNodeDescription {
019:
020: /**
021: * Constants indicating the type of a node
022: */
023: public static final int CHANNEL = 1;
024: public static final int FOLDER = 2;
025:
026: /**
027: * Returns a node Id.
028: * The Id has to be unique in the entire user layout document.
029: *
030: * @return a <code>String</code> value
031: */
032: public String getId();
033:
034: /**
035: * Set a new node Id.
036: * The Id has to be unique in the entire user layout document.
037: *
038: */
039: public void setId(String id);
040:
041: /**
042: * Determine a name associated with this node.
043: *
044: * @return a folder/channel name.
045: */
046: public String getName();
047:
048: /**
049: * Returns a type of the node, could be FOLDER or CHANNEL integer constant.
050: *
051: * @return a type
052: */
053: public int getType();
054:
055: public void setName(String name);
056:
057: public boolean isUnremovable();
058:
059: public void setUnremovable(boolean setting);
060:
061: public boolean isImmutable();
062:
063: public void setImmutable(boolean setting);
064:
065: public boolean isHidden();
066:
067: public void setHidden(boolean setting);
068:
069: /**
070: * Creates a <code>org.w3c.dom.Element</code> representation of the current node.
071: *
072: * @param root a <code>Document</code> for which the <code>Element</code> should be created.
073: * @return a <code>Element</code> value
074: */
075: public Element getXML(Document root);
076:
077: public void addNodeAttributes(Element node);
078:
079: /**
080: * Returns true if child nodes can be added to the node.
081: * Added by SCT for DLM.
082: */
083: public boolean isAddChildAllowed();
084:
085: /**
086: * Set whether or not child nodes can be added to this node.
087: * Added by SCT for DLM.
088: */
089: public void setAddChildAllowed(boolean setting);
090:
091: /**
092: * Returns true if the node's attributes can be edited.
093: * Added by SCT for DLM.
094: */
095: public boolean isEditAllowed();
096:
097: /**
098: * Set whether a node's attributes can be edited or not.
099: * Added by SCT for DLM.
100: */
101: public void setEditAllowed(boolean setting);
102:
103: /**
104: * Returns the precedence value for this node. The precedence is 0.0 for
105: * a user owned node and the value of the node's owning fragment's
106: * precedence for a node incorporated from another fragment. Added by SCT
107: * for DLM.
108: */
109: public double getPrecedence();
110:
111: /**
112: * Set the precedence of a node. See getPrecedence for more information.
113: * Added by SCT for DLM.
114: */
115: public void setPrecedence(double setting);
116:
117: /**
118: * Returns true if the node can be moved. Added by SCT for DLM.
119: */
120: public boolean isMoveAllowed();
121:
122: /**
123: * Set whether a node can be moved or not. Added by SCT for DLM.
124: */
125: public void setMoveAllowed(boolean setting);
126:
127: /**
128: * Returns true if the node can be deleted. Added by SCT for DLM.
129: */
130: public boolean isDeleteAllowed();
131:
132: /**
133: * Set whether a node can be deleted or not. Added by SCT for DLM.
134: */
135: public void setDeleteAllowed(boolean setting);
136:
137: }
|