Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved docs of Plone REST API JavaScript Client #5576

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions docs/source/client/actions/actions.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Actions

Plone has the concept of configurable actions called `portal_actions`.
Plone has the idea of configurable actions called `portal_actions`.
Each action defines an `id`, a `title`, the required permissions, and a condition that will be checked to decide whether the action will be available for a user.
Actions are sorted by categories.

Actions can be used to build user interface elements that adapt to the available actions.
An example is the Plone toolbar where the `object_tabs` (view, edit, folder contents, sharing) and the `user_actions` (login, logout, preferences) are used to display to the user only those actions that are allowed for the currently logged in user.
Plone's toolbar displays permissible actions like `object_tabs` (view, edit, folder contents, sharing) and `user_actions` (login, logout, preferences) for the logged-in user's access.

The available actions for the currently logged in user can be retrieved by calling the `@actions` endpoint on a specific context.
This also works for unauthenticated users.

## Get Actions
## Get actions

### Query function

Expand Down
12 changes: 6 additions & 6 deletions docs/source/client/actions/addons.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Add-ons

Add-on product records can be addressed through the `@addons` endpoint in a Plone site.
In order to address a specific record, the profile ID has to be passed as a path segment, such as `/plone/@addons/plone.session`.
To address a specific record, the profile ID has to be passed as a path segment, such as `/plone/@addons/plone.session`.

Reading or writing add-ons metadata requires the `cmf.ManagePortal` permission.

Expand All @@ -27,7 +27,7 @@ Use the `useGetAddon` hook to get an add-on at a given path.

### Parameters

- **addonId**: string
- **`addonId`**: string

- **Required**: Yes

Expand All @@ -43,7 +43,7 @@ Use the `useInstallAddon` hook to install an add-on at a given path.

### Parameters

- **addonId**: string
- **`addonId`**: string

- **Required**: Yes

Expand All @@ -59,7 +59,7 @@ Use the `useUninstallAddon` hook to uninstall an add-on at a given path.

### Parameters

- **addonId**: string
- **`addonId`**: string

- **Required**: Yes

Expand All @@ -75,7 +75,7 @@ Use the `useInstallProfileAddon` hook to install an add-on profile at a given pa

### Parameters

- **addonId**: string
- **`addonId`**: string

- **Required**: Yes

Expand All @@ -95,6 +95,6 @@ Use the `useUpgradeAddon` hook to upgrade an add-on at a given path.

### Parameters

- **addonId**: string
- **`addonId`**: string

- **Required**: Yes
17 changes: 9 additions & 8 deletions docs/source/client/actions/aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

A mechanism to redirect old URLs to new ones.

When an object is moved (renamed or cut/pasted into a different location), the redirection storage will remember the old path. It is smart enough to deal with transitive references (if we have a -> b and then add b -> c, it is replaced by a reference a -> c) and circular references (attempting to add a -> a does nothing).
When an object is moved (renamed or cut/pasted into a different location), the redirection storage will remember the old path.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When an object is moved (renamed or cut/pasted into a different location), the redirection storage will remember the old path.
When an object is moved (renamed or cut-and-pasted into a different location), the redirection storage will remember the old path.

Handles transitive references (for example a -> b, b -> c becomes a -> c) and ignores circular ones (for example attempting a -> a has no effect).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Handles transitive references (for example a -> b, b -> c becomes a -> c) and ignores circular ones (for example attempting a -> a has no effect).
It handles transitive references intelligently (for example a -> b, b -> c becomes a -> c), ignoring circular ones (for example attempting a -> a has no effect).


## Get Aliases List
## Get aliases list

### Query function

Expand All @@ -14,7 +15,7 @@ Use the `getAliasesListQuery` function to get the query for fetching the aliases

Use the `useGetAliasesList` hook to get the aliases list.

## Get Aliases
## Get aliases

### Query function

Expand All @@ -30,15 +31,15 @@ Use the `useGetAliases` hook to get the aliases for a page.

- **Required:** Yes

## Add Aliases for Multiple Pages
## Add aliases for many pages

### Mutation function

Use the `createAliasesMutation` function to get the mutation for adding aliases for multiple pages.
Use the `createAliasesMutation` function to get the mutation for adding aliases for many pages.

### Hook

Use the `useCreateAliases` hook to add aliases for multiple pages.
Use the `useCreateAliases` hook to add aliases for many pages.

### Parameters

Expand All @@ -64,7 +65,7 @@ Use the `useCreateAliases` hook to add aliases for multiple pages.

- **Required:** Yes

## Add Aliases for a Page
## Add aliases for a page

### Mutation function

Expand Down Expand Up @@ -94,7 +95,7 @@ Use the `useCreateAliases` hook to add aliases for a page.

- **Required:** Yes

## Delete Aliases
## Delete aliases

### Mutation function

Expand Down
2 changes: 1 addition & 1 deletion docs/source/client/actions/breadcrumbs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Breadcrumbs

## Get Breadcrumbs
## Get breadcrumbs

### Query function

Expand Down
14 changes: 7 additions & 7 deletions docs/source/client/actions/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Commenting can be enabled globally for specific content types and for single con

When commenting is enabled on your content object, you can retrieve a list of all existing comments, add new comments, reply to existing comments, or delete a comment.

## Get Comments List
## Get comments list

### Query function

Expand All @@ -22,7 +22,7 @@ Use the `useGetCommentsList` hook to get the comments list for a page.

- **Required:** Yes

## Add Comment
## Add comment

### Mutation function

