Transformer

From wiki.gpii
Revision as of 21:35, 9 October 2012 by Kasper Galschiot Markus (talk | contribs) (Created page with "==Description == The transformer is a utility that can be used by the Cloud4All/GPII architecture to translate between common terms and application specific settings. It is s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

The transformer is a utility that can be used by the Cloud4All/GPII architecture to translate between common terms and application specific settings. It is stateless, relatively easy to extend an has a basic API. Generally, transformations are defined by a vendor (or user) in the description of a solution in the Solution Registry, more particular in a Settings Handler blocks, to describe how an application specific setting(s) can be understood and transformed into a common term(s) and vice versa.

Below a description of how a transformation is described and what transformations are available. To get more context on where and how this is defined, see: Solution Registry.

At the end of this document, a description of how to implement new types of transformations is described. This is targeted at implementers only.

Declaring a transformation for a solution

As mentioned above, transformation rules for solution settings are declared along with the solutions in the settingsHandler section of the Solution Registry. The general format of this block of a solution declaration in object (hash). The key of the hash is a setting that the application understands and the value describes

              "capabilitiesTransformations": {
                   "Magnification": {
                       "expander": {
                           "type": "gpii.transformer.scaleValue",
                           "inputPath": "display.screenEnhancement.magnification",
                           "outputPath": "value",
                           "factor": 100
                       },
                       "dataType": {
                           "expander": {
                               "type": "fluid.model.transform.literalValue",
                               "value": "REG_DWORD"
                           }
                       }
                   }
               }