How Can We Help?
Synchronization workaroundSynchronization workaround
This page describes how to mark content as being synchronized and lock specific fields on content using the Pure API and recurring cronjobs.
Overall, to mark content as synchronized and locking specific fields on it, three things need to be in place:
- The content needs to be marked as coming from an external source (From 5.27.0)
- The content needs to have its source and source ID set to specific values, depending on its type.
- A cronjob needs to be set up to mark specific fields on content where both point 1. and 2. above is done.
1. Marking content as synchronized
The Pure API supports "locking" and "unlocking" content. When "lock" is successfully called on a piece of content through the API, the content is marked as coming from an external source. When "unlock" is successfully called on a piece of content, the external mark that was previously set on the content is removed.
Content that is marked as coming from an external source supports locking specific fields in the backend UI. Below, we describe how to select which fields to mark as locked.
Locking a piece of content has no effect on the access to the object through the API. It is solely an action that has effect on the behaviour in the editor of the backend.
For e.g. research output, the action to lock
(can also be found in the Swagger UI) is:
<Pure base URL>/ws/api/research-outputs/{uuid}/actions/lock |
and the action to unlock
is:
<Pure base URL>/ws/api/research-outputs/{uuid}/actions/unlock |
See the Swagger documentation for more information on interface and behaviour.
2. Setting the source and source id
Each synchronized entity in Pure has "source" and "source id" properties that indicate who is the authority for this content and what its identifier in the authority system is.
In the Pure API this information is encoded in the "identifiers" property using a "PrimaryId" object.
"identifiers": [ { "typeDiscriminator": "PrimaryId", "idSource": "<source>", "value": "<the identifier of the entity in your system>" } ], |
The "idSource" values must be the same ones that the job would have used, please refer to this table:
Content type | Source |
---|---|
Application | synchronisedUnifiedApplication |
Award | synchronisedUnifiedAward |
Equipment | synchronisedUnifiedEquipment |
External Organization | synchronisedUnifiedExternalOrganisation |
External Person | synchronisedUnifiedExternalPerson |
Organization | synchronisedUnifiedOrganisation |
Person | synchronisedUnifiedPerson |
Project | synchronisedUnifiedProject |
User | synchronisedUnifiedUser |
Activity | synchronisedActivity |
Clipping | synchronisedClipping |
Event | synchronisedEvent |
Funding | synchronisedFunding |
Journal | synchronisedJournal |
Publisher | synchronisedPublisher |
Research-Output | synchronisedResearchOutput |
3. Setting up jobs to lock fields
It is possible to use the existing synchronization jobs to lock selected editor fields.
To set up a cron job to mark specific fields on content as locked, do the following:
- Navigate to Administrator > Jobs > Cron Job Scheduling, and add a "Configurable <content type> Synchronization" job.
- Under the "Dataprovider configurations" section select "xml upload".
- In the "Synchronization view/field configuration" section select "Sync" or "Lock field" for the properties that should be locked in the editor.
- Press "Update" to save the configuration.
- Then "Change schedule", set to "Manual" and press "Save".
Updated at November 08, 2024