You can run checkstyle and spotbugs using the following:

mvn checkstyle:check com.github.spotbugs:spotbugs-maven-plugin:check

API

Additional Endpoints

material-sample-summary

Get a summary of an existing material sample. The summary includes the effective determination.

GET /material-sample-summary/{uuid}

split-configuration

Allows to store split configuration currently used by the ui to customize identifiers.

material-sample-identifier-generator

Allows to generate (but not reserve) identifiers for material-sample based on settings.

POST /material-sample-identifier-generator

Generate identifiers for a single parent:

{
  "data": {
    "type": "material-sample-identifier-generator",
    "attributes": {
      "currentParentUUID": "parent UUID",
      "quantity": "2",
      "strategy": "DIRECT_PARENT",
      "characterType": "UPPER_LETTER",
      "separator": "DASH"
    }
  }
}

Generate identifiers for multiple parents:

{
  "data": {
    "type": "material-sample-identifier-generator",
    "attributes": {
      "currentParentsUUID": ["parent UUID 1", "parent UUID 1"],
      "strategy": "TYPE_BASED",
      "materialSampleType": "CULTURE_STRAIN",
      "characterType": "LOWER_LETTER",
      "separator": "DASH"
    }
  }
}

Documentation on strategies can be found in the DINA User Guide

resource-name-identifier

Get the identifier (UUID) based on the name, the type and the group.

GET /resource-name-identifier?filter[type][EQ]=material-sample&filter[name][EQ]=name1&filter[group][EQ]=aafc

Available for types :

  • collection

  • project

  • storage-unit

  • material-sample

  • preparation-type

  • preparation-method

  • protocol

Administrative Endpoints

Index Refresh

Trigger a message to (re)index a resource. DINA_ADMIN role required. If id is omitted, all records will be processed.

POST /index-refresh

{
  "data": {
    "type": "index-refresh",
    "id": "c9e66a08-8b59-4183-8346-e2298af32bfe",
    "attributes": {
      "docType": "material-sample"
    }
  }
}

Design

Storage

storage.drawio

Database

Triggers

check_material_name_unique

Make sure material_sample_name is unique within a collection unless allow_duplicate_name is set to true (for legacy data).

check_storage_hierarchy

Ensures storage_unit 's hierarchy is except of cycles.

check_organism_is_target

Ensures that organism attached to a material_sample are using the is_target concept or are not using it but never a mix of both.

Functions

jsonb_path_exists_varchar

jsonb_path_exists_varchar(target jsonb, path varchar, vars varchar, caseSensitive boolean) = Managed Attributes

Managed Attributes can be fetched either by UUID or by a "{component}.{key}" formatted url path.

  • component: The value of the ManagedAttribute’s managedAttributeComponent field.

  • key: The value of the ManagedAttribute’s unique "key" field.

e.g.

/managed-attribute/collecting_event.my_managed_attribute.
/managed-attribute/32746f92-0530-4913-b891-242b1ff629b6.