Dossier Custom Tabs, Fields, and Filters

It is often necessary that a dossier feature additional tabs and fields.

To add custom tabs and fields to a dossier, do the following:

  1. Prepare the list of custom tabs and fields you want to add to a dossier.

  2. Open the findface-security configuration file.

    sudo vi /etc/ffsecurity/config.py
    
  3. Into the FFSECURITY section, uncomment the CUSTOM_FIELDS section and modify the exemplary content, considering the following:

    • 'items': the list of fields in a dossier. Describe each field with the following parameters:
      • 'name': field’s internal name, string.
      • 'label': field’s label in the web interface, string.
      • 'display': display format (form or list), string or array.
      • 'tab': tab that features the field. If not specified, the field appears on the main dossier page (that with a photograph).
      • 'editable': field’s editability, boolean.
      • 'type': field data type, string. Possible values:
        • list: requires items, additional parameter for lists (see below), expects objects {id, name} in dictionaries;
        • valuelist: expects elements of primitive types.
        • objectlist: allows for creating arrays of objects of required types.
        • datetime: primitive data type displayed as a datetime list.
        • date: primitive data type displayed as a date picker.
        • boolean: primitive data type displayed as a checkbox.
        • string: primitive data type string.
      • additional parameters for lists (type=list, type=valuelist):
        • multiple: possibility of selecting several items in the list, boolean.
        • items: dictionary used as a data source for the list.
        • allow_create: possibility of adding new items to the list.
        • custom_id: custom field for id (type=list).
      • additional parameters for object lists (type=objectlist).
        • object: objects used as a data source for the object list.
        • simple: indicator that the field expects data of a primitive type instead of objects, for example, expects strings with phone numbers.
    • 'filters': the list of search filters associated with the custom fields. Parameters:
      • 'name': filter’s internal name,
      • 'label': filter’s label in the web interface,
      • 'field': associated field in the format [field name].
    • 'tabs': the list of tabs in a dossier. The first listed tab corresponds to the main dossier page.
    FFSECURITY = {
    
    ...
    
        # Edit CUSTOM_FIELDS section to customize dossier content.
        # Below is an example for integration FindFace Security with Sigur.
        'CUSTOM_FIELDS': {
            'dossier_meta': {
                'items': [
                    {
                        'name': 'personid',
                        'default': '',
                        'label': 'PersonID',
                        'display': ['list', 'form'],
                        'description': 'Sigur person ID'
                    },
                    {
                        'name': 'firstname',
                        'default': '',
                        'label': 'First Name',
                        'display': ['list', 'form'],
                        'description': 'Sigur first name'
                    },
                    {
                        'name': 'lastname',
                        'default': '',
                        'label': 'Last Name',
                        'display': ['list', 'form'],
                        'description': 'Sigur last name'
                    },
                    {
                        'name': 'version',
                        'default': '',
                        'label': 'Version',
                        'display': ['list', 'form'],
                        'description': 'Sigur photo version'
                    }
                ],
                'filters': [
                    {
                        'name': 'personid',
                        'label': 'Sigur person ID filter',
                        'field': 'personid'
                    }
                ]
            }
        },
    
  4. You will see the custom content appear in the web interface.