Source Code Cross Referenced for ALNode.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » layout » alm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal.layout.alm 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.Collection;
009:        import java.util.HashMap;
010:        import java.util.Map;
011:        import java.util.Vector;
012:
013:        import org.jasig.portal.PortalException;
014:        import org.jasig.portal.layout.node.IUserLayoutNodeDescription;
015:        import org.jasig.portal.layout.restrictions.IUserLayoutRestriction;
016:        import org.w3c.dom.Element;
017:
018:        /**
019:         * IALNode summary sentence goes here.
020:         * <p>
021:         * Company: Instructional Media &amp; Magic
022:         * 
023:         * Prior to uPortal 2.5, this class existed in the package org.jasig.portal.layout.
024:         * It was moved to its present package to reflect that it is part of Aggregated
025:         * Layouts.
026:         *
027:         * @author <a href="mailto:mvi@immagic.com">Michael Ivanov</a>
028:         * @version $Revision: 36812 $
029:         */
030:        public abstract class ALNode implements  IALNode {
031:
032:            private String parentNodeId;
033:            private String nextNodeId;
034:            private String previousNodeId;
035:            private IALNodeDescription nodeDescription;
036:            private int priority = 0;
037:
038:            private final Map nodeAttributes = new HashMap(0);
039:
040:            public ALNode() {
041:            }
042:
043:            public ALNode(IALNodeDescription nd) {
044:                nodeDescription = nd;
045:            }
046:
047:            public String getId() {
048:                return nodeDescription.getId();
049:            }
050:
051:            public String getFragmentId() {
052:                return nodeDescription.getFragmentId();
053:            }
054:
055:            public String getFragmentNodeId() {
056:                return nodeDescription.getFragmentNodeId();
057:            }
058:
059:            /**
060:             * Gets the node type
061:             * @return a node type
062:             */
063:            public abstract int getNodeType();
064:
065:            public void setNodeDescription(IALNodeDescription nd) {
066:                nodeDescription = nd;
067:            }
068:
069:            public IUserLayoutNodeDescription getNodeDescription() {
070:                return nodeDescription;
071:            }
072:
073:            public void setParentNodeId(String parentNodeId) {
074:                this .parentNodeId = parentNodeId;
075:            }
076:
077:            public String getParentNodeId() {
078:                return parentNodeId;
079:            }
080:
081:            public void setNextNodeId(String nextNodeId) {
082:                this .nextNodeId = nextNodeId;
083:            }
084:
085:            public String getNextNodeId() {
086:                return nextNodeId;
087:            }
088:
089:            public void setPreviousNodeId(String previousNodeId) {
090:                this .previousNodeId = previousNodeId;
091:            }
092:
093:            public String getPreviousNodeId() {
094:                return previousNodeId;
095:            }
096:
097:            /**
098:             * Sets the priority for this node.
099:             * @param priority a <code>int</code> priority value
100:             */
101:            public void setPriority(int priority) {
102:                this .priority = priority;
103:            }
104:
105:            /**
106:             * Gets the priority value for this node.
107:             */
108:            public int getPriority() {
109:                return priority;
110:            }
111:
112:            /**
113:             * Gets a restriction by the type.
114:             * @param restrictionName a <code>String</code>  name of the restriction
115:             * @return a IUserLayoutRestriction
116:             */
117:            public IUserLayoutRestriction getRestriction(String restrictionName) {
118:                if (nodeDescription != null)
119:                    return nodeDescription.getRestriction(restrictionName);
120:                return null;
121:            }
122:
123:            /**
124:             * Gets a restrictions list by a restriction path.
125:             * @param restrictionPath a <code>String</code> restriction path
126:             * @return a IUserLayoutRestriction
127:             */
128:            public Collection getRestrictionsByPath(String restrictionPath) {
129:                if (nodeDescription != null)
130:                    return nodeDescription
131:                            .getRestrictionsByPath(restrictionPath);
132:                return new Vector();
133:            }
134:
135:            /**
136:             * Add all of common node attributes to the <code>Element</code>.
137:             * @param node an <code>Element</code> value
138:             */
139:            protected void addNodeAttributes(Element node) {
140:                nodeDescription.addNodeAttributes(node);
141:                node.setAttribute("priority", priority + "");
142:            }
143:
144:            /**
145:             * A factory method to create a <code>IALNodeDescription</code> instance,
146:             * based on the information provided in the user layout <code>Element</code>.
147:             *
148:             * @param xmlNode a user layout DTD folder/channel <code>Element</code> value
149:             * @return an <code>IALNodeDescription</code> value
150:             * @exception PortalException if the xml passed is somehow invalid.
151:             */
152:            public static IALNodeDescription createUserLayoutNodeDescription(
153:                    Element xmlNode) throws PortalException {
154:                // is this a folder or a channel ?
155:                String nodeName = xmlNode.getNodeName();
156:                if (nodeName.equals("channel")) {
157:                    return new ALChannelDescription(xmlNode);
158:                } else if (nodeName.equals("folder")) {
159:                    return new ALFolderDescription(xmlNode);
160:                } else {
161:                    throw new PortalException(
162:                            "Given XML element is neither folder nor channel");
163:                }
164:            }
165:
166:            public static ALNode createALNode(
167:                    IUserLayoutNodeDescription nodeDescription)
168:                    throws PortalException {
169:                if (nodeDescription instanceof  IALFolderDescription) {
170:                    // should be a folder
171:                    return new ALFolder(new ALFolderDescription(
172:                            (IALFolderDescription) nodeDescription));
173:                } else if (nodeDescription instanceof  IALChannelDescription) {
174:                    return new ALChannel(new ALChannelDescription(
175:                            (IALChannelDescription) nodeDescription));
176:                } else {
177:                    throw new PortalException(
178:                            "ALNode::createALNode() : The node description supplied is neither a folder nor a channel! Can't make the ALNode");
179:                }
180:            }
181:
182:            public String toString() {
183:                return "{" + parentNodeId + "," + nextNodeId + ","
184:                        + previousNodeId + "," + nodeDescription + ","
185:                        + priority + "}";
186:            }
187:
188:            public Map getAttributes() {
189:                return this .nodeAttributes;
190:            }
191:
192:            public void putAttributes(Map attributes) {
193:                this.nodeAttributes.putAll(attributes);
194:            }
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.