transformations

Antranig Basman antranig.basman at colorado.edu
Mon May 7 12:26:14 UTC 2012


Hi Anastasia, thanks for this report. The issue wasn't related to "outputPath" but was actually a bug in the 
valueMapper implementation which didn't accept options right-hand-sides which were literal values. I've 
pushed a fix and test case to my branch FLUID-4695 as well as additional implementation and tests for 
dealing with the case you mentioned of a target model structure which is non-default through containing 
array types - do try it out and let me know what further problems you run into.

Cheers,
A.


On 04/05/2012 11:43, Cheetham, Anastasia wrote:
>
> Hi, Antranig,
>
> I've been trying to update the AfASettingsStore to use the new code you have for model transformations. I'm having trouble with the valueMapper you've written; perhaps I don't know how to specify rules to do the transformation want.
>
> I need to transform (through valueMapping) the following (dot notation used for brevity):
>
>    display.screenEnhancement.fontFace: {
>      genericFontFace: "serif",
>      fontName: ["Times New Roman"]
>    }
>
> into
>
>    textFont: "times"
>
> So "serif" produces "times", "sans serif" produces "aria", etc.
>
> I'm trying to use the new valueMapper with this rule:
>
>      "textFont": {
>          "expander": {
>              "type": "fluid.model.transform.valueMapper",
>              "inputPath": "display.screenEnhancement.fontFace.genericFontFace",
>              "_comment": "TODO: For now, this ignores the actual 'fontName' setting",
>              "options": {
>                  "serif": "times",
>                  "sans serif": "verdana",
>                  "monospaced": "default",
>                  "fantasy": "default",
>                  "cursive": "default"
>              }
>          }
>      }
>
> but I apparently need an "outputPath." The problem is that the output path I want is the key to the rule: "textFont." It's at the root of the output model, so I can't use the "parent" as the key, afaik.
>
> Am I doing something wrong?
>
> Just for reference, I've pasted in a "full" version of the UIO settings and the associated AfA settings we need to transform between, at the end of this email. I'm probably going to run into more problems as I continue to work on this :-)
>
>




More information about the fluid-work mailing list