KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > events > JahiaEventGeneratorBaseService


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12

13 //
14
// JahiaEventGeneratorBaseService
15
// EV 12.01.2001
16
//
17
//
18
// fireUpdateField( theEvent )
19
// fireAddContainer( theEvent )
20
// fireUpdateContainer( theEvent )
21
// fireDeleteContainer( theEvent )
22
// fireAddPage( theEvent )
23
// fireSetRights( theEvent )
24
// fireLogin( theEvent )
25
// fireLogout( theEvent )
26
//
27

28 package org.jahia.services.events;
29
30 import org.jahia.data.events.JahiaEvent;
31 import org.jahia.exceptions.JahiaException;
32 import org.jahia.registries.JahiaListenersRegistry;
33
34
35 public class JahiaEventGeneratorBaseService extends JahiaEventGeneratorService {
36
37     private static JahiaEventGeneratorBaseService theObject;
38
39     private static org.apache.log4j.Logger logger =
40             org.apache.log4j.Logger.getLogger (JahiaEventGeneratorBaseService.class);
41
42
43     /**
44      * constructor
45      */

46     protected JahiaEventGeneratorBaseService () {
47         logger.info ("***** Starting Event Generator Service *****");
48     }
49
50
51     /**
52      * returns an instance of the JahiaEventGeneratorBaseService
53      */

54     public static synchronized JahiaEventGeneratorBaseService getInstance () {
55         if (theObject == null) {
56             theObject = new JahiaEventGeneratorBaseService ();
57         }
58         return theObject;
59     }
60
61
62     public void fireBeforeFieldActivation (JahiaEvent theEvent) throws JahiaException {
63         JahiaListenersRegistry.getInstance ().wakeupListeners ("beforeFieldActivation",
64                 theEvent);
65     }
66
67     public void fireAddField (JahiaEvent theEvent) throws JahiaException {
68         JahiaListenersRegistry.getInstance ().wakeupListeners ("fieldAdded", theEvent);
69     }
70
71     public void fireUpdateField (JahiaEvent theEvent) throws JahiaException {
72         JahiaListenersRegistry.getInstance ().wakeupListeners ("fieldUpdated", theEvent);
73     }
74
75     public void fireDeleteField (JahiaEvent theEvent) throws JahiaException {
76         JahiaListenersRegistry.getInstance ().wakeupListeners ("fieldDeleted", theEvent);
77     }
78
79     public void fireBeforeContainerActivation (JahiaEvent theEvent) throws JahiaException {
80         JahiaListenersRegistry.getInstance ().wakeupListeners ("beforeContainerActivation",
81                 theEvent);
82     }
83
84     public void fireContainerValidation (JahiaEvent theEvent) throws JahiaException {
85       JahiaListenersRegistry.getInstance ().wakeupListeners ("containerValidation", theEvent);
86     }
87     
88     public void fireAddContainerEngineAfterSave (JahiaEvent theEvent) throws JahiaException {
89       JahiaListenersRegistry.getInstance ().wakeupListeners ("addContainerEngineAfterSave",
90               theEvent);
91     }
92
93     public void fireAddContainerEngineBeforeSave (JahiaEvent theEvent) throws JahiaException {
94         JahiaListenersRegistry.getInstance ().wakeupListeners ("addContainerEngineBeforeSave",
95                 theEvent);
96     }
97
98     public void fireAddContainerEngineAfterInit (JahiaEvent theEvent) throws JahiaException {
99         JahiaListenersRegistry.getInstance ().wakeupListeners ("addContainerEngineAfterInit",
100                 theEvent);
101     }
102
103     public void fireAddContainer (JahiaEvent theEvent) throws JahiaException {
104         JahiaListenersRegistry.getInstance ().wakeupListeners ("containerAdded", theEvent);
105     }
106
107     public void fireUpdateContainerEngineBeforeSave (JahiaEvent theEvent) throws JahiaException {
108         JahiaListenersRegistry.getInstance ().wakeupListeners ("updateContainerEngineBeforeSave",
109                 theEvent);
110     }
111
112     public void fireUpdateContainerEngineAfterInit (JahiaEvent theEvent) throws JahiaException {
113         JahiaListenersRegistry.getInstance ().wakeupListeners ("updateContainerEngineAfterInit",
114                 theEvent);
115     }
116
117     public void fireUpdateContainer (JahiaEvent theEvent) throws JahiaException {
118         JahiaListenersRegistry.getInstance ().wakeupListeners ("containerUpdated", theEvent);
119     }
120
121     public void fireDeleteContainer (JahiaEvent theEvent) throws JahiaException {
122         JahiaListenersRegistry.getInstance ().wakeupListeners ("containerDeleted", theEvent);
123     }
124
125
126     public void fireSetPageProperties (JahiaEvent theEvent) throws JahiaException {
127         JahiaListenersRegistry.getInstance ().wakeupListeners ("pagePropertiesSet", theEvent);
128     }
129
130
131     public void fireSetContainerListProperties (JahiaEvent theEvent) throws JahiaException {
132         JahiaListenersRegistry.getInstance ().wakeupListeners ("containerListPropertiesSet",
133                 theEvent);
134     }
135
136
137     public void fireSetRights (JahiaEvent theEvent) throws JahiaException {
138         JahiaListenersRegistry.getInstance ().wakeupListeners ("rightsSet", theEvent);
139     }
140
141
142     public void fireAddPage (JahiaEvent theEvent) throws JahiaException {
143         JahiaListenersRegistry.getInstance ().wakeupListeners ("pageAdded", theEvent);
144     }
145
146
147     public void fireLoadPage (JahiaEvent theEvent) throws JahiaException {
148         JahiaListenersRegistry.getInstance ().wakeupListeners ("pageLoaded", theEvent);
149     }
150
151
152     public void fireLogin (JahiaEvent theEvent) throws JahiaException {
153         JahiaListenersRegistry.getInstance ().wakeupListeners ("userLoggedIn", theEvent);
154     }
155
156     public void fireLogout (JahiaEvent theEvent) throws JahiaException {
157         JahiaListenersRegistry.getInstance ().wakeupListeners ("userLoggedOut", theEvent);
158     }
159
160     public void fireUpdateTemplate (JahiaEvent theEvent) throws JahiaException {
161         JahiaListenersRegistry.getInstance ().wakeupListeners ("templateUpdated", theEvent);
162     }
163
164     /**
165      * Event fired after ContentObject.activate(...)
166      *
167      * @param theEvent JahiaEvent
168      * @throws JahiaException
169      */

170     public void fireContentActivation (JahiaEvent theEvent) throws JahiaException {
171         JahiaListenersRegistry.getInstance ().wakeupListeners ("contentActivation",
172                 theEvent);
173     }
174
175 }
176
Popular Tags