Synchronization 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.
- 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.
Warning
All of the above are necessary for this to work. Points 2. and 3. are available in Pure now and point 1. will be released in 5.27.0.
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.
Important
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 is:
unlock is:
See the API reference documentation for more information on interface and behaviour.
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 |
|---|---|
| Activity | synchronisedActivity |
| Application | synchronisedApplication |
| Award | synchronisedAward |
| Clipping | synchronisedClipping |
| Equipment | synchronisedUnifiedEquipment |
| Event | synchronisedEvent |
| External Organization | synchronisedUnifiedExternalOrganisation |
| External Person | synchronisedUnifiedExternalPerson |
| Funding | synchronisedFunding |
| Journal | synchronisedJournal |
| Organization | synchronisedUnifiedOrganisation |
| Person | synchronisedUnifiedPerson |
| Project | synchronisedUPMProject |
| Publisher | synchronisedPublisher |
| Research-Output | synchronisedResearchOutput |
| User | synchronisedUnifiedUser |
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
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".