Metadata Collections Select (v1)

http://localhost/mod-finc-config

Table of contents

mod-finc-config API

This documents the API calls that can be made to query and manage metadata sources for the current tenant/isil

Metadata Sources Select

Entity representing a metadata-source

GET /finc-select/metadata-sources

Get all metadata sources

GET /finc-select/metadata-sources
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ((label="Journals*") and status=("active" or "technical implementation") and selected="none") sortby label
    
  • orderBy: (string)

    Order by field: label, sourceId, status, lastProcessed

  • order: (one of desc, asc - default: desc)

    Order

  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    none
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    10

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of metadata sources in finc select",
  "properties": {
    "fincSelectMetadataSources": {
      "type": "array",
      "id": "fincSelectMetadataSourcesData",
      "description": "List of metadata sources for finc select",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Metadata Source Schema",
        "description": "Metadata source in finc select",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "A unique name for this metadata source"
          },
          "description": {
            "type": "string",
            "description": "A globally unique (UUID) identifier"
          },
          "status": {
            "type": "string",
            "description": "Current status of metadata source",
            "enum": [
              "active",
              "closed",
              "impossible",
              "implementation",
              "request"
            ]
          },
          "organization": {
            "type": "object",
            "description": "The organization delivering content of this metadata source",
            "properties": {
              "id": {
                "type": "string",
                "description": "Id of the the sources content’s organization, linked via uuid from organizations app."
              },
              "name": {
                "type": "string",
                "description": "Organization's name. If not given, it will be determined by backend module."
              }
            }
          },
          "contacts": {
            "type": "array",
            "description": "List of contacts",
            "minItems": 0,
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "title": "Contact",
              "description": "Contact schema",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "The contact's type. This indicates if the contact originates from the users module or the organizations module.",
                  "enum": [
                    "user",
                    "contact"
                  ]
                },
                "externalId": {
                  "type": "string",
                  "description": "The external id of this contact in the module specified by the type (users or organizations module)."
                },
                "name": {
                  "description": "The contact's name (lastName, firstName)",
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "description": "The contact's role",
                  "enum": [
                    "subject specialist",
                    "librarian",
                    "technical",
                    "vendor"
                  ]
                }
              },
              "required": [
                "externalId",
                "type",
                "name",
                "role"
              ]
            }
          },
          "indexingLevel": {
            "type": "string",
            "description": "Level used for indexing (e.g. bibliographic)"
          },
          "generalNotes": {
            "type": "string",
            "description": "General notes not fitting into the other fields"
          },
          "lastProcessed": {
            "type": "string",
            "format": "date-time",
            "description": "Date of last processing"
          },
          "tickets": {
            "type": "array",
            "description": "Links to internal tickets corresponding to this metadata source",
            "minItems": 0,
            "items": {
              "type": "string"
            }
          },
          "accessUrl": {
            "type": "string",
            "description": "URL to access metadata source"
          },
          "sourceId": {
            "type": "integer",
            "description": "The source id"
          },
          "solrShard": {
            "type": "string",
            "description": "Used solr shard",
            "enum": [
              "SLUB DBoD",
              "SLUB dswarm",
              "UBL ai",
              "UBL DNB",
              "UBL main"
            ]
          },
          "deliveryMethods": {
            "type": "array",
            "description": "Available delivery methods (e.g. API download)",
            "minItems": 0,
            "items": {
              "type": "string"
            }
          },
          "formats": {
            "type": "array",
            "description": "Available formats (e.g. MARC)",
            "minItems": 0,
            "items": {
              "type": "string"
            }
          },
          "updateRhythm": {
            "type": "string",
            "description": "Metadata source's update rhythm"
          },
          "inferiorTo": {
            "type": "array",
            "description": "Link to other metadata sources",
            "minItems": 0,
            "items": {
              "type": "string"
            }
          },
          "selected": {
            "type": "string",
            "description": "Indicator if current tenant/library has selected this metadata source",
            "enum": [
              "all",
              "some",
              "none"
            ]
          },
          "metadata": {
            "description": "Metadata about creation and changes, provided by the server (client should not provide)",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "required": [
          "id",
          "label",
          "status",
          "sourceId"
        ],
        "additionalProperties": false
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "sources",
    "totalRecords"
  ]
}

Example:

