Source Code Cross Referenced for PortalEvent.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » 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 » uPortal_rel 2 6 1 GA » org.jasig.portal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2001-2004 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal;
007:
008:        /**
009:         * Events which may be arguments to the IChannel receiveEvent() method.
010:         * @author Peter Kharchenko  {@link <a href="mailto:pkharchenko@interactivebusiness.com"">pkharchenko@interactivebusiness.com"</a>}
011:         * @author andrew.petro@yale.edu
012:         * @version $Revision: 36690 $ $Date: 2006-08-25 14:03:25 -0700 (Fri, 25 Aug 2006) $
013:         */
014:        public class PortalEvent {
015:
016:            // framework-generated events
017:
018:            public static final int SESSION_DONE = 1;
019:            public static final int UNSUBSCRIBE = 2;
020:
021:            // layout-generated events
022:            public static final int EDIT_BUTTON_EVENT = 3;
023:            public static final int HELP_BUTTON_EVENT = 4;
024:            public static final int ABOUT_BUTTON_EVENT = 5;
025:            public static final int DETACH_BUTTON_EVENT = 6;
026:            public static final int MINIMIZE_EVENT = 7;
027:            public static final int MAXIMIZE_EVENT = 8;
028:
029:            /**
030:             * The framework-generated event that is broadcast to
031:             * channels that were used for a user session which is now ending.
032:             * Typical usage is to trigger state cleanup in channels that are not
033:             * user-session-scoped.
034:             */
035:            public static final PortalEvent SESSION_DONE_EVENT = new PortalEvent(
036:                    SESSION_DONE, "sessionDone",
037:                    PortalEventSource.FRAMEWORK_GENERATED);
038:
039:            /**
040:             * The framework-generated event that is sent to
041:             * a channel when the user unsubscribes from that channel.
042:             */
043:            public static final PortalEvent UNSUBSCRIBE_EVENT = new PortalEvent(
044:                    UNSUBSCRIBE, "unsubscribe",
045:                    PortalEventSource.FRAMEWORK_GENERATED);
046:
047:            /**
048:             * The layout-generated event that is sent to
049:             * a channel when the user actuates its edit control.
050:             */
051:            public static final PortalEvent EDIT_BUTTON = new PortalEvent(
052:                    EDIT_BUTTON_EVENT, "editButtonEvent",
053:                    PortalEventSource.LAYOUT_GENERATED);
054:
055:            /**
056:             * The layout-generated event that is sent to
057:             * a channel when the user actuates its help control.
058:             */
059:            public static final PortalEvent HELP_BUTTON = new PortalEvent(
060:                    HELP_BUTTON_EVENT, "helpButtonEvent",
061:                    PortalEventSource.LAYOUT_GENERATED);
062:
063:            /**
064:             * The layout-generated event that is sent to
065:             * a channel when the user actuates its about control.
066:             */
067:            public static final PortalEvent ABOUT_BUTTON = new PortalEvent(
068:                    ABOUT_BUTTON_EVENT, "aboutButtonEvent",
069:                    PortalEventSource.LAYOUT_GENERATED);
070:
071:            /**
072:             * The layout-generated event that is sent to
073:             * a channel when the user actuates its detach control.
074:             */
075:            public static final PortalEvent DETACH_BUTTON = new PortalEvent(
076:                    DETACH_BUTTON_EVENT, "detachButtonEvent",
077:                    PortalEventSource.LAYOUT_GENERATED);
078:
079:            /**
080:             * The layout-generated event that is sent to
081:             * a channel when the user actuates its minimize control.
082:             */
083:            public static final PortalEvent MINIMIZE = new PortalEvent(
084:                    MINIMIZE_EVENT, "minimizeEvent",
085:                    PortalEventSource.LAYOUT_GENERATED);
086:
087:            /**
088:             * The layout-generated event that is sent to
089:             * a channel when the user actuates its maximize control.
090:             */
091:            public static final PortalEvent MAXIMIZE = new PortalEvent(
092:                    MAXIMIZE_EVENT, "maximizeEvent",
093:                    PortalEventSource.LAYOUT_GENERATED);
094:
095:            /**
096:             * Integer representation of an event.  Must be one of the static integers
097:             * declared in this class.
098:             */
099:            private final int eventNumber;
100:
101:            /**
102:             * String representation of the event.
103:             */
104:            private final String eventName;
105:
106:            /**
107:             * Source of the event -- curently either FRAMEWORK or LAYOUT.
108:             */
109:            private final PortalEventSource source;
110:
111:            /**
112:             * Constructor which translates from one of the integers representing a
113:             * PortalEvent to the actual PortalEvent class.
114:             * @param ev integer representing the event
115:             * @deprecated instead reference one of the static singleton events.
116:             */
117:            public PortalEvent(int ev) {
118:
119:                if (ev < 0 || ev > 8)
120:                    throw new IllegalArgumentException("The integer " + ev
121:                            + " does not identify a PortalEvent.");
122:
123:                this .eventNumber = ev;
124:
125:                final String[] eventNameArray = { "renderingDone",
126:                        "sessionDone", "unsubscribe", "editButtonEvent",
127:                        "helpButtonEvent", "aboutButtonEvent",
128:                        "detachButtonEvent", "minimizeEvent", "maximizeEvent", };
129:
130:                this .eventName = eventNameArray[ev];
131:
132:                if (ev < 3) {
133:                    this .source = PortalEventSource.FRAMEWORK_GENERATED;
134:                } else {
135:                    this .source = PortalEventSource.LAYOUT_GENERATED;
136:                }
137:
138:            }
139:
140:            /**
141:             * Construct a PortalEvent instance from parameters.
142:             * @param eventNumber - integer representation of event type
143:             * @param eventName - String name of event
144:             * @param source - source type of event
145:             */
146:            private PortalEvent(int eventNumber, String eventName,
147:                    PortalEventSource source) {
148:                this .eventNumber = eventNumber;
149:                this .eventName = eventName;
150:                this .source = source;
151:            }
152:
153:            /**
154:             * Get a String representing this event.
155:             * @return a String representing this event.
156:             */
157:            public String getEventName() {
158:                return this .eventName;
159:            }
160:
161:            /**
162:             * Get an integer representing this event.
163:             * @return an integer representing this event.
164:             */
165:            public int getEventNumber() {
166:                return this .eventNumber;
167:            }
168:
169:            /**
170:             * Get the source type of this event.
171:             * @return the source type of this event.
172:             */
173:            public PortalEventSource getSource() {
174:                return this .source;
175:            }
176:
177:            /**
178:             * Two PortalEvents are equal if they have the same eventNumber.
179:             * @param other - another object
180:             * @return true if other is a PortalEvent with the same eventNumber,
181:             * false otherwise
182:             */
183:            public boolean equals(Object other) {
184:                if (other == null)
185:                    return false;
186:                if (!(other instanceof  PortalEvent))
187:                    return false;
188:                PortalEvent otherEvent = (PortalEvent) other;
189:
190:                if (otherEvent.eventNumber == this .eventNumber)
191:                    return true;
192:
193:                return false;
194:            }
195:
196:            public String toString() {
197:                return this.eventName;
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.