REST endpoints for the Image Style Application
REST endpoints to get defined image styles |
Type | JAR |
Category | API |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Standard |
Compatibility | 14.3RC1+ |
Table of contents
Description
This module provide the rest endpoints for the Image Style extension.
The datastructures used in the parameters and responses are defined in the Image Style Model.
Endpoints
GET /wikis/{wikiName}/imageStyles
Return the list of image styles of the given wiki, as well as their configurations.
For instance curl -XGET -H 'Accept: application/json' "http://localhost:8080/xwiki/rest/wikis/xwiki/imageStyles/" returns the following json:
"imageStyles": [{
"identifier": "teststyle",
"prettyName": "Test Style",
"type": "test-style",
"adjustableSize": false,
"defaultWidth": null,
"defaultHeight": null,
"adjustableBorder": false,
"defaultBorder": false,
"adjustableAlignment": false,
"defaultAlignment": "none",
"adjustableTextWrap": false,
"defaultTextWrap": false
},
{
"identifier": "style2",
"prettyName": "Style 2",
"type": "style-2",
"adjustableSize": false,
"defaultWidth": null,
"defaultHeight": 100,
"adjustableBorder": true,
"defaultBorder": false,
"adjustableAlignment": false,
"defaultAlignment": "none",
"adjustableTextWrap": false,
"defaultTextWrap": false
}
]
}
GET /wikis/{wikiName}/imageStyles/default
Return the default image style of a given wiki.
For instance curl -XGET -H 'Accept: application/json' "http://localhost:8080/xwiki/rest/wikis/xwiki/imageStyles/default" returns the following json:
"defaultStyle": "teststyle"
}
When no default style is configured, and empty object {} is returned.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-image-style-rest 16.9.0):
- jakarta.ws.rs:jakarta.ws.rs-api 2.1.6
- org.xwiki.commons:xwiki-commons-stability 16.9.0
- org.xwiki.platform:xwiki-platform-rest-server 16.9.0
- org.xwiki.platform:xwiki-platform-image-style-model 16.9.0
- org.xwiki.platform:xwiki-platform-image-style-api 16.9.0