Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-481

The Components must expose icons and available connectors

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Work Item
    • Resolution: Fixed
    • Minor
    • None
    • None
    • None
    • All
    • GreenHopper Ranking:
      0|i0ysd7:
    • 9223372036854775807
    • Small

    Description

      Currently, the icon is not exposed or incorrectly exposed. Also, a Filter component should expose that it has 2 available outgoing ports (a MAIN and a REJECT) for example. This information is currently unavailable in TCOMP as it should.


      Proposal

      Icons

      The current return value when querying components has the following format:

      [
        {
          "name": "KafkaInput",
          "label": "Kafka Input",
          "iconURL": "/components/wizards/KafkaInput/icon/TREE_ICON_16X16",
          "type": "component",
          "typologies": [
            "SOURCE"
          ],
          "executionEngines": [
            "BEAM"
          ]
        },
        <...snip... other components ...snip...>
      ]
      

      The iconURL always points to the TCOMP REST URI that serves the byte stream for a image/png via a Wizard. Internally, this is redirected to an image via the Definition#getImagePath method, which identifies the resource to load and send from the jars on the classpath of the REST server.

      Currently, this will only work for ComponentWizardDefinition, not ComponentDefinition, etc and needs to be extended to all Definition subclasses.

      Following the existing endpoints on the wiki, I suggest:

      GET /properties/{definitionName}/icon/{type}
      

      Since there is an icon repository at github.comTalend/ui, we should in addition be able to specify an iconKey if one is available for the component. If this value is present and valid, the iconKey should be preferred by the product, otherwise the byte stream at iconURL should be downloaded and used.

      [
        {
          "name": "KafkaInput",
          "label": "Kafka Input",
          "iconURL": "/properties/KafkaInput/icon/SVG_ICON",
          "iconKey": "kafka",
          "type": "component",
          "typologies": [
            "SOURCE"
          ],
          "executionEngines": [
            "BEAM"
          ]
        },
        <...snip... other components ...snip...>
      ]
      

      Image types.

      Currently, TCOMP supports the following image types:

      • ComponentImageType: PALLETE_ICON_32X32
      • WizardImageType: TREE_ICON_16X16 and WIZARD_BANNER_75X66

      I propose to unify these under one enumeration: DefinitionImageType

      • SVG_ICON, PALETTE_ICON_32X32 (note spelling), TREE_ICON_16X16 and WIZARD_BANNER_75X66
      • If the type isn't specified, the Definition can choose its preferred format.
      • If the type isn't supported, the Definition should not return a value (probably 404 NOT FOUND) and the product should use an appropriate placeholder.
      • When proposing a URL in the definition endpoints, the first defined image resource in the above list is returned.

      Available connectors for a component

      Currently, connectors are exposed using FixedConnectorsComponentProperties#getAllSchemaPropertiesConnectors for ComponentProperties. There is currently no endpoint to retrieve this information from the REST API.

      Following the existing endpoints on the wiki, I suggest:

      GET /properties/{definitionName}/connectors
      

      With a return body of:

      {
          connectors: [
              {connectorType: 'SINK', flowType: 'MAIN'},
              {connectorType: 'SOURCE', flowType: 'MAIN'},
              {connectorType: 'SOURCE', flowType: 'REJECT'}
          ]
      }
      

      To get the initial set of connectors for a default component.

      Optionally:

      POST /properties/{definitionName}/connectors
      

      If the component can change its connectors according to the configuration of its properties. The body would be the same as all other /properties/* endpoints.

      Attachments

        Issue Links

          Activity

            People

              rskraba Ryan Skraba
              rdubois Rémy DUBOIS
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: