Skip to content

Commit 738be59

Browse files
Merge pull request #4919 from open-formulieren/docs/product-prefill
Add/update documentation for product prefill
2 parents 486d9cb + 26ce5fc commit 738be59

File tree

13 files changed

+303
-59
lines changed

13 files changed

+303
-59
lines changed

docs/conf.py

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
"https://zgw-consumers.readthedocs.io/en/latest/",
7979
None,
8080
),
81+
"objecttypes": (
82+
"https://objects-and-objecttypes-api.readthedocs.io/en/stable/",
83+
None,
84+
),
8185
}
8286

8387
# -- Options for HTML output -------------------------------------------------

docs/configuration/index.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ There are many configuration options in Open Forms. Some of these are included
77
in the core of Open Forms, and some are included by plugins. We cover various
88
configuration topics that come with Open Forms by default.
99

10-
Initial configuration
11-
---------------------
12-
1310
Open Forms supports the ``setup_configuration`` management command, which allows loading configuration via
1411
YAML files. The shape of these files is described at :ref:`installation_configuration_cli`.
1512

13+
Initial configuration
14+
---------------------
15+
1616
.. toctree::
1717
:maxdepth: 2
1818

1919
general/index
2020

21+
Plugins
22+
-------
23+
24+
Many of the plugins in Open Forms require some technical configuration before you can
25+
use them in forms. The technical requirements are grouped by functionality module.
26+
2127
.. toctree::
2228
:maxdepth: 2
23-
:caption: Plugins
2429

2530
authentication/index
2631
payment/index
Binary file not shown.
+105-37
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,127 @@
1-
.. todo:: This feature is still in development and not ready for production yet.
2-
31
.. _configuration_prefill_objects_api:
42

53
===========
64
Objects API
75
===========
86

9-
The `Objects API`_ stores data records of which the structure and shape are defined by a particular object type
10-
definition in the `Objecttypes API`_. These records can be used to pre-fill form fields if an object reference is
11-
passed when the form is started.
7+
*This plugin is also known as the "product prefill" feature.*
8+
9+
The `Objects API`_ stores data records of which the structure and shape are defined by a
10+
particular object type definition in the `Objecttypes API`_. These records can be used
11+
to pre-fill form fields if an object reference is passed when the form is started.
1212

1313
.. note::
1414

15-
The service may contain sensitive data. It is advised to require DigiD/eHerkenning authentication on the form. You
16-
should be careful with how you pass the object references to the customers and set up the object type in a way that
17-
makes authentication checks possible (e.g. by storing the expected BSN or KVK number).
15+
The service likely contains sensitive data. It is required to use authentication on
16+
the form, as this information is used to test ownership of the referenced object.
1817

19-
.. _`Objects API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/
20-
.. _`Objecttypes API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/
18+
What does the Open Forms administrator need?
19+
============================================
2120

21+
* An instance of the `Objecttypes API`_ with:
22+
23+
- an API token to access the API from Open Forms
24+
- one or more objecttypes
25+
26+
* An instance of the `Objects API`_ (v2.2+) with:
27+
28+
- (API) access to the above Objecttypes API
29+
- an API token to access the Objects API from Open Forms
30+
- read permissions for the relevant Objecttypes - Open Forms reads records.
2231

2332
Configuration
2433
=============
2534

26-
1. In Open Forms, navigate to: **Forms**
27-
2. Click **Add form**
28-
3. Define the necessary form details and add the desired components
29-
4. Navigate to: **Variables** tab
30-
5. Navigate to: **User defined** subtab
31-
6. Click **Add variable** and fill in the data from the available options:
35+
Configuration is similar to :ref:`its registration counterpart <configuration_registration_objects>`,
36+
but only the objecttypes and objects services are required.
3237

33-
* **Plugin**: Choose the *Objects API* plugin
34-
* **API Group**: Select the appropriate API group. These API groups should be set up
35-
by an administrator, via **Admin** > **Configuration** > **Prefill plugins** >
36-
**Objects API** > **Manage API groups**
37-
* **Objecttype**: Select the expected object type from the dropdown.
38-
* **Mappings**: Configure which property from the Objects API record needs to be
39-
assigned to which form variable.
38+
.. tip:: You can re-use the same API groups that are used for the registration plugin.
4039

