Skip to content

Commit e8017de

Browse files
committed
Installation and configuration for Collaborative Editing
1 parent 6d14c2a commit e8017de

File tree

6 files changed

+330
-0
lines changed

6 files changed

+330
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
description: Collaborative editing enables multiple users to work on the same content simultaneously.
3+
page_type: landing_page
4+
month_change: true
5+
---
6+
7+
# Collaborative editing
8+
9+
With Collaborative editing feature multiple users can work on the same content created in [[= product_name =]] simultaneously.
10+
This feature allows multiple users to work together on the same content item in real time, streamlining the content creation and review process.
11+
12+
Users can invite both internal and external collaborators to a session, giving them access for editing or previewing.
13+
14+
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.
15+
Real-time collaboration syncs changes instantly and shows user avatars and colored tags to indicate who is editing each part of the content.
16+
17+
This feature also introduces new dashboard tabs for managing shared drafts and joining collaboration sessions easily.
18+
19+
[[= cards([
20+
"content_management/collaborative_editing/collaborative_editing",
21+
"content_management/collaborative_editing/collaborative_editing_api",
22+
"content_management/collaborative_editing/invitation_api",
23+
"content_management/collaborative_editing/session_api",
24+
"content_management/collaborative_editing/collaborative_editing_guide"
25+
], columns=3) =]]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
description: Use PHP API to manage invitations and sessions while using collaborative editing feature.
3+
month_change: false
4+
---
5+
6+
# Collaborative editing API
7+
8+
[[= product_name =]]'s Collaborative editing API provides two services for managing sessions and invitations, which differ in function:
9+
10+
- [`InvitationServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-InvitationServiceInterface.html) is used to request product data
11+
- [`SessionServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-SessionServiceInterface.html) is used to modify products
12+
13+
``` php
14+
15+
/**
16+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
17+
* @license For full copyright and license information view LICENSE file distributed with this source code.
18+
*/
19+
declare(strict_types=1);
20+
21+
namespace Ibexa\Tests\Integration\Collaboration;
22+
23+
use DateTimeImmutable;
24+
use Ibexa\Contracts\Collaboration\Invitation\InvitationCreateStruct;
25+
use Ibexa\Contracts\Collaboration\Invitation\InvitationInterface;
26+
use Ibexa\Contracts\Collaboration\Invitation\InvitationQuery;
27+
use Ibexa\Contracts\Collaboration\Invitation\InvitationStatus;
28+
use Ibexa\Contracts\Collaboration\Invitation\InvitationUpdateStruct;
29+
use Ibexa\Contracts\Collaboration\Invitation\Query\Criterion;
30+
use Ibexa\Contracts\Collaboration\Invitation\Query\SortClause;
31+
use Ibexa\Contracts\Collaboration\InvitationServiceInterface;
32+
use Ibexa\Contracts\Collaboration\SessionServiceInterface;
33+
use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
34+
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
35+
use Ibexa\Contracts\Core\Test\IbexaKernelTestTrait;
36+
use Ibexa\Contracts\CoreSearch\Values\Query\SortDirection;
37+
use Ibexa\Contracts\Test\Core\IbexaKernelTestCase;
38+
39+
final class InvitationServiceTest extends IbexaKernelTestCase
40+
{
41+
use IbexaKernelTestTrait;
42+
43+
private const EXAMPLE_SESSION_ID = 1;
44+
private const EXAMPLE_INVITATION_ID = 1;
45+
private const EXAMPLE_PARTICIPANT_ID = 1;
46+
47+
private const EXAMPLE_INVITATION_A = 1;
48+
private const EXAMPLE_INVITATION_B = 2;
49+
private const EXAMPLE_INVITATION_C = 3;
50+
51+
protected function setUp(): void
52+
{
53+
self::bootKernel();
54+
self::setAdministratorUser();
55+
}
56+
```
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
description: Install the Collaborative editing LTS update.
3+
month_change: false
4+
---
5+
6+
# Install Collaborative editing
7+
8+
Collaborative editing feature is available as an LTS update to [[= product_name =]] starting with version v5.0 or higher, regardless of its edition.
9+
To use this feature you must first install the packages and configure them.
10+
11+
## Install packages
12+
13+
Run the following commands to install the packages:
14+
15+
``` bash
16+
composer require ibexa/collaboration
17+
composer require ibexa/share
18+
composer require ibexa/fieldtype-richtext-rte
19+
```
20+
21+
This command adds the new real-time editing functionality to the Rich Text field type.
22+
It also modifies the permission system to account for the new functionality.
23+
24+
## Configure Collaborative editing
25+
26+
Once the packages are installed, before you can start Collaborative editing feature, you must enable it by following these instructions.
27+
28+
### Add tables to the database
29+
30+
To add the tables to the database, run the following commands:
31+
32+
``` bash
33+
php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | mysql -u <username> -p <password> <database_name>
34+
php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u <username> -p <password> <database_name>
35+
```
36+
37+
### Modify the bundles file
38+
39+
Then, in the `config/bundles.php` file, add the following code:
40+
41+
``` php
42+
<?php
43+
44+
return [
45+
// A lot of bundles…
46+
Ibexa\Bundle\Collaboration\IbexaCollaborationBundle::class => ['all' => true],
47+
Ibexa\Bundle\Share\IbexaShareBundle::class => ['all' => true],
48+
Ibexa\Bundle\FieldTypeRichTextRTE\IbexaFieldTypeRichTextRTEBundle::class => ['all' => true],
49+
];
50+
```
51+
52+
### Add migration file and execute migration
53+
54+
Last step is to add migration file and execute migration with the following commands:
55+
56+
``` bash
57+
php bin/console ibexa:migrations:import vendor/ibexa/collaboration/src/bundle/Resources/migrations/2025_08_26_10_14_shareable_user.yaml
58+
php bin/console ibexa:migrations:migrate --file=2025_08_26_10_14_shareable_user.yaml
59+
```
60+
61+
You can now restart you application and start [working with the Collaborative editing feature]([[= user_doc =]]/content_management/collaborative_editing/work_with_collaborative_editing/).
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
description: You can use the PHP API to create new invitation, update existing one, read or delete it.
3+
---
4+
5+
# Invitation API
6+
7+
[`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.
8+
9+
## Create invitation
10+
11+
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:
12+
13+
``` php
14+
{
15+
$session = $this->sessionService->getSession(1);
16+
$participant = $session->getParticipants()->getByEmail('[email protected]');
17+
$createStruct = new InvitationCreateStruct($session, $participant);
18+
$createStruct->setContext([
19+
'message' => 'Hello, would you like to join my session?',
20+
]);
21+
$invitation = $this->invitationService->createInvitation($createStruct);
22+
}
23+
```
24+
25+
## Get invitation by ID
26+
27+
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):
28+
29+
``` php
30+
$this->invitationService->getInvitation(1);
31+
```
32+
33+
You can select the parameter that you can read from an invitation:
34+
35+
- Invitation ID:
36+
37+
``` php
38+
$invitation->getId();
39+
```
40+
41+
- Session ID:
42+
43+
``` php
44+
$invitation->getSession()->getId();
45+
```
46+
47+
- Participant ID:
48+
49+
``` php
50+
$invitation->getParticipant()->getId();
51+
```
52+
53+
- Invitation status:
54+
55+
``` php
56+
$invitation->getStatus();
57+
```
58+
59+
## Get invitation by participant
60+
61+
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):
62+
63+
``` php
64+
$this->innerService->getInvitationByParticipant($participant);
65+
```
66+
67+
## Find invitations
68+
69+
You can find an invitation with [`InvitationService::findInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation).
70+
71+
To learn more about the available search options, see Search Criteria and Sort Clauses for Collaborative editing.
72+
73+
## Update invitation
74+
75+
You can update existing invitation with [`InvitationService::updateInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation):
76+
77+
``` php
78+
$invitation = $this->invitationService->getInvitation(1);
79+
$updateStruct = new InvitationUpdateStruct();
80+
$updateStruct->setStatus(InvitationStatus::STATUS_ACCEPTED);
81+
$invitation = $this->invitationService->updateInvitation($invitation, $updateStruct);
82+
```
83+
84+
## Delete invitation
85+
86+
You can delete an invitation with [`InvitationService::deleteInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation):
87+
88+
``` php
89+
$invitation = $this->invitationService->getInvitation(1);
90+
$this->invitationService->deleteInvitation($invitation);
91+
```
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
description: You can use the PHP API to create new session, update existing one, find or delete it, and add or remove participants.
3+
---
4+
5+
# Session API
6+
7+
[`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.
8+
9+
## Create session
10+
11+
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):
12+
13+
``` php
14+
$this->innerService->createSession($createStruct);
15+
```
16+
## Get session
17+
18+
You can return existing collaboration session with [`SessionService::getSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_getSession):
19+
20+
- using given id:
21+
22+
``` php
23+
$this->innerService->getSession($id);
24+
```
25+
26+
- using given token:
27+
28+
``` php
29+
$this->innerService->getSessionByToken($token);
30+
```
31+
32+
- matching the given query:
33+
34+
``` php
35+
$this->innerService->findSessions($query);
36+
```
37+
38+
## Find session
39+
40+
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:
41+
42+
``` php
43+
$this->innerService->findSessions($query);
44+
```
45+
46+
## Update session
47+
48+
You can update existing invitation with [`SessionService::updateSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_updateSession):
49+
50+
``` php
51+
$this->innerService->updateSession($session, $updateStruct);
52+
```
53+
54+
## Delete session
55+
56+
You can delete session with [`SessionService::deleteSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_deleteSession):
57+
58+
``` php
59+
$this->innerService->deleteSession($session);
60+
```
61+
62+
# Participant API
63+
64+
## Add participant
65+
66+
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):
67+
68+
``` php
69+
$this->innerService->addParticipant($session, $createStruct);
70+
```
71+
72+
## Update participant
73+
74+
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):
75+
76+
``` php
77+
$this->innerService->updateParticipant($session, $participant, $updateStruct);
78+
```
79+
## Remove participant
80+
81+
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):
82+
83+
``` php
84+
$this->innerService->removeParticipant($session, $participant);
85+
```
86+
87+
## Check session Owner
88+
89+
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):
90+
91+
``` php
92+
$this->innerService->isSessionOwner($session, $user);
93+
```

mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ nav:
284284
- User field type: content_management/field_types/field_type_reference/userfield.md
285285
- Collaborative editing:
286286
- Collaborative editing product guide: content_management/collaborative_editing/collaborative_editing_guide.md
287+
- Collaborative editing: content_management/collaborative_editing/collaborative_editing.md
288+
- Collaborative editing API: content_management/collaborative_editing/collaborative_editing_api.md
289+
- Invitation API: content_management/collaborative_editing/invitation_api.md
290+
- Session API: content_management/collaborative_editing/session_api.md
287291
- Templating:
288292
- Templating: templating/templating.md
289293
- Render content:

0 commit comments

Comments
 (0)