Source Code Cross Referenced for PageResult.java in  » Portal » jboss-portal-2.6.4 » org » jboss » portal » theme » page » 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 » jboss portal 2.6.4 » org.jboss.portal.theme.page 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************************
002:         * JBoss, a division of Red Hat                                               *
003:         * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
004:         * contributors as indicated by the @authors tag. See the                     *
005:         * copyright.txt in the distribution for a full listing of                    *
006:         * individual contributors.                                                   *
007:         *                                                                            *
008:         * This is free software; you can redistribute it and/or modify it            *
009:         * under the terms of the GNU Lesser General Public License as                *
010:         * published by the Free Software Foundation; either version 2.1 of           *
011:         * the License, or (at your option) any later version.                        *
012:         *                                                                            *
013:         * This software is distributed in the hope that it will be useful,           *
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
016:         * Lesser General Public License for more details.                            *
017:         *                                                                            *
018:         * You should have received a copy of the GNU Lesser General Public           *
019:         * License along with this software; if not, write to the Free                *
020:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
021:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
022:         ******************************************************************************/package org.jboss.portal.theme.page;
023:
024:        import org.jboss.portal.theme.render.renderer.PageRendererContext;
025:        import org.jboss.portal.theme.render.renderer.RegionRendererContext;
026:        import org.jboss.portal.theme.render.renderer.WindowRendererContext;
027:
028:        import java.util.Collection;
029:        import java.util.HashMap;
030:        import java.util.Iterator;
031:        import java.util.Map;
032:        import java.util.Set;
033:
034:        /**
035:         * Interface to represent the read only information of a rendered portal page. <p>The page result allows access to all
036:         * the information needed to generate the final markup.
037:         *
038:         * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
039:         * @version $Revision: 8784 $
040:         */
041:        public class PageResult implements  PageRendererContext {
042:
043:            /** . */
044:            protected final Map results;
045:
046:            /** . */
047:            protected final Map windowContexts;
048:
049:            /** . */
050:            protected String pageName;
051:
052:            /** . */
053:            protected Map properties;
054:
055:            /** . */
056:            protected String layoutState;
057:
058:            /** . */
059:            final Map regions;
060:
061:            public PageResult(String pageName, Map properties) {
062:                this .pageName = pageName;
063:                this .properties = properties == null ? new HashMap()
064:                        : properties;
065:
066:                this .results = new HashMap(5);
067:                this .windowContexts = new HashMap(5);
068:                this .regions = new HashMap(5);
069:            }
070:
071:            public PageResult(String pageName) {
072:                this (pageName, new HashMap());
073:            }
074:
075:            /**
076:             * Get a reference to the region object for the provided region name.
077:             *
078:             * @param regionName the name of the region to get
079:             * @return the region for the provided region name
080:             */
081:            public Region getRegion2(String regionName) {
082:                return (Region) regions.get(regionName);
083:            }
084:
085:            /**
086:             * Get the name of the requested page.
087:             *
088:             * @return the name of the page that is being rendered
089:             */
090:            public String getPageName() {
091:                return pageName;
092:            }
093:
094:            /**
095:             * Get the state string of the layout. <p>The state is used to further sub select a layout uri. One layout can
096:             * contain a separate layout uri per state. The state has to match to string version of one of the allowed window
097:             * states.<p>
098:             *
099:             * @return a string representing the current window state to potentially further select a more specific layout uri
100:             */
101:            public String getLayoutState() {
102:                return layoutState;
103:            }
104:
105:            public void setLayoutState(String layoutState) {
106:                this .layoutState = layoutState;
107:            }
108:
109:            /**
110:             * Get a Set of all window ids that are contained in this page.
111:             *
112:             * @return a set of all window ids on this page
113:             */
114:            public Set getWindowIds() {
115:                return windowContexts.keySet();
116:            }
117:
118:            public WindowRendererContext getWindow(String windowId) {
119:                return getWindowContext(windowId);
120:            }
121:
122:            /**
123:             * Get the <code>WindowContext</code> for the provided window id.
124:             *
125:             * @param windowId the window id identifying the portlet to get the context for
126:             * @return the window context for the provided window id
127:             */
128:            public WindowContext getWindowContext(String windowId) {
129:                return (WindowContext) windowContexts.get(windowId);
130:            }
131:
132:            /**
133:             * Get a map of all <code>PortletContext</code>s on the page keyed by window id
134:             *
135:             * @return a map of all portlet on the page
136:             */
137:            public Map getWindowContextMap() {
138:                return windowContexts;
139:            }
140:
141:            public void addWindowContext(WindowContext windowContext) {
142:                windowContexts.put(windowContext.getId(), windowContext);
143:
144:                //
145:                Region region = (Region) regions.get(windowContext
146:                        .getRegionName());
147:
148:                //
149:                if (region == null) {
150:                    region = new Region(this , windowContext.getRegionName());
151:                    regions.put(region.getId(), region);
152:                }
153:
154:                //
155:                region.addWindowContext(windowContext);
156:            }
157:
158:            // PageRenderContext implementation *********************************************************************************
159:
160:            public String getProperty(String name) {
161:                return (String) properties.get(name);
162:            }
163:
164:            public Map getProperties() {
165:                return properties;
166:            }
167:
168:            public Collection getRegions() {
169:                return regions.values();
170:            }
171:
172:            public RegionRendererContext getRegion(String regionName) {
173:                return (RegionRendererContext) regions.get(regionName);
174:            }
175:
176:            public void rebuild() {
177:                // Clear all windows
178:                for (Iterator i = regions.values().iterator(); i.hasNext();) {
179:                    Region region = (Region) i.next();
180:                    region.windows.clear();
181:                }
182:
183:                // Readd all windows
184:                for (Iterator i = windowContexts.values().iterator(); i
185:                        .hasNext();) {
186:                    WindowContext wc = (WindowContext) i.next();
187:
188:                    //
189:                    Region region = (Region) regions.get(wc.getRegionName());
190:
191:                    //
192:                    if (region == null) {
193:                        region = new Region(this , wc.getRegionName());
194:                        regions.put(region.getId(), region);
195:                    }
196:
197:                    //
198:                    region.addWindowContext(wc);
199:                }
200:            }
201:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.