Source Code Cross Referenced for ViewPortlet.java in  » Report » pentaho-report » org » pentaho » ui » portlet » 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 » Report » pentaho report » org.pentaho.ui.portlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006 Pentaho Corporation.  All rights reserved. 
003:         * This software was developed by Pentaho Corporation and is provided under the terms 
004:         * of the Mozilla Public License, Version 1.1, or any later version. You may not use 
005:         * this file except in compliance with the license. If you need a copy of the license, 
006:         * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho 
007:         * BI Platform.  The Initial Developer is Pentaho Corporation.
008:         *
009:         * Software distributed under the Mozilla Public License is distributed on an "AS IS" 
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
011:         * the license for the specific language governing your rights and limitations.
012:         *
013:         * @created Aug 2, 2005 
014:         * @author James Dixon
015:         */
016:
017:        package org.pentaho.ui.portlet;
018:
019:        import java.io.IOException;
020:        import java.io.PrintWriter;
021:        import javax.portlet.ActionRequest;
022:        import javax.portlet.PortletException;
023:        import javax.portlet.PortletPreferences;
024:        import javax.portlet.RenderRequest;
025:        import javax.portlet.RenderResponse;
026:
027:        import org.pentaho.messages.Messages;
028:
029:        public abstract class ViewPortlet extends BasePortlet {
030:
031:            public void doPortletHelp(RenderRequest request,
032:                    RenderResponse response, PentahoPortletSession userSession)
033:                    throws PortletException, IOException {
034:                response.setContentType("text/html"); //$NON-NLS-1$
035:                PrintWriter out = response.getWriter();
036:                out
037:                        .println(Messages
038:                                .getString(
039:                                        "ViewPortlet.CODE_MESSAGE_TEMPLATE", Messages.getString("ViewPortlet.USER_HELP_NOT_AVAILABLE"))); //$NON-NLS-1$ //$NON-NLS-2$
040:            }
041:
042:            public void doPortletEdit(RenderRequest request,
043:                    RenderResponse response, PentahoPortletSession userSession)
044:                    throws PortletException, IOException {
045:                response.setContentType("text/html"); //$NON-NLS-1$
046:                PrintWriter out = response.getWriter();
047:                // TODO sbarkdull, ViewPortlet.CODE_MESSAGE_TEMPLATE probably shouldnt be in resource file
048:                out
049:                        .println(Messages
050:                                .getString(
051:                                        "ViewPortlet.CODE_MESSAGE_TEMPLATE", Messages.getString("ViewPortlet.USER_OPTIONS_NOT_AVAILABLE"))); //$NON-NLS-1$ //$NON-NLS-2$
052:            }
053:
054:            protected String getSetting(String name, String defaultValue,
055:                    ActionRequest request,
056:                    PortletRequestParameterProvider requestParameters) {
057:
058:                PortletPreferences prefs = request.getPreferences();
059:                String value = request.getParameter(name);
060:                if (value == null) {
061:                    // get the default value from the preferences
062:                    value = prefs.getValue(name, null);
063:                    if (value != null && requestParameters != null) {
064:                        requestParameters.setParameter(name, value);
065:                    } else {
066:                        value = defaultValue;
067:                    }
068:                }
069:                return value;
070:            }
071:
072:            /**
073:             * Using <code>name</code> as a key, look for the key first in the portal's RenderRequest,
074:             * if it is found, return its value.
075:             * If it is not found in the RenderRequest, look in the PortletPreferences. If it is
076:             * found, and the PortletRequestParameterProvider is not null, add the key/value
077:             * pair to the PortletRequestParameterProvider, and return the value.
078:             * If it is not found in either the RenderRequest or the PortletPreferences,
079:             * return the <code>defaultValue</code> parameter.
080:             * 
081:             * @param name
082:             * @param defaultValue String returned if name cannot be found in the RenderRequest or the PortletPreferences.
083:             * @param request RendRequest active during this request cycle.
084:             * @param requestParameters PortletRequestParameterProvider active during this request cycle
085:             * @return the value associated with the key specified by the <code>name</code> parameter.
086:             */
087:            protected String getSetting(String name, String defaultValue,
088:                    RenderRequest request,
089:                    PortletRequestParameterProvider requestParameters) {
090:
091:                PortletPreferences prefs = request.getPreferences();
092:                String value = request.getParameter(name);
093:                if (value == null) {
094:                    // get the default value from the preferences
095:                    value = prefs.getValue(name, null);
096:                    if (value != null) {
097:                        if (requestParameters != null) {
098:                            requestParameters.setParameter(name, value);
099:                        }
100:                    } else {
101:                        value = defaultValue;
102:                    }
103:                }
104:                return value;
105:            }
106:
107:            protected long getSetting(String name, long defaultValue,
108:                    RenderRequest request,
109:                    PortletRequestParameterProvider requestParameters) {
110:
111:                String valueStr = getSetting(name, Long.toString(defaultValue),
112:                        request, requestParameters);
113:
114:                try {
115:                    return Long.parseLong(valueStr);
116:                } catch (Exception e) {
117:                    return defaultValue;
118:                }
119:            }
120:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.