Package com.microstrategy.web.app
Class EventMap
- java.lang.Object
-
- com.microstrategy.utils.config.AbstractConfigurationElement
-
- com.microstrategy.web.app.EventMap
-
- All Implemented Interfaces:
ConfigurationElement
,ConfigurationFile
,java.lang.Cloneable
public class EventMap extends AbstractConfigurationElement
This class represents an event Map. An Event map is used to have one WebBean handle an event that was not originated by itself, based on the information of another event.
These maps are defined on the page config, as children of the page node.
This class can be initialized receiving an XML Node with the following structure:
<event-map id="eventId" map-id="mapId" target="targetBean">
It provides a map() method that returns a WebEvent, applying the map as defined for this EventMap
<argument id="argId" map-id="mapId" />
<argument id="argId2" map-id="mapId2" />
...
</event-map>
- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventMap.EventMapArgument
Represents an argument that will be mapped as part of an event-map.-
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATT_ID
Returns a Hashmap with the list of arguments.static java.lang.String
ATT_MAP_ID
static java.lang.String
ATT_ROOT_ONLY
static java.lang.String
ATT_TARGET
static java.lang.String
NODE_EVENT
-
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventMapArgument(EventMap.EventMapArgument eventMapArgument)
AbstractConfigurationElement.FilteredList
getArguments()
int
getEventId()
java.lang.Object
getKey()
Default implementation forgetKey()
.protected java.lang.String
getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.int
getMapId()
java.lang.String
getTarget()
Returns the target of this map.protected boolean
isKeyAttribute(java.lang.String name)
Returnstrue
is the name is that of the key attribute.boolean
isRootOnly()
Returns whether this map applies to events from all sources or only those whose source is the root of the beans hierarchyWebEvent
map(RequestKeys requestKeys, PageComponent page)
void
setEventId(int value)
Set the event id of the event map to the given valuevoid
setKey(org.w3c.dom.Element element)
Default implementation forsetKey()
.void
setMapId(int value)
Set the map id of the event map to the given valuevoid
setRootOnly(boolean value)
Set this event map to be root only or otherwisevoid
setTarget(java.lang.String value)
Set the target of the event map to the given value-
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getDTDFileName, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initDefaultAttributes, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, load, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reload, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setStrAttribute, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation
-
-
-
-
Field Detail
-
ATT_ID
public static final java.lang.String ATT_ID
Returns a Hashmap with the list of arguments. It's not intended to be used as a public field. It has package visibility only for Unittesting purposes.- See Also:
- Constant Field Values
-
ATT_TARGET
public static final java.lang.String ATT_TARGET
- See Also:
- Constant Field Values
-
ATT_ROOT_ONLY
public static final java.lang.String ATT_ROOT_ONLY
- Since:
- MicroStrategy Web 8.0.1
- See Also:
- Constant Field Values
-
ATT_MAP_ID
public static final java.lang.String ATT_MAP_ID
- See Also:
- Constant Field Values
-
NODE_EVENT
public static final java.lang.String NODE_EVENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EventMap
public EventMap()
- Since:
- MicroStrategy Web 9.0.0
-
EventMap
public EventMap(org.w3c.dom.Node root)
Creates an EventMap with the information in the xml node.- Parameters:
root
- An XML Node with the information for this event map.
-
EventMap
public EventMap(int eventId, int mapId, java.lang.String target)
Constructor for an EventMap with the given the arguments.- Parameters:
eventId
- The original eventmapId
- The Id of the event to map totarget
- The name of the bean that should handle the request.
-
-
Method Detail
-
getEventId
public int getEventId()
- Returns:
- the id of the event to be mapped
-
setEventId
public void setEventId(int value)
Set the event id of the event map to the given value- Parameters:
value
- The value for the event id on the event map- Since:
- MicroStrategy Web 9.0.0
-
getMapId
public int getMapId()
- Returns:
- the id of the event to map to
-
setMapId
public void setMapId(int value)
Set the map id of the event map to the given value- Parameters:
value
- The value for the map id on the event map- Since:
- MicroStrategy Web 9.0.0
-
getTarget
public java.lang.String getTarget()
Returns the target of this map. The target should be a bean children of the current page. You must specify the complete path of the target, if the bean is the bean is a child of another bean, i.e.:
bean.child.child.target
- Returns:
- the path fo the target bean of this event-map
-
setTarget
public void setTarget(java.lang.String value)
Set the target of the event map to the given value- Parameters:
value
- The value for the target on the event map- Since:
- MicroStrategy Web 9.0.0
-
isRootOnly
public boolean isRootOnly()
Returns whether this map applies to events from all sources or only those whose source is the root of the beans hierarchy- Returns:
- true for root event maps
- Since:
- MicroStrategy Web 8.0.1
-
setRootOnly
public void setRootOnly(boolean value)
Set this event map to be root only or otherwise- Parameters:
value
- The boolean value for the rootOnly attribute on the event map.- Since:
- MicroStrategy Web 9.0.0
-
addEventMapArgument
public void addEventMapArgument(EventMap.EventMapArgument eventMapArgument)
- Since:
- MicroStrategy Web 9.0.0
-
getArguments
public AbstractConfigurationElement.FilteredList getArguments()
- Since:
- MicroStrategy Web 9.0.0
-
map
public WebEvent map(RequestKeys requestKeys, PageComponent page)
- Parameters:
requestKeys
- TheRequestKeys
instance with the current request informationpage
- the current Page component from which the Event should be generated.- Returns:
- A WebEvent mapped from this EventMap information. It will return
null
if either the target bean is not found or if neither of the events (the source or target) are defined.
-
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElement
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.- Specified by:
getKeyAttribute
in classAbstractConfigurationElement
- Since:
- MicroStrategy Web 9.0.0
-
getKey
public java.lang.Object getKey()
Description copied from class:AbstractConfigurationElement
Default implementation forgetKey()
. It assumes a single attribute can be used to uniquely identify this element among its siblings; the attribute to use is specified by thegetKeyAttribute()
method.- Specified by:
getKey
in interfaceConfigurationElement
- Overrides:
getKey
in classAbstractConfigurationElement
- Returns:
- If
getKeyAttribute()
is empty returnsnull
, otherwise it returns the value of the given attribute. - Since:
- MicroStrategy Web 9.0.0
-
setKey
public void setKey(org.w3c.dom.Element element)
Description copied from class:AbstractConfigurationElement
Default implementation forsetKey()
. It assumes a single attribute can be used to uniquely identify this element among its siblings and adds this attribute to the given element; the attribute to use is specified by thegetKeyAttribute()
method.- Overrides:
setKey
in classAbstractConfigurationElement
- Since:
- MicroStrategy Web 9.0.0
-
isKeyAttribute
protected boolean isKeyAttribute(java.lang.String name)
Description copied from class:AbstractConfigurationElement
Returnstrue
is the name is that of the key attribute.- Overrides:
isKeyAttribute
in classAbstractConfigurationElement
- Since:
- MicroStrategy Web 9.0.0
-
-