Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---

Check warning on line 1 in docs/content_management/collaborative_editing/collaborative_editing.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing.md#L1

[Ibexa.ReadingLevel] The grade level is 18.38. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 18.38. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Collaborative editing enables multiple users to work on the same content simultaneously.
page_type: landing_page
month_change: true
---

# Collaborative editing

With Collaborative editing feature multiple users can work on the same content created in [[= product_name =]] simultaneously.
This feature allows multiple users to work together on the same content item in real time, streamlining the content creation and review process.

Users can invite both internal and external collaborators to a session, giving them access for editing or previewing.

Additionaly, they can collaborate using a Real-time collaboration, an advanced part of the collaboration feature, to write and review content in a live mode thanks to CKEditor.

Check warning on line 14 in docs/content_management/collaborative_editing/collaborative_editing.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing.md#L14

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing.md", "range": {"start": {"line": 14, "column": 1}}}, "severity": "WARNING"}
Real-time collaboration syncs changes instantly and shows user avatars and colored tags to indicate who is editing each part of the content.

This feature also introduces new dashboard tabs for managing shared drafts and joining collaboration sessions easily.

Check warning on line 17 in docs/content_management/collaborative_editing/collaborative_editing.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing.md#L17

[Ibexa.VerySimply] Avoid using 'easily'.
Raw output
{"message": "[Ibexa.VerySimply] Avoid using 'easily'.", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing.md", "range": {"start": {"line": 17, "column": 111}}}, "severity": "WARNING"}

[[= cards([
"content_management/collaborative_editing/collaborative_editing",
"content_management/collaborative_editing/collaborative_editing_api",
"content_management/collaborative_editing/invitation_api",
"content_management/collaborative_editing/session_api",
"content_management/collaborative_editing/collaborative_editing_guide"
], columns=3) =]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---

Check warning on line 1 in docs/content_management/collaborative_editing/collaborative_editing_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing_api.md#L1

[Ibexa.ReadingLevel] The grade level is 19.73. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 19.73. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing_api.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Use PHP API to manage invitations and sessions while using collaborative editing feature.
month_change: false
---

# Collaborative editing API

[[= product_name =]]'s Collaborative editing API provides two services for managing sessions and invitations, which differ in function:

- [`InvitationServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-InvitationServiceInterface.html) is used to request product data

Check failure on line 10 in docs/content_management/collaborative_editing/collaborative_editing_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing_api.md#L10

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing_api.md", "range": {"start": {"line": 10, "column": 75}}}, "severity": "ERROR"}
- [`SessionServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-SessionServiceInterface.html) is used to modify products

Check failure on line 11 in docs/content_management/collaborative_editing/collaborative_editing_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/collaborative_editing_api.md#L11

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/collaborative_editing_api.md", "range": {"start": {"line": 11, "column": 72}}}, "severity": "ERROR"}

``` php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Tests\Integration\Collaboration;

use DateTimeImmutable;
use Ibexa\Contracts\Collaboration\Invitation\InvitationCreateStruct;
use Ibexa\Contracts\Collaboration\Invitation\InvitationInterface;
use Ibexa\Contracts\Collaboration\Invitation\InvitationQuery;
use Ibexa\Contracts\Collaboration\Invitation\InvitationStatus;
use Ibexa\Contracts\Collaboration\Invitation\InvitationUpdateStruct;
use Ibexa\Contracts\Collaboration\Invitation\Query\Criterion;
use Ibexa\Contracts\Collaboration\Invitation\Query\SortClause;
use Ibexa\Contracts\Collaboration\InvitationServiceInterface;
use Ibexa\Contracts\Collaboration\SessionServiceInterface;
use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Test\IbexaKernelTestTrait;
use Ibexa\Contracts\CoreSearch\Values\Query\SortDirection;
use Ibexa\Contracts\Test\Core\IbexaKernelTestCase;

final class InvitationServiceTest extends IbexaKernelTestCase
{
use IbexaKernelTestTrait;

private const EXAMPLE_SESSION_ID = 1;
private const EXAMPLE_INVITATION_ID = 1;
private const EXAMPLE_PARTICIPANT_ID = 1;

private const EXAMPLE_INVITATION_A = 1;
private const EXAMPLE_INVITATION_B = 2;
private const EXAMPLE_INVITATION_C = 3;

protected function setUp(): void
{
self::bootKernel();
self::setAdministratorUser();
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---

Check warning on line 1 in docs/content_management/collaborative_editing/install_collaborative_editing.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/install_collaborative_editing.md#L1

[Ibexa.ReadingLevel] The grade level is 10.74. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 10.74. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/content_management/collaborative_editing/install_collaborative_editing.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Install the Collaborative editing LTS update.
month_change: false
---

# Install Collaborative editing

Collaborative editing feature is available as an LTS update to [[= product_name =]] starting with version v5.0 or higher, regardless of its edition.
To use this feature you must first install the packages and configure them.

## Install packages

Run the following commands to install the packages:

``` bash
composer require ibexa/collaboration
composer require ibexa/share
composer require ibexa/fieldtype-richtext-rte
```

This command adds the new real-time editing functionality to the Rich Text field type.
It also modifies the permission system to account for the new functionality.

## Configure Collaborative editing

Once the packages are installed, before you can start Collaborative editing feature, you must enable it by following these instructions.

### Add tables to the database

To add the tables to the database, run the following commands:

``` bash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The dump-sql schema is not meant to be executed in production, we need raw SQLs here (see https://github.com/ibexa/doctrine-schema/blob/main/src/bundle/Command/DumpSqlCommand.php#L106-L114 and Updated DumpSqlCommand to compare against existing database doctrine-schema#21 (comment) )
  2. We support PostgreSQL as well, this is MySQL only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySQL:

CREATE TABLE ibexa_collaboration
(
    id              INT AUTO_INCREMENT NOT NULL,
    owner_id        INT                NOT NULL,
    token           VARCHAR(160)       NOT NULL,
    discriminator   VARCHAR(190)       NOT NULL,
    is_active       TINYINT(1)         NOT NULL,
    has_public_link TINYINT(1)         NOT NULL,
    created_at      DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    updated_at      DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    UNIQUE INDEX ibexa_collaboration_token_idx (token),
    INDEX ibexa_collaboration_owner_idx (owner_id),
    UNIQUE INDEX ibexa_collaboration_token_uc (token),
    PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
  COLLATE `utf8mb4_unicode_520_ci`
  ENGINE = InnoDB;
CREATE TABLE ibexa_collaboration_participant
(
    id            INT AUTO_INCREMENT NOT NULL,
    session_id    INT                NOT NULL,
    discriminator VARCHAR(190)       NOT NULL,
    scope         VARCHAR(255) DEFAULT NULL,
    token         VARCHAR(255) DEFAULT NULL,
    created_at    DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    updated_at    DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    INDEX IDX_9C5C6401613FECDF (session_id),
    UNIQUE INDEX ibexa_collaboration_participant_token_idx (token),
    PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
  COLLATE `utf8mb4_unicode_520_ci`
  ENGINE = InnoDB;
CREATE TABLE ibexa_collaboration_participant_internal
(
    id      INT NOT NULL,
    user_id INT NOT NULL,
    INDEX IDX_E838B79AA76ED395 (user_id),
    PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
  COLLATE `utf8mb4_unicode_520_ci`
  ENGINE = InnoDB;
CREATE TABLE ibexa_collaboration_participant_external
(
    id    INT          NOT NULL,
    email VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
  COLLATE `utf8mb4_unicode_520_ci`
  ENGINE = InnoDB;
CREATE TABLE ibexa_collaboration_invitation
(
    id             INT AUTO_INCREMENT NOT NULL,
    session_id     INT                NOT NULL,
    participant_id INT                NOT NULL,
    sender_id      INT                NOT NULL,
    status         VARCHAR(64)        NOT NULL,
    context        LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)',
    created_at     DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    updated_at     DATETIME           NOT NULL COMMENT '(DC2Type:datetimetz_immutable)',
    INDEX IDX_36C63687613FECDF (session_id),
    INDEX IDX_36C636879D1C3019 (participant_id),
    INDEX IDX_36C63687F624B39D (sender_id),
    PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
  COLLATE `utf8mb4_unicode_520_ci`
  ENGINE = InnoDB;
ALTER TABLE ibexa_collaboration
    ADD CONSTRAINT ibexa_collaboration_owner_id_fk FOREIGN KEY (owner_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT;
ALTER TABLE ibexa_collaboration_participant
    ADD CONSTRAINT ibexa_collaboration_participant_session_id_fk FOREIGN KEY (session_id) REFERENCES ibexa_collaboration (id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ibexa_collaboration_participant_internal
    ADD CONSTRAINT ibexa_collaboration_participant_internal_pk FOREIGN KEY (id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ibexa_collaboration_participant_internal
    ADD CONSTRAINT ibexa_collaboration_participant_internal_user_id_fk FOREIGN KEY (user_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT;
ALTER TABLE ibexa_collaboration_participant_external
    ADD CONSTRAINT ibexa_collaboration_participant_external_pk FOREIGN KEY (id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_session_id_fk FOREIGN KEY (session_id) REFERENCES ibexa_collaboration (id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_participant_id_fk FOREIGN KEY (participant_id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_sender_id_fk FOREIGN KEY (sender_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT;

Copy link
Contributor

@ciastektk ciastektk Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostgreSQL

CREATE TABLE ibexa_collaboration
(
    id              SERIAL       NOT NULL,
    owner_id        INT          NOT NULL,
    token           VARCHAR(160) NOT NULL,
    discriminator   VARCHAR(190) NOT NULL,
    is_active       BOOLEAN      NOT NULL,
    has_public_link BOOLEAN      NOT NULL,
    created_at      TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    updated_at      TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    PRIMARY KEY (id)
);
CREATE UNIQUE INDEX ibexa_collaboration_token_idx ON ibexa_collaboration (token);
CREATE INDEX ibexa_collaboration_owner_idx ON ibexa_collaboration (owner_id);
CREATE UNIQUE INDEX ibexa_collaboration_token_uc ON ibexa_collaboration (token);
COMMENT
ON COLUMN ibexa_collaboration.created_at IS '(DC2Type:datetimetz_immutable)';
COMMENT
ON COLUMN ibexa_collaboration.updated_at IS '(DC2Type:datetimetz_immutable)';
CREATE TABLE ibexa_collaboration_participant
(
    id            SERIAL       NOT NULL,
    session_id    INT          NOT NULL,
    discriminator VARCHAR(190) NOT NULL,
    scope         VARCHAR(255) DEFAULT NULL,
    token         VARCHAR(255) DEFAULT NULL,
    created_at    TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    updated_at    TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX ibexa_collaboration_participant_idx ON ibexa_collaboration_participant (session_id);
CREATE UNIQUE INDEX ibexa_collaboration_participant_token_idx ON ibexa_collaboration_participant (token);
COMMENT
ON COLUMN ibexa_collaboration_participant.created_at IS '(DC2Type:datetimetz_immutable)';
COMMENT
ON COLUMN ibexa_collaboration_participant.updated_at IS '(DC2Type:datetimetz_immutable)';
CREATE TABLE ibexa_collaboration_participant_internal
(
    id      INT NOT NULL,
    user_id INT NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX ibexa_collaboration_participant_internal_idx ON ibexa_collaboration_participant_internal (user_id);
CREATE TABLE ibexa_collaboration_participant_external
(
    id    INT          NOT NULL,
    email VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
);
CREATE TABLE ibexa_collaboration_invitation
(
    id             SERIAL      NOT NULL,
    session_id     INT         NOT NULL,
    participant_id INT         NOT NULL,
    sender_id      INT         NOT NULL,
    status         VARCHAR(64) NOT NULL,
    context        JSON DEFAULT NULL,
    created_at     TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    updated_at     TIMESTAMP(0) WITH TIME ZONE NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX ibexa_collaboration_invitation_idx ON ibexa_collaboration_invitation (session_id);
CREATE INDEX ibexa_collaboration_invitation_idx ON ibexa_collaboration_invitation (participant_id);
CREATE INDEX ibexa_collaboration_invitation_idx ON ibexa_collaboration_invitation (sender_id);
COMMENT
ON COLUMN ibexa_collaboration_invitation.created_at IS '(DC2Type:datetimetz_immutable)';
COMMENT
ON COLUMN ibexa_collaboration_invitation.updated_at IS '(DC2Type:datetimetz_immutable)';
ALTER TABLE ibexa_collaboration
    ADD CONSTRAINT ibexa_collaboration_owner_id_fk FOREIGN KEY (owner_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_participant
    ADD CONSTRAINT ibexa_collaboration_participant_session_id_fk FOREIGN KEY (session_id) REFERENCES ibexa_collaboration (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_participant_internal
    ADD CONSTRAINT ibexa_collaboration_participant_internal_pk FOREIGN KEY (id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_participant_internal
    ADD CONSTRAINT ibexa_collaboration_participant_internal_user_id_fk FOREIGN KEY (user_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_participant_external
    ADD CONSTRAINT ibexa_collaboration_participant_external_pk FOREIGN KEY (id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_session_id_fk FOREIGN KEY (session_id) REFERENCES ibexa_collaboration (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_participant_id_fk FOREIGN KEY (participant_id) REFERENCES ibexa_collaboration_participant (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE ibexa_collaboration_invitation
    ADD CONSTRAINT ibexa_collaboration_invitation_sender_id_fk FOREIGN KEY (sender_id) REFERENCES ezuser (contentobject_id) ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE;

php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | mysql -u <username> -p <password> <database_name>
php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u <username> -p <password> <database_name>
```

### Modify the bundles file

Then, in the `config/bundles.php` file, add the following code:

``` php
<?php

return [
// A lot of bundles…
Ibexa\Bundle\Collaboration\IbexaCollaborationBundle::class => ['all' => true],
Ibexa\Bundle\Share\IbexaShareBundle::class => ['all' => true],
Ibexa\Bundle\FieldTypeRichTextRTE\IbexaFieldTypeRichTextRTEBundle::class => ['all' => true],
];
```

### Add migration file and execute migration

Last step is to add migration file and execute migration with the following commands:

``` bash
php bin/console ibexa:migrations:import vendor/ibexa/collaboration/src/bundle/Resources/migrations/2025_08_26_10_14_shareable_user.yaml

Check warning on line 57 in docs/content_management/collaborative_editing/install_collaborative_editing.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/install_collaborative_editing.md#L57

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/content_management/collaborative_editing/install_collaborative_editing.md", "range": {"start": {"line": 57, "column": 136}}}, "severity": "WARNING"}
php bin/console ibexa:migrations:migrate --file=2025_08_26_10_14_shareable_user.yaml
```

You can now restart you application and start [working with the Collaborative editing feature]([[= user_doc =]]/content_management/collaborative_editing/work_with_collaborative_editing/).
91 changes: 91 additions & 0 deletions docs/content_management/collaborative_editing/invitation_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---

Check warning on line 1 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L1

[Ibexa.ReadingLevel] The grade level is 19.66. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 19.66. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: You can use the PHP API to create new invitation, update existing one, read or delete it.

Check warning on line 2 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L2

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 2, "column": 14}}}, "severity": "WARNING"}
---

# Invitation API

[`InvitationService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html) enables you to read, add, update, and remove invitation for collaborative editing session.

Check failure on line 7 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L7

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 7, "column": 67}}}, "severity": "ERROR"}

## Create invitation

You can create new invitation for the collaborative session using the [`InvitationService::createInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_createInvitation) method:

Check failure on line 11 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L11

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 11, "column": 155}}}, "severity": "ERROR"}

``` php
{
$session = $this->sessionService->getSession(1);
$participant = $session->getParticipants()->getByEmail('[email protected]');
$createStruct = new InvitationCreateStruct($session, $participant);
$createStruct->setContext([
'message' => 'Hello, would you like to join my session?',
]);
$invitation = $this->invitationService->createInvitation($createStruct);
}
```

## Get invitation by ID

You can get an invitation by ID with [`InvitationService::getInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation):

Check failure on line 27 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L27

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 27, "column": 119}}}, "severity": "ERROR"}

``` php
$this->invitationService->getInvitation(1);
```

You can select the parameter that you can read from an invitation:

- Invitation ID:

``` php
$invitation->getId();
```

- Session ID:

``` php
$invitation->getSession()->getId();
```

- Participant ID:

``` php
$invitation->getParticipant()->getId();
```

Check warning on line 52 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L52

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 52, "column": 1}}}, "severity": "WARNING"}
- Invitation status:

``` php
$invitation->getStatus();
```

## Get invitation by participant

You can get an invitation by participant with [`InvitationService::getInvitationByParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_getInvitationByParticipant):

Check failure on line 61 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L61

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 61, "column": 141}}}, "severity": "ERROR"}

``` php
$this->innerService->getInvitationByParticipant($participant);
```

## Find invitations

You can find an invitation with [`InvitationService::findInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation).

Check failure on line 69 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L69

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 69, "column": 115}}}, "severity": "ERROR"}

To learn more about the available search options, see Search Criteria and Sort Clauses for Collaborative editing.

## Update invitation

You can update existing invitation with [`InvitationService::updateInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation):

Check failure on line 75 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L75

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 75, "column": 125}}}, "severity": "ERROR"}

``` php
$invitation = $this->invitationService->getInvitation(1);
$updateStruct = new InvitationUpdateStruct();
$updateStruct->setStatus(InvitationStatus::STATUS_ACCEPTED);
$invitation = $this->invitationService->updateInvitation($invitation, $updateStruct);
```

## Delete invitation

You can delete an invitation with [`InvitationService::deleteInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation):

Check failure on line 86 in docs/content_management/collaborative_editing/invitation_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/invitation_api.md#L86

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/invitation_api.md", "range": {"start": {"line": 86, "column": 119}}}, "severity": "ERROR"}

``` php
$invitation = $this->invitationService->getInvitation(1);
$this->invitationService->deleteInvitation($invitation);
```
93 changes: 93 additions & 0 deletions docs/content_management/collaborative_editing/session_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---

Check warning on line 1 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L1

[Ibexa.ReadingLevel] The grade level is 21.12. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 21.12. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: You can use the PHP API to create new session, update existing one, find or delete it, and add or remove participants.

Check warning on line 2 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L2

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 2, "column": 14}}}, "severity": "WARNING"}
---

# Session API

[`SessionService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html) enables you work with the collaborative session, for example, create a new one, update or delete existing one, and add or remove new participants to join collaborative session.

Check failure on line 7 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L7

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 7, "column": 64}}}, "severity": "ERROR"}

Check warning on line 7 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L7

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 7, "column": 116}}}, "severity": "WARNING"}

## Create session

You can create new collaboration session with given id with [`SessionService::createSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_createSession):

Check failure on line 11 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L11

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 11, "column": 139}}}, "severity": "ERROR"}

