Skip to content

How to add new communities

hevp edited this page Jan 17, 2019 · 10 revisions

This page is deprecated! Go to the B2SHARE Training material for more information


  1. Go to b2share/simplestore/lib/simplestore_model/metadata

  2. Copy an existing file (e.g. bbmri_metadata_config.py) and name it following the pattern COMMUNITY_metadata_config.py

  3. Change the content of this file according to the community requirements. The important variables are:

    1. domain will uniquely identify the community
    2. display_name is the name displayed on the deposit page; if this is missing, domain will be used instead
    3. table_name is not currently used, but should be the same as domain
    4. kind is not used anymore; it can be set to either 'domain' or 'project'. In the case of a community, it's better to set it to 'project'
    5. image is the image name, located in the image folder (/opt/invenio/var/www/img). The image should be less than 64px wide, but test and change it to make it look better.
    6. domaindesc is a description of the domain that is used as a tooltip.
  4. Change the fields vector to contain the metadata fields appropriate for the community.

    • name: the field name
    • col_type: the data type
    • display_text: what the user will see
    • description: helpful tooltip for the field
    • required: True or False, whether the field is absolutely required or not
    • autocomplete suggestions for text fields can be added by setting:
      • data_provide : typeahead
      • and data_source to a json list of accepted values (expressed in Python: json.dumps(['value1', 'value2'])
  5. Add the new domain to the list of configured domains, in invenio-local.conf (https://github.com/B2SHARE/invenio-scripts)

  6. Add the new domain in the MySQL collections table: