Source Code Cross Referenced for LayoutStructure.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » layout » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2001, 2002, 2005 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;
007:
008:        import java.util.ArrayList;
009:        import java.util.List;
010:
011:        import org.apache.commons.logging.Log;
012:        import org.apache.commons.logging.LogFactory;
013:        import org.jasig.portal.RDBMServices;
014:
015:        /**
016:         * LayoutStructure represents a channel or folder in a layout.
017:         * @version $Revision: 35797 $ $Date: 2005-05-16 10:27:27 -0700 (Mon, 16 May 2005) $
018:         * @since uPortal 2.5 - before 2.5 this class existed as a public inner class of RDBMUserLayoutStore.
019:         */
020:        public final class LayoutStructure {
021:
022:            private static final Log LOG = LogFactory
023:                    .getLog(LayoutStructure.class);
024:
025:            /**
026:             * The ID of this LayoutStructure.
027:             */
028:            private final int structId;
029:
030:            /**
031:             * The ID of the LayoutStructure that is the next sibling of this LayoutStructure.
032:             */
033:            private final int nextId;
034:
035:            /**
036:             * The ID of the LayoutStructure that is the child of this LayoutStructure.
037:             */
038:            private final int childId;
039:
040:            /**
041:             * The ID of any channel that this LayoutStructure instance is representing.
042:             * Zero if this LayoutStructure instance does not represent a channel.
043:             */
044:            private final int chanId;
045:
046:            /**
047:             * When this LayoutStructure represents a folder, the name of that folder.
048:             * Null otherwise.
049:             */
050:            private String name;
051:
052:            /**
053:             * When this LayoutStructure represents a folder, the type of that folder.
054:             * Null otherwise.
055:             */
056:            private String type;
057:
058:            /**
059:             * True if this LayoutStructure is hidden, false otherwise.
060:             */
061:            private boolean hidden;
062:
063:            /**
064:             * True if this LayoutStructure cannot be removed, false otherwise.
065:             */
066:            private boolean unremovable;
067:
068:            /**
069:             * True if this LayoutStructure cannot be changed, false otherwise.
070:             */
071:            private boolean immutable;
072:
073:            /**
074:             * A List of StructureParameter instances representing parameters
075:             * to this LayoutStructure. 
076:             * 
077:             * Prior to uPortal 2.5, this field was null when there were no parameters.  Now
078:             * this field is never null and no parameters are repreesented by an empty list.
079:             */
080:            private final List parameters = new ArrayList();
081:
082:            private String locale;
083:
084:            /**
085:             * Instantiate a new LayoutStructure with the given configuration.
086:             * @param structId the id of this LayoutStructure
087:             * @param nextId the id of the next sibling of this LayoutStructure
088:             * @param childId the id of the first child of this LayoutStructure
089:             * @param chanId the id of the channel represented by this LayoutStructure, or zero if we do not represent a channel
090:             * @param hidden "T" or "Y" if this LayoutStructure is hidden
091:             * @param unremovable "T" or "Y" if this LayoutStructure is unremovable
092:             * @param immutable "T" or "Y" if this LayoutStructure is unchangeable
093:             */
094:            public LayoutStructure(int structId, int nextId, int childId,
095:                    int chanId, String hidden, String unremovable,
096:                    String immutable) {
097:                this .nextId = nextId;
098:                this .childId = childId;
099:                this .chanId = chanId;
100:                this .structId = structId;
101:                this .hidden = RDBMServices.dbFlag(hidden);
102:                this .immutable = RDBMServices.dbFlag(immutable);
103:                this .unremovable = RDBMServices.dbFlag(unremovable);
104:
105:                if (LOG.isTraceEnabled()) {
106:                    LOG.trace("Instantiated new " + this );
107:                }
108:            }
109:
110:            /**
111:             * Instantiate a new LayoutStructure with the given configuration.
112:             * @param structId the id of this LayoutStructure
113:             * @param nextId the id of the next sibling of this LayoutStructure
114:             * @param childId the id of the first child of this LayoutStructure
115:             * @param chanId the id of the channel represented by this LayoutStructure, or zero if we do not represent a channel
116:             * @param hidden "T" or "Y" if this LayoutStructure is hidden
117:             * @param unremovable "T" or "Y" if this LayoutStructure is unremovable
118:             * @param immutable "T" or "Y" if this LayoutStructure is unchangeable
119:             * @param locale the locale of this LayoutStructure
120:             */
121:            public LayoutStructure(int structId, int nextId, int childId,
122:                    int chanId, String hidden, String unremovable,
123:                    String immutable, String locale) {
124:                this .nextId = nextId;
125:                this .childId = childId;
126:                this .chanId = chanId;
127:                this .structId = structId;
128:                this .hidden = RDBMServices.dbFlag(hidden);
129:                this .immutable = RDBMServices.dbFlag(immutable);
130:                this .unremovable = RDBMServices.dbFlag(unremovable);
131:                this .locale = locale; // for i18n by Shoji
132:
133:                if (LOG.isTraceEnabled()) {
134:                    LOG.trace("Instantiated new " + this );
135:                }
136:            }
137:
138:            /**
139:             * Add information about the folder represented by this LayoutStructure.
140:             * @param folderName the name of the folder
141:             * @param folderType the type of the folder
142:             */
143:            public void addFolderData(String folderName, String folderType) {
144:                this .name = folderName;
145:                this .type = folderType;
146:            }
147:
148:            /**
149:             * Returns true if this LayoutStructure represents a channel, false otherwise.
150:             * Otherwise is the case where this LayoutStructure represents a folder.
151:             * @return true if a channel, false if a folder.
152:             */
153:            public boolean isChannel() {
154:                return this .chanId != 0;
155:            }
156:
157:            /**
158:             * Add a parameter to this LayoutStructure.
159:             * @param paramName the name of the parameter
160:             * @param paramValue the value of the parameter
161:             */
162:            public void addParameter(String paramName, String paramValue) {
163:                this .parameters.add(new StructureParameter(paramName,
164:                        paramValue));
165:            }
166:
167:            /**
168:             * Get the id of the next LayoutStructure or zero if there is no next LayoutStructure.
169:             * @return 0 or the id of the next layout structure.
170:             */
171:            public int getNextId() {
172:                return this .nextId;
173:            }
174:
175:            /**
176:             * Get the id of the child of this LayoutStructure, or zero if we do not have
177:             * a child.
178:             * @return 0 or the id of our child.
179:             */
180:            public int getChildId() {
181:                return this .childId;
182:            }
183:
184:            /**
185:             * Get the id of the channel represented by this LayoutStructure instance,
186:             * or zero if we do not represent a channel.
187:             * @return 0 or the id of the channel
188:             */
189:            public int getChanId() {
190:                return this .chanId;
191:            }
192:
193:            /**
194:             * Get the id of this LayoutStructure.
195:             * 
196:             * @return the id of this LayoutStructure.
197:             */
198:            public int getStructId() {
199:                return this .structId;
200:            }
201:
202:            /**
203:             * Return true if this LayoutStructure is hidden, false otherwise.
204:             * 
205:             * @return true if this LayoutStructure is hidden, false otherwise.
206:             */
207:            public boolean isHidden() {
208:                return this .hidden;
209:            }
210:
211:            /**
212:             * Returns true if this LayoutStructure is immutable, false otherwise.
213:             * 
214:             * @return false if this LayoutStructure can be changed, true otherwise.
215:             */
216:            public boolean isImmutable() {
217:                return this .immutable;
218:            }
219:
220:            /**
221:             * Get the locale of this LayoutStructure.
222:             * 
223:             * @return the locale of this LayoutStructure.
224:             */
225:            public String getLocale() {
226:                return this .locale;
227:            }
228:
229:            /**
230:             * Get the name of the folder that this LayoutStructure represents, or null
231:             * if this LayoutStructure does not represent a folder.
232:             * 
233:             * @return the name of this LayoutStructure.
234:             */
235:            public String getName() {
236:                return this .name;
237:            }
238:
239:            /**
240:             * Get a List of StructureParameter instances representing parameters of
241:             * this LayoutStructure instance.
242:             * 
243:             * Prior to uPortal 2.5, this method would return null when there were no
244:             * parameters.  Now we return an empty list when there are no parameters.
245:             * This simplifies consumers of this class, who can simply blithely iterate over
246:             * the empty list and no longer have to check for null.
247:             * 
248:             * @return a List of StructureParameter instances.
249:             */
250:            public List getParameters() {
251:                return this .parameters;
252:            }
253:
254:            /**
255:             * Get the String representing the type of the folder that this LayoutStructure
256:             * represents, or null if this LayoutStructure does not represent a folder.
257:             * Different layout management approaches may define differing types of
258:             * folders for their own purposes. The core types typically used by all
259:             * are: header, footer, and regular. The value returned is the value found
260:             * in the up_layout_struct table's type column. For instances of 
261:             * LayoutStructure that represent a channel this method will return a 
262:             * value of null.
263:             * 
264:             * @return a String representing the type of this layout structure.
265:             */
266:            public String getType() {
267:                return this .type;
268:            }
269:
270:            /**
271:             * Return true if this structure is unremovable, false otherwise.
272:             * 
273:             * @return false if this structure can be removed, true otherwise.
274:             */
275:            public boolean isUnremovable() {
276:                return this .unremovable;
277:            }
278:
279:            public String toString() {
280:                StringBuffer sb = new StringBuffer();
281:                sb.append("LayoutStructure:");
282:                sb.append(" structId = ").append(this .structId);
283:                sb.append(" nextId = ").append(this .nextId);
284:                sb.append(" childId = ").append(this .childId);
285:                sb.append(" chanId = ").append(this .chanId);
286:                sb.append(" name = [").append(this .name).append("]");
287:                sb.append(" hidden = ").append(this .hidden);
288:                sb.append(" unremovable = ").append(this .unremovable);
289:                sb.append(" immutable = ").append(this .immutable);
290:                sb.append(" parameters = [").append(this .parameters);
291:                sb.append(" locale = [").append(this .locale).append("]");
292:
293:                return sb.toString();
294:            }
295:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.