Functions for working with DSpace Communities.
Communities are top-level organizational units containing Collections of Items.
Summary
Functions
Creates a new community.
Deletes a community.
Fetches a single community by UUID.
Fetches the parent community of a community.
Finds communities using Discovery search.
Lists all communities from the repository.
Lists collections within a community.
Lists subcommunities within a community.
Lists top-level communities (communities without a parent).
Replaces an existing community.
Updates an existing community.
Functions
@spec create( map(), keyword() ) :: DSpace.API.Operation.t()
Creates a new community.
Communities can be top-level or subcommunities with a parent.
Options
:parent- UUID of the parent community
@spec delete( binary(), keyword() ) :: DSpace.API.Operation.t()
Deletes a community.
@spec fetch( binary(), keyword() ) :: DSpace.API.Operation.t()
Fetches a single community by UUID.
@spec fetch_parent(binary()) :: DSpace.API.Operation.t()
Fetches the parent community of a community.
@spec find(keyword()) :: DSpace.API.Operation.t()
Finds communities using Discovery search.
This operation can be streamed.
Parameters
options- Search options, seeDSpace.API.Search.query/1for details
Examples
# Find all communities
iex> Community.find([])
%DSpace.API.Operation.JSON{path: "/api/discover/search/objects", ...}
# Find all communities with filters
iex> Community.find(filters: [%{filter: "subject", operator: "contains", value: "science"}])
%DSpace.API.Operation.JSON{...}
# Simple community search with text query
iex> Community.find(query: "research community")
%DSpace.API.Operation.JSON{...}
# Search with additional filters
iex> Community.find(query: "library", filters: [%{filter: "subject", operator: "contains", value: "science"}])
%DSpace.API.Operation.JSON{...}
# Search within a specific parent community
iex> Community.find(query: "academic", scope: "parent-community-uuid")
%DSpace.API.Operation.JSON{...}
@spec list(keyword()) :: DSpace.API.Operation.t()
Lists all communities 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_collections( binary(), keyword() ) :: DSpace.API.Operation.t()
Lists collections within a community.
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_subcommunities( binary(), keyword() ) :: DSpace.API.Operation.t()
Lists subcommunities within a community.
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_toplevel(keyword()) :: DSpace.API.Operation.t()
Lists top-level communities (communities without a parent).
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 community.
@spec update(binary(), list(), keyword()) :: DSpace.API.Operation.t()
Updates an existing community.