From f74422e01bc1a78787243e0c712a7ff6bb718a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Wed, 19 Nov 2025 01:33:20 +0100 Subject: [PATCH 1/8] IBX-10527: Describe Content Type Search REST API --- .../types/view/ContentTypeView.json.example | 182 +++ .../types/view/ContentTypeView.xml.example | 122 ++ .../view/ContentTypeViewInput.json.example | 12 + .../view/ContentTypeViewInput.xml.example | 10 + .../input/ibexa-content-types.raml | 31 + .../rest_api_reference/input/ibexa-types.raml | 30 +- .../rest_api_reference.html | 1006 ++++++++++++++++- 7 files changed, 1386 insertions(+), 7 deletions(-) create mode 100644 docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.json.example create mode 100644 docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.xml.example create mode 100644 docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.json.example create mode 100644 docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.xml.example diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.json.example new file mode 100644 index 0000000000..e7146e205e --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.json.example @@ -0,0 +1,182 @@ +{ + "ContentTypeList": { + "_media-type": "application/vnd.ibexa.api.ContentTypeList+json", + "_href": "", + "ContentType": [ + { + "_media-type": "application/vnd.ibexa.api.ContentType+json", + "_href": "/api/ibexa/v2/content/types/1", + "id": 1, + "status": "DEFINED", + "identifier": "folder", + "names": { + "value": [ + { + "_languageCode": "eng-GB", + "#text": "Folder" + } + ] + }, + "descriptions": { + "value": [] + }, + "creationDate": "2002-06-18T09:21:38+00:00", + "modificationDate": "2015-11-29T21:14:32+00:00", + "Creator": { + "_media-type": "application/vnd.ibexa.api.User+json", + "_href": "/api/ibexa/v2/user/users/14" + }, + "Modifier": { + "_media-type": "application/vnd.ibexa.api.User+json", + "_href": "/api/ibexa/v2/user/users/14" + }, + "Groups": { + "_media-type": "application/vnd.ibexa.api.ContentTypeGroupRefList+json", + "_href": "/api/ibexa/v2/content/types/1/groups" + }, + "Draft": { + "_media-type": "application/vnd.ibexa.api.ContentType+json", + "_href": "/api/ibexa/v2/content/types/1/draft" + }, + "remoteId": "a3d405b81be900468eb153d774f4f0d2", + "urlAliasSchema": null, + "nameSchema": "", + "isContainer": true, + "mainLanguageCode": "eng-GB", + "defaultAlwaysAvailable": true, + "defaultSortField": "PATH", + "defaultSortOrder": "ASC", + "FieldDefinitions": { + "_media-type": "application/vnd.ibexa.api.FieldDefinitionList+json", + "_href": "/api/ibexa/v2/content/types/1/fieldDefinitions", + "FieldDefinition": [ + { + "_media-type": "application/vnd.ibexa.api.FieldDefinition+json", + "_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/4", + "id": 4, + "identifier": "name", + "fieldType": "ezstring", + "fieldGroup": "", + "position": 1, + "isTranslatable": true, + "isRequired": true, + "isInfoCollector": false, + "defaultValue": "Folder", + "isSearchable": true, + "names": { + "value": [ + { + "_languageCode": "eng-GB", + "#text": "Name" + } + ] + }, + "descriptions": { + "value": [] + }, + "fieldSettings": [], + "validatorConfiguration": { + "StringLengthValidator": { + "maxStringLength": 255, + "minStringLength": null + } + } + }, + { + "_media-type": "application/vnd.ibexa.api.FieldDefinition+json", + "_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/119", + "id": 119, + "identifier": "short_description", + "fieldType": "ezrichtext", + "fieldGroup": "", + "position": 3, + "isTranslatable": true, + "isRequired": false, + "isInfoCollector": false, + "defaultValue": { + "xml": "\n
\n", + "xhtml5edit": "\n
\n" + }, + "isSearchable": true, + "names": { + "value": [ + { + "_languageCode": "eng-GB", + "#text": "Short description" + } + ] + }, + "descriptions": { + "value": [] + }, + "fieldSettings": [], + "validatorConfiguration": [] + }, + { + "_media-type": "application/vnd.ibexa.api.FieldDefinition+json", + "_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/155", + "id": 155, + "identifier": "short_name", + "fieldType": "ezstring", + "fieldGroup": "", + "position": 2, + "isTranslatable": true, + "isRequired": false, + "isInfoCollector": false, + "defaultValue": null, + "isSearchable": true, + "names": { + "value": [ + { + "_languageCode": "eng-GB", + "#text": "Short name" + } + ] + }, + "descriptions": { + "value": [] + }, + "fieldSettings": [], + "validatorConfiguration": { + "StringLengthValidator": { + "maxStringLength": 100, + "minStringLength": null + } + } + }, + { + "_media-type": "application/vnd.ibexa.api.FieldDefinition+json", + "_href": "/api/ibexa/v2/content/types/1/fieldDefinitions/156", + "id": 156, + "identifier": "description", + "fieldType": "ezrichtext", + "fieldGroup": "", + "position": 4, + "isTranslatable": true, + "isRequired": false, + "isInfoCollector": false, + "defaultValue": { + "xml": "\n
\n", + "xhtml5edit": "\n
\n" + }, + "isSearchable": true, + "names": { + "value": [ + { + "_languageCode": "eng-GB", + "#text": "Description" + } + ] + }, + "descriptions": { + "value": [] + }, + "fieldSettings": [], + "validatorConfiguration": [] + } + ] + } + } + ] + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.xml.example new file mode 100644 index 0000000000..ae03b8f316 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeView.xml.example @@ -0,0 +1,122 @@ + + + + 1 + DEFINED + folder + + Folder + + + 2002-06-18T09:21:38+00:00 + 2015-11-29T21:14:32+00:00 + + + + + a3d405b81be900468eb153d774f4f0d2 + + <short_name|name> + true + eng-GB + true + PATH + ASC + + + 4 + name + ezstring + + 1 + true + true + false + Folder + true + + Name + + + + + + 255 + + + + + 119 + short_description + ezrichtext + + 3 + true + false + false + + <?xml version="1.0" encoding="UTF-8"?> +<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-variant ezpublish-1.0"/> + + <?xml version="1.0" encoding="UTF-8"?> +<section xmlns="http://ibexa.co/namespaces/ezpublish5/xhtml5/edit"/> + + + true + + Short description + + + + + + + 155 + short_name + ezstring + + 2 + true + false + false + + true + + Short name + + + + + + 100 + + + + + 156 + description + ezrichtext + + 4 + true + false + false + + <?xml version="1.0" encoding="UTF-8"?> +<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-variant ezpublish-1.0"/> + + <?xml version="1.0" encoding="UTF-8"?> +<section xmlns="http://ibexa.co/namespaces/ezpublish5/xhtml5/edit"/> + + + true + + Description + + + + + + + + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.json.example new file mode 100644 index 0000000000..dc560a679f --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.json.example @@ -0,0 +1,12 @@ +{ + "ViewInput": { + "identifier": "ContentTypeView", + "ContentTypeQuery": { + "limit": 1, + "offset": 0, + "Query": { + "ContentTypeIdentifierCriterion": "folder" + } + } + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.xml.example new file mode 100644 index 0000000000..6ab7a94b6f --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/types/view/ContentTypeViewInput.xml.example @@ -0,0 +1,10 @@ + + ContentTypeView + + 1 + 0 + + folder + + + diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-content-types.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-content-types.raml index a135909845..ffccf9d107 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-content-types.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-content-types.raml @@ -39,6 +39,37 @@ get: description: OK - returns a list of content types. 401: description: Error - The user has no permission to read the content types. +/view: + post: + displayName: Find content types + description: Executes a query and returns a View that includes the results. Refer to [Search Criteria Reference](/en/latest/search/content_type_search_reference/content_type_criteria/). + headers: + Accept: + description: The ContentTypeView schema is returned in XML or JSON format. + example: | + application/vnd.ibexa.api.ContentTypeView+xml + application/vnd.ibexa.api.ContentTypeView+json + Content-Type: + description: The ContentTypeViewInput schema is posted in XML or JSON format. + example: | + application/vnd.ibexa.api.ContentTypeViewInput+json + body: + application/vnd.ibexa.api.ContentTypeViewInput+json: + type: ContentTypeViewInputWrapper + example: !include examples/content/types/view/ContentTypeViewInput.json.example + responses: + 200: + description: OK - returns a view and its results + body: + application/vnd.ibexa.api.ContentTypeView+xml: + type: ContentTypeView + example: !include examples/content/types/view/ContentTypeView.xml.example + application/vnd.ibexa.api.ContentTypeView+json: + type: ContentTypeViewWrapper + example: !include examples/content/types/view/ContentTypeView.json.example + 400: + description: Error - the input doesn't match the input schema definition + /{contentTypeId}: get: displayName: Get content type diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml index c019b4057b..2369f957e9 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml @@ -686,6 +686,7 @@ ContentTypeList: properties: ContentType: type: ContentType[] + description: 'Array of ContentType objects.' ContentTypeUpdateStruct: description: 'This class is used for updating a content type.' @@ -3232,6 +3233,33 @@ ContentTypeUpdate: type: datetime required: false +ContentTypeViewInputWrapper: + description: 'JSON object with only a ViewInput property.' + type: object + properties: + ViewInput: ContentTypeViewInput + +ContentTypeViewInput: + description: 'This class represents a content type view input.' + type: object + properties: + ContentTypeQuery: + type: object + xml: + name: ViewInput + +ContentTypeViewWrapper: + description: 'JSON object with only a ContentTypeView property.' + type: object + properties: + ContentTypeView: ContentTypeView + +ContentTypeView: + description: 'This class represents a content type view.' + type: object + properties: + ContentTypeList: ContentTypeList + ViewInputWrapper: description: 'JSON object with only a ViewInput property.' type: object @@ -6512,4 +6540,4 @@ InvitationCreate: type: object Invitation: - type: object \ No newline at end of file + type: object diff --git a/docs/api/rest_api/rest_api_reference/rest_api_reference.html b/docs/api/rest_api/rest_api_reference/rest_api_reference.html index f5bdf91307..fc8a3313be 100644 --- a/docs/api/rest_api/rest_api_reference/rest_api_reference.html +++ b/docs/api/rest_api/rest_api_reference/rest_api_reference.html @@ -35316,6 +35316,831 @@
Types
] } } + + + + + + + + + + + + + + + +
+
+

/content/types/view

+ +
+
+
+
+
+
+ Find content types + +
+
+
+

+ POST + /content/types/view +

+

Executes a query and returns a View that includes the results. Refer to Search Criteria Reference.

+

+
+
Header parameters
+
+

Accept

+

The ContentTypeView schema is returned in XML or JSON format.

+
+ + + + + + + + + + + + + + + + + +
PropertyValue
Type + + + string + + + + +
Examples + application/vnd.ibexa.api.ContentTypeView+xml +application/vnd.ibexa.api.ContentTypeView+json + +
+
+
+
+

Content-Type

+

The ContentTypeViewInput schema is posted in XML or JSON format.

+
+ + + + + + + + + + + + + + + + + +
PropertyValue
Type + + + string + + + + +
Examples + application/vnd.ibexa.api.ContentTypeViewInput+json + +
+
+
+
+ + +
+
Possible responses
+
+ + + + + + + + + + + + + + + + + +
CodeDescription
+ + 200 + + +

OK - returns a view and its results

+
+ 400 + +

Error - the input doesn't match the input schema definition

+
+
+
+ +
+
Types
+
+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + ContentTypeViewInputWrapper + + JSON object with only a ViewInput property.
+ + ContentTypeView + + This class represents a content type view.
+ + ContentTypeViewWrapper + + JSON object with only a ContentTypeView property.
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+

+ file_copy + +

+
+                                {
+    "ViewInput": {
+        "identifier": "ContentTypeView",
+        "ContentTypeQuery": {
+            "limit": 1,
+            "offset": 0,
+            "Query": {
+                "ContentTypeIdentifierCriterion": "folder"
+            }
+        }
+    }
+}
+
+                            
+
+ View more +
+
+
+ +
+
+
+
+
+ +
+ Code: 200 +
+
+
+
+
+
+

+ file_copy + +

+
+                                <?xml version="1.0" encoding="UTF-8"?>
+<ContentTypeList media-type="application/vnd.ibexa.api.ContentTypeList+xml" href="">
+    <ContentType media-type="application/vnd.ibexa.api.ContentType+xml" href="/api/ibexa/v2/content/types/1">
+        <id>1</id>
+        <status>DEFINED</status>
+        <identifier>folder</identifier>
+        <names>
+            <value languageCode="eng-GB">Folder</value>
+        </names>
+        <descriptions/>
+        <creationDate>2002-06-18T09:21:38+00:00</creationDate>
+        <modificationDate>2015-11-29T21:14:32+00:00</modificationDate>
+        <Creator media-type="application/vnd.ibexa.api.User+xml" href="/api/ibexa/v2/user/users/14"/>
+        <Modifier media-type="application/vnd.ibexa.api.User+xml" href="/api/ibexa/v2/user/users/14"/>
+        <Groups media-type="application/vnd.ibexa.api.ContentTypeGroupRefList+xml" href="/api/ibexa/v2/content/types/1/groups"/>
+        <Draft media-type="application/vnd.ibexa.api.ContentType+xml" href="/api/ibexa/v2/con
+                            
+
+ View more +
+
+
+

+ file_copy + +

+
+                                {
+    "ContentTypeList": {
+        "_media-type": "application/vnd.ibexa.api.ContentTypeList+json",
+        "_href": "",
+        "ContentType": [
+            {
+                "_media-type": "application/vnd.ibexa.api.ContentType+json",
+                "_href": "/api/ibexa/v2/content/types/1",
+                "id": 1,
+                "status": "DEFINED",
+                "identifier": "folder",
+                "names": {
+                    "value": [
+                        {
+                            "_languageCode": "eng-GB",
+                            "#text": "Folder"
+                        }
+                    ]
+                },
+                "descriptions": {
+                    "value": []
+                },
+                "creationDate": "2002-06-18T09:21:38+00:00",
+                "modificationDate": "2015-11-29T21:14:32+00:00",
+                "Creator": {
+                    "_media-type": "application/vnd.ibexa.api.User+json",
+                    "_href": "/api/ib
+                            
+
+ View more +
+
+
+