Source Code Cross Referenced for RenderConfig.java in  » Portal » stringbeans-3.5 » com » nabhinc » portlet » mvcportlet » core » 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 » stringbeans 3.5 » com.nabhinc.portlet.mvcportlet.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * (C) Copyright 2004 Nabh Information Systems, Inc. 
003:         * 
004:         * All copyright notices regarding Nabh's products MUST remain
005:         * intact in the scripts and in the outputted HTML.
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public License
008:         * as published by the Free Software Foundation; either version 2.1 
009:         * of the License, or (at your option) any later version.
010:         * 
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of 
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
014:         * GNU Lesser General Public License for more details.
015:         * 
016:         * You should have received a copy of the GNU Lesser General Public License
017:         * along with this program; if not, write to the Free Software 
018:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
019:         * 
020:         */
021:        package com.nabhinc.portlet.mvcportlet.core;
022:
023:        import java.util.HashMap;
024:
025:        import javax.portlet.RenderRequest;
026:
027:        import com.nabhinc.core.MimeTypes;
028:        import com.nabhinc.portlet.mvcportlet.util.ConfigUtil;
029:
030:        /**
031:         * Configuration associated with an render type, i.e., a
032:         * request type used in render method of ControllerPortlet.
033:         * 
034:         * @author Padmanabh Dabke
035:         * (c) 2004 Nabh Information Systems, Inc. All Rights Reserved.
036:         */
037:        public class RenderConfig extends RequestConfig {
038:            private NavigationNode rcNavNode = null;
039:            private RenderProcessor rcProcessor = null;
040:            private HashMap rcIncludePathMap = new HashMap();
041:            private HashMap rcGlobalIncludePathMap = null;
042:
043:            public void setControllerPortletConfig(
044:                    ControllerPortletConfig config) {
045:                super .setControllerPortletConfig(config);
046:                rcGlobalIncludePathMap = config.getGlobalIncludePathMap();
047:            }
048:
049:            protected HashMap getIncludePathMap() {
050:                return rcIncludePathMap;
051:            }
052:
053:            /**
054:             * 
055:             * @return
056:             */
057:            public NavigationNode getNavigationNode() {
058:                return rcNavNode;
059:            }
060:
061:            /**
062:             * 
063:             * @param node
064:             */
065:            public void setNavigationNode(NavigationNode node) {
066:                rcNavNode = node;
067:            }
068:
069:            /**
070:             * @return Returns the RenderProcessor.
071:             */
072:            public RenderProcessor getRenderProcessor() {
073:                return rcProcessor;
074:            }
075:
076:            /**
077:             * @param processor The RenderProcessor to set.
078:             */
079:            public void setRenderProcessor(RenderProcessor processor) {
080:                rcProcessor = processor;
081:            }
082:
083:            /**
084:             * Returns the include path of "default" key name.
085:             * @param request
086:             * @return
087:             */
088:            public String getDefaultIncludePath(RenderRequest request) {
089:                return getIncludePath(request, "default");
090:            }
091:
092:            /**
093:             * Returns the include path that mapped with the key/name. It will first determine the 
094:             * type of the display to be generated by checking the mobile clients that understand 
095:             * XHTML or WML and set the appropriate displayType (xhtmlmp or wml).
096:             * If none of the display types is supported, then it assumes window state's display.
097:             * It will try to return display-specific include path if specified. Otherwise, global 
098:             * mapping's include is returned
099:             * @param request
100:             * @param name The key of the include path.
101:             * @return
102:             */
103:            public String getIncludePath(RenderRequest request, String name) {
104:                // Determine the type of display to be generated. We first check for mobile clients that
105:                // understand XHTML MP or WML. If not, we check if window state-specific display is specified.
106:                // One of the assumptions here is that the display for mobile displays is not dependent on
107:                // window state.
108:                String acceptHeader = request.getProperty("accept");
109:                String displayType = null;
110:                if (acceptHeader != null) {
111:                    if (acceptHeader.indexOf(MimeTypes.XHTML_MP) != -1) {
112:                        displayType = "xhtmlmp";
113:                    } else if (acceptHeader.indexOf(MimeTypes.WML) != -1) {
114:                        displayType = "wml";
115:                    }
116:                }
117:
118:                if (displayType == null) {
119:                    displayType = request.getWindowState().toString();
120:                }
121:
122:                // First find out if there is a display-specific include. If not look for a general
123:                // include.
124:                String includePath = (String) rcIncludePathMap.get(ConfigUtil
125:                        .constructPathKey(name, displayType));
126:                if (includePath == null)
127:                    includePath = (String) rcIncludePathMap.get(name);
128:
129:                // If render type specific mapping is not specified check in the global mapping
130:                if (includePath == null) {
131:                    includePath = (String) rcGlobalIncludePathMap
132:                            .get(ConfigUtil.constructPathKey(name, displayType));
133:                }
134:                if (includePath == null)
135:                    includePath = (String) rcGlobalIncludePathMap.get(name);
136:                return includePath;
137:            }
138:
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.