-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
The DSpaceClient class can be extended to include several new methods to interact with the DSpace Item API as documented in https://github.com/DSpace/RestContract/blob/main/items.md. These methods provide functionality for managing item relationships, access status, metrics, owning collections, and mapped collections.
Functions:
- get_item_metrics
- Fetches metrics for a specified item.
- Handles network errors and API response status codes.
- get_item_thumbnail
- Retrieves the thumbnail of an item, if available.
- Handles the following status codes:
- 200 OK: Returns the thumbnail.
- 204 No Content: Indicates no thumbnail is available.
- 401 Unauthorized: Logs insufficient authentication.
- 403 Forbidden: Logs insufficient permissions.
- 404 Not Found: Logs that the item or thumbnail is missing.
- get_item_owning_collection
- Retrieves the owning collection for a specified item.
- Handles errors when the item or owning collection cannot be retrieved.
- update_item_owning_collection
- Updates the owning collection of a specified item.
- Handles the following status codes:
- 204 No Content: Indicates success.
- 403 Forbidden: Logs insufficient permissions or CSRF token issues.
- Other: Logs any unexpected response.
- get_item_mapped_collections
- Retrieves all mapped collections for a specified item.
- Handles error codes like 401, 403, 405, and 422.
- add_item_mapped_collection
- Adds a new mapping between an item and a collection.
- Handles appropriate API response codes and errors.
- delete_item_mapped_collection
- Removes a mapping between an item and a collection.
- Handles response codes for authentication, permissions, and entity processing.
- get_item_relationships
- Retrieves relationships of an item.
- Handles response parsing and error logging.
- get_item_access_status
- Fetches the access status of an item.
- Manages API responses for invalid parameters, missing items, and more.
Benefits:
- Provides a comprehensive interface for interacting with DSpace items.
- Improves error handling and robustness in API interactions.
- Aligns the client with the latest DSpace REST API specifications.
Metadata
Metadata
Assignees
Labels
No labels