org.opencms.main
Interface I_CmsEventListener

All Known Subinterfaces:
I_CmsModuleAction
All Known Implementing Classes:
A_CmsModuleAction, CmsDriverManager, CmsFlexCache, CmsLocaleManager, CmsMemoryObjectCache, CmsSearchManager, CmsStaticExportManager, CmsVfsMemoryObjectCache, CmsWorkplaceManager, CmsXmlEntityResolver

public interface I_CmsEventListener

Implement this interface in case your class has to react to CmsEvents that are thrown by system.

In order to recieve system events, your class must register with the OpenCms event mechanism. This can be done in the constructor of a class like this:

 org.opencms.main.OpenCms.addCmsEventListener(this);
 
A typical implementation might look like this:
 public void cmsEvent(org.opencms.main.CmsEvent event) {
     switch (event.getType()) {
         case org.opencms.main.I_CmsEventListener.EVENT_PUBLISH_PROJECT:
         case org.opencms.main.I_CmsEventListener.EVENT_CLEAR_CACHES:
             // do something
             break;
         case org.opencms.main.I_CmsEventListener.EVENT_LOGIN_USER:
            // do something else
             break;
         }
 }
 

Since:
6.0.0
Version:
$Revision: 1.32 $
Author:
Alexander Kandzior
See Also:
CmsEvent, OpenCms.addCmsEventListener(I_CmsEventListener), OpenCms.addCmsEventListener(I_CmsEventListener, int[])

Field Summary
static int EVENT_BEFORE_PUBLISH_PROJECT
          Event "a project is to published" (but has not yet been published).
static int EVENT_CLEAR_CACHES
          Event "all caches must be cleared".
static int EVENT_CLEAR_OFFLINE_CACHES
          Event "clear all offline caches".
static int EVENT_CLEAR_ONLINE_CACHES
          Event "clear all online caches".
static int EVENT_CLEAR_PRINCIPAL_CACHES
          Event "all caches related to user and groups must be cleared".
static int EVENT_FLEX_CACHE_CLEAR
          Event "the FlexCache must be cleared".
static int EVENT_FLEX_PURGE_JSP_REPOSITORY
          Event "delete all JSP pages in the "real" file system (so they will be rebuild next time the JSP is requested)".
static int EVENT_FULLSTATIC_EXPORT
          Event "full static export".
static int EVENT_LOGIN_USER
          Event "user has logged in".
static int EVENT_PROJECT_MODIFIED
          Event "a project was modified" (e.g. a project has been deleted, or the project resources have been changed).
static int EVENT_PROPERTY_DEFINITION_CREATED
          Event "a property definition has been created".
static int EVENT_PROPERTY_DEFINITION_MODIFIED
          Event "a property definition has been modified".
static int EVENT_PROPERTY_MODIFIED
          Event "a single property (and so the resource itself, too) have been modified".
static int EVENT_PUBLISH_PROJECT
          Event "a project was published".
static int EVENT_RESOURCE_AND_PROPERTIES_MODIFIED
          Event "all properties (and so the resource itself, too) have been modified".
static int EVENT_RESOURCE_COPIED
           
static int EVENT_RESOURCE_CREATED
           
static int EVENT_RESOURCE_DELETED
           
static int EVENT_RESOURCE_LIST_MODIFIED
          Event "the list of sub-resources of a folder has been modified", (e.g. a new resource has been created).
static int EVENT_RESOURCE_MODIFIED
          Event "a single resource has been modified".
static int EVENT_RESOURCE_MOVED
           
static int EVENT_RESOURCES_AND_PROPERTIES_MODIFIED
          Event "a list of resources and their properties have been modified".
static int EVENT_RESOURCES_MODIFIED
          Event "a bunch of resources has been modified".
static int EVENT_UPDATE_EXPORTS
          Event "update exported resources".
static java.lang.String KEY_DBCONTEXT
          Key name for passing a database context in the data map.
static java.lang.String KEY_PROJECTID
          Key name for passing a project id in the data map.
static java.lang.String KEY_PUBLISHID
          Key name for passing a publish history id in the data map.
static java.lang.String KEY_PUBLISHLIST
          Key name for passing a publish list in the data map.
static java.lang.String KEY_REPORT
          Key name for passing a report in the data map.
static java.lang.Integer LISTENERS_FOR_ALL_EVENTS
          Marker for "all events".
 
Method Summary
 void cmsEvent(CmsEvent event)
          Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.
 

Field Detail

KEY_REPORT

static final java.lang.String KEY_REPORT
Key name for passing a report in the data map.

See Also:
Constant Field Values

KEY_PUBLISHID

static final java.lang.String KEY_PUBLISHID
Key name for passing a publish history id in the data map.

See Also:
Constant Field Values

KEY_PUBLISHLIST

static final java.lang.String KEY_PUBLISHLIST
Key name for passing a publish list in the data map.

See Also:
Constant Field Values

KEY_PROJECTID

static final java.lang.String KEY_PROJECTID
Key name for passing a project id in the data map.

See Also:
Constant Field Values

KEY_DBCONTEXT

static final java.lang.String KEY_DBCONTEXT
Key name for passing a database context in the data map.

See Also:
Constant Field Values

LISTENERS_FOR_ALL_EVENTS

static final java.lang.Integer LISTENERS_FOR_ALL_EVENTS
Marker for "all events".


EVENT_LOGIN_USER

static final int EVENT_LOGIN_USER
Event "user has logged in".

Event data:

