Changeset View
Changeset View
Standalone View
Standalone View
docs/api/use-cases.rst
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
This would be the case for example if the client initially posted a | This would be the case for example if the client initially posted a | ||||
``partial`` deposit (e.g. only metadata with no archive, or an archive | ``partial`` deposit (e.g. only metadata with no archive, or an archive | ||||
without metadata, or a split archive because the initial one exceeded | without metadata, or a split archive because the initial one exceeded | ||||
the limit size imposed by swh repository deposit). | the limit size imposed by swh repository deposit). | ||||
The content of a deposit can only be updated while it is in the ``partial`` | The content of a deposit can only be updated while it is in the ``partial`` | ||||
state; this causes the content to be **replaced** (the old version is discarded). | state; this causes the content to be **replaced** (the old version is discarded). | ||||
Its metadata, however, can also be updated while in the ``done`` state; | Its metadata, however, can also be updated while in the ``done`` state; see below. | ||||
which adds a new version of the metadata in the SWH archive, | |||||
**in addition to** the old one(s). | |||||
In this state, ``In-Progress`` is not allowed, so the deposit cannot go back | |||||
in the ``partial`` state, but only to ``deposited``. | |||||
As a failsafe, to avoid accidentally updating the wrong deposit, this requires | |||||
the ``X-Check-SWHID`` HTTP header to be set to the value of the SWHID of the | |||||
deposit's content (returned after the deposit finished loading). | |||||
Schema representation | Schema representation | ||||
^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^ | ||||
Scenario: updating a deposit via SWORDv2_ protocol: | Scenario: updating a deposit via SWORDv2_ protocol: | ||||
.. figure:: ../images/deposit-update-chart.svg | .. figure:: ../images/deposit-update-chart.svg | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
Completing the deposit | Completing the deposit | ||||
---------------------- | ---------------------- | ||||
When this is all done, the loaders notify the deposit server, which sets | When this is all done, the loaders notify the deposit server, which sets | ||||
the deposit status to ``done``. | the deposit status to ``done``. | ||||
This can then be polled by deposit clients, using the *state iri*. | This can then be polled by deposit clients, using the *state iri*. | ||||
Deposit metadata updates | |||||
------------------------ | |||||
We saw earlier that a deposit can only be updated when in ``partial`` state. | |||||
This is one exception to this rule: its metadata can be updated while in the | |||||
``done`` state; which adds a new version of the metadata in the SWH archive, | |||||
**in addition to** the old one(s). | |||||
In this state, ``In-Progress`` is not allowed, so the deposit cannot go back | |||||
in the ``partial`` state, but only to ``deposited``. | |||||
As a failsafe, to avoid accidentally updating the wrong deposit, this requires | |||||
the ``X-Check-SWHID`` HTTP header to be set to the value of the SWHID of the | |||||
deposit's content (returned after the deposit finished loading). | |||||
.. _SWORDv2: http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html | .. _SWORDv2: http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html |