This Plugin / Repo is being maintained by a community of developers. There is no warranty given or bug fixing guarantee; especially not by Programmfabrik GmbH. Please use the GitHub issue tracking to report bugs and self organize bug fixing. Feel free to directly contact the committing developers.
This server plugin for fylr allows automatically setting the values of numeric ID fields when saving data. IDs are assigned in numerical order starting from 1. Optionally, the incrementation can be performed separately for each combination of values present in a defined set of base fields (see first example below).
Please note that the ID field as well as all base fields are expected to be either grouped inside the same nested field or located at the root level of the object.
IDs can be generated with the same incrementer used for multiple object types if the path to the ID field (and base fields, if present) are the same (see second example below).
The latest version of this plugin can be found here.
The ZIP can be downloaded and installed using the plugin manager, or used directly (recommended).
For the plugin to work, a new object type has to be created. This object type needs to have two fields "incrementer_id" and "incrementer_map" (both text fields). All users that will interact with the plugin need to have read and write access for this object type.
All plugin configuration takes place in base configuration.
- User account for ID generation: The user account that is to be used for generating new ID values. This account must have the rights to read and edit objects of the configured incrementer object type (see below) and also have system rights for accessing object types, users and workflows.
- Incrementer object type: The object type that has been created for usage with the plugin
- Field name 'Incrementer ID': The name of the field to use for storing the ID in incrementer objects
- Field name 'Incrementer values': The name of the field to use for storing the values in incrementer objects
- Mask for reading and editing incrementer objects: The mask to use when working with incrementer objects
- Incrementers:
- Incrementer ID: The unique ID of this specific incrementer
- Object types: The object types for which this incrementer works (please note that the configured user account must have read rights for these object types)
- Path to parent field: The path to the nested field that contains the ID field and the base fields (leave empty if the ID field and the base fields are on the root level of the object).
- ID field name: The name of the ID field to be filled out by the plugin. This has to be a numeric field. The field will only be updated if it is empty, if the parent field has been newly created and if all base fields have been filled out by the user.
- Base field names: The names of the base fields to consider when setting the ID. These can be text fields or fields of the custom data type DANTE.
- IDs of pools to consider: If not empty, IDs are only updated for resources in the specified pools (and their child pools). Also, resources in other pools are not considered during ID generation.
Before the plugin is used for the first time, the incrementer objects have to be created by running the node script "scripts/initialize.js" (Node v22 is required):
node scripts/initialize.js FYLR_URL ACCESS_TOKEN
The access token has to be a valid token for the user account that the script is to use.
The script can be run again at a later point in time to rebuild the incrementer objects based on the IDs currently set in the database.
- Object types: example
- Path to parent field: _nested:example__parent
- ID field name: id
- Base field names: place, year
The field "id" contains the respective value as generated by the plugin.
Object 1:
{
"_nested:example__parent": [
{ "place": "London", "year": "2020", "id": 1 },
{ "place": "Berlin", "year": "2020", "id": 1 },
{ "place": "Berlin", "year": "2020", "id": 2 }
]
}
Object 2:
{
"_nested:example__parent": [
{ "place": "London", "year": "2020", "id": 2 },
{ "place": "Berlin", "year": "2020", "id": 3 }
{ "place": "Berlin", "year": "2021", "id": 1 }
]
}
- Object types: example, example2
- Path to parent field:
- ID field name: id
- Base field names:
The field "id" contains the respective value as generated by the plugin.
Object 1 (Object type: "example"):
{
"id": 1
}
Object 2 (Object type: "example2"):
{
"id": 2
}
Object 3 (Object type: "example"):
{
"id": 3
}