{
  "metadataSources": [
    {
      "id": "6dd325f8-b1d5-4568-a0d7-aecf6b8d6697",
      "label": "Cambridge University Press Journals",
      "description": "This is a test metadata source",
      "status": "active",
      "contacts": [
        {
          "type": "user",
          "externalId": "fcfaca0b-12e7-467e-b503-d44a44d60a62",
          "name": "Doe, John",
          "role": "librarian"
        },
        {
          "type": "contact",
          "externalId": "01771c0a-a890-4488-b5e9-366aa697bd93",
          "name": "Doe, Jane",
          "role": "vendor"
        }
      ],
      "indexingLevel": "bibliographic",
      "generalNotes": "Test licensing note",
      "lastProcessed": "2018-01-01",
      "tickets": [
        "http://redmine.de/123",
        "http://redmine.de/456"
      ],
      "accessUrl": "http://access.url",
      "sourceId": 1,
      "solrShard": "UBL main",
      "deliveryMethods": [
          "API Download"
      ],
      "formats": [
        "csv"
      ],
      "updateRhythm": "monthly",
      "inferiorTo": [
        "uuid-789",
        "uuid-123"
      ],
      "selected": "all"
    }
  ],
  "totalRecords": 1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to list metadata-sources -- malformed parameter 'query', syntax error at column 6"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

"unable to list metadata-sources -- unauthorized"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"metadata-source not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /finc-select/metadata-sources/{id}

Get one metadata source identified by id

GET /finc-select/metadata-sources/{id}
URI Parameters
  • id: required (string)

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Metadata Source Schema",
  "description": "Metadata source in finc select",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this metadata source"
    },
    "description": {
      "type": "string",
      "description": "A globally unique (UUID) identifier"
    },
    "status": {
      "type": "string",
      "description": "Current status of metadata source",
      "enum": [
        "active",
        "closed",
        "impossible",
        "implementation",
        "request"
      ]
    },
    "organization": {
      "type": "object",
      "description": "The organization delivering content of this metadata source",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the the sources content’s organization, linked via uuid from organizations app."
        },
        "name": {
          "type": "string",
          "description": "Organization's name. If not given, it will be determined by backend module."
        }
      }
    },
    "contacts": {
      "type": "array",
      "description": "List of contacts",
      "minItems": 0,
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Contact",
        "description": "Contact schema",
        "properties": {
          "type": {
            "type": "string",
            "description": "The contact's type. This indicates if the contact originates from the users module or the organizations module.",
            "enum": [
              "user",
              "contact"
            ]
          },
          "externalId": {
            "type": "string",
            "description": "The external id of this contact in the module specified by the type (users or organizations module)."
          },
          "name": {
            "description": "The contact's name (lastName, firstName)",
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "The contact's role",
            "enum": [
              "subject specialist",
              "librarian",
              "technical",
              "vendor"
            ]
          }
        },
        "required": [
          "externalId",
          "type",
          "name",
          "role"
        ]
      }
    },
    "indexingLevel": {
      "type": "string",
      "description": "Level used for indexing (e.g. bibliographic)"
    },
    "generalNotes": {
      "type": "string",
      "description": "General notes not fitting into the other fields"
    },
    "lastProcessed": {
      "type": "string",
      "format": "date-time",
      "description": "Date of last processing"
    },
    "tickets": {
      "type": "array",
      "description": "Links to internal tickets corresponding to this metadata source",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "accessUrl": {
      "type": "string",
      "description": "URL to access metadata source"
    },
    "sourceId": {
      "type": "integer",
      "description": "The source id"
    },
    "solrShard": {
      "type": "string",
      "description": "Used solr shard",
      "enum": [
        "SLUB DBoD",
        "SLUB dswarm",
        "UBL ai",
        "UBL DNB",
        "UBL main"
      ]
    },
    "deliveryMethods": {
      "type": "array",
      "description": "Available delivery methods (e.g. API download)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "formats": {
      "type": "array",
      "description": "Available formats (e.g. MARC)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "updateRhythm": {
      "type": "string",
      "description": "Metadata source's update rhythm"
    },
    "inferiorTo": {
      "type": "array",
      "description": "Link to other metadata sources",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "selected": {
      "type": "string",
      "description": "Indicator if current tenant/library has selected this metadata source",
      "enum": [
        "all",
        "some",
        "none"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "required": [
    "id",
    "label",
    "status",
    "sourceId"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "6dd325f8-b1d5-4568-a0d7-aecf6b8d6697",
  "label": "Cambridge University Press Journals",
  "description": "This is a test metadata source",
  "status": "active",
  "contacts": [
    {
      "type": "user",
      "externalId": "fcfaca0b-12e7-467e-b503-d44a44d60a62",
      "name": "Doe, John",
      "role": "librarian"
    },
    {
      "type": "contact",
      "externalId": "01771c0a-a890-4488-b5e9-366aa697bd93",
      "name": "Doe, Jane",
      "role": "vendor"
    }
  ],
  "indexingLevel": "bibliographic",
  "generalNotes": "Test licensing note",
  "lastProcessed": "2018-01-01",
  "tickets": [
    "http://redmine.de/123",
    "http://redmine.de/456"
  ],
  "accessUrl": "http://access.url",
  "sourceId": 1,
  "solrShard": "UBL main",
  "deliveryMethods": [
      "API Download"
  ],
  "formats": [
    "csv"
  ],
  "updateRhythm": "monthly",
  "inferiorTo": [
    "uuid-789",
    "uuid-123"
  ],
  "selected": "all"
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to get retrieve metadata-source -- unauthorized

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"metadata-source not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /finc-select/metadata-sources/{id}/collections/select-all

Put, if all metadata collections of this source are selected resp. deselected

PUT /finc-select/metadata-sources/{id}/collections/select-all
URI Parameters
  • id: required (string)
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Object to select resp. deselect metadata sources or collections",
  "type": "object",
  "title": "Select",
  "properties": {
    "select": {
      "type": "boolean",
      "description": "Boolean which describes if entity shall be selected resp. deselected"
    }
  },
  "required": [
    "select"
  ]
}

Example:

{
  "select": true
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update select-all -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"select-all not found"

Response 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator