Get Item¶
Get an Item from the content store.
This API is used to get pages, components and folders. It returns the content and other metadata such as url, descriptorUrl, folder flag, and extra properties
Resource Information¶
This service uses the tomcat application on port 8080 by default. To see a list of default ports click here
The context for this API is /
.
HTTP Verb
|
GET
|
URL
|
/api/1/site/content_store/item |
Response Formats
|
JSON , XML |
Parameters¶
Name
|
Type
|
Required
|
Description
|
---|---|---|---|
url
|
String
|
✓
|
The item’s url (e.g /site/website/index.xml)
|
Response Elements¶
For successful requests, an HTTP 200 response is sent back with the following elements returned by the service:
Name
|
Description
|
---|---|
name
|
Name of item being retrieved (e.g. index.xml
|
url
|
The item’s URL (e.g /site/website/index.xml)
|
descriptorUrl
|
The item’s descriptor URL (e.g. for a folder: /site/website.meta.xml,
for a page: /site/website/index.xml)
|
descriptorDom
|
Contains the content of item being retrieved (DOM of xml)
|
properties
|
Contains additional properties that are generated by an ItemProcessor
|
folder
|
Indicates whether the item is a folder (true or false)
|
Example¶
Page/Component¶
The example below gets the content of the home page of a site created using the Website Editorial blueprint
Request¶
GET .../api/1/site/content_store/item.json?url=/site/website/index.xml
Response without additional properties generated by an ItemProcessor¶
Status 200 OK
1{
2 "name": "index.xml",
3 "url": "/site/website/index.xml",
4 "descriptorUrl": "/site/website/index.xml",
5 "descriptorDom": {
6 "page": {
7 "content-type": "/page/home",
8 "display-template": "/templates/web/pages/home.ftl",
9 "merge-strategy": "inherit-levels",
10 "placeInNav": "false",
11 "file-name": "index.xml",
12 "objectGroupId": "8d7f",
13 "objectId": "8d7f21fa-5e09-00aa-8340-853b7db302da",
14 "folder-name": null,
15 "header": {
16 "item": {
17 "key": "/site/components/headers/header.xml",
18 "value": "Header",
19 "include": "/site/components/headers/header.xml",
20 "disableFlattening": "false"
21 }
22 },
23 "createdDate": "1/31/2017 16:18:14",
24 "createdDate_dt": "1/31/2017 16:18:14",
25 "lastModifiedDate": "5/18/2017 15:52:21",
26 "lastModifiedDate_dt": "5/18/2017 15:52:21",
27 "left-rail": {
28 "item": {
29 "key": "/site/components/left-rails/left-rail-with-latest-articles.xml",
30 "value": "Left Rail with Latest Articles",
31 "include": "/site/components/left-rails/left-rail-with-latest-articles.xml",
32 "disableFlattening": "false"
33 }
34 },
35 "internal-name": "Home",
36 "orderDefault_f": "-1",
37 "title": "Editorial",
38 "hero_text": "<p>Aenean ornare velit lacus, ac varius enim ullamcorper eu. Proin aliquam facilisis ante interdum congue. Integer mollis, nisl amet convallis, porttitor magna ullamcorper, amet egestas mauris. Ut magna finibus nisi nec lacinia. Nam maximus erat id euismod egestas. Pellentesque sapien ac quam. Lorem ipsum dolor sit nullam.</p>",
39 "hero_title": "<h1><span>Hi, I’m Editorial</span></h1>\n<h3><span style=\"font-size: 1.5em;\">by HTML5 UP</span></h3>",
40 "features": {
41 "item": [
42 {
43 "value": "Quam lorem ipsum",
44 "key": "/site/components/features/quam-lorem-ipsum.xml",
45 "include": "/site/components/features/quam-lorem-ipsum.xml",
46 "disableFlattening": "false"
47 },
48 {
49 "key": "/site/components/features/sapien-veroeros.xml",
50 "value": "Sapien Veroeros",
51 "include": "/site/components/features/sapien-veroeros.xml",
52 "disableFlattening": "false"
53 }
54 ]
55 },
56 "hero_image": "/static-assets/images/strawberries.jpg",
57 "features_title": "Erat lacinia"
58 }
59 },
60 "properties": null,
61 "folder": false
62}
Response with additional properties generated by an ItemProcessor¶
Status 200 OK
1 {
2 "name": "index.xml",
3 "url": "/site/website/index.xml",
4 "descriptorUrl": "/site/website/index.xml",
5 "descriptorDom": {
6 "page": {
7 "content-type": "/page/home",
8 "display-template": "/templates/web/pages/home.ftl",
9 "merge-strategy": "inherit-levels",
10 "placeInNav": "false",
11 "file-name": "index.xml",
12 "objectGroupId": "8d7f",
13 "objectId": "8d7f21fa-5e09-00aa-8340-853b7db302da",
14 "folder-name": null,
15 "header": {
16 "item": {
17 "key": "/site/components/headers/header.xml",
18 "value": "Header",
19 "include": "/site/components/headers/header.xml",
20 "disableFlattening": "false"
21 }
22 },
23 "createdDate": "1/31/2017 16:18:14",
24 "createdDate_dt": "1/31/2017 16:18:14",
25 "lastModifiedDate": "5/18/2017 15:52:21",
26 "lastModifiedDate_dt": "5/18/2017 15:52:21",
27 "left-rail": {
28 "item": {
29 "key": "/site/components/left-rails/left-rail-with-latest-articles.xml",
30 "value": "Left Rail with Latest Articles",
31 "include": "/site/components/left-rails/left-rail-with-latest-articles.xml",
32 "disableFlattening": "false"
33 }
34 },
35 "internal-name": "Home",
36 "orderDefault_f": "-1",
37 "title": "Editorial",
38 "hero_text": "<p>Aenean ornare velit lacus, ac varius enim ullamcorper eu. Proin aliquam facilisis ante interdum congue. Integer mollis, nisl amet convallis, porttitor magna ullamcorper, amet egestas mauris. Ut magna finibus nisi nec lacinia. Nam maximus erat id euismod egestas. Pellentesque sapien ac quam. Lorem ipsum dolor sit nullam.</p>",
39 "hero_title": "<h1><span>Hi, I’m Editorial</span></h1>\n<h3><span style=\"font-size: 1.5em;\">by HTML5 UP</span></h3>",
40 "features": {
41 "item": [
42 {
43 "value": "Quam lorem ipsum",
44 "key": "/site/components/features/quam-lorem-ipsum.xml",
45 "include": "/site/components/features/quam-lorem-ipsum.xml",
46 "disableFlattening": "false"
47 },
48 {
49 "key": "/site/components/features/sapien-veroeros.xml",
50 "value": "Sapien Veroeros",
51 "include": "/site/components/features/sapien-veroeros.xml",
52 "disableFlattening": "false"
53 }
54 ]
55 },
56 "hero_image": "/static-assets/images/strawberries.jpg",
57 "features_title": "Erat lacinia"
58 }
59 },
60 "properties": {"//page/merge-strategy":"inherit-levels","//page/content-type":"/page/home"},
61 "folder": false
62 }
Folder¶
The example below gets the home page folder of a site created using the Website Editorial blueprint
Request¶
GET .../api/1/site/content_store/item.json?url=/site/website/
Response¶
Status 200 OK
1{
2 "name":"website",
3 "url":"/site/website",
4 "descriptorUrl":"/site/website.meta.xml",
5 "descriptorDom":null,
6 "properties":null,
7 "folder":true
8}
Responses¶
Status
|
Location
|
Response Body
|
---|---|---|
200
|
See example above.
|
|
404
|
"No item found at /site/website/index.xml" |
|
500
|
"Internal server error" |