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
@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
@spec delete( binary(), keyword() ) :: DSpace.API.Operation.t()
Deletes a collection.
@spec fetch( binary(), keyword() ) :: DSpace.API.Operation.t()
Fetches a single collection by UUID.
@spec fetch_default_access_conditions(binary()) :: DSpace.API.Operation.t()
Fetches the default access conditions for a collection.
@spec fetch_parent_community(binary()) :: DSpace.API.Operation.t()
Fetches the parent community of a collection.
@spec find(keyword()) :: DSpace.API.Operation.t()
Finds collections using Discovery search.
This operation can be streamed.
Parameters
options- Search options, seeDSpace.API.Search.query/1for details
Examples
# Find all collections
iex> Collection.find([])
%DSpace.API.Operation.JSON{path: "/api/discover/search/objects", ...}
# Find all collections with filters
iex> Collection.find(filters: [%{filter: "title", operator: "contains", value: "special"}])
%DSpace.API.Operation.JSON{...}
# Simple collection search with text query
iex> Collection.find(query: "digital archives")
%DSpace.API.Operation.JSON{path: "/api/discover/search/objects", ...}
# Search with additional filters
iex> Collection.find(query: "library", filters: [%{filter: "title", operator: "contains", value: "special"}])
%DSpace.API.Operation.JSON{...}
# Search within a specific community
iex> Collection.find(query: "research", scope: "community-uuid")
%DSpace.API.Operation.JSON{...}
@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)
@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)
@spec replace(binary(), map(), keyword()) :: DSpace.API.Operation.t()
Replaces an existing collection.
@spec update(binary(), list(), keyword()) :: DSpace.API.Operation.t()
Updates an existing collection.