Expand All @@ -38,7 +38,7 @@ Use the `useCreateComment` hook to add a comment for a page.

- **Required:** Yes

- **reply_id**: string
- **`reply_id`**: string

- **Required:** No
- The id of the comment to which you want to reply
Expand All @@ -53,7 +53,7 @@ Use the `useCreateComment` hook to add a comment for a page.
- **Required:** Yes
- The content of the comment.

## Update Comment
## Update comment

### Mutation function

Expand All @@ -69,7 +69,7 @@ Use the `useUpdateComment` hook to update a comment for the given id and path.

- **Required:** Yes

- **comment_id**: string
- **`comment_id`**: string

- **Required:** Yes

Expand All @@ -83,7 +83,7 @@ Use the `useUpdateComment` hook to update a comment for the given id and path.
- **Required:** Yes
- The content of the comment.

## Delete Comment
## Delete comment

### Mutation function

Expand All @@ -99,6 +99,6 @@ Use the `useDeleteComment` hook to delete a comment for the given id and path.

- **Required:** Yes

- **comment_id**: string
- **`comment_id`**: string

- **Required:** Yes
12 changes: 6 additions & 6 deletions docs/source/client/actions/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Get the data for a specific content given its path.

## Get Content
## Get content

### Query options function

Expand All @@ -26,15 +26,15 @@ Use the `useGetContent` hook to get the content at a given path.

- **Required:** No

- **fullObjects:** boolean
- **`fullObjects`:** `boolean`

- **Required:** No

- **expand:** string[]

- **Required:** No

## Add Content
## Add content

### Mutation options function

Expand Down Expand Up @@ -152,7 +152,7 @@ Use the `useCreateContent` hook to add content at a given path.

- **Required:** No

## Update Content
## Update content

### Mutation function

Expand Down Expand Up @@ -258,7 +258,7 @@ Use the `useUpdateContent` hook to update content at a given path.

- **Required**: No

## Delete Content
## Delete content

### Mutation function

Expand All @@ -280,7 +280,7 @@ Use the `useDeleteContent` hook to delete content at a given path.

(relatedobject)=

#### RelatedObject
#### `RelatedObject`

`@id: string`

Expand Down
6 changes: 3 additions & 3 deletions docs/source/client/actions/contextnavigation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Context Navigation
# Context navigation

The `@contextnavigation` endpoint uses the same semantics as the classic Plone navigation portlet. Instead of storing the portlet configuration in a portlet assignment storage, you can pass these as parameters to the service or expand the component.
The `@contextnavigation` endpoint uses the same semantics as the classic Plone navigation `portlet`. Instead of storing the `portlet` configuration in a `portlet` assignment storage, you can pass these as parameters to the service or expand the part.

## Get Context Navigation
## Get context navigation

### Query function

Expand Down
12 changes: 6 additions & 6 deletions docs/source/client/actions/controlpanels.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Control Panels
# Control panels

Control panels in Plone allow you to configure the global site setup of a Plone site.
The `@controlpanels` endpoint in `plone.restapi` allows you to list all existing control panels in a Plone site, and to retrieve or edit the settings of a specific control panel.

## Get Control Panels List
## Get control panels list

### Query function

Expand All @@ -13,7 +13,7 @@ Use the `getControlpanelsQuery` function to get the query for fetching the contr

Use the `useGetControlpanels` hook to get the control panels list.

## Get Control Panel
## Get control panel

### Query function

Expand All @@ -29,7 +29,7 @@ Use the `useGetControlpanel` hook to get a control panel at a given path.

- **Required**: Yes

## Add Custom Elements in Control Panel
## Add custom elements in control panel

### Mutation function

Expand All @@ -45,7 +45,7 @@ Use the `useCreateControlpanel` hook to add a custom element in the control pane

- **Required**: Yes

## Update Custom Elements in Control Panel
## Update custom elements in control panel

### Mutation function

Expand All @@ -61,7 +61,7 @@ Use the `useUpdateControlpanel` hook to update a custom element in the control p

- **Required**: Yes

## Delete Custom Elements in Control Panel
## Delete custom elements in control panel

### Mutation function

Expand Down
6 changes: 3 additions & 3 deletions docs/source/client/actions/copymove.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copy and Move
# Copy and move

## Copying an object

Expand All @@ -10,7 +10,7 @@ The source object can be specified either by URL, path, UID or `intid`:
To move a content object, send a `POST` request to the `/@move` endpoint at the destination's URL with the source object specified in the request body.
The source object can be specified either by URL, path, UID or `intid`:

## Copy Content
## Copy content

### Mutation function

Expand All @@ -33,7 +33,7 @@ Use the `useCopy` hook to copy a content object.
- **Required:** Yes
- The source object to copy. It can be specified either by URL, path, UID or `intid`.

## Move Content
## Move content

### Mutation function

Expand Down
8 changes: 4 additions & 4 deletions docs/source/client/actions/email-notification.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Email Notification
# Email notification

## Contact Site Owner (Contact Form)
## Contact site owner (contact form)

Plone allows the user to contact the site owner via a form on the website.
This makes sure the site owner does not have to expose their email addresses publicly.
This makes sure the site owner doesn't have to expose their email addresses publicly.
At the same time, it allows the users to reach out to the site owners.

## Send Email Notification
## Send email notification

### Mutation function

Expand Down
4 changes: 2 additions & 2 deletions docs/source/client/actions/email-send.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Email Send
# Email send

To send an email to an arbitrary email address use the /@email-send endpoint.

## Send Email
## Send email

### Mutation function

Expand Down