Skip to content

Commit 6860367

Browse files
dabrtmnocon
andauthored
IBX-10527: Describe Content Type Search REST API (#2953)
* IBX-10527: Describe Content Type Search REST API --------- Co-authored-by: Marek Nocoń <[email protected]>
1 parent 52834fc commit 6860367

File tree

8 files changed

+1391
-10
lines changed

8 files changed

+1391
-10
lines changed
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"ContentTypeList": {
3+
"_media-type": "application/vnd.ibexa.api.ContentTypeList+json",
4+
"_href": "",
5+
"ContentType": [
6+
{
7+
"_media-type": "application/vnd.ibexa.api.ContentType+json",
8+
"_href": "/api/ibexa/v2/content/types/1",
9+
"id": 1,
10+
"status": "DEFINED",
11+
"identifier": "folder",
12+
"names": {
13+
"value": [
14+
{
15+
"_languageCode": "eng-GB",
16+
"#text": "Folder"
17+
}
18+
]
19+
},
20+
"descriptions": {
21+
"value": []
22+
},
23+
"creationDate": "2002-06-18T09:21:38+00:00",
24+
"modificationDate": "2015-11-29T21:14:32+00:00",
25+
"Creator": {
26+
"_media-type": "application/vnd.ibexa.api.User+json",
27+
"_href": "/api/ibexa/v2/user/users/14"
28+
},
29+
"Modifier": {
30+
"_media-type": "application/vnd.ibexa.api.User+json",
31+
"_href": "/api/ibexa/v2/user/users/14"
32+
},
33+
"Groups": {
34+
"_media-type": "application/vnd.ibexa.api.ContentTypeGroupRefList+json",
35+
"_href": "/api/ibexa/v2/content/types/1/groups"
36+
},
37+
"Draft": {
38+
"_media-type": "application/vnd.ibexa.api.ContentType+json",
39+
"_href": "/api/ibexa/v2/content/types/1/draft"
40+
},
41+
"remoteId": "a3d405b81be900468eb153d774f4f0d2",
42+
"urlAliasSchema": null,
43+
"nameSchema": "<short_name|name>",
44+
"isContainer": true,
45+
"mainLanguageCode": "eng-GB",
46+
"defaultAlwaysAvailable": true,
47+
"defaultSortField": "PATH",
48+
"defaultSortOrder": "ASC",
49+
"FieldDefinitions": {
50+
"_media-type": "application/vnd.ibexa.api.FieldDefinitionList+json",
51+
"_href": "/api/ibexa/v2/content/types/1/fieldDefinitions",
52+
"FieldDefinition": [
53+
{
54+
"_media-type": "application/vnd.ibexa.api.FieldDefinition+json",
55+
"_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/4",
56+
"id": 4,
57+
"identifier": "name",
58+
"fieldType": "ezstring",
59+
"fieldGroup": "",
60+
"position": 1,
61+
"isTranslatable": true,
62+
"isRequired": true,
63+
"isInfoCollector": false,
64+
"defaultValue": "Folder",
65+
"isSearchable": true,
66+
"names": {
67+
"value": [
68+
{
69+
"_languageCode": "eng-GB",
70+
"#text": "Name"
71+
}
72+
]
73+
},
74+
"descriptions": {
75+
"value": []
76+
},
77+
"fieldSettings": [],
78+
"validatorConfiguration": {
79+
"StringLengthValidator": {
80+
"maxStringLength": 255,
81+
"minStringLength": null
82+
}
83+
}
84+
},
85+
{
86+
"_media-type": "application/vnd.ibexa.api.FieldDefinition+json",
87+
"_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/119",
88+
"id": 119,
89+
"identifier": "short_description",
90+
"fieldType": "ezrichtext",
91+
"fieldGroup": "",
92+
"position": 3,
93+
"isTranslatable": true,
94+
"isRequired": false,
95+
"isInfoCollector": false,
96+
"defaultValue": {
97+
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://docbook.org/ns/docbook\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"5.0-variant ezpublish-1.0\"/>\n",
98+
"xhtml5edit": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://ibexa.co/namespaces/ezpublish5/xhtml5/edit\"/>\n"
99+
},
100+
"isSearchable": true,
101+
"names": {
102+
"value": [
103+
{
104+
"_languageCode": "eng-GB",
105+
"#text": "Short description"
106+
}
107+
]
108+
},
109+
"descriptions": {
110+
"value": []
111+
},
112+
"fieldSettings": [],
113+
"validatorConfiguration": []
114+
},
115+
{
116+
"_media-type": "application/vnd.ibexa.api.FieldDefinition+json",
117+
"_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/155",
118+
"id": 155,
119+
"identifier": "short_name",
120+
"fieldType": "ezstring",
121+
"fieldGroup": "",
122+
"position": 2,
123+
"isTranslatable": true,
124+
"isRequired": false,
125+
"isInfoCollector": false,
126+
"defaultValue": null,
127+
"isSearchable": true,
128+
"names": {
129+
"value": [
130+
{
131+
"_languageCode": "eng-GB",
132+
"#text": "Short name"
133+
}
134+
]
135+
},
136+
"descriptions": {
137+
"value": []
138+
},
139+
"fieldSettings": [],
140+
"validatorConfiguration": {
141+
"StringLengthValidator": {
142+
"maxStringLength": 100,
143+
"minStringLength": null
144+
}
145+
}
146+
},
147+
{
148+
"_media-type": "application/vnd.ibexa.api.FieldDefinition+json",
149+
"_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/156",
150+
"id": 156,
151+
"identifier": "description",
152+
"fieldType": "ezrichtext",
153+
"fieldGroup": "",
154+
"position": 4,
155+
"isTranslatable": true,
156+
"isRequired": false,
157+
"isInfoCollector": false,
158+
"defaultValue": {
159+
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://docbook.org/ns/docbook\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"5.0-variant ezpublish-1.0\"/>\n",
160+
"xhtml5edit": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://ibexa.co/namespaces/ezpublish5/xhtml5/edit\"/>\n"
161+
},
162+
"isSearchable": true,
163+
"names": {
164+
"value": [
165+
{
166+
"_languageCode": "eng-GB",
167+
"#text": "Description"
168+
}
169+
]
170+
},
171+
"descriptions": {
172+
"value": []
173+
},
174+
"fieldSettings": [],
175+
"validatorConfiguration": []
176+
}
177+
]
178+
}
179+
}
180+
]
181+
}
182+
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ContentTypeList media-type="application/vnd.ibexa.api.ContentTypeList+xml" href="">
3+
<ContentType media-type="application/vnd.ibexa.api.ContentType+xml" href="/api/ibexa/v2/content/types/1">
4+
<id>1</id>
5+
<status>DEFINED</status>
6+
<identifier>folder</identifier>
7+
<names>
8+
<value languageCode="eng-GB">Folder</value>
9+
</names>
10+
<descriptions/>
11+
<creationDate>2002-06-18T09:21:38+00:00</creationDate>
12+
<modificationDate>2015-11-29T21:14:32+00:00</modificationDate>
13+
<Creator media-type="application/vnd.ibexa.api.User+xml" href="/api/ibexa/v2/user/users/14"/>
14+
<Modifier media-type="application/vnd.ibexa.api.User+xml" href="/api/ibexa/v2/user/users/14"/>
15+
<Groups media-type="application/vnd.ibexa.api.ContentTypeGroupRefList+xml" href="/api/ibexa/v2/content/types/1/groups"/>
16+
<Draft media-type="application/vnd.ibexa.api.ContentType+xml" href="/api/ibexa/v2/content/types/1/draft"/>
17+
<remoteId>a3d405b81be900468eb153d774f4f0d2</remoteId>
18+
<urlAliasSchema></urlAliasSchema>
19+
<nameSchema>&lt;short_name|name&gt;</nameSchema>
20+
<isContainer>true</isContainer>
21+
<mainLanguageCode>eng-GB</mainLanguageCode>
22+
<defaultAlwaysAvailable>true</defaultAlwaysAvailable>
23+
<defaultSortField>PATH</defaultSortField>
24+
<defaultSortOrder>ASC</defaultSortOrder>
25+
<FieldDefinitions media-type="application/vnd.ibexa.api.FieldDefinitionList+xml" href="/api/ibexa/v2/content/types/1/fieldDefinitions">
26+
<FieldDefinition media-type="application/vnd.ibexa.api.FieldDefinition+xml" href="/api/ibexa/v2/content/types/1/fieldDefinitions/4">
27+
<id>4</id>
28+
<identifier>name</identifier>
29+
<fieldType>ezstring</fieldType>
30+
<fieldGroup></fieldGroup>
31+
<position>1</position>
32+
<isTranslatable>true</isTranslatable>
33+
<isRequired>true</isRequired>
34+
<isInfoCollector>false</isInfoCollector>
35+
<defaultValue>Folder</defaultValue>
36+
<isSearchable>true</isSearchable>
37+
<names>
38+
<value languageCode="eng-GB">Name</value>
39+
</names>
40+
<descriptions/>
41+
<fieldSettings/>
42+
<validatorConfiguration>
43+
<value key="StringLengthValidator">
44+
<value key="maxStringLength">255</value>
45+
<value key="minStringLength"/></value>
46+
</validatorConfiguration>
47+
</FieldDefinition>
48+
<FieldDefinition media-type="application/vnd.ibexa.api.FieldDefinition+xml" href="/api/ibexa/v2/content/types/1/fieldDefinitions/119">
49+
<id>119</id>
50+
<identifier>short_description</identifier>
51+
<fieldType>ezrichtext</fieldType>
52+
<fieldGroup></fieldGroup>
53+
<position>3</position>
54+
<isTranslatable>true</isTranslatable>
55+
<isRequired>false</isRequired>
56+
<isInfoCollector>false</isInfoCollector>
57+
<defaultValue>
58+
<value key="xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
59+
&lt;section xmlns=&quot;http://docbook.org/ns/docbook&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; version=&quot;5.0-variant ezpublish-1.0&quot;/&gt;
60+
</value>
61+
<value key="xhtml5edit">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
62+
&lt;section xmlns=&quot;http://ibexa.co/namespaces/ezpublish5/xhtml5/edit&quot;/&gt;
63+
</value>
64+
</defaultValue>
65+
<isSearchable>true</isSearchable>
66+
<names>
67+
<value languageCode="eng-GB">Short description</value>
68+
</names>
69+
<descriptions/>
70+
<fieldSettings/>
71+
<validatorConfiguration/>
72+
</FieldDefinition>
73+
<FieldDefinition media-type="application/vnd.ibexa.api.FieldDefinition+xml" href="/api/ibexa/v2/content/types/1/fieldDefinitions/155">
74+
<id>155</id>
75+
<identifier>short_name</identifier>
76+
<fieldType>ezstring</fieldType>
77+
<fieldGroup></fieldGroup>
78+
<position>2</position>
79+
<isTranslatable>true</isTranslatable>
80+
<isRequired>false</isRequired>
81+
<isInfoCollector>false</isInfoCollector>
82+
<defaultValue/>
83+
<isSearchable>true</isSearchable>
84+
<names>
85+
<value languageCode="eng-GB">Short name</value>
86+
</names>
87+
<descriptions/>
88+
<fieldSettings/>
89+
<validatorConfiguration>
90+
<value key="StringLengthValidator">
91+
<value key="maxStringLength">100</value>
92+
<value key="minStringLength"/></value>
93+
</validatorConfiguration>
94+
</FieldDefinition>
95+
<FieldDefinition media-type="application/vnd.ibexa.api.FieldDefinition+xml" href="/api/ibexa/v2/content/types/1/fieldDefinitions/156">
96+
<id>156</id>
97+
<identifier>description</identifier>
98+
<fieldType>ezrichtext</fieldType>
99+
<fieldGroup></fieldGroup>
100+
<position>4</position>
101+
<isTranslatable>true</isTranslatable>
102+
<isRequired>false</isRequired>
103+
<isInfoCollector>false</isInfoCollector>
104+
<defaultValue>
105+
<value key="xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
106+
&lt;section xmlns=&quot;http://docbook.org/ns/docbook&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; version=&quot;5.0-variant ezpublish-1.0&quot;/&gt;
107+
</value>
108+
<value key="xhtml5edit">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
109+
&lt;section xmlns=&quot;http://ibexa.co/namespaces/ezpublish5/xhtml5/edit&quot;/&gt;
110+
</value>
111+
</defaultValue>
112+
<isSearchable>true</isSearchable>
113+
<names>
114+
<value languageCode="eng-GB">Description</value>
115+
</names>
116+
<descriptions/>
117+
<fieldSettings/>
118+
<validatorConfiguration/>
119+
</FieldDefinition>
120+
</FieldDefinitions>
121+
</ContentType>
122+
</ContentTypeList>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"ContentTypeViewInput": {
3+
"identifier": "ContentTypeViewInput",
4+
"ContentTypeQuery": {
5+
"limit": 1,
6+
"offset": 0,
7+
"Query": {
8+
"ContentTypeGroupIdCriterion": 1,
9+
"ContentTypeIdentifierCriterion": "folder"
10+
}
11+
}
12+
}
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<ContentTypeViewInput>
2+
<identifier>ContentTypeViewInput</identifier>
3+
<ContentTypeQuery>
4+
<limit>1</limit>
5+
<offset>0</offset>
6+
<Query>
7+
<ContentTypeIdentifierCriterion>folder</ContentTypeIdentifierCriterion>
8+
<ContentTypeGroupIdCriterion>1</ContentTypeGroupIdCriterion>
9+
</Query>
10+
</ContentTypeQuery>
11+
</ContentTypeViewInput>

docs/api/rest_api/rest_api_reference/input/ibexa-content-types.raml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,41 @@ get:
3939
description: OK - returns a list of content types.
4040
401:
4141
description: Error - The user has no permission to read the content types.
42+
/view:
43+
post:
44+
displayName: Find content types
45+
description: Executes a query and returns a View that includes the results. Refer to [Search Criteria Reference](/en/4.6/search/content_type_search_reference/content_type_criteria/).
46+
headers:
47+
Accept:
48+
description: The ContentTypeList schema is returned in XML or JSON format.
49+
example: |
50+
application/vnd.ibexa.api.ContentTypeList+xml
51+
application/vnd.ibexa.api.ContentTypeList+json
52+
Content-Type:
53+
description: The ContentTypeViewInput schema is posted in XML or JSON format.
54+
example: |
55+
application/vnd.ibexa.api.ContentTypeViewInput+xml
56+
application/vnd.ibexa.api.ContentTypeViewInput+json
57+
body:
58+
application/vnd.ibexa.api.ContentTypeViewInput+xml:
59+
type: ContentTypeViewInput
60+
example: !include examples/content/types/view/ContentTypeViewInput.xml.example
61+
application/vnd.ibexa.api.ContentTypeViewInput+json:
62+
type: ContentTypeViewInputWrapper
63+
example: !include examples/content/types/view/ContentTypeViewInput.json.example
64+
responses:
65+
200:
66+
description: OK - returns a view and its results
67+
body:
68+
application/vnd.ibexa.api.ContentTypeView+xml:
69+
type: ContentTypeList
70+
example: !include examples/content/types/view/ContentTypeList.xml.example
71+
application/vnd.ibexa.api.ContentTypeView+json:
72+
type: ContentTypeListWrapper
73+
example: !include examples/content/types/view/ContentTypeList.json.example
74+
400:
75+
description: Error - the input doesn't match the input schema definition
76+
4277
/{contentTypeId}:
4378
get:
4479
displayName: Get content type

0 commit comments

Comments
 (0)