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 StringapplicationTranslationKeyprotected org.xwiki.component.manager.ComponentManagercomponentManagerprotected ContextualLocalizationManagercontextualLocalizationManagerprotected StringdescriptionTranslationKeyprotected org.slf4j.Loggerloggerprotected org.xwiki.component.namespace.NamespaceContextExecutornamespaceContextExecutor
-
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 booleanequals(Object o)StringgetApplicationName()StringgetDescription()protected StringgetLocalizedMessage(String key)Render a translation key in the context of the namespace (e.g.inthashCode()-
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:
getDescriptionin interfaceRecordableEventDescriptor- Returns:
- the description of the event type
-
getApplicationName
public String getApplicationName()
- Specified by:
getApplicationNamein interfaceRecordableEventDescriptor- Returns:
- the name of the application that provide this event
-
-