-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Params JsonObject #49
Comments
Hi @zajcu, In Knot.x 2.0.0 we introduced a task concept where you can define only one task per fragment.
Then in the configuration we have:
Task can specify one and more actions to execute, in this example we have two actions:
You can check available placeholders here. Maybe it is worth to add the example for configuration attributes, like
So then in the action configuration, you will have:
Can you please verify if it works for you? Our intention was to simply tag attributes. |
Thank you @zajcu for your input. As we discussed this solution works as expected. However, we discovered new requirements. Let me explain it with the example below: ZG Bridge integrates with Knot.x to deliver dynamic data to templates coming from AEM. ZG Bridge defines collections and collections items that can be easily used during AEM authoring. So, let's imagine that we have two independent collections: authors and books. Both authors and books are JSON objects coming from REST API. JSON is a contract, REST API is a data source. There are two REST endpoints for authors:
and books:
Then in ZG Bridge you can specify what items are used to fill a template from AEM. In this way, we can specify two books at a single page (first - the primary one, second - the recommended one). The example HTML markup can look like:
In Knot.x there is the
and specify two actions. But as you see this solution is not very flexible. So we need some configuration to make those task definitions more dynamic. Let's change the task configuration to:
Then we can configure
, where the
With this solution we specify Action once:
Then we can specify the dynamic task provider implementation that would transform the |
Thank you @tomaszmichalak this is exactly what we need to cover our requirements. By the way very nice explanation. |
Hi,
|
…ub.com:Knotx/knotx-fragments into feature/#49-node-factories-with-common-configs
…ub.com:Knotx/knotx-fragments into feature/#49-node-factories-with-common-configs
…ub.com:Knotx/knotx-fragments into feature/#49-node-factories-with-common-configs
…mon-configs Feature/#49 node factories with common configs
Is your feature request related to a problem? Please describe.
In databridge 1.5.0 version there was a awesome feature: params
https://github.com/Knotx/knotx-data-bridge/tree/1.5.0
What is missed in current 2.0 version
Describe the solution you'd like
We need similar feature in 2.x version. For example to cover example code:
`<knotx:snippet data-knotx-task-item="bookslist" data-knotx-bookslist-params-item='{"queryParams":{"q": "java"}}' data-knotx-task-item2="userlist" data-knotx-userlist-params-item2='{{"queryParams":{"name":"John Doe"}}'>
{{item._result.book.name}}
{{item2._result.user.name}}
...`I supposed the simple solution will be extend fragments model to have additional JsonObject property, and later in processing consume it for example in HttpAction like it was in old implementation in HttpClientFacade (1.5.0 version).
Potentialy this object can be reused in other places.
What do you think?
Additional context
We have used it a lot in our current project, we need this to start migrate !X to the last version.
The text was updated successfully, but these errors were encountered: