Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-4932

Add support for a wildcard mergePolicy.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None

      Description

      Currently there's not support for a wildcard mergePolicy.

      For example we would like to be able to declare the following policy:

      mergePolicy: {
          "*.someObject": "noexpand"
      }
      

      Which would result in no expansion for every second level (in the tree) "someObject" object.

      The issue first arose in GPII's lifecycle manager where we used now removed non-api function fluid.resolveEnvironment. We switched to using fluid.expand that acts almost in the same way. The noticeable difference between the two was that the latter one actually knows how to handle expanders (unlike the former).
      The object that was expanded with fluid.expand contains expanders but in the path that should not be expanded by the utility. Thus we were required to write an optional mergePolicy that would indicate that that particular path doesn't need to be expanded.

      Currently in order to do that we have to express it with an expanded version of the mergePolicy:

      mergePolicy: {
          someParent: {
              someObject: {
                  "*": { "noexpand": true // "noexpand" }
              }
          }
       }
      

      Example of the expanded material:

       [ {
           "capabilities": [
               "applications.org\\.gnome\\.desktop\\.a11y.magnifier.id"
           ],
           "settings": { 
               "mouse-tracking": "centered"
            }
          "capabilitiesTransformations": {
              "mag-factor": "display.screenEnhancement.magnification",
              "mouse-tracking": {
                  "expander": {
                      "type": "fluid.model.transform.valueMapper",
                      "inputPath": "display.screenEnhancement.tracking",
                      "options": {
                          "mouse":
                              { "outputValue": "centered" }
                          }
                      }
                  }
              }
           }
       ]
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              antranig Antranig Basman
              Reporter:
              yura Yura Zenevich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: