Skip to content

Commit

Permalink
[#4396] Moved ObjectsAPI views and urls to contrib, added basic plugi…
Browse files Browse the repository at this point in the history
…n structure
  • Loading branch information
vaszig committed Sep 13, 2024
1 parent 35a68df commit 59304cb
Show file tree
Hide file tree
Showing 43 changed files with 1,039 additions and 398 deletions.
1 change: 1 addition & 0 deletions docs/configuration/prefill/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Prefill plugins
kvk
stuf_bg
suwinet
objects_api
43 changes: 43 additions & 0 deletions docs/configuration/prefill/objects_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. todo:: This feature is still in development and not ready for production yet.

.. _configuration_prefill_objects_api:

===========
Objects API
===========

The `Objects API`_ stores data records of which the structure and shape are defined by a particular object type
definition in the `Objecttypes API`_. These records can be used to pre-fill form fields if an object reference is
passed when the form is started.

.. note::

The service may contain sensitive data. It is advised to require DigiD/eHerkenning authentication on the form. You
should be careful with how you pass the object references to the customers and set up the object type in a way that
makes authentication checks possible (e.g. by storing the expected BSN or KVK number).

.. _`Objects API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/
.. _`Objecttypes API`: https://objects-and-objecttypes-api.readthedocs.io/en/latest/


Configuration
=============

1. In Open Forms, navigate to: **Forms**
2. Click **Add form**
3. Define the necessary form details and add the desired components
4. Navigate to: **Variables** tab
5. Navigate to: **User defined** subtab
6. Click **Add variable** and fill in the data from the available options:
* **Plugin**: Choose the *Objects API* plugin
* **API Group**: Select the appropriate API group. These API groups should be set up by an administrator,
via **Admin** > **Configuration** > **Prefill plugins** > **Objects API** > **Manage API groups**
* **Objecttype**: Select the expected object type from the dropdown.
* **Mappings**: Configure which property from the Objects API record needs to be assigned to which form variable.
For each form variable you want to pre-fill, add a new mapping. Then, on the left select the desired form variable,
and on the right you can specify which property from the object type contains the value.

7. Click **Save**
8. Save the form

The Objects API configuration is now complete.
3 changes: 3 additions & 0 deletions docs/developers/plugins/prefill_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ You can find an example implementation in :mod:`openforms.prefill.contrib.demo`.
Implementation
--------------

Plugins must be added to the ``INSTALLED_APPS`` setting in :mod:`openforms.conf.base`. See the demo
app (:class:`openforms.prefill.contrib.demo.apps.DemoApp`) as an example.

Plugins must implement the interface from :class:`openforms.prefill.base.BasePlugin`.
It's safe to use this as a base class.

Expand Down
Loading

0 comments on commit 59304cb

Please sign in to comment.