Source Code Cross Referenced for Portlet.java in  » Portal » jportlet » net » sf » jportlet » 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 » Portal » jportlet » net.sf.jportlet.portlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Mar 8, 2003
003:         */
004:        package net.sf.jportlet.portlet;
005:
006:        import java.io.IOException;
007:
008:        import java.util.ArrayList;
009:        import java.util.Collection;
010:
011:        import javax.servlet.http.HttpServlet;
012:
013:        /**
014:         * The abstract <code>Portlet</code> is used by the portlet container to
015:         * invoke the portlet.
016:         *
017:         * @author <a href="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
018:         */
019:        public abstract class Portlet extends HttpServlet {
020:            //~ Instance fields --------------------------------------------------------
021:
022:            private PortletConfig _portletConfig;
023:
024:            //~ Methods ----------------------------------------------------------------
025:
026:            /**
027:             * Returns the configuration of the portlet
028:             * @return PortletConfig
029:             */
030:            public PortletConfig getPortletConfig() {
031:                return _portletConfig;
032:            }
033:
034:            /**
035:             * Returns the time the response of the Portlet  object was last modified,
036:             * in milliseconds since midnight January 1, 1970 GMT.
037:             * If the time is unknown, this method returns a negative number (the default).
038:             * <p>
039:             * Portlets that can quickly determine their last modification time should
040:             * override this method. This makes browser and proxy caches work more
041:             * effectively, reducing the load on server and network resources
042:             *
043:             * @param request
044:             * @return long
045:             */
046:            public abstract long getLastModified(PortletRequest request);
047:
048:            /**
049:             * Initialize the portlet
050:             * @param config configuration of the portlet
051:             * @throws PortletException if any error occurs
052:             */
053:            public void init(PortletConfig portletConfig)
054:                    throws PortletException {
055:                _portletConfig = portletConfig;
056:            }
057:
058:            /**
059:             * Called by the portlet container to ask the portlet to initialize a personalized user experience
060:             *
061:             * @param request
062:             * @throws PortletException
063:             */
064:            public abstract void login(PortletRequest request)
065:                    throws PortletException;
066:
067:            /**
068:             * Called by the portlet container to indicate that a concrete portlet instance is being removed
069:             *
070:             * @param request
071:             */
072:            public abstract void logout(PortletRequest request)
073:                    throws PortletException;
074:
075:            /**
076:             * This function is invoke by the container in order to render the portlet
077:             *
078:             * @param request current request
079:             * @param response current response
080:             * @throws IOException if any IO error occurs
081:             * @throws PortletException if any other error
082:             */
083:            public abstract void service(PortletRequest request,
084:                    PortletResponse response) throws PortletException,
085:                    IOException;
086:
087:            //~ Inner Classes ----------------------------------------------------------
088:
089:            /**
090:             * The <code>Markup</code> class is a finite enumeration of the
091:             * possible markup languages that a portlet can supports
092:             */
093:            public static class Markup {
094:                //~ Static fields/initializers -----------------------------------------
095:
096:                public static final Markup HTML = new Markup("html",
097:                        "text/html");
098:                public static final Markup WML = new Markup("wml", "text/wml");
099:
100:                //~ Instance fields ----------------------------------------------------
101:
102:                private String _name;
103:                private String _mimeType;
104:
105:                //~ Constructors -------------------------------------------------------
106:
107:                private Markup(String name, String mimeType) {
108:                    _name = name;
109:                    _mimeType = mimeType;
110:                }
111:
112:                //~ Methods ------------------------------------------------------------
113:
114:                public static Portlet.Markup fromMimeType(String mimeType) {
115:                    if (HTML._mimeType.equalsIgnoreCase(mimeType)) {
116:                        return HTML;
117:                    } else if (WML._mimeType.equalsIgnoreCase(mimeType)) {
118:                        return WML;
119:                    } else {
120:                        return null;
121:                    }
122:                }
123:
124:                public static Portlet.Markup fromString(String str) {
125:                    if (HTML._name.equalsIgnoreCase(str)) {
126:                        return HTML;
127:                    } else if (WML._name.equalsIgnoreCase(str)) {
128:                        return WML;
129:                    } else {
130:                        return null;
131:                    }
132:                }
133:
134:                public String toString() {
135:                    return _name;
136:                }
137:
138:                public String getMimeType() {
139:                    return _mimeType;
140:                }
141:            }
142:
143:            /**
144:             * The <code>Mode</code> class is a finite enumeration of the
145:             * possible modes that a portlet can assume
146:             */
147:            public static class Mode {
148:                //~ Static fields/initializers -----------------------------------------
149:
150:                public static final Mode CONFIGURE = new Mode("configure");
151:                public static final Mode EDIT = new Mode("edit");
152:                public static final Mode HELP = new Mode("help");
153:                public static final Mode VIEW = new Mode("view");
154:
155:                //~ Instance fields ----------------------------------------------------
156:
157:                private String _name;
158:
159:                //~ Constructors -------------------------------------------------------
160:
161:                private Mode(String name) {
162:                    _name = name;
163:                }
164:
165:                //~ Methods ------------------------------------------------------------
166:
167:                public String toString() {
168:                    return _name;
169:                }
170:
171:                public static Portlet.Mode fromString(String str) {
172:                    if (CONFIGURE._name.equals(str)) {
173:                        return CONFIGURE;
174:                    } else if (EDIT._name.equals(str)) {
175:                        return EDIT;
176:                    } else if (HELP._name.equals(str)) {
177:                        return HELP;
178:                    } else if (VIEW._name.equals(str)) {
179:                        return VIEW;
180:                    } else {
181:                        return null;
182:                    }
183:                }
184:
185:                public static Collection getAll() {
186:                    ArrayList all = new ArrayList();
187:                    all.add(CONFIGURE);
188:                    all.add(EDIT);
189:                    all.add(HELP);
190:                    all.add(VIEW);
191:                    return all;
192:                }
193:            }
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.