WikiPageEvent
Class designation: Class org.apache.wiki.event.WikiPageEvent extends org.apache.wiki.event.WikiEvent

WikiPageEvent extends the abstract class WikiEvent to indicate a change in the state or processing of a WikiPage.

There are two main categories of events:

Phase Boundary Events
Those considered as "beginning-of-phase", and those as "end-of-phase" events (as designated by *_BEGIN and *_END), as generated by the WikiEngine. The phases include pre-save, post-save, pre-translate, and post-translate.
In-Phase Events
In-phase events are generated as specific events from the PageEventFilter (or elsewhere), on a per-listener basis. There may be many such events during a particular phase.

E.g., a typical event sequence for the pre-translate phase would be:

PRE_TRANSLATE_BEGIN
PRE_TRANSLATE
PRE_TRANSLATE
...
PRE_TRANSLATE_END

There are eighteen WikiPageEvent types (in six groups):

Page locking events#

WikiPageEvent.PAGE_LOCK
indicates a page lock event. This is based on events generated by PageManager
WikiPageEvent.PAGE_UNLOCK
indicates a page unlock event. This is based on events generated by PageManager

Pre-translate events#

WikiPageEvent.PRE_TRANSLATE_BEGIN
indicates the beginning of all wiki pre-translate page events. This is based on events generated by FilterManager
WikiPageEvent.PRE_TRANSLATE
indicates a wiki pre-translate page event. This is based on events generated by PageEventFilter
WikiPageEvent.PRE_TRANSLATE_END
indicates the end of all wiki pre-translate page events. This is based on events generated by FilterManager

Post-translate events#

WikiPageEvent.POST_TRANSLATE_BEGIN
indicates the beginning of all wiki post-translate page events. This is based on events generated by FilterManager
WikiPageEvent.POST_TRANSLATE
indicates a wiki post-translate page event. This is based on events generated by PageEventFilter
WikiPageEvent.POST_TRANSLATE_END
indicates the end of all wiki post-translate page events. This is based on events generated by FilterManager

Pre-save events#

WikiPageEvent.PRE_SAVE_BEGIN
indicates the beginning of all wiki pre-save page events. This is based on events generated by FilterManager
WikiPageEvent.PRE_SAVE
indicates a wiki pre-save page event. This is based on events generated by PageEventFilter
WikiPageEvent.PRE_SAVE_END
indicates the end of all wiki pre-save page events. This is based on events generated by FilterManager

Post-save events#

WikiPageEvent.POST_SAVE_BEGIN
indicates the beginning of all wiki post-save page events. This is based on events generated by FilterManager
WikiPageEvent.POST_SAVE
indicates a wiki post-save page event. This is based on events generated by PageEventFilter
WikiPageEvent.POST_SAVE_END
indicates the end of all wiki post-save page events. This is based on events generated by FilterManager

Page request events#

WikiPageEvent.PAGE_REQUESTED
indicates a wiki page request event (the start of a request). This is based on events generated by WikiServletFilter
WikiPageEvent.PAGE_DELIVERED
indicates a wiki page delivery event (the end of a request). This is based on events generated by WikiServletFilter
WikiPageEvent.PAGE_DELETE_REQUEST
indicates a wiki page delete event (the beginning of a delete request). This is based on events generated by WikiServletFilter
WikiPageEvent.PAGE_DELETED
indicates a wiki page deleted event (after the delete has been completed). This is based on events generated by WikiServletFilter

Notes#

Page Requested and Delivered Events#

These two events are fired once per page request, at the beginning and after delivery of the page (respectively). They are generated by the WikiServletFilter.

Page Lock and Unlock Events#

Page lock and unlock events occur only once during an editing session, so there are no begin and end events. They are generated by the PageManager.

WikiPageEvents#

Other WikiPageEvents include both phase boundary and in-phase events for saving, pre- and post-translating content. These are very noisy event types, but are not fired unless a listener is available. They are generated by the FilterManager, PageEventFilter, and potentially other implementing classes.

Firing Order and Phase Boundaries#

Note that due to the asynchronous nature of event processing, any threads spawned by such events will not necessarily have completed during their specific phase; we can assume only that no more events of that phase will be fired after its *_END event has been fired.


See also: WikiEvent, PageEventFilter, WikiEventListener, WikiEventManager


Category.Documentation