Source Code Cross Referenced for PortalRenderSet.java in  » Portal » jboss-portal-2.6.4 » org » jboss » portal » theme » 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 
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;
023:
024:        import org.jboss.portal.common.util.MediaType;
025:        import org.jboss.portal.theme.impl.render.dynamic.DynaDecorationRenderer;
026:        import org.jboss.portal.theme.impl.render.dynamic.DynaPortletRenderer;
027:        import org.jboss.portal.theme.impl.render.dynamic.DynaRegionRenderer;
028:        import org.jboss.portal.theme.impl.render.dynamic.DynaWindowRenderer;
029:        import org.jboss.portal.theme.metadata.RendererSetMetaData;
030:        import org.jboss.portal.theme.render.ObjectRenderer;
031:        import org.jboss.portal.theme.render.renderer.DecorationRenderer;
032:        import org.jboss.portal.theme.render.renderer.PortletRenderer;
033:        import org.jboss.portal.theme.render.renderer.RegionRenderer;
034:        import org.jboss.portal.theme.render.renderer.WindowRenderer;
035:
036:        /**
037:         * The portal render set is a set of renderer implementations for the markup container of a page. <p>A render set
038:         * consists of 4 iterface implementations with some meta data describing the web application the render set is coming
039:         * from, and the content type it is capable of handling.</p>
040:         *
041:         * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>.
042:         * @version <tt>$Revision: 8784 $</tt>
043:         */
044:        public final class PortalRenderSet {
045:
046:            private final RegionRenderer regionRenderer;
047:            private final WindowRenderer windowRenderer;
048:            private final PortletRenderer portletRenderer;
049:            private final DecorationRenderer decorationRenderer;
050:            private final MediaType contentType;
051:            private final String appID;
052:            private final String name;
053:            private final ServerRegistrationID registrationId;
054:            private final boolean ajaxEnabled;
055:
056:            /**
057:             * construct a render set
058:             *
059:             * @param renderSetName  the name of the render set as defined in the portal-renderSet.xml descriptor, or null if it
060:             *                       was defined as part of a layout descriptor.
061:             * @param runtimeContext the runtime environment (data describing the portal web application in wich the render set
062:             *                       was defined)
063:             * @param rendererSetMD  meta data about an individual set of 4 renderer implementation together with their supported
064:             *                       content type
065:             * @throws IllegalAccessException
066:             * @throws InstantiationException
067:             * @throws ClassNotFoundException
068:             */
069:            public PortalRenderSet(String renderSetName,
070:                    RuntimeContext runtimeContext,
071:                    RendererSetMetaData rendererSetMD)
072:                    throws IllegalAccessException, InstantiationException,
073:                    ClassNotFoundException {
074:                // there CAN be render sets without a name !
075:
076:                if (runtimeContext == null) {
077:                    throw new IllegalArgumentException("no valid container");
078:                }
079:                if (rendererSetMD == null) {
080:                    throw new IllegalArgumentException("no valid set");
081:                }
082:                this .name = renderSetName;
083:                this .appID = runtimeContext.getAppId();
084:                this .registrationId = ServerRegistrationID.createID(
085:                        ServerRegistrationID.TYPE_RENDERSET, new String[] {
086:                                appID, name });
087:                this .contentType = rendererSetMD.getContentType();
088:                this .ajaxEnabled = rendererSetMD.isAjaxEnabled();
089:
090:                if (ajaxEnabled) // wrap the current renderer with the ajax delegator one.
091:                {
092:                    this .regionRenderer = new DynaRegionRenderer(
093:                            (RegionRenderer) loadRenderer(runtimeContext
094:                                    .getClassLoader(), rendererSetMD
095:                                    .getRegionRenderer()));
096:                    this .windowRenderer = new DynaWindowRenderer(
097:                            (WindowRenderer) loadRenderer(runtimeContext
098:                                    .getClassLoader(), rendererSetMD
099:                                    .getWindowRenderer()));
100:                    this .portletRenderer = new DynaPortletRenderer(
101:                            (PortletRenderer) loadRenderer(runtimeContext
102:                                    .getClassLoader(), rendererSetMD
103:                                    .getPortletRenderer()));
104:                    this .decorationRenderer = new DynaDecorationRenderer(
105:                            (DecorationRenderer) loadRenderer(runtimeContext
106:                                    .getClassLoader(), rendererSetMD
107:                                    .getDecorationRenderer()));
108:                } else {
109:                    this .regionRenderer = (RegionRenderer) loadRenderer(
110:                            runtimeContext.getClassLoader(), rendererSetMD
111:                                    .getRegionRenderer());
112:                    this .windowRenderer = (WindowRenderer) loadRenderer(
113:                            runtimeContext.getClassLoader(), rendererSetMD
114:                                    .getWindowRenderer());
115:                    this .portletRenderer = (PortletRenderer) loadRenderer(
116:                            runtimeContext.getClassLoader(), rendererSetMD
117:                                    .getPortletRenderer());
118:                    this .decorationRenderer = (DecorationRenderer) loadRenderer(
119:                            runtimeContext.getClassLoader(), rendererSetMD
120:                                    .getDecorationRenderer());
121:                }
122:            }
123:
124:            public ServerRegistrationID getRegistrationId() {
125:                return registrationId;
126:            }
127:
128:            /** @see PortalRenderSet#getMediaType */
129:            public MediaType getMediaType() {
130:                return contentType;
131:            }
132:
133:            /**
134:             * Get the name of the application (the WAR) that contains this render set.
135:             *
136:             * @return the name of the application (the WAR) that contains this render set
137:             */
138:            public String getAppId() {
139:                return appID;
140:            }
141:
142:            /**
143:             * Get the name of this render set.
144:             *
145:             * @return the name of this render set
146:             */
147:            public String getName() {
148:                return name;
149:            }
150:
151:            /** @see PortalRenderSet#getRegionRenderer */
152:            public RegionRenderer getRegionRenderer() {
153:                return regionRenderer;
154:            }
155:
156:            /** @see PortalRenderSet#getWindowRenderer */
157:            public WindowRenderer getWindowRenderer() {
158:                return windowRenderer;
159:            }
160:
161:            /** @see PortalRenderSet#getPortletRenderer */
162:            public PortletRenderer getPortletRenderer() {
163:                return portletRenderer;
164:            }
165:
166:            /** @see PortalRenderSet#getDecorationRenderer */
167:            public DecorationRenderer getDecorationRenderer() {
168:                return decorationRenderer;
169:            }
170:
171:            public boolean isAjaxEnabled() {
172:                return ajaxEnabled;
173:            }
174:
175:            /** @see java.lang.Object#toString */
176:            public String toString() {
177:                return "PortalRenderSet: " + getAppId() + "."
178:                        + (getName() == null ? "<from layout>" : getName())
179:                        + ": " + getMediaType() + " [" + getRegionRenderer()
180:                        + "][" + getWindowRenderer() + "]["
181:                        + getDecorationRenderer() + "][" + getPortletRenderer()
182:                        + "]";
183:            }
184:
185:            private ObjectRenderer loadRenderer(ClassLoader loader,
186:                    String className) throws ClassNotFoundException,
187:                    IllegalAccessException, InstantiationException {
188:                return (ObjectRenderer) loader.loadClass(className)
189:                        .newInstance();
190:            }
191:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.