41-
For each form variable you want to pre-fill, add a new mapping. Then, on the left
42-
select the desired form variable, and on the right you can specify which property
43-
from the object type contains the value.
40+
To configure the Objects API follow these steps:
4441

45-
7. Click **Save**
46-
8. Save the form
42+
#. In Open Forms, navigate to: **Configuration** > **Services**
43+
#. Create a service for the Objects API (ORC) where the form data will be registered.
4744

48-
The Objects API configuration is now complete.
45+
a. Click **Service toevoegen**.
46+
b. Fill out the form:
4947

50-
.. note::
48+
* **Label**: *Fill in a human readable label*, for example: ``My Objects API``
49+
* **Type**: Select the type: ``ORC``
50+
* **API root url**: The root of this API, *for example* ``https://example.com/objecten/api/v2/``
51+
52+
* **Authorization type**: Select the option: ``API Key``
53+
* **Header key**: Fill in ``Authorization``
54+
* **Header value**: Fill in ``Token <tokenValue>`` where ``<tokenValue>`` is replaced by the token provided by the backend service
55+
* **OAS**: URL that points to the OAS, same URL as used for **API root url** with ``/schema/openapi.yaml`` added to it
56+
*for example:* ``https://example.com/objecten/api/v1/schema/openapi.yaml``
57+
58+
* **NLX**: Support for NLX can be selected here if enabled in the installation
59+
60+
c. Click **Opslaan** and repeat to create configuration for the other component.
61+
62+
#. Create a service for the Objecttypes API (ORC).
63+
64+
a. Click **Service toevoegen**.
65+
b. Fill out the form:
66+
67+
* **Label**: *Fill in a human readable label*, for example: ``My Objecttypes API``
68+
* **Type**: Select the type: ``ORC``
69+
* **API root url**: The root of this API, *for example* ``https://example.com/objecttypen/api/v2/``
70+
71+
* **Authorization type**: Select the option: ``API Key``
72+
* **Header key**: Fill in ``Authorization``
73+
* **Header value**: Fill in ``Token <tokenValue>`` where ``<tokenValue>`` is replaced by the token provided by the backend service
74+
* **OAS**: URL that points to the OAS, same URL as used for **API root url** with ``/schema/openapi.yaml`` added to it
75+
*for example:* ``https://example.com/objecttypen/api/v1/schema/openapi.yaml``
5176

52-
The Objects API prefill can be used not only for prefilling and showing the data to the user,
53-
but it can also work together with the Objects API registration plugin
54-
(see :ref:`Objects API configuration (English) <configuration_registration_objects>`) in order to make
55-
modifications to an existing object in the Objects API. This requires the form user to be the "owner"
56-
of the object and the necessary configuration in the Objects API registration at the form level
57-
(by choosing to update the existing object).
77+
* **NLX**: Support for NLX can be selected here if enabled in the installation
5878

59-
.. image:: _assets/update_existing_object.png
79+
c. Click **Opslaan** and repeat to create configuration for the other component.
80+
81+
#. Navigate to **Configuration** > **Configuration overview**. In the
82+
**Prefill plugins** group, click on **Manage API groups** for the **Objects API** line.
83+
84+
#. Enter the following details:
85+
86+
* **Name**: Enter a recognizable name, it will be displayed in various dropdowns.
87+
* **Objects API**: Select the Objects API (ORC) service created above
88+
* **Objecttypes API**: Select the Objecttypes API (ORC) service created above
89+
90+
The remainder of the fields can be left empty.
91+
92+
#. Click **Save**
93+
94+
The Objects API configuration is now complete and can be selected as prefill backend in
95+
the form builder. When doing so, you will be able to select the desired object type and
96+
its version.
97+
98+
Recommendations for the Objecttype JSON Schemas
99+
===============================================
100+
101+
The same recommendations apply as for the
102+
:ref:`registration plugin <configuration_registration_objects_objecttype_tips>`. We
103+
rely heavily on the JSON Schema specified in the object type.
104+
105+
Technical
106+
=========
107+
108+
Open Forms requires Objects API v2.2 or newer and the Objecttypes API v2.0 or newer.
109+
110+
================ ===============================================
111+
Objects API Test status
112+
================ ===============================================
113+
2.2.x Manually verified
114+
2.3.x Manually verified
115+
2.4.x Manually verified, automated end-to-end testing
116+
================ ===============================================
117+
118+
================ ===============================================
119+
Objecttypes API Test status
120+
================ ===============================================
121+
2.0.x Unknown
122+
2.1.x Manually verified
123+
2.2.x Manually verified, automated end-to-end testing
124+
================ ===============================================
125+
126+
.. _`Objects API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/
127+
.. _`Objecttypes API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/

