From 05e109d8fdb76cd1646be44813a7212d8a2db74e Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 11:57:04 +0200 Subject: [PATCH 01/12] collaboration - donfiguration for v5.0 --- .../src/Notification/ListRenderer.php | 11 +- .../src/Command/ManageSessionsCommand.php | 164 +++++++++++++++ .../collaborative_editing.md | 23 +++ .../collaborative_editing_api.md | 189 ++++++++++++++++++ .../configure_collaborative_editing.md | 111 ++++++++++ mkdocs.yml | 3 + 6 files changed, 491 insertions(+), 10 deletions(-) create mode 100644 code_samples/collaboration/src/Command/ManageSessionsCommand.php create mode 100644 docs/content_management/collaborative_editing/collaborative_editing.md create mode 100644 docs/content_management/collaborative_editing/collaborative_editing_api.md create mode 100644 docs/content_management/collaborative_editing/configure_collaborative_editing.md diff --git a/code_samples/back_office/notifications/src/Notification/ListRenderer.php b/code_samples/back_office/notifications/src/Notification/ListRenderer.php index ced5b5dd1d..4c7153a582 100644 --- a/code_samples/back_office/notifications/src/Notification/ListRenderer.php +++ b/code_samples/back_office/notifications/src/Notification/ListRenderer.php @@ -13,17 +13,8 @@ class ListRenderer implements NotificationRenderer, TypedNotificationRendererInterface { - protected Environment $twig; - - protected RouterInterface $router; - - protected RequestStack $requestStack; - - public function __construct(Environment $twig, RouterInterface $router, RequestStack $requestStack) + public function __construct(protected Environment $twig, protected RouterInterface $router, protected RequestStack $requestStack) { - $this->twig = $twig; - $this->router = $router; - $this->requestStack = $requestStack; } public function render(Notification $notification): string diff --git a/code_samples/collaboration/src/Command/ManageSessionsCommand.php b/code_samples/collaboration/src/Command/ManageSessionsCommand.php new file mode 100644 index 0000000000..f943d44a32 --- /dev/null +++ b/code_samples/collaboration/src/Command/ManageSessionsCommand.php @@ -0,0 +1,164 @@ +invitationService = $invitationService; + $this->sessionService = $sessionService; + } + + public function execute(InputInterface $input, OutputInterface $output): int + { + $this->permissionResolver->setCurrentUserReference( + $this->userService->loadUserByLogin('admin') + ); + + // Create a sharing session for Content + $versionInfo = $this->contentService->loadContent(52)->getVersionInfo(); + $createStruct = new ContentSessionCreateStruct( + $versionInfo, + $versionInfo->getInitialLanguage() + ); + $createStruct->setHasPublicLink(false); + + $token = 'my-secret-token-12345'; + $createStruct->setToken($token); + + $sessionId = $this->sessionService->createSession($createStruct)->getId(); + + // Get a session by ID or token + $session = $this->sessionService->getSession($sessionId); + $session = $this->sessionService->getSessionByToken($token); + + // Find sessions + $sessionQuery = new SessionQuery(new Token($token)); + $session = $this->sessionService->findSessions($sessionQuery)->getFirst(); + + // Update a session + $updateStruct = new ContentSessionUpdateStruct(); + $updateStruct->setHasPublicLink(true); + + $this->sessionService->updateSession($session, $updateStruct); + + // Deactivate a session + $updateStruct = new ContentSessionUpdateStruct(); + $updateStruct->setIsActive(false); + + $this->sessionService->updateSession($session, $updateStruct); + + // Manage participants + $user = $this->userService->loadUserByLogin('another_user'); + $internalParticipantCreateStruct = new InternalParticipantCreateStruct( + $user, + ContentSessionScope::VIEW + ); + $externalParticipantCreateStruct = new ExternalParticipantCreateStruct( + 'external@example.com', + ContentSessionScope::VIEW, + 'personal-secret-token-12345' + ); + + $internalParticipant = $this->sessionService->addParticipant($session, $internalParticipantCreateStruct); + $externalParticipant = $this->sessionService->addParticipant($session, $externalParticipantCreateStruct); + + // Get and update participants + $participant = $this->sessionService + ->getSession($session->getId()) + ->getParticipants() + ->getByEmail($user->email); + + $internalParticipantUpdateStruct = new InternalParticipantUpdateStruct(ContentSessionScope::EDIT); + $this->sessionService->updateParticipant($session, $participant, $internalParticipantUpdateStruct); + + // Remove participant + $this->sessionService->removeParticipant($session, $externalParticipant); + + // Check ownerships. If no user is provided, current user is used. + $this->sessionService->isSessionOwner( + $session, + $this->userService->loadUserByLogin('another_user') + ); + + // Check participation + $this->sessionService->isSessionParticipant( + $session, + $this->permissionResolver->getCurrentUserReference() + ); + + // Manage invitations + $invitationQuery = new InvitationQuery(new Session($session)); + $invitations = $this->invitationService->findInvitations($invitationQuery)->getInvitations(); + + foreach ($invitations as $invitation) { + $output->writeln('Invitation ID: ' . $invitation->getId() . ' Status: ' . $invitation->getStatus()); + } + + $invitation = $this->invitationService->getInvitationByParticipant($participant); + + // Create invitation - use when auto-inviting participants is not enabled + $invitationCreateStruct = new InvitationCreateStruct( + $session, + $internalParticipant + ); + + $this->invitationService->createInvitation($invitationCreateStruct); + + // Update invitation + $invitationUpdateStruct = new InvitationUpdateStruct(); + $invitationUpdateStruct->setStatus(InvitationStatus::STATUS_REJECTED); + + $this->invitationService->updateInvitation($invitation, $invitationUpdateStruct); + + // Delete invitation + $invitation = $this->invitationService->getInvitation(2); + $this->invitationService->deleteInvitation($invitation); + + // Delete a session + $this->sessionService->deleteSession($session); + + return Command::SUCCESS; + } +} diff --git a/docs/content_management/collaborative_editing/collaborative_editing.md b/docs/content_management/collaborative_editing/collaborative_editing.md new file mode 100644 index 0000000000..f32e081682 --- /dev/null +++ b/docs/content_management/collaborative_editing/collaborative_editing.md @@ -0,0 +1,23 @@ +--- +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 specific part of the Rich Text field. + +This feature also introduces new dashboard tabs for managing shared drafts and joining collaboration sessions easily. + +[[= cards([ +"content_management/collaborative_editing/collaborative_editing_guide", +"content_management/collaborative_editing/configure_collaborative_editing", +"content_management/collaborative_editing/collaborative_editing_api" +], columns=3) =]] \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/collaborative_editing_api.md b/docs/content_management/collaborative_editing/collaborative_editing_api.md new file mode 100644 index 0000000000..6160a89b2f --- /dev/null +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -0,0 +1,189 @@ +--- +description: Use PHP API to manage invitations, sessions, and participants while using collaborative editing feature. +month_change: true +--- + +# Collaborative editing API + +[[= product_name =]]'s Collaborative editing API provides two services for managing sessions and invitations, which differ in function: + +- [`InvitationServiceInterface`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html) is used to manage collaboration sessions invitations +- [`SessionServiceInterface`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html) is used to manage collaboration sessions + +## Managing sessions + +### Create session + +You can create new collaboration session with [`SessionService::createSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_createSession): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 69, 81) =]] +``` + +### Get session + +You can get an existing collaboration session with [`SessionService::getSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession): + +- using given id - with [`SessionService::getSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession) + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 82, 83) =]] +``` + +- using given token - with [`SessionService::getSessionByToken`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSessionByToken) + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 83, 84) =]] +``` + +### Find sessions + +You can find an existing session with [`SessionService::findSessions`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_findSessions) by: + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 86, 89) =]] +``` + +### Update session + +You can update existing invitation with [`SessionService::updateSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateSession): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 90, 95) =]] +``` + +### Deactivate session + +You can deactivate session with [`SessionService::deleteSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deactivateSession): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 96, 101) =]] +``` + +### Delete session + +You can delete session with [`SessionService::deleteSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 169, 170) =]] +``` + +## Managing participants + +### Add participant + +You can add participant to the collaboration session with [`SessionService::addParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_addParticipant): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 102, 116) =]] +``` + +### Get and update participant + +You can update participant added to the collaboration session with [`SessionService::updateParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateParticipant): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 117, 125) =]] +``` +### Remove participant + +You can remove participant from the collaboration session with [`SessionService::removeParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_removeParticipant): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 126, 127) =]] +``` + +### Check session owner + +You can check the owner of the collaboration session with [`SessionService::isSessionOwner`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceDecorator.html#method_isSessionOwner): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 129, 134) =]] +``` + +If no user is provided, current user is used. + +### Check session participant + +You can check the participant of the collaboration session with [`SessionService::isSessionParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_isSessionParticipant): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 135, 140) =]] +``` + +## Managing invitations + +### Manage invitation + +You can get an invitation with [`InvitationService::getInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_getInvitation): + + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 141, 150) =]] +``` + +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(); +``` + +### Create invitation + +You can create new invitation for the collaborative session using the [`InvitationService::createInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_createInvitation) method: + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 151, 158) =]] +``` + +You can use it when auto-inviting participants is not enabled. + +### Update invitation + +You can update existing invitation with [`InvitationService::updateInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_updateInvitation): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 159, 164) =]] +``` + +### Delete invitation + +You can delete an invitation with [`InvitationService::deleteInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_deleteInvitation): + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 165, 168) =]] +``` + +### Find invitations + +You can find an invitation with [`InvitationService::findInvitations`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_findInvitations). + +To learn more about the available search options, see Search Criteria and Sort Clauses for Collaborative editing. + +## Example API usage + +Below you can see an example of API usage for Collaborative editing: + +``` php +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php') =]] +``` \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md new file mode 100644 index 0000000000..9618765b39 --- /dev/null +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -0,0 +1,111 @@ +--- +description: Configure the Collaborative editing feature. +month_change: true +--- + +# Collaborative editing + +Collaborative editing feature is available in [[= product_name =]] starting with version v5.0.2 or higher, regardless of its edition. + +## Install Real-time editing feature package + +If you have an arrangements with [[= product_name_base =]] to use Real-time editing feature, you need to install following package: + +``` bash +composer require ibexa/fieldtype-richtext-rte +``` + +This command instals also `ibexa/ckeditor-premium` package and 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 + +Before you can start Collaborative editing feature, you must enable it by following these instructions. + +### Configuration + +You can configure Collaborative editing per [Repository](repository_configuration.md). + +Under `ibexa.repositories..collaboration` [configuration key](configuration.md#configuration-files), indicate the settings for collaboration: + +``` yaml +ibexa: + repositories: + : + collaboration: + participants: + allowed_types: + - internal + - external + auto_invite: + session: + public_link_enabled: +``` + +The following setiings are available: + +- participants: + - `allowed_types` - defines allowed user types, values: `internal`, `external`, you can set one, both, or none of the values + - `auto_invite` - determines whether invitations should be sent automatically when inviting someone to a session, default value: `true`, available values: `true`, `false` +- session: + - `public_link_enabled` - determines whether the public link is available, default value: `false`, available values: `true`, `false` + +### 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 -p +php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u -p +``` + +### Modify the bundles file + +Then, if not using Symfony Flex, add the following code to the `config/bundles.php` file: + +``` php + ['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 +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/). + +### Security configurations + +After an installation process is finished, go to `config/packages/security.yaml` and make following changes: + +- uncomment following lines with `shared` user provider under the `providers` key: + +```yaml +providers: + shared: + id: Ibexa\Collaboration\Security\User\ShareableLinkUserProvider +``` + +- uncomment following lines under the `ibexa_shareable_link` key: + +```yaml +ibexa_shareable_link: + request_matcher: Ibexa\Collaboration\Security\RequestMatcher\ShareableLinkRequestMatcher + pattern: ^/ + provider: shared + stateless: true + user_checker: Ibexa\Core\MVC\Symfony\Security\UserChecker + guard: + authenticator: Ibexa\Collaboration\Security\Authenticator\ShareableLinkAuthenticator +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ca209a9202..f2d4409aaf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -280,7 +280,10 @@ nav: - URL field type: content_management/field_types/field_type_reference/urlfield.md - User field type: content_management/field_types/field_type_reference/userfield.md - Collaborative editing: + - Collaborative editing: content_management/collaborative_editing/collaborative_editing.md - Collaborative editing product guide: content_management/collaborative_editing/collaborative_editing_guide.md + - Configure Collaborative editing: content_management/collaborative_editing/configure_collaborative_editing.md + - Collaborative editing API: content_management/collaborative_editing/collaborative_editing_api.md - Templating: - Templating: templating/templating.md - Render content: From 176a1df7d8be172f71df652784bcf96832a3e293 Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 12:11:46 +0200 Subject: [PATCH 02/12] composer fix --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b21f1dc068..8b5f82b043 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,9 @@ "ibexa/discounts-codes": "~5.0.x-dev", "ibexa/core-search": "~5.0.x-dev", "ibexa/product-catalog-symbol-attribute": "~5.0.x-dev", - "ibexa/messenger": "~5.0.x-dev" + "ibexa/messenger": "~5.0.x-dev", + "ibexa/collaboration": "~5.0.x-dev", + "ibexa/share": "~5.0.x-dev" }, "scripts": { "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", From 97e5fe30424ac353992afaa23573181fde45b629 Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 12:30:31 +0200 Subject: [PATCH 03/12] code samples lines adjusted --- .../src/Command/ManageSessionsCommand.php | 20 ++++------ .../collaborative_editing_api.md | 38 ++++++++----------- 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/code_samples/collaboration/src/Command/ManageSessionsCommand.php b/code_samples/collaboration/src/Command/ManageSessionsCommand.php index f943d44a32..3aad006b05 100644 --- a/code_samples/collaboration/src/Command/ManageSessionsCommand.php +++ b/code_samples/collaboration/src/Command/ManageSessionsCommand.php @@ -26,28 +26,22 @@ use Ibexa\Contracts\Share\Collaboration\ContentSessionCreateStruct; use Ibexa\Contracts\Share\Collaboration\ContentSessionScope; use Ibexa\Contracts\Share\Collaboration\ContentSessionUpdateStruct; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -#[\Symfony\Component\Console\Attribute\AsCommand(name: 'app:manage-sessions')] -final class ManageSessionsCommand extends Command +#[AsCommand(name: 'app:manage-sessions')] +final class ManageSessionCommand extends Command { - private readonly InvitationServiceInterface $invitationService; - - private readonly SessionServiceInterface $sessionService; - public function __construct( - InvitationServiceInterface $invitationService, - SessionServiceInterface $sessionService, + private readonly InvitationServiceInterface $invitationService, + private readonly SessionServiceInterface $sessionService, private readonly ContentService $contentService, private readonly UserService $userService, private readonly PermissionResolver $permissionResolver ) { - parent::__construct(self::$defaultName); - - $this->invitationService = $invitationService; - $this->sessionService = $sessionService; + parent::__construct(); } public function execute(InputInterface $input, OutputInterface $output): int @@ -161,4 +155,4 @@ public function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } -} +} \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/collaborative_editing_api.md b/docs/content_management/collaborative_editing/collaborative_editing_api.md index 6160a89b2f..68c2c69edf 100644 --- a/docs/content_management/collaborative_editing/collaborative_editing_api.md +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -17,7 +17,7 @@ month_change: true You can create new collaboration session with [`SessionService::createSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_createSession): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 69, 81) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 53, 65) =]] ``` ### Get session @@ -27,13 +27,13 @@ You can get an existing collaboration session with [`SessionService::getSession` - using given id - with [`SessionService::getSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession) ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 82, 83) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 66, 67) =]] ``` - using given token - with [`SessionService::getSessionByToken`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSessionByToken) ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 83, 84) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 67, 68) =]] ``` ### Find sessions @@ -41,7 +41,7 @@ You can get an existing collaboration session with [`SessionService::getSession` You can find an existing session with [`SessionService::findSessions`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_findSessions) by: ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 86, 89) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 70, 73) =]] ``` ### Update session @@ -49,15 +49,7 @@ You can find an existing session with [`SessionService::findSessions`](https://d You can update existing invitation with [`SessionService::updateSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateSession): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 90, 95) =]] -``` - -### Deactivate session - -You can deactivate session with [`SessionService::deleteSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deactivateSession): - -``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 96, 101) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 74, 79) =]] ``` ### Delete session @@ -65,7 +57,7 @@ You can deactivate session with [`SessionService::deleteSession`](https://doc.ib You can delete session with [`SessionService::deleteSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 169, 170) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 153, 154) =]] ``` ## Managing participants @@ -75,7 +67,7 @@ You can delete session with [`SessionService::deleteSession`](https://doc.ibexa. You can add participant to the collaboration session with [`SessionService::addParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_addParticipant): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 102, 116) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 86, 100) =]] ``` ### Get and update participant @@ -83,14 +75,14 @@ You can add participant to the collaboration session with [`SessionService::addP You can update participant added to the collaboration session with [`SessionService::updateParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateParticipant): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 117, 125) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 101, 109) =]] ``` ### Remove participant You can remove participant from the collaboration session with [`SessionService::removeParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_removeParticipant): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 126, 127) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 110, 111) =]] ``` ### Check session owner @@ -98,7 +90,7 @@ You can remove participant from the collaboration session with [`SessionService: You can check the owner of the collaboration session with [`SessionService::isSessionOwner`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceDecorator.html#method_isSessionOwner): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 129, 134) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 113, 118) =]] ``` If no user is provided, current user is used. @@ -108,7 +100,7 @@ If no user is provided, current user is used. You can check the participant of the collaboration session with [`SessionService::isSessionParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_isSessionParticipant): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 135, 140) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 119, 124) =]] ``` ## Managing invitations @@ -119,7 +111,7 @@ You can get an invitation with [`InvitationService::getInvitation`](https://doc. ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 141, 150) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 125, 134) =]] ``` You can select the parameter that you can read from an invitation: @@ -153,7 +145,7 @@ You can select the parameter that you can read from an invitation: You can create new invitation for the collaborative session using the [`InvitationService::createInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_createInvitation) method: ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 151, 158) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 135, 142) =]] ``` You can use it when auto-inviting participants is not enabled. @@ -163,7 +155,7 @@ You can use it when auto-inviting participants is not enabled. You can update existing invitation with [`InvitationService::updateInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_updateInvitation): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 159, 164) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 143, 148) =]] ``` ### Delete invitation @@ -171,7 +163,7 @@ You can update existing invitation with [`InvitationService::updateInvitation`]( You can delete an invitation with [`InvitationService::deleteInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_deleteInvitation): ``` php -[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 165, 168) =]] +[[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 149, 152) =]] ``` ### Find invitations From 9017928d31470e55996888c99be8b8f5bcaa9f2a Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 10:45:24 +0000 Subject: [PATCH 04/12] PHP & JS CS Fixes --- .../collaboration/src/Command/ManageSessionsCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code_samples/collaboration/src/Command/ManageSessionsCommand.php b/code_samples/collaboration/src/Command/ManageSessionsCommand.php index 3aad006b05..1eebd931c6 100644 --- a/code_samples/collaboration/src/Command/ManageSessionsCommand.php +++ b/code_samples/collaboration/src/Command/ManageSessionsCommand.php @@ -32,7 +32,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[AsCommand(name: 'app:manage-sessions')] -final class ManageSessionCommand extends Command +final class ManageSessionsCommand extends Command { public function __construct( private readonly InvitationServiceInterface $invitationService, @@ -155,4 +155,4 @@ public function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } -} \ No newline at end of file +} From 9aaddfe0323abad8e6c718f954e672a46b9aaabf Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 12:53:10 +0200 Subject: [PATCH 05/12] fixes --- .../config/mysql/ibexa_share.sql | 82 ++++++++++++++++++ .../config/postgresql/ibexa_share.sql | 84 +++++++++++++++++++ .../collaborative_editing.md | 3 +- .../collaborative_editing_api.md | 43 +++++----- .../configure_collaborative_editing.md | 51 ++++++++--- 5 files changed, 230 insertions(+), 33 deletions(-) create mode 100644 code_samples/collaboration/config/mysql/ibexa_share.sql create mode 100644 code_samples/collaboration/config/postgresql/ibexa_share.sql diff --git a/code_samples/collaboration/config/mysql/ibexa_share.sql b/code_samples/collaboration/config/mysql/ibexa_share.sql new file mode 100644 index 0000000000..a4a367436f --- /dev/null +++ b/code_samples/collaboration/config/mysql/ibexa_share.sql @@ -0,0 +1,82 @@ +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; \ No newline at end of file diff --git a/code_samples/collaboration/config/postgresql/ibexa_share.sql b/code_samples/collaboration/config/postgresql/ibexa_share.sql new file mode 100644 index 0000000000..fc860430c8 --- /dev/null +++ b/code_samples/collaboration/config/postgresql/ibexa_share.sql @@ -0,0 +1,84 @@ +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; \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/collaborative_editing.md b/docs/content_management/collaborative_editing/collaborative_editing.md index f32e081682..e627d60d0e 100644 --- a/docs/content_management/collaborative_editing/collaborative_editing.md +++ b/docs/content_management/collaborative_editing/collaborative_editing.md @@ -6,8 +6,7 @@ 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. +With Collaborative editing feature multiple users can work on the same content created in [[= product_name =]] simultaneously, 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. diff --git a/docs/content_management/collaborative_editing/collaborative_editing_api.md b/docs/content_management/collaborative_editing/collaborative_editing_api.md index 68c2c69edf..1214a0d864 100644 --- a/docs/content_management/collaborative_editing/collaborative_editing_api.md +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -7,14 +7,14 @@ month_change: true [[= product_name =]]'s Collaborative editing API provides two services for managing sessions and invitations, which differ in function: -- [`InvitationServiceInterface`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html) is used to manage collaboration sessions invitations -- [`SessionServiceInterface`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html) is used to manage collaboration sessions +- [`InvitationServiceInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html) is used to manage collaboration sessions invitations +- [`SessionServiceInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html) is used to manage collaboration sessions ## Managing sessions ### Create session -You can create new collaboration session with [`SessionService::createSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_createSession): +You can create new collaboration session with [`SessionService::createSession()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_createSession): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 53, 65) =]] @@ -22,15 +22,15 @@ You can create new collaboration session with [`SessionService::createSession`]( ### Get session -You can get an existing collaboration session with [`SessionService::getSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession): +You can get an existing collaboration session with [`SessionService::getSession()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession): -- using given id - with [`SessionService::getSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession) +- using given id - with [`SessionService::getSession()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSession) ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 66, 67) =]] ``` -- using given token - with [`SessionService::getSessionByToken`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSessionByToken) +- using given token - with [`SessionService::getSessionByToken()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_getSessionByToken) ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 67, 68) =]] @@ -38,7 +38,7 @@ You can get an existing collaboration session with [`SessionService::getSession` ### Find sessions -You can find an existing session with [`SessionService::findSessions`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_findSessions) by: +You can find an existing session with [`SessionService::findSessions()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_findSessions) by passing a SessionQuery object: ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 70, 73) =]] @@ -46,7 +46,7 @@ You can find an existing session with [`SessionService::findSessions`](https://d ### Update session -You can update existing invitation with [`SessionService::updateSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateSession): +You can update existing invitation with [`SessionService::updateSession()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateSession): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 74, 79) =]] @@ -54,7 +54,7 @@ You can update existing invitation with [`SessionService::updateSession`](https: ### Delete session -You can delete session with [`SessionService::deleteSession`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): +You can delete session with [`SessionService::deleteSession()`](h/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 153, 154) =]] @@ -64,7 +64,7 @@ You can delete session with [`SessionService::deleteSession`](https://doc.ibexa. ### Add participant -You can add participant to the collaboration session with [`SessionService::addParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_addParticipant): +You can add participant to the collaboration session with [`SessionService::addParticipant()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_addParticipant): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 86, 100) =]] @@ -72,14 +72,17 @@ You can add participant to the collaboration session with [`SessionService::addP ### Get and update participant -You can update participant added to the collaboration session with [`SessionService::updateParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateParticipant): +You can update participant added to the collaboration session with [`SessionService::updateParticipant()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_updateParticipant): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 101, 109) =]] ``` + +The example below updates participant's permissions to allow for editing of shared content, not only previewing. + ### Remove participant -You can remove participant from the collaboration session with [`SessionService::removeParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_removeParticipant): +You can remove participant from the collaboration session with [`SessionService::removeParticipant()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_removeParticipant): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 110, 111) =]] @@ -87,7 +90,7 @@ You can remove participant from the collaboration session with [`SessionService: ### Check session owner -You can check the owner of the collaboration session with [`SessionService::isSessionOwner`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceDecorator.html#method_isSessionOwner): +You can check whether a user belongs to a collaboration session with [`SessionService::isSessionOwner()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceDecorator.html#method_isSessionOwner): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 113, 118) =]] @@ -97,7 +100,7 @@ If no user is provided, current user is used. ### Check session participant -You can check the participant of the collaboration session with [`SessionService::isSessionParticipant`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_isSessionParticipant): +You can check the participant of the collaboration session with [`SessionService::isSessionParticipant()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_isSessionParticipant): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 119, 124) =]] @@ -107,14 +110,14 @@ You can check the participant of the collaboration session with [`SessionService ### Manage invitation -You can get an invitation with [`InvitationService::getInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_getInvitation): +You can get an invitation with [`InvitationService::getInvitation()`](h/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_getInvitation): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 125, 134) =]] ``` -You can select the parameter that you can read from an invitation: +You can select the property that you can read from an invitation: - Invitation ID: @@ -142,7 +145,7 @@ You can select the parameter that you can read from an invitation: ### Create invitation -You can create new invitation for the collaborative session using the [`InvitationService::createInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_createInvitation) method: +You can create new invitation for the collaborative session using the [`InvitationService::createInvitation()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_createInvitation) method: ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 135, 142) =]] @@ -152,7 +155,7 @@ You can use it when auto-inviting participants is not enabled. ### Update invitation -You can update existing invitation with [`InvitationService::updateInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_updateInvitation): +You can update existing invitation with [`InvitationService::updateInvitation()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_updateInvitation): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 143, 148) =]] @@ -160,7 +163,7 @@ You can update existing invitation with [`InvitationService::updateInvitation`]( ### Delete invitation -You can delete an invitation with [`InvitationService::deleteInvitation`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_deleteInvitation): +You can delete an invitation with [`InvitationService::deleteInvitation()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_deleteInvitation): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 149, 152) =]] @@ -168,7 +171,7 @@ You can delete an invitation with [`InvitationService::deleteInvitation`](https: ### Find invitations -You can find an invitation with [`InvitationService::findInvitations`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_findInvitations). +You can find an invitation with [`InvitationService::findInvitations()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_findInvitations). To learn more about the available search options, see Search Criteria and Sort Clauses for Collaborative editing. diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 9618765b39..15c02235ee 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -52,25 +52,50 @@ The following setiings are available: ### Add tables to the database -To add the tables to the database, run the following commands: +First, add the tables to the database: +Create the `ibexa_share.sql` file that contains the following code: -``` bash -php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | mysql -u -p -php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u -p -``` +=== "MySQL" + + ``` sql + [[= include_file('code_samples/collaboration/config/mysql/ibexa_share.sql', 0, None, ' ') =]] + ``` + +=== "PostgreSQL" + + ``` sql + [[= include_file('code_samples/collaboration/config/postgresql/ibexa_share.sql', 0, None, ' ') =]] + ``` + +Then, run the following command, where `` is the same name that you defined when you [installed [[= product_name =]]](../getting_started/install_ibexa_dxp.md#change-installation-parameters): + +=== "MySQL" + + ``` sql + php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | mysql -u -p + php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u -p + ``` + +=== "PostgreSQL" + + ``` sql + php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | postgresql -u -p + php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | postgresql -u -p + ``` ### Modify the bundles file Then, if not using Symfony Flex, add the following code to the `config/bundles.php` file: ``` php - ['all' => true], Ibexa\Bundle\Share\IbexaShareBundle::class => ['all' => true], Ibexa\Bundle\FieldTypeRichTextRTE\IbexaFieldTypeRichTextRTEBundle::class => ['all' => true], + Ibexa\Bundle\CkeditorPremium\IbexaCkeditorPremiumBundle::class => [‘all’ => true], ]; ``` @@ -83,8 +108,6 @@ php bin/console ibexa:migrations:import vendor/ibexa/collaboration/src/bundle/Re 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/). - ### Security configurations After an installation process is finished, go to `config/packages/security.yaml` and make following changes: @@ -92,7 +115,9 @@ After an installation process is finished, go to `config/packages/security.yaml` - uncomment following lines with `shared` user provider under the `providers` key: ```yaml -providers: +security: + providers: + # ... shared: id: Ibexa\Collaboration\Security\User\ShareableLinkUserProvider ``` @@ -100,7 +125,9 @@ providers: - uncomment following lines under the `ibexa_shareable_link` key: ```yaml -ibexa_shareable_link: +security: + # ... + ibexa_shareable_link: request_matcher: Ibexa\Collaboration\Security\RequestMatcher\ShareableLinkRequestMatcher pattern: ^/ provider: shared @@ -108,4 +135,6 @@ ibexa_shareable_link: user_checker: Ibexa\Core\MVC\Symfony\Security\UserChecker guard: authenticator: Ibexa\Collaboration\Security\Authenticator\ShareableLinkAuthenticator -``` \ No newline at end of file +``` + +You can now restart you application and start working with the Collaborative editing feature. \ No newline at end of file From 6b42795afbb64ec87442dd5d7bfaef3360faae5c Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 1 Oct 2025 14:14:18 +0200 Subject: [PATCH 06/12] link fixed --- .../collaborative_editing/configure_collaborative_editing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 15c02235ee..76418a77f8 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -67,7 +67,7 @@ Create the `ibexa_share.sql` file that contains the following code: [[= include_file('code_samples/collaboration/config/postgresql/ibexa_share.sql', 0, None, ' ') =]] ``` -Then, run the following command, where `` is the same name that you defined when you [installed [[= product_name =]]](../getting_started/install_ibexa_dxp.md#change-installation-parameters): +Then, run the following command, where `` is the same name that you defined when you [installed](install_ibexa_dxp.md#change-installation-parameters) [[= product_name =]]: === "MySQL" From 7aa922d8f649f3fa58cea9e7bcee5358dc7f282b Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Thu, 2 Oct 2025 10:49:23 +0200 Subject: [PATCH 07/12] fixes after review --- .../configure_collaborative_editing.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 76418a77f8..245f559814 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -42,10 +42,10 @@ ibexa: public_link_enabled: ``` -The following setiings are available: +The following settings are available: - participants: - - `allowed_types` - defines allowed user types, values: `internal`, `external`, you can set one, both, or none of the values + - `allowed_types` - defines allowed user types, values: `internal`, `external`, you can set one or both of the values - `auto_invite` - determines whether invitations should be sent automatically when inviting someone to a session, default value: `true`, available values: `true`, `false` - session: - `public_link_enabled` - determines whether the public link is available, default value: `false`, available values: `true`, `false` @@ -69,19 +69,19 @@ Create the `ibexa_share.sql` file that contains the following code: Then, run the following command, where `` is the same name that you defined when you [installed](install_ibexa_dxp.md#change-installation-parameters) [[= product_name =]]: -=== "MySQL" +=== “MySQL” - ``` sql - php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | mysql -u -p - php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | mysql -u -p - ``` +```bash +mysql -u -p < ibexa_share.sql +``` -=== "PostgreSQL" +=== “PostgreSQL” - ``` sql - php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/collaboration/src/bundle/Resources/config/schema.yaml | postgresql -u -p - php bin/console ibexa:doctrine:schema:dump-sql vendor/ibexa/share/src/bundle/Resources/config/schema.yaml | postgresql -u -p - ``` +```bash +psql < ibexa_share.sql +``` + +This command modifies the existing database schema by adding database configuration required for using Collaborative editing. ### Modify the bundles file From 96171111a3356644bec15b1be6b5df1e70154a51 Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Tue, 14 Oct 2025 12:25:40 +0200 Subject: [PATCH 08/12] fixes --- .../collaborative_editing_api.md | 26 ------- .../configure_collaborative_editing.md | 70 ++++++++++--------- 2 files changed, 36 insertions(+), 60 deletions(-) diff --git a/docs/content_management/collaborative_editing/collaborative_editing_api.md b/docs/content_management/collaborative_editing/collaborative_editing_api.md index 1214a0d864..f0cd2af04a 100644 --- a/docs/content_management/collaborative_editing/collaborative_editing_api.md +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -117,32 +117,6 @@ You can get an invitation with [`InvitationService::getInvitation()`](h/api/php_ [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 125, 134) =]] ``` -You can select the property 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(); -``` - ### Create invitation You can create new invitation for the collaborative session using the [`InvitationService::createInvitation()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_createInvitation) method: diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 245f559814..54de04f7ab 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -7,7 +7,9 @@ month_change: true Collaborative editing feature is available in [[= product_name =]] starting with version v5.0.2 or higher, regardless of its edition. -## Install Real-time editing feature package +## Installation + +### Install Real-time editing feature package If you have an arrangements with [[= product_name_base =]] to use Real-time editing feature, you need to install following package: @@ -18,38 +20,6 @@ composer require ibexa/fieldtype-richtext-rte This command instals also `ibexa/ckeditor-premium` package and 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 - -Before you can start Collaborative editing feature, you must enable it by following these instructions. - -### Configuration - -You can configure Collaborative editing per [Repository](repository_configuration.md). - -Under `ibexa.repositories..collaboration` [configuration key](configuration.md#configuration-files), indicate the settings for collaboration: - -``` yaml -ibexa: - repositories: - : - collaboration: - participants: - allowed_types: - - internal - - external - auto_invite: - session: - public_link_enabled: -``` - -The following settings are available: - -- participants: - - `allowed_types` - defines allowed user types, values: `internal`, `external`, you can set one or both of the values - - `auto_invite` - determines whether invitations should be sent automatically when inviting someone to a session, default value: `true`, available values: `true`, `false` -- session: - - `public_link_enabled` - determines whether the public link is available, default value: `false`, available values: `true`, `false` - ### Add tables to the database First, add the tables to the database: @@ -108,7 +78,11 @@ php bin/console ibexa:migrations:import vendor/ibexa/collaboration/src/bundle/Re php bin/console ibexa:migrations:migrate --file=2025_08_26_10_14_shareable_user.yaml ``` -### Security configurations +## Configure Collaborative editing + +Before you can start Collaborative editing feature, you must enable it by following these instructions. + +### Security configuration After an installation process is finished, go to `config/packages/security.yaml` and make following changes: @@ -137,4 +111,32 @@ security: authenticator: Ibexa\Collaboration\Security\Authenticator\ShareableLinkAuthenticator ``` +### Configuration + +You can configure Collaborative editing per [Repository](repository_configuration.md). + +Under `ibexa.repositories..collaboration` [configuration key](configuration.md#configuration-files), indicate the settings for collaboration: + +``` yaml +ibexa: + repositories: + : + collaboration: + participants: + allowed_types: + - internal + - external + auto_invite: + session: + public_link_enabled: +``` + +The following settings are available: + +- participants: + - `allowed_types` - defines allowed user types, values: `internal`, `external`, you can set one or both of the values + - `auto_invite` - determines whether invitations should be sent automatically when inviting someone to a session, default value: `true`, available values: `true`, `false` +- session: + - `public_link_enabled` - determines whether the public link is available, default value: `false`, available values: `true`, `false` + You can now restart you application and start working with the Collaborative editing feature. \ No newline at end of file From 18d900cf0271bcb5c6b9645fd9275187ca74c402 Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Tue, 14 Oct 2025 12:47:12 +0200 Subject: [PATCH 09/12] links fixed --- .../collaborative_editing/collaborative_editing_api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content_management/collaborative_editing/collaborative_editing_api.md b/docs/content_management/collaborative_editing/collaborative_editing_api.md index f0cd2af04a..c8dec678bb 100644 --- a/docs/content_management/collaborative_editing/collaborative_editing_api.md +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -54,7 +54,7 @@ You can update existing invitation with [`SessionService::updateSession()`](/api ### Delete session -You can delete session with [`SessionService::deleteSession()`](h/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): +You can delete session with [`SessionService::deleteSession()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-SessionServiceInterface.html#method_deleteSession): ``` php [[= include_file('code_samples/collaboration/src/Command/ManageSessionsCommand.php', 153, 154) =]] @@ -110,7 +110,7 @@ You can check the participant of the collaboration session with [`SessionService ### Manage invitation -You can get an invitation with [`InvitationService::getInvitation()`](h/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_getInvitation): +You can get an invitation with [`InvitationService::getInvitation()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Collaboration-InvitationServiceInterface.html#method_getInvitation): ``` php From 15f39f4bad5d754451c70542420062f2042bb0af Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 15 Oct 2025 11:28:15 +0200 Subject: [PATCH 10/12] fixes in sql files, configuration updated --- .../collaboration/config/mysql/ibexa_share.sql | 6 +++--- .../config/postgresql/ibexa_share.sql | 6 +++--- .../configure_collaborative_editing.md | 17 +++-------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/code_samples/collaboration/config/mysql/ibexa_share.sql b/code_samples/collaboration/config/mysql/ibexa_share.sql index a4a367436f..a2af45f670 100644 --- a/code_samples/collaboration/config/mysql/ibexa_share.sql +++ b/code_samples/collaboration/config/mysql/ibexa_share.sql @@ -65,13 +65,13 @@ CREATE TABLE ibexa_collaboration_invitation 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; + ADD CONSTRAINT ibexa_collaboration_owner_id_fk FOREIGN KEY (owner_id) REFERENCES ibexa_user (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; + ADD CONSTRAINT ibexa_collaboration_participant_internal_user_id_fk FOREIGN KEY (user_id) REFERENCES ibexa_user (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 @@ -79,4 +79,4 @@ ALTER TABLE ibexa_collaboration_invitation 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; \ No newline at end of file + ADD CONSTRAINT ibexa_collaboration_invitation_sender_id_fk FOREIGN KEY (sender_id) REFERENCES ibexa_user (contentobject_id) ON DELETE RESTRICT; \ No newline at end of file diff --git a/code_samples/collaboration/config/postgresql/ibexa_share.sql b/code_samples/collaboration/config/postgresql/ibexa_share.sql index fc860430c8..ef98000160 100644 --- a/code_samples/collaboration/config/postgresql/ibexa_share.sql +++ b/code_samples/collaboration/config/postgresql/ibexa_share.sql @@ -67,13 +67,13 @@ ON COLUMN ibexa_collaboration_invitation.created_at IS '(DC2Type:datetimetz_immu 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; + ADD CONSTRAINT ibexa_collaboration_owner_id_fk FOREIGN KEY (owner_id) REFERENCES ibexa_user (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; + ADD CONSTRAINT ibexa_collaboration_participant_internal_user_id_fk FOREIGN KEY (user_id) REFERENCES ibexa_user (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 @@ -81,4 +81,4 @@ ALTER TABLE ibexa_collaboration_invitation 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; \ No newline at end of file + ADD CONSTRAINT ibexa_collaboration_invitation_sender_id_fk FOREIGN KEY (sender_id) REFERENCES ibexa_user (contentobject_id) ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE; \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 54de04f7ab..06416a6f80 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -17,7 +17,7 @@ If you have an arrangements with [[= product_name_base =]] to use Real-time edit composer require ibexa/fieldtype-richtext-rte ``` -This command instals also `ibexa/ckeditor-premium` package and adds the new real-time editing functionality to the Rich Text field type. +This command installs also `ibexa/ckeditor-premium` package and 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. ### Add tables to the database @@ -62,22 +62,11 @@ Then, if not using Symfony Flex, add the following code to the `config/bundles.p 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], Ibexa\Bundle\CkeditorPremium\IbexaCkeditorPremiumBundle::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 -php bin/console ibexa:migrations:migrate --file=2025_08_26_10_14_shareable_user.yaml -``` - ## Configure Collaborative editing Before you can start Collaborative editing feature, you must enable it by following these instructions. @@ -107,8 +96,8 @@ security: provider: shared stateless: true user_checker: Ibexa\Core\MVC\Symfony\Security\UserChecker - guard: - authenticator: Ibexa\Collaboration\Security\Authenticator\ShareableLinkAuthenticator + custom_authenticators: + - Ibexa\Collaboration\Security\Authenticator\ShareableLinkAuthenticator ``` ### Configuration From 3f716303c4b6e1e89dd033b3b9b4ab535c5f918a Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Wed, 15 Oct 2025 11:45:52 +0200 Subject: [PATCH 11/12] sql files removed --- .../config/mysql/ibexa_share.sql | 82 ------------------ .../config/postgresql/ibexa_share.sql | 84 ------------------- .../configure_collaborative_editing.md | 33 -------- 3 files changed, 199 deletions(-) delete mode 100644 code_samples/collaboration/config/mysql/ibexa_share.sql delete mode 100644 code_samples/collaboration/config/postgresql/ibexa_share.sql diff --git a/code_samples/collaboration/config/mysql/ibexa_share.sql b/code_samples/collaboration/config/mysql/ibexa_share.sql deleted file mode 100644 index a2af45f670..0000000000 --- a/code_samples/collaboration/config/mysql/ibexa_share.sql +++ /dev/null @@ -1,82 +0,0 @@ -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 ibexa_user (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 ibexa_user (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 ibexa_user (contentobject_id) ON DELETE RESTRICT; \ No newline at end of file diff --git a/code_samples/collaboration/config/postgresql/ibexa_share.sql b/code_samples/collaboration/config/postgresql/ibexa_share.sql deleted file mode 100644 index ef98000160..0000000000 --- a/code_samples/collaboration/config/postgresql/ibexa_share.sql +++ /dev/null @@ -1,84 +0,0 @@ -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 ibexa_user (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 ibexa_user (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 ibexa_user (contentobject_id) ON DELETE RESTRICT NOT DEFERRABLE INITIALLY IMMEDIATE; \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index 06416a6f80..ab01124189 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -20,39 +20,6 @@ composer require ibexa/fieldtype-richtext-rte This command installs also `ibexa/ckeditor-premium` package and 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. -### Add tables to the database - -First, add the tables to the database: -Create the `ibexa_share.sql` file that contains the following code: - -=== "MySQL" - - ``` sql - [[= include_file('code_samples/collaboration/config/mysql/ibexa_share.sql', 0, None, ' ') =]] - ``` - -=== "PostgreSQL" - - ``` sql - [[= include_file('code_samples/collaboration/config/postgresql/ibexa_share.sql', 0, None, ' ') =]] - ``` - -Then, run the following command, where `` is the same name that you defined when you [installed](install_ibexa_dxp.md#change-installation-parameters) [[= product_name =]]: - -=== “MySQL” - -```bash -mysql -u -p < ibexa_share.sql -``` - -=== “PostgreSQL” - -```bash -psql < ibexa_share.sql -``` - -This command modifies the existing database schema by adding database configuration required for using Collaborative editing. - ### Modify the bundles file Then, if not using Symfony Flex, add the following code to the `config/bundles.php` file: From b3bdbba8c1b55410b59e1b10e61ea2148cfc9e9f Mon Sep 17 00:00:00 2001 From: julitafalcondusza Date: Thu, 16 Oct 2025 10:44:19 +0200 Subject: [PATCH 12/12] fixes --- .../collaborative_editing/configure_collaborative_editing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content_management/collaborative_editing/configure_collaborative_editing.md b/docs/content_management/collaborative_editing/configure_collaborative_editing.md index ab01124189..1e3094673e 100644 --- a/docs/content_management/collaborative_editing/configure_collaborative_editing.md +++ b/docs/content_management/collaborative_editing/configure_collaborative_editing.md @@ -30,7 +30,7 @@ Then, if not using Symfony Flex, add the following code to the `config/bundles.p return [ // A lot of bundles… Ibexa\Bundle\FieldTypeRichTextRTE\IbexaFieldTypeRichTextRTEBundle::class => ['all' => true], - Ibexa\Bundle\CkeditorPremium\IbexaCkeditorPremiumBundle::class => [‘all’ => true], + Ibexa\Bundle\CkeditorPremium\IbexaCkeditorPremiumBundle::class => ['all' => true], ]; ```