Package org.xwiki.eventstream
Class AbstractRecordableEventDescriptor
- java.lang.Object
-
- org.xwiki.eventstream.AbstractRecordableEventDescriptor
-
- All Implemented Interfaces:
RecordableEventDescriptor
public abstract class AbstractRecordableEventDescriptor extends Object implements RecordableEventDescriptor
Abstract implementation ofRecordableEventDescriptor
.- Since:
- 9.4RC1
- Version:
- $Id: 617314823231d5c4319ed3ded7cd323bcab9350b $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.xwiki.eventstream.RecordableEventDescriptor
RecordableEventDescriptor.EventFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected String
applicationTranslationKey
protected org.xwiki.component.manager.ComponentManager
componentManager
protected ContextualLocalizationManager
contextualLocalizationManager
protected String
descriptionTranslationKey
protected org.slf4j.Logger
logger
protected org.xwiki.component.namespace.NamespaceContextExecutor
namespaceContextExecutor
-
Constructor Summary
Constructors Constructor Description AbstractRecordableEventDescriptor(String descriptionTranslationKey, String applicationTranslationKey)
Construct an AbstractRecordableEventDescriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getApplicationName()
String
getDescription()
protected String
getLocalizedMessage(String key)
Render a translation key in the context of the namespace (e.g.int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.eventstream.RecordableEventDescriptor
getApplicationIcon, getApplicationId, getEventTitle, getEventType, getEventTypeIcon, getFilter, isEnabled
-
-
-
-
Field Detail
-
logger
@Inject protected org.slf4j.Logger logger
-
componentManager
@Inject protected org.xwiki.component.manager.ComponentManager componentManager
-
contextualLocalizationManager
@Inject protected ContextualLocalizationManager contextualLocalizationManager
-
namespaceContextExecutor
@Inject protected org.xwiki.component.namespace.NamespaceContextExecutor namespaceContextExecutor
-
descriptionTranslationKey
protected String descriptionTranslationKey
-
applicationTranslationKey
protected String applicationTranslationKey
-
-
Constructor Detail
-
AbstractRecordableEventDescriptor
public AbstractRecordableEventDescriptor(String descriptionTranslationKey, String applicationTranslationKey)
Construct an AbstractRecordableEventDescriptor.- Parameters:
descriptionTranslationKey
- the name of the translation key that describe the eventapplicationTranslationKey
- the translation key of the name of the application that send this event
-
-
Method Detail
-
getLocalizedMessage
protected String getLocalizedMessage(String key)
Render a translation key in the context of the namespace (e.g. the current wiki) where the component has been loaded. Use-case: an event descriptor coming from the sub wiki is loaded and displayed in the main wiki. If the translation resource is located in the sub wiki with the "WIKI" scope, the translation could not be rendered in the main wiki. That's why we need to execute the localization in the context of the sub wiki.- Parameters:
key
- the key to render- Returns:
- the rendered localization.
- Since:
- 10.6RC1, 10.5, 9.11.6
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceRecordableEventDescriptor
- Returns:
- the description of the event type
-
getApplicationName
public String getApplicationName()
- Specified by:
getApplicationName
in interfaceRecordableEventDescriptor
- Returns:
- the name of the application that provide this event
-
-