``` php
$this->innerService->createSession($createStruct);
```
## Get session

You can return existing collaboration session with [`SessionService::getSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_getSession):

Check failure on line 18 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L18

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 18, "column": 127}}}, "severity": "ERROR"}

- using given id:

``` php
$this->innerService->getSession($id);
```

- using given token:

``` php
$this->innerService->getSessionByToken($token);
```

- matching the given query:

``` php
$this->innerService->findSessions($query);
```

## Find session

You can find an existing session with [`SessionService::findSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_findSession) by:

Check failure on line 40 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L40

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 40, "column": 115}}}, "severity": "ERROR"}

``` php
$this->innerService->findSessions($query);
```

## Update session

You can update existing invitation with [`SessionService::updateSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_updateSession):

Check failure on line 48 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L48

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 48, "column": 119}}}, "severity": "ERROR"}

``` php
$this->innerService->updateSession($session, $updateStruct);
```

## Delete session

You can delete session with [`SessionService::deleteSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_deleteSession):

Check failure on line 56 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L56

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 56, "column": 107}}}, "severity": "ERROR"}

``` php
$this->innerService->deleteSession($session);
```

# Participant API

## Add participant

You can add participant to the collaboration session with [`SessionService::addParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_addParticipant):

Check failure on line 66 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L66

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 66, "column": 138}}}, "severity": "ERROR"}

``` php
$this->innerService->addParticipant($session, $createStruct);
```

## Update participant

You can update participant added to the collaboration session with [`SessionService::updateParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_updateParticipant):

