Component:DataFeedItemMapper: Difference between revisions

From Resonite Wiki
add info
add some explaination
Line 3: Line 3:
|Name=Data Feed Item Mapper
|Name=Data Feed Item Mapper
}}
}}
The DataFeedItemMapper allows you to define which data feed items map to which UI templates.
The DataFeedItemMapper allows you to define which data feed items map to which UI templates. It does this via the list <code>Mappings</code>, which take classes that extend [[Type:DataFeedItem|DataFeedItem]] and If they match a mapping in the list it Duplicates that item's template and adds it into the list.
 
For more info on data feeds, see [[Data Feed]]s


== Fields ==
== Fields ==
Line 17: Line 19:
== ItemMapping ==
== ItemMapping ==
{{Table TypeFields
{{Table TypeFields
|ItemType|{{RootFieldType|SyncType}}|TypeAdv0=true| The type to map to a template. The type coming from a data feed usually is based on the class DataFeedItem.
|ItemType|{{RootFieldType|SyncType}}|TypeAdv0=true| The type to map to a template. The type coming from a data feed will extend the abstract class [[Type:DataFeedItem|DataFeedItem]].
|GenericReplacementTypes|{{RootFieldType|SyncTypeList}}|TypeAdv1=true| If <code>ItemType</code> is a type that has generic single letter arguments, the type won't be accepted if it's arguments in order don't match the arguments in this list in order.
|GenericReplacementTypes|{{RootFieldType|SyncTypeList}}|TypeAdv1=true| If <code>ItemType</code> is a type that has generic single letter arguments, the type won't be accepted if it's arguments in order don't match the arguments in this list in order.
|Template|'''[[Component:FeedItemInterface|FeedItemInterface]]'''|TypeAdv2=true| The template to duplicate when matched with this item mapping.
|Template|'''[[Component:FeedItemInterface|FeedItemInterface]]'''|TypeAdv2=true| The template to duplicate when matched with this item mapping.
Line 24: Line 26:
== Usage ==
== Usage ==


This component will use the item mappings defined in the Mappings list to match specific [[Type:Type|Types]] of data feed items to corresponding feed item interface templates.
This component is to be put into a [[Component:SingleFeedView]] or similar so that the component it is specified inside of can use this component to map incoming feed items from the data feed to UI or object templates.


== Examples ==
== Examples ==

Revision as of 18:11, 12 January 2025

Component image 
Data Feed Item Mapper component as seen in the Scene Inspector

The DataFeedItemMapper allows you to define which data feed items map to which UI templates. It does this via the list Mappings, which take classes that extend DataFeedItem and If they match a mapping in the list it Duplicates that item's template and adds it into the list.

For more info on data feeds, see Data Feeds

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Mappings list of ItemMapping A list of item Mappings to map data feed item types to Feed Templates.

Sync Delegates

Lua error in mw.text.lua at line 25: bad argument #1 to 'match' (string expected, got nil).
Triggers
Method Name Method type and Arguments. Is the method hidden? Description

ItemMapping

Fields
Name Type Description
ItemType direct SyncType The type to map to a template. The type coming from a data feed will extend the abstract class DataFeedItem.
GenericReplacementTypes list of SyncType If ItemType is a type that has generic single letter arguments, the type won't be accepted if it's arguments in order don't match the arguments in this list in order.
Template FeedItemInterface The template to duplicate when matched with this item mapping.

Usage

This component is to be put into a Component:SingleFeedView or similar so that the component it is specified inside of can use this component to map incoming feed items from the data feed to UI or object templates.

Examples

See Also