Syndesis: ActionMetadata should provide human readable schema label

Created on 25 Jan 2018  路  19Comments  路  Source: syndesisio/syndesis

Today we are using ActionMetadata/outputSchema/title as a Document label eventually. This is copied into DataShape/type here:
https://github.com/syndesisio/syndesis/blob/e488dffd620c30a45204f18786a1f0e6545b8383/app/rest/rest/src/main/java/io/syndesis/rest/v1/handler/connection/ConnectionActionHandler.java#L143
https://github.com/syndesisio/syndesis/blob/e488dffd620c30a45204f18786a1f0e6545b8383/app/rest/rest/src/main/java/io/syndesis/rest/v1/handler/connection/ConnectionActionHandler.java#L149

We need to do either

  • Put the human readable short label in ActionMetadata/outputSchema/title
  • Or introduce ActionMetadata/outputSchema/name

And also ActionMetadata/outputSchema/description for a bit longer description. datamapper UI is showing it as a tooltip when hover on a short label.

Then we might need to introduce those into DataShape as well. Note that DataShape/type is already used for class name, so it might be better to add name and description so that we can put the readable name and description on Java type as well.

Screenshots for Today's label and tooltip

test-flatprimitiveclass
twitter-status

groucommon grouconnector grouserver

All 19 comments

BTW, #1136 would need to allow users to specify DataShape label (and description) in the action configuration page.

@KurtStam suggested to introduce new properties like name and description, as title is already in use for internal use in DB connector.

@igarashitm so something like:

@Value.Immutable
@JsonDeserialize(builder = DataShape.Builder.class)
public interface DataShape extends Serializable {

    // New fields
    String getName();
    String getDescription()
    String[] getTags();

    String getKind();
    String getType();
    String getSpecification();

    class Builder extends ImmutableDataShape.Builder {
    }
}

I'd add just the implements WithName on the DataShape, is there a use case for tags and description, let's not overthink this 馃槇

description is shown as a tooltip in datamapper when you hover on a document name. It might be good to consider doing same in integration flow as well (related to #700, FYI @dongniwang).
tags sounds interesting, we can show them when user chose the action maybe?

BTW, can we add those name and description even for the Java DataShape (i.e. non-dynamic)? Let's say Twitter, today we're just showing a class name Status for label and FQCN twitter4j.Status for tooltip. It might be better showing Twitter Search or Twitter Mention just like we show in action configuration.

Thanks @igarashitm for opening this issue.

Just wanted to clarify and make sure we're on the same page:

  • I understand the current implementation of data mapper have the full data type information shown as a tooltip. But for integration flow, showing data type as a tooltip is probably not accessible and too hidden for users.
  • I don't really understand why we want to show the action 'Twitter search' instead of 'Twitter status'?

@dongniwang Yeah I mean we should show data type name in integration flow for sure. The description via tooltip would be an additional information on top of it, just like datamapper does.
Twitter Search and Twitter Mention is what user have seen when they choose the action right? I'm totally fine if we prefer class name though, I still want to have connectors to explicittly put those into name and description. I believe the fanciest name for the action is only known by the connector and its action itself :-)

Added screenshots for how datamapper UI shows label today in issue description. The tooltip just shows FQCN, and the document title is created from it in datamapper UI, which shouldn't. datamapper should consume those from outside.

@igarashitm @zregvart so should we add optional name ad description to the data-shape model ? I have some spare time so I can implement it if needed.

@lburgazzoli thanks that helps! agree that the description should be optional, tooltip shouldn't appear if there's no additional info.

Oh on the other hand, if name is not defined, the data type label is going to be blank in integration flow and datamapper. Not sure we want to accept it.

We can get name to return type as default value

Ah cool. That works for me then :-)

That might be just a gotcha when showing a label - if name is not empty then use it, otherwise use type.

@lburgazzoli so now each connector can put the DataShapeName and DataShapeDescription into properties when it generates dynamic schema, then those are automatically filled into DataShape, is that right?

Ah nope, that's extension, we still need to do something with dynamic action metadata if we want to generate those from action configuration.

Uh forgot it, let me work on it

Completed - Thank you for the great work @lburgazzoli !

Was this page helpful?
0 / 5 - 0 ratings