diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.json.example new file mode 100644 index 0000000000..a3f61ea8e8 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.json.example @@ -0,0 +1,5 @@ +{ + "CopyLocationInput": { + "destination": "/1/5" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.xml.example new file mode 100644 index 0000000000..7efbd20968 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/CopyLocationInput.xml.example @@ -0,0 +1,3 @@ + + /1/2 + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.json.example new file mode 100644 index 0000000000..a12a7b3ceb --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.json.example @@ -0,0 +1,5 @@ +{ + "SwapLocationInput": { + "destination": "/1/2" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.xml.example new file mode 100644 index 0000000000..cd94888786 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/locations/path/POST/SwapLocationInput.xml.example @@ -0,0 +1,3 @@ + + /1/2 + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.json.example new file mode 100644 index 0000000000..bc0af4ab2a --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.json.example @@ -0,0 +1,5 @@ +{ + "RestoreTrashItemInput": { + "destination": "/1/2" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.xml.example new file mode 100644 index 0000000000..f9b481acaa --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.xml.example @@ -0,0 +1,3 @@ + + /1/2 + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.json.example b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.json.example new file mode 100644 index 0000000000..e737e3e190 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.json.example @@ -0,0 +1,4 @@ +{ + "RestoreTrashItemInput": { + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.xml.example new file mode 100644 index 0000000000..c3d6fa01fb --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.xml.example @@ -0,0 +1 @@ + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.json.example b/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.json.example new file mode 100644 index 0000000000..756f41b01e --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.json.example @@ -0,0 +1,5 @@ +{ + "MoveUserGroupInput": { + "destination": "/1/5/14" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.xml.example new file mode 100644 index 0000000000..32af73250b --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/user/groups/path/POST/MoveUserGroupInput.xml.example @@ -0,0 +1,3 @@ + + /1/2 + diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-content-locations.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-content-locations.raml index 6a4cc6a72c..b6b169d716 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-content-locations.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-content-locations.raml @@ -51,34 +51,6 @@ get: description: Error - the user is not authorized to read this Location. 404: description: Error - the Location with the given path does not exist. - move: - displayName: Move subtree - description: Moves Location to a different parent. The destination can also be '/content/trash' where the Location is put into the trash. (NOTE - Be aware that the user might lose access to the item after it has been moved, for example when read access is limited by a subtree). MOVE or POST with header X-HTTP-Method-Override MOVE. - headers: - Destination: - description: A parent Location resource to which the Location is moved e.g. '/api/ibexa/v2/content/locations/1/63'. - responses: - 201: - description: Created. If destination is '/api/ibexa/v2/content/trash' and content only has one Location (NOTE - Like on normal subtree moves, be aware that the user might lose access to the item after it has been moved to Trash.) - 204: - description: No Content. If destination is '/api/ibexa/v2/content/trash' and content still has other Locations (no trash item is created). - 401: - description: Error - the user is not authorized to move this Location. - 404: - description: Error - the Location with the given ID does not exist. - copy: - displayName: Copy subtree - description: Copies the subtree to a different parent. COPY or POST with header X-HTTP-Method-Override COPY. - headers: - Destination: - description: A parent Location resource to which the Location is moved e.g. '/api/ibexa/v2/content/locations/1/63'. - responses: - 201: - description: Created. Copied the subtree to a different parent. - 401: - description: Error - the user is not authorized to move this Location. - 404: - description: Error - the Location with the given ID does not exist. delete: displayName: Delete subtree description: Deletes the complete subtree for the given path. Every content item which does not have any other Location is deleted. Otherwise the deleted Location is removed from the content item. The children are recursively deleted. @@ -125,13 +97,41 @@ get: description: Error - the user is not authorized to update this Location. 404: description: Error - the Location with the given ID does not exist. - swap: - displayName: Swap Location - description: Swaps the Location of a content item with the given Location of another content item. SWAP or POST with header X-HTTP-Method-Override SWAP. + post: + displayName: Swap Location / Copy subtree / Move subtree / Trash + description: "Depending on request method or Content-Type header, one of the following: swaps the Location of a content item with the given Location of another content item, copies a subtree, moves a subtree, sends location to trash. Request method can be POST, SWAP, COPY, MOVE, or TRASH." headers: + Content-Type: + description: Required only when using POST request method. Indicates the format of the request body and the action. + example: | + application/vnd.ibexa.api.SwapLocationInput+json + application/vnd.ibexa.api.SwapLocationInput+xml + application/vnd.ibexa.api.CopyLocationInput+json + application/vnd.ibexa.api.CopyLocationInput+xml + application/vnd.ibexa.api.MoveLocationInput+json + application/vnd.ibexa.api.MoveLocationInput+xml + application/vnd.ibexa.api.TrashLocationInput+json + application/vnd.ibexa.api.TrashLocationInput+xml Destination: - description: A parent Location resource to which the Location is moved e.g. '/api/ibexa/v2/content/locations/1/63'. + description: Required only when using SWAP, COPY, or MOVE request methods. A location resource to swap with, copy the subtree to, or move the subtree to, e.g. '/api/ibexa/v2/content/locations/1/63'. + example: /api/ibexa/v2/content/locations/1/63 + body: + description: Used together with POST request method. Indicates the location to swap with or the subtree to copy + application/vnd.ibexa.api.SwapLocationInput+json: + type: SwapLocationInputWrapper + example: !include examples/content/locations/path/POST/SwapLocationInput.json.example + application/vnd.ibexa.api.SwapLocationInput+xml: + type: SwapLocationInput + example: !include examples/content/locations/path/POST/SwapLocationInput.xml.example + application/vnd.ibexa.api.CopyLocationInput+json: + type: CopyLocationInputWrapper + example: !include examples/content/locations/path/POST/CopyLocationInput.json.example + application/vnd.ibexa.api.CopyLocationInput+xml: + type: CopyLocationInput + example: !include examples/content/locations/path/POST/CopyLocationInput.xml.example responses: + 201: + description: Created. Copied or moved the subtree to a different parent, or sent the location to Trash. 204: description: No Content. Swapped the Location of a content item with the given Location of another content item. 401: diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-content-objects.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-content-objects.raml index 763ab99a5d..7e3f84e62c 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-content-objects.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-content-objects.raml @@ -183,10 +183,15 @@ get: description: Temporary redirect. 404: description: Error - the resource does not exist. - copy: + post: displayName: Create a draft from current version - description: The system creates a new draft as a copy of the current version. COPY or POST with header X-HTTP-Method-Override COPY. + description: The system creates a new draft as a copy of the current version. Request method can be POST or COPY. headers: + Content-Type: + description: Optional when using the COPY request method. + example: | + application/vnd.ibexa.api.CreateDraftFromCurrentVersionInput+json + application/vnd.ibexa.api.CreateDraftFromCurrentVersionInput+xml Accept: description: If set, the updated version is returned in XML or JSON format. example: | @@ -311,18 +316,37 @@ get: description: Error - the content ID or version ID does not exist. 412: description: Error - the current ETag does not match with the one provided in the If-Match header. - copy: - displayName: Create a draft from a version - description: The system creates a new draft as a copy of the given version. COPY or POST with header X-HTTP-Method-Override COPY. + delete: + displayName: Delete content version + description: Deletes the content version. + responses: + 204: + description: No Content - the version is deleted. + 404: + description: Error - the content item or version were not found. + 401: + description: Error - the user is not authorized to delete this version. + 403: + description: Error - the version is in published state. + post: + displayName: Publish or copy content version + description: Publishes or copies the content version as draft, depending on request method or Content-Type header. Request method can be POST, PUBLISH, or COPY. headers: + Content-Type: + description: Required when using the POST request method to indicate the action. + example: | + application/vnd.ibexa.api.PublishContentVersionInput+json + application/vnd.ibexa.api.PublishContentVersionInput+xml + application/vnd.ibexa.api.CreateDraftFromVersionInput+json + application/vnd.ibexa.api.CreateDraftFromVersionInput+xml Accept: - description: If set, the updated version is returned in XML or JSON format. + description: If set, the published version is returned in XML or JSON format. example: | application/vnd.ibexa.api.Version+xml application/vnd.ibexa.api.Version+json responses: 201: - description: Created. + description: Copy created. body: application/vnd.ibexa.api.Version+xml: type: Version @@ -330,26 +354,6 @@ get: application/vnd.ibexa.api.Version+json: type: VersionWrapper example: !include examples/content/objects/content_id/versions/version_no/COPY/Version.json.example - 401: - description: Error - the user is not authorized to update this content item. - 404: - description: Error - the content item was not found. - delete: - displayName: Delete content version - description: Deletes the content version. - responses: - 204: - description: No Content - the version is deleted. - 404: - description: Error - the content item or version were not found. - 401: - description: Error - the user is not authorized to delete this version. - 403: - description: Error - the version is in published state. - publish: - displayName: Publish a content version - description: Publishes the content version. PUBLISH or POST with header X-HTTP-Method-Override PUBLISH - responses: 204: description: No Content - the content version is published. 401: diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-content-trash.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-content-trash.raml index 01c3568230..d8ef38e674 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-content-trash.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-content-trash.raml @@ -55,12 +55,31 @@ delete: description: Error - The user has no permission to read the item in Trash. 404: description: Error - An item in Trash with the provided ID does not exist. - move: + post: displayName: Untrash content item - description: Restores an item from Trash. MOVE or POST with header X-HTTP-Method-Override MOVE. + description: Restores an item from Trash. Request method can be POST or MOVE. headers: + Content-Type: + description: Optional when using the MOVE request method. + example: | + application/vnd.ibexa.api.RestoreTrashItemInput+json + application/vnd.ibexa.api.RestoreTrashItemInput+xml Destination: - description: If the destination Location URI is provided, the item from Trash is restored under this Location, otherwise it is restored under its original parent Location. + description: Used together with MOVE request method. If the destination Location URI (e.g. /api/ibexa/v2/content/locations/1/2) is provided, the item from Trash is restored under this Location, otherwise it is restored under its original parent Location. + body: + description: Used together with POST request method. Omit the "destination" property to restore under original location. + application/vnd.ibexa.api.RestoreTrashItemInput+json: + type: RestoreTrashItemInputWrapper + example: !include examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.json.example + application/vnd.ibexa.api.RestoreTrashItemInput+xml: + type: RestoreTrashItemInput + example: !include examples/content/trash/trash_itemid/POST/RestoreTrashItemInput.xml.example + application/vnd.ibexa.api.RestoreTrashItemInputOriginalLocation+json: + type: RestoreTrashItemInputWrapper + example: !include examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.json.example + application/vnd.ibexa.api.RestoreTrashItemInputOriginalLocation+xml: + type: RestoreTrashItemInput + example: !include examples/content/trash/trash_itemid/POST/RestoreTrashItemInputOriginal.xml.example responses: 201: description: Item restored. 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..5388bb00d1 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 @@ -65,17 +65,10 @@ get: description: Error - The user is not authorized to read this content type. 404: description: Error - The content type does not exist. - copy: - displayName: Copy content type - description: Copies a content type. A new remote ID is generated, and the identifier of the copy is set to 'copy_of_originalBaseIdentifier_newTypeId' (or another random string). COPY or POST with header X-HTTP-Method-Override COPY. - responses: - 201: - description: Copy of the content type created. - 401: - description: Error - The user is not authorized to copy this content type. post: - displayName: Create Draft - description: Creates a draft and updates it with the given data. + displayName: Create Draft / Copy + description: | + Depending on request details, either creates a content type draft with the given data or copies a content type. When copying a new ID is generated, and the identifier of the copy is set to 'copy_of_originalBaseIdentifier_newTypeId'. To create a copy request method can be POST or COPY. headers: Accept: description: If set, the new content type draft is returned in XML or JSON format. @@ -83,10 +76,12 @@ get: application/vnd.ibexa.api.ContentTypeInfo+xml application/vnd.ibexa.api.ContentTypeInfo+json Content-Type: - description: The content type Update schema encoded in XML or JSON format. + description: The content type update schema encoded in XML or JSON format or application/vnd.ibexa.api.CopyContentTypeInput to indicate copying. example: | application/vnd.ibexa.api.ContentTypeUpdate+xml application/vnd.ibexa.api.ContentTypeUpdate+json + application/vnd.ibexa.api.CopyContentTypeInput+json + application/vnd.ibexa.api.CopyContentTypeInput+xml body: application/vnd.ibexa.api.ContentTypeUpdate+xml: type: ContentTypeUpdate @@ -96,7 +91,7 @@ get: example: !include examples/content/types/content_type_id/POST/ContentTypeUpdate.json.example responses: 201: - description: Draft created. + description: Draft or copy created. For copying the response is empty. body: application/vnd.ibexa.api.ContentTypeInfo+xml: type: ContentTypeInfo @@ -107,7 +102,7 @@ get: 400: description: Error - The input does not match the input schema definition. 401: - description: Error - The user is not authorized to create the draft. + description: Error - The user is not authorized to create or copy the draft. 403: description: Error - A content type with the given new identifier already exists. A draft already exists. delete: @@ -228,9 +223,15 @@ get: description: Error - A content type with the given new identifier already exists. 404: description: Error - There is no draft for this content type. - publish: + post: displayName: Publish content type draft - description: Publishes a content type draft. PUBLISH or POST with header X-HTTP-Method-Override PUBLISH. + description: Publishes a content type draft. Request method can be POST or PUBLISH. + headers: + Content-Type: + description: Optional when using the PUBLISH request method. + example: | + application/vnd.ibexa.api.PublishContentTypeInput+json + application/vnd.ibexa.api.PublishContentTypeInput+xml responses: 200: body: 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 20ae546d32..2dd6e812b4 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 @@ -6275,3 +6275,54 @@ ActionConfiguration: type: datetime description: 'Timestamp indicating when the action configuration was last updated.' +SwapLocationInputWrapper: + type: object + properties: + SwapLocationInput: + type: SwapLocationInput + +SwapLocationInput: + type: object + properties: + destination: + type: string + description: The location path to swap with. + +MoveUserGroupInputWrapper: + type: object + properties: + MoveUserGroupInput: + type: MoveUserGroupInput + +MoveUserGroupInput: + type: object + properties: + destination: + type: string + description: The path string of the new parent location. + +CopyLocationInputWrapper: + type: object + properties: + CopyLocationInput: + type: CopyLocationInput + +CopyLocationInput: + type: object + properties: + destination: + type: string + description: The location path the subtree will be copied to. + +RestoreTrashItemInputWrapper: + type: object + properties: + RestoreTrashItemInput: + type: RestoreTrashItemInput + +RestoreTrashItemInput: + type: object + properties: + destination: + type: string + description: The path string under which the item should be restored. diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-user-groups.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-user-groups.raml index 5cd5fb5e09..aafe1af67f 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-user-groups.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-user-groups.raml @@ -151,12 +151,26 @@ get: description: Error - the user is not authorized to delete this content type. 403: description: Error - the User Group is not empty. - move: + post: displayName: Move User Group - description: Moves the User Group to another parent. MOVE or POST with header X-HTTP-Method-Override MOVE. + description: Moves the User Group to another parent. Request method can be POST or MOVE. headers: + Content-Type: + description: Required only when using POST request method. Indicates the format of the request body. + example: | + application/vnd.ibexa.api.MoveUserGroupInput+json + application/vnd.ibexa.api.MoveUserGroupInput+xml Destination: - description: A parent group resource to which the Location is moved. + description: Required only when using MOVE request method. A parent group resource to which the Location is moved. + example: /api/ibexa/v2/content/locations/1/63 + body: + description: Required only when using POST request method. A parent group resource to which the Location is moved. + application/vnd.ibexa.api.MoveUserGroupInputWrapper+json: + type: MoveUserGroupInputWrapper + example: !include examples/user/groups/path/POST/MoveUserGroupInput.json.example + application/vnd.ibexa.api.MoveUserGroupInput+xml: + type: MoveUserGroupInput + example: !include examples/user/groups/path/POST/MoveUserGroupInput.xml.example responses: 201: description: Created - moves the User Group to another parent. diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-user-roles.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-user-roles.raml index f8da41075c..25cdc0cb69 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-user-roles.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-user-roles.raml @@ -234,9 +234,15 @@ post: description: Error - there is no draft or Role with the given ID. 412: description: Error - the current ETag does not match with the one provided in the If-Match header. - publish: + post: displayName: Publish Role draft - description: Publishes a Role draft. PUBLISH or POST with header X-HTTP-Method-Override PUBLISH. + description: Publishes a Role draft. Request method can be POST or PUBLISH. + headers: + Content-Type: + description: Optional when using the PUBLISH request method. + example: | + application/vnd.ibexa.api.PublishRoleInput+json + application/vnd.ibexa.api.PublishRoleInput+xml responses: 204: description: No Content. 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 4d204f3de2..22e2bcbe0e 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 @@ -4170,8 +4170,8 @@

/
  • - - COPY + + POST
  • @@ -4665,14 +4665,50 @@

    Types

    - COPY + POST /content/objects/{contentId}/currentversion

    -

    The system creates a new draft as a copy of the current version. COPY or POST with header X-HTTP-Method-Override COPY.

    +

    The system creates a new draft as a copy of the current version. Request method can be POST or COPY.

    Header parameters
    +

    Content-Type

    +

    Optional when using the COPY request method.

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

    Accept

    If set, the updated version is returned in XML or JSON format.

    @@ -4724,7 +4760,7 @@
    Possible responses
    - 201 @@ -4800,28 +4836,28 @@
    Types
    -
    +
    -
    -
    -
    +
    +

    file_copy

    -
    +                            
                                     <?xml version="1.0" encoding="UTF-8"?>
     <Version media-type="application/vnd.ibexa.api.Version+xml" href="/api/ibexa/v2/content/objects/107/versions/4">
         <VersionInfo>
    @@ -4867,20 +4903,20 @@ 
    Types
    <Content media-type="application/vnd.ibexa.api.ContentInfo+xml" href="/api
    - View more + View more
    -
    +

    file_copy

    -
    +                            
                                     {
         "Version": {
             "_media-type": "application/vnd.ibexa.api.Version+json",
    @@ -4911,16 +4947,16 @@ 
    Types
    - View more + View more
    -