See Also:
CmsObject.loginUser(String, String), Constant Field Values

EVENT_PUBLISH_PROJECT

static final int EVENT_PUBLISH_PROJECT
Event "a project was published".

Event data:

See Also:
CmsPublishManager.publishProject(org.opencms.file.CmsObject), EVENT_BEFORE_PUBLISH_PROJECT, Constant Field Values

EVENT_BEFORE_PUBLISH_PROJECT

static final int EVENT_BEFORE_PUBLISH_PROJECT
Event "a project is to published" (but has not yet been published).

Event data:

See Also:
CmsPublishManager.publishProject(org.opencms.file.CmsObject), EVENT_PUBLISH_PROJECT, Constant Field Values

EVENT_FULLSTATIC_EXPORT

static final int EVENT_FULLSTATIC_EXPORT
Event "full static export".

This is thrown in CmsStaticExportManager. Event data:

See Also:
Constant Field Values

EVENT_CLEAR_CACHES

static final int EVENT_CLEAR_CACHES
Event "all caches must be cleared".

Not thrown by the core classes, but might be used in modules.

See Also:
Constant Field Values

EVENT_CLEAR_PRINCIPAL_CACHES

static final int EVENT_CLEAR_PRINCIPAL_CACHES
Event "all caches related to user and groups must be cleared".

Not thrown by the core classes, but might be used in modules.

See Also:
Constant Field Values

EVENT_FLEX_PURGE_JSP_REPOSITORY

static final int EVENT_FLEX_PURGE_JSP_REPOSITORY
Event "delete all JSP pages in the "real" file system (so they will be rebuild next time the JSP is requested)".

This is thrown on the "FlexCache Administration" page if you press the button "Purge JSP repository", or if you use the _flex=purge request parameter.

See Also:
Constant Field Values

EVENT_FLEX_CACHE_CLEAR

static final int EVENT_FLEX_CACHE_CLEAR
Event "the FlexCache must be cleared".

This is thrown on the "FlexCache Administration" page if you press one ot the "Clear cache" buttons, or if you use the _flex=clearcache request parameter.

See Also:
Constant Field Values

EVENT_RESOURCE_MODIFIED

static final int EVENT_RESOURCE_MODIFIED
Event "a single resource has been modified".

Event data:

See Also:
Constant Field Values

EVENT_RESOURCES_MODIFIED

static final int EVENT_RESOURCES_MODIFIED
Event "a bunch of resources has been modified".

Event data:

See Also:
Constant Field Values

EVENT_RESOURCE_LIST_MODIFIED

static final int EVENT_RESOURCE_LIST_MODIFIED
Event "the list of sub-resources of a folder has been modified", (e.g. a new resource has been created).

Event data:

See Also:
Constant Field Values

EVENT_PROPERTY_MODIFIED

static final int EVENT_PROPERTY_MODIFIED
Event "a single property (and so the resource itself, too) have been modified".

Event data:

See Also:
Constant Field Values

EVENT_RESOURCE_AND_PROPERTIES_MODIFIED

static final int EVENT_RESOURCE_AND_PROPERTIES_MODIFIED
Event "all properties (and so the resource itself, too) have been modified".

Event data:

See Also:
Constant Field Values

EVENT_CLEAR_OFFLINE_CACHES

static final int EVENT_CLEAR_OFFLINE_CACHES
Event "clear all offline caches".

Event data: none

See Also:
Constant Field Values

EVENT_CLEAR_ONLINE_CACHES

static final int EVENT_CLEAR_ONLINE_CACHES
Event "clear all online caches".

Event data: none

See Also:
Constant Field Values

EVENT_PROJECT_MODIFIED

static final int EVENT_PROJECT_MODIFIED
Event "a project was modified" (e.g. a project has been deleted, or the project resources have been changed).

Event data:

See Also:
Constant Field Values

EVENT_UPDATE_EXPORTS

static final int EVENT_UPDATE_EXPORTS
Event "update exported resources".

This event updates all export points, deletes the content of the "export" folder, purges the JSP repository, and clears all caches.

This event is for internal use.

See Also:
Constant Field Values

EVENT_RESOURCE_MOVED

static final int EVENT_RESOURCE_MOVED
See Also:
EVENT_RESOURCE_CREATED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_DELETED, Constant Field Values

EVENT_RESOURCE_CREATED

static final int EVENT_RESOURCE_CREATED
See Also:
EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, Constant Field Values

EVENT_RESOURCE_COPIED

static final int EVENT_RESOURCE_COPIED
See Also:
EVENT_RESOURCES_MODIFIED, Constant Field Values

EVENT_RESOURCE_DELETED

static final int EVENT_RESOURCE_DELETED
See Also:
EVENT_RESOURCES_MODIFIED, Constant Field Values

EVENT_PROPERTY_DEFINITION_MODIFIED

static final int EVENT_PROPERTY_DEFINITION_MODIFIED
Event "a property definition has been modified".

Event data:

See Also:
Constant Field Values

EVENT_RESOURCES_AND_PROPERTIES_MODIFIED

static final int EVENT_RESOURCES_AND_PROPERTIES_MODIFIED
Event "a list of resources and their properties have been modified".

Event data:

See Also:
Constant Field Values

EVENT_PROPERTY_DEFINITION_CREATED

static final int EVENT_PROPERTY_DEFINITION_CREATED
Event "a property definition has been created".

Event data:

See Also:
Constant Field Values
Method Detail

cmsEvent

void cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.

Parameters:
event - CmsEvent that has occurred