Check failure on line 74 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L74

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 74, "column": 150}}}, "severity": "ERROR"}

``` php
$this->innerService->updateParticipant($session, $participant, $updateStruct);
```
## Remove participant

You can remove participant from the collaboration session with [`SessionService::removeParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_removeParticipant):

Check failure on line 81 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L81

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 81, "column": 146}}}, "severity": "ERROR"}

``` php
$this->innerService->removeParticipant($session, $participant);
```

## Check session Owner

You can check the Owner of the collaboration session with [`SessionService::removeParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_removeParticipant):

Check failure on line 89 in docs/content_management/collaborative_editing/session_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/collaborative_editing/session_api.md#L89

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/content_management/collaborative_editing/session_api.md", "range": {"start": {"line": 89, "column": 141}}}, "severity": "ERROR"}

``` php
$this->innerService->isSessionOwner($session, $user);
```
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ nav:
- User field type: content_management/field_types/field_type_reference/userfield.md
- Collaborative editing:
- Collaborative editing product guide: content_management/collaborative_editing/collaborative_editing_guide.md
- Collaborative editing: content_management/collaborative_editing/collaborative_editing.md
- Collaborative editing API: content_management/collaborative_editing/collaborative_editing_api.md
- Invitation API: content_management/collaborative_editing/invitation_api.md
- Session API: content_management/collaborative_editing/session_api.md
- Templating:
- Templating: templating/templating.md
- Render content:
Expand Down
Loading