Mandatory properties catalog
Catalogs are used to specify mandatory properties for an entity. These properties have an impact on the calculation of the product's progress score when they are not filled in. A catalog can also be used to specify fields and lists to be audited.
The catalog can also be downloaded to the instance by going to:
Repository > System > Properties catalog
We recommend checking the validity of the JSON table (without backslash) with a parser before launching the instance - http://json.parser.online.fr/
Note: You need to clear the caches once the file has been modified, then reformulate the products.
Each catalog contains a number of mandatory or optional fields in its definition:
Identifier | Type | Mandatory | Description |
---|---|---|---|
id | texte | Yes | the catalog's unique identifier e.g. "inco" |
label | text | Yes | The displayed name of the catalog e.g. EU 1169/2011 (INCO) |
entityType | Tab | No | allows you to filter the catalog's application to a specific type of entity e.g.: ['bcpg:finishedProduct'] will apply this catalog only to finished products |
entityFilter | text | No | allows you to filter the catalog's application to an entity using a SPEL formula e.g. "hierarchy1 != null" or "spel(hierarchy1 != null)" will apply this catalog only to entities with a family |
fields | *tab | yes | the list of fields to be filled in for the entity to be validated e.g.: ["bcpg:legalName", "bcpg:storageConditionsRef"] will create a catalog where the legal wording and packaging conditions must be filled in |
uniqueFields | tab | No | the list of single-value fields e.g.: ["bcpg:erpcode", "cm:name"]. If a value is duplicated, the field will be populated in the catalog |
auditedFields | tab | No | the list of fields or lists taken into account when updating the catalog modification date e.g. ["bcpg:legalName", "compoList"]. When one of the fields in this list is modified, the catalog date is updated |
i18nMessages | Object | No | mapping fields / labels to specify a label for a mandatory field. eg: {"bcpg:clients": "associé", "cm:title": "becpg.forms.field.tradeName"} for bcpg:clients we use the new label associé. for cm:title we use a language key, this language key must be declared in a Core language file (Alfresco). |
locales | tab | No | The list of languages to which the catalog applies. If this field is not present, report languages will be selected (if any), otherwise the system language will be the selected language. A language is defined by a two-letter code according to the ISO-639-1 standard https://fr.wikipedia.org/wiki/Liste\_des\_codes\_ISO\_639-1 |
You can indicate an alternative between two fields in a list by separating them with the "|" symbol.
e.g : ["bcpg:useByDate|bcpg:bestBeforeDate"]
Add/delete a catalog field
- Go to Repository>System>Properties catalog;
- Put the cursor on "Catalogs" and press "Download";
- Open the file with a text editor (Atom for example);
- Add or delete a line;
- Add or delete a line;
- Return to the instance and press "More" and then "Import a new version" and choose the file which has just been modified.
- Reformulate products.
Use a renamed field in the catalog
Use the i18nMessages parameter in the catalog to override the field name.
"i18nMessages" :{
"cm:title":"becpg.forms.field.tradeName"
},
Multilingual fields
For multilingual fields, it is possible to make this field mandatory for one language only: follow the field with an underscore and the language, e.g. bcpg:legalName_pl
force
the legal name field in Polish, regardless of the language selected in the catalog or reports.
Formulas
Formula fields can also be created by prefixing the field with formula{id}|. For example, formula1|isLiquid() or formula1|spel(isLiquid())..
The formula id can then be used to specify its label:
"i18nMessages": {
"formula1" : "becpg.forms.field.tradeName",
"formula2" : "formula2.missingKey"
}
You can use SPEL formulas to test whether a list is filled in or empty, for example:
formula1|spel(costList.?[value != null].size() == costList.size()) test if all cost values are filled in.
Examples
Below are examples of catalogs:
[
{
"id": "incoFinishedProduct",
"label": "EU 1169/2011 (INCO)",
"entityType": [
"bcpg:finishedProduct"
],
"uniqueFields": [
"bcpg:erpCode",
"cm:name"
],
"fields": [
"bcpg:legalName",
"bcpg:precautionOfUseRef",
"bcpg:useByDate|bcpg:bestBeforeDate",
"bcpg:storageConditionsRef",
"cm:title"
],
"i18nMessages": {
"cm:title": "Trade name"
},
"auditedFields": [
"bcpg:legalName",
"cm:title",
"cm:description"
],
"modifiedField": "bcpg:modifiedCatalog1",
"entityFilter": "@beCPG.assocValue(nodeRef,\"bcpg:entityTplRef\")!=null && (@beCPG.assocValue(nodeRef,\"bcpg:entityTplRef\").toString()!=\"workspace://SpacesStore/7d1bf1c6-dc17-42ee-8314-cca9d6d30515\")"
},
{
"id": "incoRawMaterials",
"label": "EU1169/2011 (INCO)",
"entityType": [
"bcpg:rawMaterial"
],
"uniqueFields": [
"bcpg:erpCode",
"cm:name"
],
"fields": [
"bcpg:legalName"
]
}
]