DSpace.API.Community (dspace_ex v0.1.0-alpha2)

Copy Markdown View Source

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

create(community, options \\ [])

@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

delete(uuid, options \\ [])

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

Deletes a community.

fetch(uuid, options \\ [])

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

Fetches a single community by UUID.

fetch_parent(uuid)

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

Fetches the parent community of a community.

find(options \\ [])

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

Finds communities using Discovery search.

This operation can be streamed.

Parameters

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{...}

list(options \\ [])

@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)

list_collections(uuid, options \\ [])

@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)

list_subcommunities(uuid, options \\ [])

@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)

list_toplevel(options \\ [])

@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)

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

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

Replaces an existing community.

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

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

Updates an existing community.