-
Notifications
You must be signed in to change notification settings - Fork 83
IBX-9737: Collaborative editing described in Developer Documentation - v5.0 #2721
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
Draft
julitafalcondusza
wants to merge
12
commits into
5.0
Choose a base branch
from
IBX-9737
base: 5.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6a822f8
collaboration events skeleton added
julitafalcondusza b52ac68
services description added
julitafalcondusza e22c0d9
session api added
julitafalcondusza d8203ca
Session & invitation API - skeleton
julitafalcondusza 3b4f1d5
Collaborative editing - installation
julitafalcondusza 3207ed3
Updates, content added
julitafalcondusza e65c54b
new criterions and sort clauses, fixes
julitafalcondusza c0a31b6
mkdocs updated
julitafalcondusza cc33bc5
collaboration events file removed from PR
julitafalcondusza 13a094b
content updated
julitafalcondusza 1a77424
batch of fixes
julitafalcondusza 4f949ca
work in progress
julitafalcondusza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
docs/content_management/collaborative_editing/collaborative_editing.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
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. | ||
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. | ||
|
||
[[= 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) =]] |
56 changes: 56 additions & 0 deletions
56
docs/content_management/collaborative_editing/collaborative_editing_api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
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 | ||
- [`SessionServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-SessionServiceInterface.html) is used to modify products | ||
|
||
``` 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(); | ||
} | ||
``` |
61 changes: 61 additions & 0 deletions
61
docs/content_management/collaborative_editing/install_collaborative_editing.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
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 | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. composer require ibexa/share installs also ibexa/collaboration. The same situation for composer require ibexa/fieldtype-richtext-rte - installs also ibexa/ckeditor-premium. |
||
|
||
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 | ||
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], | ||
]; | ||
``` | ||
|
||
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 | ||
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
91
docs/content_management/collaborative_editing/invitation_api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
description: You can use the PHP API to create new invitation, update existing one, read or delete it. | ||
--- | ||
|
||
# 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. | ||
|
||
## 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: | ||
|
||
``` 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): | ||
|
||
``` 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(); | ||
``` | ||
|
||
- 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): | ||
|
||
``` 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). | ||
|
||
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): | ||
|
||
``` 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): | ||
|
||
``` php | ||
$invitation = $this->invitationService->getInvitation(1); | ||
$this->invitationService->deleteInvitation($invitation); | ||
``` | ||
julitafalcondusza marked this conversation as resolved.
Show resolved
Hide resolved
|
93 changes: 93 additions & 0 deletions
93
docs/content_management/collaborative_editing/session_api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
description: You can use the PHP API to create new session, update existing one, find or delete it, and add or remove participants. | ||
--- | ||
|
||
# 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. | ||
|
||
## 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): | ||
|
||
``` 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): | ||
|
||
- 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: | ||
|
||
``` 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): | ||
|
||
``` 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): | ||
|
||
``` 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): | ||
|
||
``` 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): | ||
|
||
``` 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): | ||
|
||
``` 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): | ||
|
||
``` php | ||
$this->innerService->isSessionOwner($session, $user); | ||
``` |
23 changes: 23 additions & 0 deletions
23
...borative_editing_search_reference/invitation/created_at_invitation_criterion.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
description: CreatedAt Search Criterion | ||
--- | ||
|
||
# CreatedAt Search Criterion | ||
|
||
The `CreatedAt` Search Criterion searches for invitations based on the date they were created. | ||
|
||
## Arguments | ||
|
||
- `value` - date to be matched, provided as a DateTimeInterface object | ||
- `operator` - optional operator string (EQ, GT, GTE, LT, LTE) | ||
julitafalcondusza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Example | ||
|
||
```php | ||
$criteria = new \Ibexa\Contracts\Collaboration\Invitation\Query\Criterion\CreatedAt( | ||
new DateTime('2025-05-01 14:07:02'), | ||
'GTE' | ||
julitafalcondusza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
|
||
$query = new InvitationQuery($criteria); | ||
``` |
19 changes: 19 additions & 0 deletions
19
...rative_editing_search_reference/invitation/created_at_invitation_sort_clause.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
description: CreatedAt Sort Clause | ||
--- | ||
|
||
# CreatedAt Sort Clause | ||
|
||
The `CreatedAt` Sort Clause sorts search results by the date and time of the creation of invitation. | ||
|
||
## Arguments | ||
|
||
- (optional) `direction` - SortDirection constant, either SortDirection::ASC or SortDirection::DESC. | ||
|
||
## Example | ||
|
||
```php | ||
$sortClause = [new \Ibexa\Contracts\Collaboration\Invitation\Query\SortClause\CreatedAt(SortDirection::DESC)]); | ||
|
||
$query = new InvitationQuery($criteria, sortClause); | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.