Write back data with Actions(使用操作(Actions)回写数据)¶
You may want to configure your Slate application so that user work in the interactive application is "written back" to the underlying data asset in Foundry. The recommended way to perform writeback in Slate is using Ontology Actions. To write data back directly, you can use OSDK Actions or API Gateway Queries. If you prefer to use a submission form for this purpose, consider using the Action widget.
In addition to reading from the Ontology layer through the platform tab, Slate supports writing back to the Ontology via Actions using the Action widget.
Slate's writeback to the Ontology is configured through a widget, rather than through the Platform tab, to allow the developer to optionally take advantage of the automatically generated Action Form. This allows developers to avoid recreating all of the form elements from Slate widgets.
In this setup, it's common to place the Action widget within a Dialog container and trigger the container to open with a Slate Event when the form should be shown.
Alternatively, the form display can be toggled off, in which case the widget configuration serves as a template to collect the values to submit based on user interactions and inputs in other widgets within the app. Submission is then triggered with an event, most often from a Button widget.
The Action widget also provides hooks for Slate Events to broadcast the validation state of the Action as well as its successful or failed submission.
Review the documentation on Actions for more details of how to structure and configure Actions, and the documentation on the Action Widget for details on widget configuration in Slate.
中文翻译¶
使用操作(Actions)回写数据¶
您可能希望配置Slate应用程序,使得用户在交互式应用程序中的操作能够"回写"到Foundry中的底层数据资产。在Slate中执行回写的推荐方式是使用本体论操作(Ontology Actions)。如需直接回写数据,您可以使用OSDK操作(OSDK Actions)或API网关查询(API Gateway Queries)。如果您希望为此目的使用提交表单,请考虑使用操作组件(Action widget)。
除了通过平台标签页(Platform tab)从本体论层(Ontology layer)读取数据外,Slate还支持通过操作组件(Action widget)使用操作(Actions)将数据回写到本体论(Ontology)。
Slate通过组件而非平台标签页来配置回写到本体论的操作,这样开发者可以选择利用自动生成的操作表单(Action Form)。这使得开发者无需使用Slate组件重新创建所有表单元素。
在这种配置中,通常的做法是将操作组件(Action widget)放置在对话框(Dialog)容器内,并在需要显示表单时通过Slate事件(Slate Event)触发容器打开。
或者,也可以关闭表单显示,此时组件配置将作为模板,根据用户在其他组件中的交互和输入来收集要提交的值。然后通过事件触发提交,最常见的是通过按钮组件(Button widget)实现。
操作组件(Action widget)还提供了Slate事件(Slate Events)的钩子,用于广播操作的验证状态以及提交成功或失败的信息。
请查阅操作(Actions)的文档,了解如何构建和配置操作的更多详情,以及操作组件(Action Widget)的文档,了解Slate中组件配置的详细信息。