Source code: com/opencms/flex/I_CmsEventListener.java
1 /*
2 * File : $Source: /usr/local/cvs/opencms/src/com/opencms/flex/Attic/I_CmsEventListener.java,v $
3 * Date : $Date: 2003/02/26 15:19:24 $
4 * Version: $Revision: 1.5 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2002 - 2003 Alkacon Software (http://www.alkacon.com)
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about Alkacon Software, please see the
22 * company website: http://www.alkacon.com
23 *
24 * For further information about OpenCms, please see the
25 * project website: http://www.opencms.org
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this library; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 */
31
32 package com.opencms.flex;
33
34 /**
35 * Implement this interface in case your class has to react
36 * to CmsEvents that are thrown by system.<p>
37 *
38 * In order to recieve system events, your class must register with
39 * the OpenCms event mechanism. This can be done in the constructor of a class
40 * like this:
41 * <pre>
42 * com.opencms.core.A_OpenCms.addCmsEventListener(this);
43 * </pre>
44 *
45 * A typical implementation might look like this:
46 * <pre>
47 * public void cmsEvent(com.opencms.flex.CmsEvent event) {
48 * switch (event.getType()) {
49 * case com.opencms.flex.I_CmsEventListener.EVENT_PUBLISH_PROJECT:
50 * case com.opencms.flex.I_CmsEventListener.EVENT_CLEAR_CACHES:
51 * // do something
52 * break;
53 * case com.opencms.flex.I_CmsEventListener.EVENT_LOGIN_USER:
54 * // do something else
55 * break;
56 * }
57 * }
58 * </pre>
59 *
60 * @author Alexander Kandzior (a.kandzior@alkacon.com)
61 *
62 * @version $Revision: 1.5 $
63 * @since FLEX alpha 1
64 *
65 * @see CmsEvent
66 * @see com.opencms.core.A_OpenCms#addCmsEventListener(I_CmsEventListener)
67 */
68 public interface I_CmsEventListener {
69
70 /**
71 * Event "user has logged in".<p>
72 *
73 * @see com.opencms.file.CmsObject#loginUser(String, String)
74 */
75 public static int EVENT_LOGIN_USER = 1;
76
77 /**
78 * Event "a project was published".<p>
79 *
80 * @see com.opencms.file.CmsObject#publishProject(int, I_CmsReport)
81 */
82 public static int EVENT_PUBLISH_PROJECT = 2;
83
84 /**
85 * Event "a resource was published".<p>
86 *
87 * @see com.opencms.file.CmsObject#publishResource(String, boolean)
88 */
89 public static int EVENT_PUBLISH_RESOURCE = 3;
90
91 /**
92 * Event "a resource in the COS was published".<p>
93 *
94 * @see com.opencms.defaults.master.CmsMasterContent#publishResource(CmsObject)
95 */
96 public static int EVENT_PUBLISH_BO_RESOURCE = 4;
97
98 /**
99 * Event "all caches mut be cleared".<p>
100 *
101 * Not thrown by the core classes, but might be used in modules.
102 */
103 public static int EVENT_CLEAR_CACHES = 5;
104
105 /**
106 * Event used by the Flex Cluster Module.<p>
107 */
108 public static int EVENT_FLEX_CLUSTER_CHECK_SOURCE = 6;
109
110 /**
111 * Event used by the Flex Cluster Module.<p>
112 */
113 public static int EVENT_FLEX_CLUSTER_HOOK = 7;
114
115 /**
116 * Event "delete all JSP pages in the "real" file system
117 * (so they will be rebuild next time the JSP is requested)".<p>
118 *
119 * This is thrown on the "FlexCache Administration" page if you press
120 * the button "Purge JSP repository", or if you use the <code>_flex=purge</code>
121 * request parameter.
122 */
123 public static int EVENT_FLEX_PURGE_JSP_REPOSITORY = 8;
124
125 /**
126 * Event "the FlexCache must be cleared".<p>
127 *
128 * This is thrown on the "FlexCache Administration" page if you press
129 * one ot the "Clear cache" buttons, or if you use the <code>_flex=clearcache</code>
130 * request parameter.
131 */
132 public static int EVENT_FLEX_CACHE_CLEAR = 9;
133
134 /** Event "static export has just happened"
135 *
136 * @see com.opencms.file.CmsObject#publishProject(int, I_CmsReport)
137 */
138 public static int EVENT_STATIC_EXPORT = 10;
139
140 /**
141 * Acknowledge the occurrence of the specified event, implement this
142 * method to check for CmsEvents in your class.
143 *
144 * @param event CmsEvent that has occurred
145 */
146 public void cmsEvent(CmsEvent event);
147 }
148