You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collections provide a powerful way to curate and organize records within your InvenioRDM instance. They define sets of records based on search filters and can be organized hierarchically to create meaningful groupings of content.
4
4
5
-
!!! warning
6
-
This features currently lacks a user-friendly interface for easy configuration and require manual setup.
5
+
_Updated in v14: Added user interface for collections management in community settings._
7
6
8
7
## Overview
9
8
@@ -19,34 +18,126 @@ Collections **cannot** be used to apply access restrictions or permission-based
19
18
20
19
## Configuration
21
20
21
+
### Display Settings
22
+
22
23
To enable displaying the communities "Browse" menu entry in your InvenioRDM instance, add to your `invenio.cfg`:
23
24
24
25
```python
25
26
COMMUNITIES_SHOW_BROWSE_MENU_ENTRY=True
26
27
```
27
28
28
-
Additionally, for any communities that you want to setup collections, you need to configure them to allow subcommunities via the `children.allow` setting.
29
+
### Collection Hierarchy Limits
30
+
31
+
You can configure limits for collection hierarchies to maintain good user experience and system performance:
32
+
33
+
```python
34
+
# Maximum depth for collection hierarchies (default: 1)
35
+
# Depth 0 = root collections
36
+
# Depth 1 = children of root
37
+
# Depth 2 = grandchildren
38
+
# Setting this to 1 allows 2 levels: root + children only
39
+
COMMUNITIES_COLLECTIONS_MAX_DEPTH=1
40
+
41
+
# Maximum number of collection trees per community (default: 10)
42
+
# Set to 0 for unlimited trees
43
+
COMMUNITIES_COLLECTIONS_MAX_TREES=10
44
+
45
+
# Maximum number of collections per tree (default: 100)
46
+
# This counts all collections in a tree, regardless of depth
#### Restricting Collections for Specific Communities
85
+
86
+
You can use the `IfCommunitySlug` generator to apply different permissions based on community slug. For example, to block collections management for a community with slug `physics`:
87
+
88
+
```python
89
+
from invenio_communities.permissions import CommunityPermissionPolicy
90
+
from invenio_communities.generators import (
91
+
CommunityOwners,
92
+
IfCommunitySlug,
93
+
)
94
+
from invenio_records_permissions.generators import Disable, SystemProcess
# Block collections for 'physics' community, allow for others
101
+
IfCommunitySlug(
102
+
slugs=['physics'], # Community slugs to match
103
+
then_=[Disable()], # Block everyone for 'physics'
104
+
else_=[CommunityOwners()], # Allow for others
105
+
),
106
+
SystemProcess(), # System always has access
107
+
]
108
+
```
29
109
30
-
!!! bug "Requirement on enabled subcommunities"
31
-
Having a community with `children.allow: true` is a limitation of the current "Browse" menu entry implementation in InvenioRDM v13. This will be patched to allow communities that might only have collections (and not subcommunities enabled) to still display the "Browse" menu entry.
32
110
33
111
## Managing Collections
34
112
35
-
Collections are organized within **Collection Trees** - hierarchical structures that allow you to create logical groupings and nested relationships. Collection trees serve as the root containers for your collections and can be:
113
+
Collections are organized within **Collection Trees**(also called **Sections**) - hierarchical structures that allow you to create logical groupings and nested relationships. Collection trees serve as the root containers for your collections and can be:
36
114
37
115
-**Community-specific** - Scoped to records of a particular community
38
116
-**Global** - Scoped across records of your entire instance
39
117
40
118
!!! info "Global collections"
41
119
Global collections display is not yet implemented in InvenioRDM v13.
42
120
43
-
Before creating collections, you need:
121
+
### Using the Collections UI (v14+)
122
+
123
+
_Available from InvenioRDM v14_
124
+
125
+
Community owners can manage collections through the community settings interface:
126
+
127
+
1. Navigate to your community's settings page
128
+
2. Click on the **Collections** tab in the left sidebar
129
+
3. Use the interface to:
130
+
- Create new sections (collection trees).
131
+
- Add collections within sections.
132
+
- Create nested child collections.
133
+
- Edit collection queries and metadata.
134
+
- Reorder collections via drag-and-drop.
135
+
- Delete collections and sections.
136
+
44
137
45
-
1.**Access to Python shell** - Collections are currently managed via `invenio shell`
46
-
2.**A community with subcommunities enabled** - At present, collections are scoped to communities, so you need at least one community. Additionally, to display the "Browse" tab, that community must have `children.allow: true` set.
138
+
### Managing Collections Programmatically
47
139
48
-
!!! warning "Administration UI for Collections"
49
-
The administration UI for managing collections is not yet available in InvenioRDM v13. Collections are currently managed programmatically via the Python shell.
140
+
You can also manage collections programmatically via the Python shell or custom scripts. This is useful for bulk operations or automated setup.
0 commit comments