Publication pattern templates
Publication pattern templates help you create consistent publication patterns more quickly and easily. Instead of entering the same details repeatedly — for example, for a monthly publication — you can use a template to prefill common values. This is especially useful when managing many serials that follow similar schedules.
Creating a set of publication pattern templates is a task likely to be undertaken when first setting up the Serials Management module for use. It is not expected to be a frequent task.
Note: Publication pattern templates are not the same as label templates, which control how issue labels are formatted.
Creating publication pattern templates
Pre-requisites
To create a publication pattern template and add it to FOLIO you will need:
Basic familiarity with JSON
An understanding of the structure of publication patterns in FOLIO
Knowledge of how to make requests to the FOLIO API
A user with permission to create publication pattern templates
Required permissions:
OKAPI:
Serials: Manage publication pattern templatesEureka:
UI-Serials-Management Modelrulesets - Managecapability set
Process
Publication pattern templates can be retrieved, created and deleted using the /serials-management/modelRulesets API endpoint (see the Serials Management API documentation for the full details).
Assuming a user with the correct permissions/capabilities:
All existing templates can be retrieved with a GET request to the endpoint
New templates can be created with a POST request containing the template JSON
Templates can be deleted with a DELETE request to the endpoint using the template’s UUID
Updating an existing template via PUT is not currently supported. To make changes, delete the existing template and post a new version.
⚠️ Note: Deleting a template does not affect any existing publication patterns based on that template, so this can be done safely at any time.
Publication pattern template JSON
The publication pattern template (called a modelRuleset in the code) consists of the following top-level properties:
Property | Description |
|---|---|
name | A user-readable name for the template. This will be searched and displayed in the UI when the user is selecting a template to use. Also used to control the order in which the templates display |
description | A user-readable description for the template. This will be searched and displayed in the UI when the user is selecting a template to use. |
exampleLabel | A sample issue label generated using the template. This helps users distinguish templates with similar structures but different labelling conventions (e.g. |
modelRulesetStatus | Valid values are |
serialRuleset | The heart of the template. The serialRuleset is a complex JSON object that defines the recurrence (frequency, publication days), chronology, enumeration and label template that will be used when creating a publication pattern with the template |
The serialRuleset is a complex which requires an understanding of the format of publication patterns in FOLIO. While the concepts are the same as those exposed to the user when creating publication patterns in the UI, it is based on the internal model of a publication pattern (aka ruleset) used in the underlying code, which means that it uses terms and structures that may not be immediately familiar users. However, each part of the serialRuleset does map to the publication pattern as displayed in the UI.
The easiest approach to getting a serialRuleset is to set one up in the UI and with the Developer Console open in the browser use the “Preview” function to generate a list of preview issues. The payload POSTed to the /serials-management/predictedPieces/generate endpoint by this action contains a serialRuleset plus some additional properties (startDate, startingValue, numberOfCycles). If the additional properties are removed, the remaining properties form a valid serialRuleset. This is demonstrated in the following video
Example: serialRuleset for a Monthly Publication
{
"rulesetStatus": {
"value": "active"
},
"recurrence": {
"timeUnit": {
"value": "month"
},
"period": "1",
"issues": "1",
"rules": [
{
"pattern": {
"day": "1"
},
"ordinal": "1",
"patternType": "month_date"
}
]
},
"templateConfig": {
"chronologyRules": [
{
"ruleLocale": "en",
"templateMetadataRuleFormat": "chronology_year",
"ruleFormat": {
"yearFormat": {
"value": "full"
}
},
"index": 0
}
],
"enumerationRules": [
{
"ruleFormat": {
"levels": [
{
"format": {
"value": "number"
},
"sequence": {
"value": "continuous"
},
"units": 1,
"index": 0
},
{
"format": {
"value": "number"
},
"sequence": {
"value": "reset"
},
"index": 1,
"units": "12"
}
]
},
"templateMetadataRuleFormat": "enumeration_numeric",
"index": 0
}
],
"templateString": "Vol.{{enumeration1.level1}},Issue{{enumeration1.level2}}.{{chronology1.year}}"
}
}