docs/configuration/registration/objects.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,23 @@ To configure the Objects API follow these steps:
127127
* **User ID**: Audit trail user ID, usually same as the Client ID
128128
* **User representation**: *For example:* ``Open Forms``
129129

130-
#. Navigate to **Configuration** > **Overview**. In the **Registration plugin** group,
131-
click on **Configuration** for the **Objects API registratie** line.
130+
#. Navigate to **Configuration** > **Configuration overview**. In the
131+
**Registration plugins** group, click on **Manage API groups** for the
132+
**Objects API registratie** line.
132133

133134
#. Enter the following details:
134135

136+
* **Name**: Enter a recognizable name, it will be displayed in various dropdowns.
135137
* **Objects API**: Select the Objects API (ORC) service created above
136138
* **Objecttypes API**: Select the Objecttypes API (ORC) service created above
137139
* **Documenten API**: Select the Documenten API (DRC) service created above
138140
* **Catalogi API**: Select the Zaaktypecatalogus (ZTC) service created above
141+
* **Organisatie RSIN**: Fill the RSIN to use as "bronorganisatie" in Document uploads.
142+
*For example:* ``123456789``. You an override this on a per-form basis.
143+
144+
The following fields are deprecated - it's better to specify a catalogue and the
145+
description of the document types instead.
146+
139147
* **Submission report informatieobjecttype**: Fill in the default URL of the
140148
INFORMATIEOBJECTTYPE for the submission report in the Catalogi API *For example*
141149
``https://example.com/api/v1/informatieobjecttypen/1/``. You an override this on a
@@ -150,8 +158,6 @@ To configure the Objects API follow these steps:
150158
INFORMATIEOBJECTTYPE for the submission attachments in the Catalogi API *For example*
151159
``https://example.com/api/v1/informatieobjecttypen/3/``. You an override this on a
152160
per-form and per-file component basis.
153-
* **Organisatie RSIN**: Fill the RSIN to use as "bronorganisatie" in Document uploads.
154-
*For example:* ``123456789``. You an override this on a per-form basis.
155161

156162
For the legacy configuration format, additional fields are available:
157163

@@ -176,7 +182,7 @@ When doing so, the corresponding objecttype and objecttype version will have to
176182
.. _configuration_registration_objects_objecttype_tips:
177183

178184
Recommendations for the Objecttype JSON Schemas
179-
================================================
185+
===============================================
180186

181187
The objecttype definition uses `JSON Schema <https://json-schema.org/>`_, and this schema
182188
is processed by Open Forms.
Loading
Loading
Loading

docs/manual/forms/examples/camunda7.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ raketicoon linksonder.
5050
Formulier maken
5151
===============
5252

53-
#. Maak een formulier aan met de volgende componenten in een formulier stap:
53+
#. Maak een formulier aan met de volgende componenten in een formulierstap:
5454

5555
* Getal-component met label **Leeftijd** en eigenschapsnaam **leeftijd**
5656
* Getal-component met label **Inkomen** en eigenschapsnaam **inkomen**

docs/manual/forms/examples/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Voorbeelden
1313
advanced_logic
1414
appointment_form
1515
prefill
16+
objects_prefill
1617
calculations
1718
auth_static_variables
1819
repeating_groups

0 commit comments

Comments
 (0)