Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-6333

Additional types of parameter editors

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: rel-4-1-0
    • Component/s: Designer
    • Security Level: Users (General product issues)
    • Additional information:
      Hide

      Documentation: http://doc.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/parameters-editor.html#parameters-graph-parameter-type-editor

      Motivation: A nice thing about subgraphs is that they can look and behave like ordinary components. Users only need to connect edges to it and configure its properties. One of the main features that are making a subgraph to look like a component are public graph parameters that from the parent graph are edited as subgraph component's properties. To make editing of subgraph component's properties comfortable, graph parameters (which are backing the properties) have an Editor Type. Default editor type is String and it does not provide any special way of editing the value - just a simple editable cell.

      There are two ways of defining an editor type:

      • Component Binding - this editor type is bound to some particular component in the subgraph and its property. It can be easily created from Component Editor by selecting the property and choosing Export as graph parameter in component editor's toolbar.
      • Simple Type - this types are most helpful when there is no component the parameter could be bound to. For example when the value of parameter is written directly to output file or web service request, processed in CTL in some transformation or a dynamic parameter, used in Java code, etc.

      In Designer 4.0.x there were only few Simple Type editors: String, Multiline String, Integer, Boolean, Password, and File URL. If developer of a subgraph wanted to provide some other, more complex editors for subgraph's parameters, but the parameters were not bound to a component, he usually ended up adding disabled components, just for the reason of borrowing their editor.

      In 4.1, there are following editors available:

      • Basic: String, Multiline String, Integer, Decimal, Boolean
      • Advanced: File URL, Date/Time, Properties
      • Metadata Related: Single Field, Multiple Fields, Sort Key, Field Mapping, Join Key
      • Enumerations: Enumeration, Character Set, Time Zone, Field Type, Locale

      Many of the editors are configurable, which gives more flexibility than using disabled components and, of course, subgraph looks much better without them.

      The GoogleCharts.zip project demonstrates usage of parameter editors on subgraphs that create Google Vizualization's charts.

      Role mapping example
      The ScatterChart expects input metadata that comply to the Scatter Chart's data format.
      Input metadata, apart from data column with X values, may have N data columns for Y values and five optional columns for each data column. ScatterChart subgraph needs to know a role of each optional column, to be able to pass it to the chart. With Field Mapping editor it is easy to let the user annotate columns by their roles:

      In subgraph, mapped role can be obtained in CTL transformation by using following code:

      string roleMapping = getParamValue("ROLE_MAPPING");
      string[] roles = getMappedSourceFields(roleMapping, $in.0.fieldName);
      if (length(roles) > 0) {
          $out.0.role = roles[0];
      }
      

      Delimiter Filler example
      This is another example with a subgraph that works for any metadata on input edge. DelimiterFiller subgraph counts all input records and writes delimiter character to a field in all records but the last. The name of a field to which the subgraph writes is passed to subgraph by a public parameter with Simple Type editor. This editor allows to comfortably choose a field from input metadata and can even be configured to show only fields of string type.

      In DelimiterFiller, value of the parameter is used when writing data into output record:

      setStringValue($out.0, getParamValue("DELIMITER_FIELD"), delimiter);
      

      Point shape enumeration
      There is also an editor for choosing value from a list of available values. One only needs to put available values in a table...

      ... and the editor is ready for use:

      Look inside the GoogleCharts.zip project to see also examples on Sort Key, Multiline String (JSON), Character Set, Properties, Boolean, and Integer editors!

      Show
      Documentation : http://doc.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/parameters-editor.html#parameters-graph-parameter-type-editor Motivation : A nice thing about subgraphs is that they can look and behave like ordinary components. Users only need to connect edges to it and configure its properties. One of the main features that are making a subgraph to look like a component are public graph parameters that from the parent graph are edited as subgraph component's properties. To make editing of subgraph component's properties comfortable, graph parameters (which are backing the properties) have an Editor Type . Default editor type is String and it does not provide any special way of editing the value - just a simple editable cell. There are two ways of defining an editor type: Component Binding - this editor type is bound to some particular component in the subgraph and its property. It can be easily created from Component Editor by selecting the property and choosing Export as graph parameter in component editor's toolbar. Simple Type - this types are most helpful when there is no component the parameter could be bound to. For example when the value of parameter is written directly to output file or web service request, processed in CTL in some transformation or a dynamic parameter, used in Java code, etc. In Designer 4.0.x there were only few Simple Type editors: String, Multiline String, Integer, Boolean, Password, and File URL. If developer of a subgraph wanted to provide some other, more complex editors for subgraph's parameters, but the parameters were not bound to a component, he usually ended up adding disabled components, just for the reason of borrowing their editor. In 4.1, there are following editors available: Basic: String, Multiline String, Integer, Decimal, Boolean Advanced: File URL, Date/Time, Properties Metadata Related: Single Field, Multiple Fields, Sort Key, Field Mapping, Join Key Enumerations: Enumeration, Character Set, Time Zone, Field Type, Locale Many of the editors are configurable, which gives more flexibility than using disabled components and, of course, subgraph looks much better without them. The GoogleCharts.zip project demonstrates usage of parameter editors on subgraphs that create Google Vizualization's charts. Role mapping example The ScatterChart expects input metadata that comply to the Scatter Chart's data format . Input metadata, apart from data column with X values, may have N data columns for Y values and five optional columns for each data column. ScatterChart subgraph needs to know a role of each optional column, to be able to pass it to the chart. With Field Mapping editor it is easy to let the user annotate columns by their roles: In subgraph, mapped role can be obtained in CTL transformation by using following code: string roleMapping = getParamValue( "ROLE_MAPPING" ); string[] roles = getMappedSourceFields(roleMapping, $in.0.fieldName); if (length(roles) > 0) { $out.0.role = roles[0]; } Delimiter Filler example This is another example with a subgraph that works for any metadata on input edge. DelimiterFiller subgraph counts all input records and writes delimiter character to a field in all records but the last. The name of a field to which the subgraph writes is passed to subgraph by a public parameter with Simple Type editor. This editor allows to comfortably choose a field from input metadata and can even be configured to show only fields of string type. In DelimiterFiller, value of the parameter is used when writing data into output record: setStringValue($out.0, getParamValue( "DELIMITER_FIELD" ), delimiter); Point shape enumeration There is also an editor for choosing value from a list of available values. One only needs to put available values in a table... ... and the editor is ready for use: Look inside the GoogleCharts.zip project to see also examples on Sort Key, Multiline String (JSON), Character Set, Properties, Boolean, and Integer editors!

      Description

      • additional types of editors for parameters
      • avoid "hacking" - putting component into subgraph only to get nice editor
        • locale
        • charset

      go through all editors and consider using it as editor type for parameters. Create list of possible new parameter editor types.

      Editors dependent on component (eg. using input metadata) are not good candidates of parameter editor. But most of "independent" editors probably are.

        Attachments

        1. GoogleCharts.zip
          166 kB
        2. pointShapeCombo.png
          pointShapeCombo.png
          10 kB
        3. pointShapeValues.png
          pointShapeValues.png
          21 kB
        4. roleMapping.png
          roleMapping.png
          62 kB
        5. selectDelimiterField.png
          selectDelimiterField.png
          120 kB

          Issue Links

            Activity

              People

              Assignee:
              krygielovam Magdalena Malysz (Inactive)
              Reporter:
              urbanj Jaroslav Urban (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 7 hours, 45 minutes
                  1d 7h 45m