Allow users to edit objects and links(允许用户编辑对象和链接)¶
Editing data from Foundry object applications¶
You can allow users in user applications (like Workshop and Object Views) to edit property values, add and remove links, and create and delete objects. You can also configure side effects (like notifications) based on edits made by users.
The supported way to configure this functionality is to create and configure action types in the Ontology Manager. Learn more about how to set up action types.
The remainder of this documentation covers what needs to be configured on object types and link types before users can take actions.
Editing data from external applications¶
The Objects API provides endpoints for external clients to write and update objects, properties, and links with full permissions enforcement.
Set up the prerequisites¶
In order for a user to be able to take an action defined in an action type configuration, a writeback dataset must be created. The writeback dataset will read the edits made by users when it is built and will reflect the most up-to-date state of any given object.
:::callout{theme="neutral"} Note that edits are written to the writeback dataset and not the dataset backing an object type or link type. This ensures that users have access to both the original data and the edited data in their analyses. :::
To set up a writeback dataset:
- Navigate to the Datasources page of the object type or link type you want to enable edits on.
- Select Generate in the Writeback dataset portion of the page to create a new writeback dataset. A dialog will open asking you to choose a Project where you’d like to place the dataset. Select a location.
- Make sure the users who you want to be able to edit the object type or link type have edit permissions on the writeback dataset.
- Ensure that the users who you want to be able to view changes made to the object type or link type have view permissions on the writeback dataset.
- The ability to view objects and links is controlled by an object type and link type’s backing datasources.
- The ability to view the edits on objects and links is controlled by the permissions on the writeback dataset.
- If users have access to only the former, they can see only the object as it exists without edits applied. If users have access to the latter, they can see both the edits and the object as it exists at present.
:::callout{theme="neutral"} If you want a property in your object type to capture manually-entered data from an end user (via an Action or other writeback method) and this data does not yet exist in Foundry, you will need to add an empty column to the object type’s backing dataset and map it to a new property in your object type. You also need to enable edits; this is done by creating a writeback dataset in Object Storage V1 or by toggling on edits in Object Storage V2. :::
中文翻译¶
允许用户编辑对象和链接¶
从 Foundry 对象应用编辑数据¶
您可以允许用户应用(如 Workshop 和 Object Views)中的用户编辑属性值、添加和删除链接,以及创建和删除对象。您还可以根据用户的编辑操作配置副作用(如通知)。
配置此功能的推荐方式是在 Ontology Manager 中创建和配置操作类型(action types)。了解如何设置操作类型。
本文档的其余部分将介绍在用户执行操作之前,需要在对象类型(object types)和链接类型(link types)上进行的配置。
从外部应用编辑数据¶
Objects API 为外部客户端提供了端点,用于在完全权限控制下写入和更新对象、属性及链接。
设置前提条件¶
为了让用户能够执行操作类型配置中定义的操作,必须创建一个回写数据集(writeback dataset)。该回写数据集在构建时会读取用户所做的编辑,并反映任何给定对象的最新状态。
:::callout{theme="neutral"} 请注意,编辑内容会写入回写数据集,而非支持对象类型或链接类型的数据集。这确保了用户在分析中既能访问原始数据,也能访问编辑后的数据。 :::
要设置回写数据集:
- 导航至要启用编辑功能的对象类型或链接类型的 Datasources 页面。
- 在页面的 Writeback dataset 部分选择 Generate,以创建新的回写数据集。系统将弹出对话框,要求您选择放置数据集的 Project。请选择一个位置。
- 确保您希望允许编辑该对象类型或链接类型的用户拥有回写数据集的编辑权限。
- 确保您希望允许查看该对象类型或链接类型变更的用户拥有回写数据集的查看权限。
- 查看对象和链接的能力由对象类型和链接类型的支持数据源(backing datasources)控制。
- 查看对象和链接编辑内容的能力由回写数据集的权限控制。
- 如果用户仅能访问前者,则只能看到未应用编辑的对象。如果用户能访问后者,则既能查看编辑内容,也能查看对象的当前状态。
:::callout{theme="neutral"} 如果您希望对象类型中的某个属性能够捕获终端用户手动输入的数据(通过操作或其他回写方法),且该数据在 Foundry 中尚不存在,您需要在对象类型的支持数据集中添加一个空列,并将其映射到对象类型中的新属性。此外,您还需要启用编辑功能;这可以通过在 Object Storage V1 中创建回写数据集,或在 Object Storage V2 中开启编辑开关来实现。 :::