DSpace.API.Collection (dspace_ex v0.1.0)

Copy Markdown View Source

Functions for working with DSpace Collections.

Collections are containers for Items in the DSpace hierarchy.

Summary

Functions

Creates a new collection.

Deletes a collection.

Fetches a single collection by UUID.

Fetches the default access conditions for a collection.

Fetches the parent community of a collection.

Finds collections using Discovery search.

Lists all collections from the repository.

Lists items that belong to the collection.

Replaces an existing collection.

Updates an existing collection.

Functions

create(collection, options \\ [])

@spec create(
  map(),
  keyword()
) :: DSpace.API.Operation.t()

Creates a new collection.

Collections must have a parent (a community or another collection).

Options

  • :parent - UUID of the parent community or collection (required)

delete(uuid, options \\ [])

@spec delete(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Deletes a collection.

fetch(uuid, options \\ [])

@spec fetch(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Fetches a single collection by UUID.

fetch_default_access_conditions(uuid)

@spec fetch_default_access_conditions(binary()) :: DSpace.API.Operation.t()

Fetches the default access conditions for a collection.

fetch_parent_community(uuid)

@spec fetch_parent_community(binary()) :: DSpace.API.Operation.t()

Fetches the parent community of a collection.

find(options \\ [])

@spec find(keyword()) :: DSpace.API.Operation.t()

Finds collections using Discovery search.

This operation can be streamed.

Parameters

Examples

# Find all collections
Collection.find([])

# Find all collections with filters
Collection.find(filters: [%{filter: "title", operator: "contains", value: "special"}])

# Simple collection search with text query
Collection.find(query: "digital archives")

# Search with additional filters
Collection.find(query: "library", filters: [%{filter: "title", operator: "contains", value: "special"}])

# Search within a specific community
Collection.find(query: "research", scope: "community-uuid")

list(options \\ [])

@spec list(keyword()) :: DSpace.API.Operation.t()

Lists all collections from the repository.

This operation can be streamed.

Options

  • :page - Page number (0-based, defaults to 0)
  • :size - Number of items per page (usually defaults to 20)

list_items(uuid, options \\ [])

@spec list_items(
  binary(),
  keyword()
) :: DSpace.API.Operation.t()

Lists items that belong to the collection.

This operation can be streamed.

Options

  • :page - Page number (0-based, defaults to 0)
  • :size - Number of items per page (usually defaults to 20)

replace(uuid, collection, options \\ [])

@spec replace(binary(), map(), keyword()) :: DSpace.API.Operation.t()

Replaces an existing collection.

update(uuid, updates, options \\ [])

@spec update(binary(), list(), keyword()) :: DSpace.API.Operation.t()

Updates an existing collection.