Page History
HTML Wrap | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
HTML Wrap | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Related topics: |
Include Page | ||||
---|---|---|---|---|
|
Table of Contents | ||||
---|---|---|---|---|
|
Modules
Multiexcerpt | ||
---|---|---|
| ||
The Java API for RESTful Web Services - JAX-RS is defined in the packages The dependencies (for both the interfaces and the implementations) are managed by the |
Magnolia's REST web services consist of several modules:
- REST Services
- REST Integration
- REST Content Delivery
- REST Tools
REST Services
The REST Services module installs the following endpoints of the REST API: nodes, properties and commands.
Advanced Tables - Table Plus | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
|
REST Integration
Multiexcerpt | ||
---|---|---|
| ||
The REST Integration module installs the integration part of REST. The module:
|
Advanced Tables - Table Plus | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||
|
REST Content Delivery
The REST Content Delivery module lets you configure a content delivery endpoint with minimal overhead.
The delivery endpoint allows you to get JCR content through a RESTful API. The nodes can be pages, components, stories or anything else that is stored in a workspace. The response is displayed in a concise JSON format.
This module depends on the rest-integration
module.
Advanced Tables - Table Plus | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
|
REST Tools
Multiexcerpt | ||
---|---|---|
| ||
The REST Tools module integrates the swagger tools into the Admin UI. These tools ease the development and testing of REST endpoints. The module extends the |
Not installed by default.
Installing
Maven is the easiest way to install the modules. Add the following dependencies to your bundle:
Artifact maven dependencies snippet | ||||
---|---|---|---|---|
|
Artifact maven dependencies snippet | ||||
---|---|---|---|---|
|
Artifact maven dependencies snippet | ||||
---|---|---|---|---|
|
Artifact maven dependencies snippet | ||||
---|---|---|---|---|
|
Include Page | ||||
---|---|---|---|---|
|
Artifact resource link groupId info.magnolia.rest artifactId magnolia-rest-services label $artifactId.jar renderType download_link resourceType JAR Artifact resource link groupId info.magnolia.rest artifactId magnolia-rest-integration label $artifactId.jar renderType download_link resourceType JAR Artifact resource link groupId info.magnolia.rest artifactId magnolia-rest-content-delivery label $artifactId.jar renderType download_link resourceType JAR - Rest Tools bundle:
Artifact resource link groupId info.magnolia.rest artifactId magnolia-rest-tools label $artifactId.zip renderType download_link resourceType ZIP
Info |
---|
Preconfigured Magnolia bundles contain the magnolia-rest-services , magnolia-rest-integration and magnolia-rest-content-delivery modules but not magnolia-rest-tools . When adding magnolia-rest-tools directly to your bundle, unpack the zip file and add all the files it contains to the WEB-INF/libs folder of your webapps. |
Configuration
REST Tools module - Setting the API base path
Multiexcerpt | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||
The Swagger API explorer tool searches for the API at a path set in
When using one of Magnolia's preconfigured bundles running on localhost, set the property to Set the path to where REST services reside on your system. If you run the standard Magnolia bundle and work on the author instance, set the path to
After setting the base path, restart Magnolia. Swagger is in Dev > REST Tools. |
REST Services module - configuring the commands endpoint
Note |
---|
You can make sweeping changes with commands, such as bypassing approval and deleting the whole site. Commands are therefore subject to special security restrictions. |
To enable the use of commands through REST:
- In the Security app, grant URI access permission to the path
/.rest/commands/v2/*
to the role for users who need access to the commands endpoint. - Whitelist any commands you want to expose to REST. The white list is managed in
/modules/rest-services/rest-endpoints/commands/enabledCommands
.
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||
|
Properties:
enabledCommands | required Enabled commands node. |
| required Arbitrary name for the command. Use any name you like. |
| required Access node. |
| required Roles node. |
| required Role name. Grants the role permission to execute the command. Add the |
| required Catalog where the command resides. |
| required Command definition name. |
Content Delivery module - configuring the delivery endpoint
You can define multiple endpoints in the version 2 of the delivery endpoint, definitions can be in YAML or in JCR ( on the configuration
workspace).
Every endpoint is accessible via distinct endpointPath
. The endpointPath property is set automatically by the given name and location of the endpoint definition, or it can be set explicitly in the configuration.
<magnolia-base-path>/.rest/endpointPath/{path}
<magnolia-base-path>/.rest/endpointPath?query-parameters
Localtab Group | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
For a complete reference - please see Delivery endpoint API v2 - Configuration.
Security
See REST security.