-
Notifications
You must be signed in to change notification settings - Fork 83
Installation and configuration for Collaborative Editing #2902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.6
Are you sure you want to change the base?
Changes from 1 commit
e8017de
cf48275
3a9ed35
c298211
de19c1e
667080e
46f1728
60ef6d9
21e1473
2a35111
cbe24d8
9ffdc54
9a46431
fcf6262
8b02db4
c29913d
6d12ac7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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
|
||
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
|
||
Real-time collaboration syncs changes instantly and shows user avatars and colored tags to indicate who is editing each part of the content. | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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
|
||
|
||
[[= 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
|
||
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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
- [`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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` 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 | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
{ | ||
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
|
||
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. | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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: | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` bash | ||
|
||
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: | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` php | ||
<?php | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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], | ||
julitafalcondusza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
]; | ||
``` | ||
|
||
### 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
|
||
php bin/console ibexa:migrations:migrate --file=2025_08_26_10_14_shareable_user.yaml | ||
``` | ||
julitafalcondusza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
You can now restart you application and start [working with the Collaborative editing feature]([[= user_doc =]]/content_management/collaborative_editing/work_with_collaborative_editing/). |
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
|
||
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
|
||
--- | ||
|
||
# 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## 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
|
||
|
||
``` 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
|
||
|
||
``` 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
|
||
- 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
|
||
|
||
``` 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
To learn more about the available search options, see Search Criteria and Sort Clauses for Collaborative editing. | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## 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
|
||
|
||
``` 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
|
||
|
||
``` php | ||
$invitation = $this->invitationService->getInvitation(1); | ||
$this->invitationService->deleteInvitation($invitation); | ||
``` |
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
|
||
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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--- | ||
|
||
# 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
- 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 | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` 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
|
||
|
||
``` 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
|
||
|
||
``` 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
|
||
|
||
``` php | ||
$this->innerService->addParticipant($session, $createStruct); | ||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
## 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
|
||
|
||
``` 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
|
||
|
||
``` 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
|
||
julitafalcondusza marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` php | ||
$this->innerService->isSessionOwner($session, $user); | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.