External Entities String Functions and JSONPath Field Mapper
External Entities String Functions and JSONPath Field Mapper is a field mapper plugin that extends the features of the JSONPath field mapper with current string functions (concatenate, sub-string, replace, etc.).
Features
With the default field mapping plugins, it is not possible to use parts of multiple field values to generate a new one. However, in some cases, it might be convenient to do so. For instance, when using xnttmulti to aggregate multiple sources into one external entity type, it might be convenient to be able to reference other entities according to the initial source of a given instance. Let's say I have an external entity "aggreg" that uses 2 REST service sources (alpha and beta) using xnttmulti: source "alpha" and "beta" provide the same field values but are differentiated by a prefix added to their identifier (using xnttmulti features). Therefore, on alpha and beta REST services, I could find an entity using the id "123" but from Drupal external entity "aggreg", I would have 2 entities, one with the identifier "a123" and another with "b123". So far, so good. But now, if those entities have a reference to an other entity, for instance a "child" entity, it would use the identifier of the source. If alpha "123" entity has a child "456", the corresponding Drupal external entity aggreg "a123" would just have a "456" identifier without prefix. Impossible to tell if it refers to "alpha" or "beta". This plugin can be used to solve that case by using a sub-string of the entity identifier that would extract the "source prefix" (ie. "a" or "b") and prefix it to the child reference field, so we would have "a456" that would refer to the correct source.
Similar projects
External Entities JSONPath field mapper (currently included in External Entities module).
Community Documentation
Not available yet.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-beta4 | Pre-release | Xntt v3 compatibility | Oct 9, 2024 |