Skip to content

Commit 92102fc

Browse files
committed
Update backend README
1 parent ef7f4d6 commit 92102fc

1 file changed

Lines changed: 93 additions & 3 deletions

File tree

backend/README.md

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
# kitconcept.keywordmanager
1+
# Keyword Manager for Plone (Backend: kitconcept.keywordmanager)
22

3-
Change, merge and delete keywords (subjects) in Plone.
3+
The backend package for Keyword Manager for Plone — a Plone 6 add-on that lets content editors rename, merge, and delete keywords (subjects/tags) across a site, with all content updated automatically. See also the frontend package [@kitconcept/volto-keywordmanager](https://www.npmjs.com/package/@kitconcept/volto-keywordmanager).
44

55
## Features
66

7-
TODO: List our awesome features
7+
- **Browse all keywords** currently in use, sorted by name or by number of occurrences.
8+
- **Filter keywords** to quickly find a specific term in a long list.
9+
- **Rename a keyword** — the new name is applied to every content item that uses it automatically.
10+
- **Merge keywords** — combine synonyms, fix typos, or resolve ambiguities by merging multiple keywords into one canonical term; all affected content is updated in one step.
11+
- **Delete keywords** — remove terms that are no longer needed.
12+
- **Manage multiple keyword fields** — works with the standard `Subject` field and any other keyword-type index in the catalog.
13+
14+
## Requirements
15+
16+
- Plone 6.1 or 6.2
17+
- Python 3.11, 3.12, or 3.13
818

919
## Installation
1020

@@ -20,6 +30,86 @@ Create the Plone site.
2030
make create-site
2131
```
2232

33+
## Configuration
34+
35+
To configure one of the following options, import the config module:
36+
37+
```py
38+
from kitconcept.keywordmanager import config
39+
```
40+
41+
### Options
42+
43+
The keywords permission allows you to set a custom permission who should be able to manage keywords.
44+
45+
```py
46+
config.MANAGE_KEYWORDS_PERMISSION = "kitconcept.keywordmanager: Manage Keywords"
47+
```
48+
49+
The meta type of the keyword indexes can be set. This is only useful if you're one of those crazy people that use custom indexes.
50+
51+
```py
52+
config.META_TYPE = "KeywordIndex"
53+
```
54+
55+
There are indexes of `META_TYPE` we know we don't want to manage because bad things will happen. You can exclude those using:
56+
57+
```py
58+
config.IGNORE_INDEXES = [
59+
"object_provides",
60+
"allowedRolesAndUsers",
61+
"getRawRelatedItems",
62+
"getEventType",
63+
"block_types",
64+
]
65+
```
66+
67+
You can set a list of indexes that should always be reindex when merging or deleting keywords on objects. Most people won't need this.
68+
69+
```py
70+
config.ALWAYS_REINDEX = (
71+
"SearchableText",
72+
)
73+
```
74+
75+
## REST API
76+
77+
### GET `/@keywords` (or `/path/to/page/@keywords`)
78+
79+
| Parameter | Source | Type / Values | Required | Default | Description |
80+
| ------------ | ------ | --------------------------- | -------- | --------- | --------------------------- |
81+
| `idx` | form | string | no | "Subject" | The keyword index to query. |
82+
| `sort_order` | form | "ascending" or "descending" | no || The sort order of results. |
83+
| `sort_on` | form | "keyword" or "occurrence" | no || The field to sort on. |
84+
85+
### PATCH `/@keywords` (or `/path/to/page/@keywords`)
86+
87+
| Parameter | Source | Type / Values | Required | Default | Description |
88+
| -------------- | ------ | ------------- | -------- | --------- | -------------------------------------- |
89+
| `idx` | form | string | no | "Subject" | The keyword index to query. |
90+
| `new_keyword` | body | string | yes || The name of the keyword to be created. |
91+
| `old_keywords` | body | list[string] | yes || The old keywords to be deleted. |
92+
93+
### DELETE `/@keywords` (or `/path/to/page/@keywords`)
94+
95+
| Parameter | Source | Type / Values | Required | Default | Description |
96+
| --------- | ------ | ------------- | -------- | --------- | --------------------------------------- |
97+
| `idx` | form | string | no | "Subject" | The keyword index to query. |
98+
| `items` | body | list | yes || The name of the keywords to be deleted. |
99+
100+
### GET `/@keywordIndex`
101+
102+
No parameters.
103+
104+
## Utility
105+
106+
```py
107+
from kitconcept.keywordmanager.interfaces import IKeywordManager
108+
from zope.component import getUtility
109+
110+
km = getUtility(IKeywordManager)
111+
```
112+
23113
## Contribute
24114

25115
- [Issue tracker](https://github.com/kitconcept/kitconcept-keywordmanager/issues)

0 commit comments

Comments
 (0)