diff --git a/docs/api/event_reference/collaboration_events.md b/docs/api/event_reference/collaboration_events.md new file mode 100644 index 0000000000..5747e1a226 --- /dev/null +++ b/docs/api/event_reference/collaboration_events.md @@ -0,0 +1,40 @@ +--- +description: Events that are triggered when working with collaborative editing feature. +page_type: reference +month_change: false +--- + +# Collaboration events + +## Invitation events + +| Event | Dispatched by | +|---|---| +|[BeforeCreateInvitationEvent](../php_api/php_api_reference/classes/)|[InvitationServicenterface](../php_api/php_api_reference/classes/.html)| +|[BeforeDeleteInvitationEvent](../php_api/php_api_reference/classes/)|[InvitationServicenterface](../php_api/php_api_reference/classes/.html)| +|[BeforeUpdateInvitationEvent](../php_api/php_api_reference/classes/)|[[InvitationServicenterface](../php_api/php_api_reference/classes/.html)| +|[CreateInvitationEvent](../php_api/php_api_reference/classes/)|[InvitationServiceInterface](../php_api/php_api_reference/classes/.html)| +|[DeleteInvitationEvent](../php_api/php_api_reference/classes/)|[InvitationServiceInterface](../php_api/php_api_reference/classes/.html)| +|[UpdateInvitationEvent](../php_api/php_api_reference/classes/)|[InvitationServiceInterface](../php_api/php_api_reference/classes/.html)| + +## Participant events + +| Event | Dispatched by | +|---|---| +|[AddParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[BeforeAddParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[BeforeRemoveParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[BeforeUpdateParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[RemoveParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[UpdateParticipantEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| + +## Session events + +| Event | Dispatched by | +|---|---|---| +|[BeforeCreateSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[BeforeDeleteSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[BeforeUpdateSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[CreateSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[DeleteSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| +|[UpdateSessionEvent](../php_api/php_api_reference/classes/)|[SessionServiceInterface](../php_api/php_api_reference/classes/.html)| \ 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 new file mode 100644 index 0000000000..ddff28b3be --- /dev/null +++ b/docs/content_management/collaborative_editing/collaborative_editing.md @@ -0,0 +1,19 @@ +--- +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 LTS multiple users can work on the same content created in [[= product_name =]] simultaneously. +They can collaborate and use a real-time editor to write and review content in a live mode thanks to CKEditor. + +You can also extend this feature to adjust it to your needs. + +[[= cards([ +"content_management/collaborative_editing/collaborative_editing", +"content_management/collaborative_editing/collaborative_editing_api", +"content_management/collaborative_editing/invitation_api", +"content_management/collaborative_editing/session_api" +], columns=4) =]] 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..c08f2838bc --- /dev/null +++ b/docs/content_management/collaborative_editing/collaborative_editing_api.md @@ -0,0 +1,56 @@ +--- +description: Use PHP API to manage invitations and sessions while using collaborative editing feature. +month_change: false +--- + +# Collaborative editing API + +[[= product_name =]]'s Collaborative editing API provides two services for managing sessions and invitations, which differ in function: + +- [`InvitationServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-InvitationServiceInterface.html) is used to request product data +- [`SessionServiceInterface`](../api/php_api/php_api_reference/classes/Ibexa-Contracts-(?)-SessionServiceInterface.html) is used to modify products + +``` php + +/** + * @copyright Copyright (C) Ibexa AS. All rights reserved. + * @license For full copyright and license information view LICENSE file distributed with this source code. + */ +declare(strict_types=1); + +namespace Ibexa\Tests\Integration\Collaboration; + +use DateTimeImmutable; +use Ibexa\Contracts\Collaboration\Invitation\InvitationCreateStruct; +use Ibexa\Contracts\Collaboration\Invitation\InvitationInterface; +use Ibexa\Contracts\Collaboration\Invitation\InvitationQuery; +use Ibexa\Contracts\Collaboration\Invitation\InvitationStatus; +use Ibexa\Contracts\Collaboration\Invitation\InvitationUpdateStruct; +use Ibexa\Contracts\Collaboration\Invitation\Query\Criterion; +use Ibexa\Contracts\Collaboration\Invitation\Query\SortClause; +use Ibexa\Contracts\Collaboration\InvitationServiceInterface; +use Ibexa\Contracts\Collaboration\SessionServiceInterface; +use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; +use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; +use Ibexa\Contracts\Core\Test\IbexaKernelTestTrait; +use Ibexa\Contracts\CoreSearch\Values\Query\SortDirection; +use Ibexa\Contracts\Test\Core\IbexaKernelTestCase; + +final class InvitationServiceTest extends IbexaKernelTestCase +{ + use IbexaKernelTestTrait; + + private const EXAMPLE_SESSION_ID = 1; + private const EXAMPLE_INVITATION_ID = 1; + private const EXAMPLE_PARTICIPANT_ID = 1; + + private const EXAMPLE_INVITATION_A = 1; + private const EXAMPLE_INVITATION_B = 2; + private const EXAMPLE_INVITATION_C = 3; + + protected function setUp(): void + { + self::bootKernel(); + self::setAdministratorUser(); + } +``` \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/extend_collaborative_editing.md b/docs/content_management/collaborative_editing/extend_collaborative_editing.md new file mode 100644 index 0000000000..ce47649cf8 --- /dev/null +++ b/docs/content_management/collaborative_editing/extend_collaborative_editing.md @@ -0,0 +1,14 @@ +--- +description: Extend Collaborative editing feature by creating custom session or participant type. +month_change: false +--- + +# Extend Collaborative editing + +## Custom Session Type use case + +### Create custom Session Type + +## Custom Participant Type use case + +### Create custom Participant Type \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/install_collaborative_editing.md b/docs/content_management/collaborative_editing/install_collaborative_editing.md new file mode 100644 index 0000000000..6401eb8ca6 --- /dev/null +++ b/docs/content_management/collaborative_editing/install_collaborative_editing.md @@ -0,0 +1,52 @@ +--- +description: Install the Collaborative editing LTS update. +month_change: false +--- + +# Install Collaborative editing + +Collaborative editing feature is available as an LTS update to [[= product_name =]] starting with version v5.0 or higher, regardless of its edition. +To use this feature you must first install the packages and configure them. + +## Install packages + +Run the following commands to install the packages: + +``` bash +composer require ibexa/collaboration +composer require ibexa/share +composer require ibexa/fieldtype-richtext-rte +``` + +This command adds the new real-time editing functionality to the Rich Text field type. +It also modifies the permission system to account for the new functionality. + +## Configure Collaborative editing + +Once the packages are installed, before you can start Collaborative editing feature, you must enable it by following these instructions. + +### Add tables to the database + +To add the tables to the database, run the following command: + +``` 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, in the `config/bundles.php` file, add the following code: + +``` php + ['all' => true], + Ibexa\Bundle\Share\IbexaShareBundle::class => ['all' => true], + Ibexa\Bundle\FieldTypeRichTextRTE\IbexaFieldTypeRichTextRTEBundle::class => ['all' => true], +]; +``` + +You can now restart you application and start [working with the Collaborative editing feature]([[= user_doc =]]/content_management/collaborative_editing/work_with_collaborative_editing/). \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/invitation_api.md b/docs/content_management/collaborative_editing/invitation_api.md new file mode 100644 index 0000000000..85ffb6ac9d --- /dev/null +++ b/docs/content_management/collaborative_editing/invitation_api.md @@ -0,0 +1,96 @@ +--- +description: You can use the PHP API to create new invitation, update existing one, read or delete it. +--- + +# Invitation API + +[`InvitationService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html) enables you to read, add, update, and remove invitation for collaborative editing session. + +## Create invitation + +You can create new invitation for the collaborative session using the [`InvitationService::createInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_createInvitation) method: + +``` php +{ + $session = self::getSessionService()->getSession(self::EXAMPLE_SESSION_ID); + $participant = $session->getParticipants()->getById(self::EXAMPLE_PARTICIPANT_ID); + + $createStruct = new InvitationCreateStruct($session, $participant); + $createStruct->setContext([ + 'message' => 'Hello, would you like to join my session?', + ]); + + $invitation = $this->getInvitationService()->createInvitation($createStruct); + + self::assertEquals(InvitationStatus::STATUS_PENDING, $invitation->getStatus()); + self::assertEquals([ + 'message' => 'Hello, would you like to join my session?', + ], $invitation->getContext()); +} +``` + +## Read invitation + +You can read an invitation with [`InvitationService::getInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation): + +``` php + $this->getInvitationService()->getInvitation(self::EXAMPLE_INVITATION_ID); +``` + +You can select the parameter that you can read from an invitaion: + +- Invitation ID: + +``` php + self::assertEquals(self::EXAMPLE_INVITATION_ID, $invitation->getId()); +``` + +- Session ID: + +``` php + self::assertEquals(self::EXAMPLE_SESSION_ID, $invitation->getSession()->getId()); +``` + +- Participant ID: + +``` php + self::assertEquals(self::EXAMPLE_PARTICIPANT_ID, $invitation->getParticipant()->getId()); +``` + +- Invitation status: + +``` php + self::assertEquals(InvitationStatus::STATUS_PENDING, $invitation->getStatus()); +``` + +## Find invitation + +You can find an invitation with [`InvitationService::findInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation) by: + +- Invitation ID: + +``` php +[[= include_file('code_samples/api/public_php_api/src/Command/(?).php', , ) =]] +``` + +- Session ID: + +- Participant ID: + +- Invitation status: + +## Update invitation + +You can update existing invitation with [`InvitationService::deleteInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation): + +``` php +$invitation = $this->getInvitationService()->getInvitation(self::EXAMPLE_INVITATION_ID); +``` + +## Delete invitation + +You can delete an invitation with [`InvitationService::deleteInvitation`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-InvitationService.html#method_deleteInvitation): + +``` php + $this->getInvitationService()->deleteInvitation($invitation); +``` \ No newline at end of file diff --git a/docs/content_management/collaborative_editing/session_api.md b/docs/content_management/collaborative_editing/session_api.md new file mode 100644 index 0000000000..72ba3551bd --- /dev/null +++ b/docs/content_management/collaborative_editing/session_api.md @@ -0,0 +1,93 @@ +--- +description: You can use the PHP API to create new session, update existing one, find or delete it, and add or remove participants. +--- + +# Session API + +[`SessionService`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html) enables you work with the collaborative session, for example, create a new one, update or delete existing one, and add or remove new participants to join collaborative session. + +## Create session + +You can create new collaboration session with given id with [`SessionService::createSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_createSession): + +``` php + $this->innerService->createSession($createStruct); +``` +## Get session + +You can return existing collaboration session with [`SessionService::getSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_getSession): + +- using given id: + +``` php + $this->innerService->getSession($id); +``` + +- using given token: + +``` php + $this->innerService->getSessionByToken($token); +``` + +- matching the given query: + +``` php + $this->innerService->findSessions($query); +``` + +## Find session + +You can find an existing session with [`SessionService::findSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_findSession) by: + +``` php + $this->innerService->findSessions($query); +``` + +## Update session + +You can update existing invitation with [`SessionService::updateSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_updateSession): + +``` php + $this->innerService->updateSession($session, $updateStruct); +``` + +## Delete session + +You can delete session with [`SessionService::deleteSession`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_deleteSession): + +``` php + $this->innerService->deleteSession($session); +``` + +# Participant API + +## Add participant + +You can add participant to the collaboration session with [`SessionService::addParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_addParticipant): + +``` php + $this->innerService->addParticipant($session, $createStruct); +``` + +## Update participant + +You can update participant added to the collaboration session with [`SessionService::updateParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_updateParticipant): + +``` php + $this->innerService->updateParticipant($session, $participant, $updateStruct); +``` +## Remove participant + +You can remove participant from the collaboration session with [`SessionService::removeParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_removeParticipant): + +``` php + $this->innerService->removeParticipant($session, $participant); +``` + +## Check session Owner + +You can check the Owner of the collaboration session with [`SessionService::removeParticipant`](../../api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-SessionService.html#method_removeParticipant): + +``` php + $this->innerService->isSessionOwner($session, $user); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/content_id_criterion.md b/docs/search/collaborative_editing_search_reference/content_id_criterion.md new file mode 100644 index 0000000000..781467d58a --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/content_id_criterion.md @@ -0,0 +1,19 @@ +# ContentID Criterion + +The `ContentID` Search Criterion searches for content sessions based on content item ID. + +## Arguments + +- `value` - integer(s) representing the content item id(s) + +## Example + +```php +$criteria = new Ibexa\Share\Session\Query\Criterion\ContentId(1); + +OR + +$criteria = new Ibexa\Share\Session\Query\Criterion\ContentId([1, 2]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/content_session_criterion.md b/docs/search/collaborative_editing_search_reference/content_session_criterion.md new file mode 100644 index 0000000000..36c6bdd83a --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/content_session_criterion.md @@ -0,0 +1,22 @@ +# ContentSession Criterion + +The `ContentSession` Search Criterion searches for contentId, versionNo, languageId. + +## Arguments + +- `contentId` - integer representing content item ID +- `versionNo` - integer representing version number +- `languageId` - integer representing language ID + +## Example + +```php +$criteria = new Ibexa\Share\Session\Query\Criterion\ContentSession(1, 2, 3); + +OR + +$versionInfo = $this->contentService->loadVersionInfoById(1); +$criteria = new Ibexa\Share\Session\Query\Criterion\ContentSession::fromVersionInfo($versionInfo); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/created_at_criterion.md b/docs/search/collaborative_editing_search_reference/created_at_criterion.md new file mode 100644 index 0000000000..db7b908c95 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/created_at_criterion.md @@ -0,0 +1,19 @@ +# CreatedAt Criterion + +The `CreatedAtCriterion` Search Criterion searches for sessions based on the date when they were created. + +## Arguments + +- `value` - date to be matched, provided as a DateTimeInterface object +- `operator` - optional operator string (EQ, GT, GTE, LT, LTE) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\CreatedAt( + new DateTime('2025-05-01 14:07:02'), + 'GTE' +); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/email_criterion.md b/docs/search/collaborative_editing_search_reference/email_criterion.md new file mode 100644 index 0000000000..57e3b806dc --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/email_criterion.md @@ -0,0 +1,19 @@ +# Email Criterion + +The `Email` Search Criterion searches for sessions based on participant email. + +## Arguments + +- `value` - string(s) representing the Participant email(s) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Email('participant@link.invalid'); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Email(['participant1@link.invalid', 'participant2@link.invalid']); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/id_criterion.md b/docs/search/collaborative_editing_search_reference/id_criterion.md new file mode 100644 index 0000000000..1b4152c7c4 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/id_criterion.md @@ -0,0 +1,19 @@ +# ID Criterion + +The `ID` Search Criterion searches for sessions based on session ID. + +## Arguments + +- `value` - integer(s) representing the Session id(s) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Id(1); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Id([1, 2]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/is_active_criterion.md b/docs/search/collaborative_editing_search_reference/is_active_criterion.md new file mode 100644 index 0000000000..c2e8a5a1a3 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/is_active_criterion.md @@ -0,0 +1,19 @@ +# IsActive Criterion + +The `IsActive` Search Criterion searches for sessions based on active status. + +## Arguments + +- (optional) `value` - bool representing the whether to search for active (default true) or inactive (false) sessions. + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\IsActive(); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\IsActive(false); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/language_id_criterion.md b/docs/search/collaborative_editing_search_reference/language_id_criterion.md new file mode 100644 index 0000000000..bdde8d9a25 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/language_id_criterion.md @@ -0,0 +1,19 @@ +# LanguageID Criterion + +The `LanguageID` Search Criterion searches for content sessions based on language ID of content item. + +## Arguments + +- `value` - integer(s) representing language id(s) + +## Example + +```php +$criteria = new Ibexa\Share\Session\Query\Criterion\LanguageId(1); + +OR + +$criteria = new Ibexa\Share\Session\Query\Criterion\LanguageId([1, 2]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/logical_and_criterion.md b/docs/search/collaborative_editing_search_reference/logical_and_criterion.md new file mode 100644 index 0000000000..3a14381f3c --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/logical_and_criterion.md @@ -0,0 +1,14 @@ +# LogicalAnd Criterion + +The `LogicalAnd` Search Criterion matches combined by the logical operator. + +## Example + +```php +$criteria = Ibexa\Contracts\Collaboration\Session\Query\Criterion\LogicalAnd( + new Ibexa\Contracts\Collaboration\Session\Query\Criterion\IsActive(), + new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Type('content') +); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/logical_or_criterion.md b/docs/search/collaborative_editing_search_reference/logical_or_criterion.md new file mode 100644 index 0000000000..1bafe11a68 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/logical_or_criterion.md @@ -0,0 +1,14 @@ +# LogicalOr Criterion + +The `LogicalOr` Search Criterion matches combined by the logical operator. + +## Example + +```php +$criteria = Ibexa\Contracts\Collaboration\Session\Query\Criterion\LogicalOr( , + new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Id(1), + new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Token('12345-12345-12345-12345') +); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/owner_criterion.md b/docs/search/collaborative_editing_search_reference/owner_criterion.md new file mode 100644 index 0000000000..7d4a6ed56c --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/owner_criterion.md @@ -0,0 +1,22 @@ +# Owner Criterion + +The `Owner` Search Criterion searches for sessions based on session Owner. + +## Arguments + +- `value` - user(s) to be matched, provided as a UserReference object + +## Example + +```php +$user = $this->userService->loadUserByLogin('foo'); +$currentUser = $this->permissionResolver->getCurrentUserReference(); + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Owner($user); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Owner([$user, $currentUser]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/token_criterion.md b/docs/search/collaborative_editing_search_reference/token_criterion.md new file mode 100644 index 0000000000..f4a32d6168 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/token_criterion.md @@ -0,0 +1,19 @@ +# Token Criterion + +The `Token` Search Criterion searches for sessions based on session token. + +## Arguments + +- `value` - string(s) representing the session token(s) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Token('12345-12345-12345-12345-12345'); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Token(['12345-12345-12345-12345-12345', '12345-67890-098765-54321-12345']); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/type_criterion.md b/docs/search/collaborative_editing_search_reference/type_criterion.md new file mode 100644 index 0000000000..526affb2de --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/type_criterion.md @@ -0,0 +1,19 @@ +# Type Criterion + +The `Type` Search Criterion searches for sessions based on session type. + +## Arguments + +- `value` - string(s) representing the session type(s) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Type('content'); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\Type(['content', 'product']); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/updated_at_criterion.md b/docs/search/collaborative_editing_search_reference/updated_at_criterion.md new file mode 100644 index 0000000000..38085ea451 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/updated_at_criterion.md @@ -0,0 +1,19 @@ +# UpdatedAt Criterion + +The `UpdatedAt` Search Criterion searches for sessions based on the date when they were updated. + +## Arguments + +- `value` - date to be matched, provided as a DateTimeInterface object +- `operator` - optional operator string (EQ, GT, GTE, LT, LTE) + +## Example + +```php +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\UpdatedAt( + new DateTime('2025-05-01 14:07:02'), + 'GTE' +); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/user_id_criterion.md b/docs/search/collaborative_editing_search_reference/user_id_criterion.md new file mode 100644 index 0000000000..56d2b58e1d --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/user_id_criterion.md @@ -0,0 +1,22 @@ +# UserID Criterion + +The `UserID` Search Criterion searches for sessions based on internal participants. + +## Arguments + +- `value` - user(s) to be matched, provided as a UserReference object + +## Example + +```php +$user = $this->userService->loadUserByLogin('foo'); +$currentUser = $this->permissionResolver->getCurrentUserReference(); + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\UserId($user); + +OR + +$criteria = new Ibexa\Contracts\Collaboration\Session\Query\Criterion\UserId([$user, $currentUser]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/docs/search/collaborative_editing_search_reference/version_no_criterion.md b/docs/search/collaborative_editing_search_reference/version_no_criterion.md new file mode 100644 index 0000000000..3cab93e278 --- /dev/null +++ b/docs/search/collaborative_editing_search_reference/version_no_criterion.md @@ -0,0 +1,19 @@ +# VersionNo Criterion + +The `VersionNo` Search Criterion searches for content sessions based on version number of content item. + +## Arguments + +- `value` - integer(s) representing version number(s) + +## Example + +```php +$criteria = new Ibexa\Share\Session\Query\Criterion\VersionNo(1); + +OR + +$criteria = new Ibexa\Share\Session\Query\Criterion\VersionNo([1, 2]); + +$query = new SessionQuery($criteria); +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 264c8307ed..70851670fe 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -274,6 +274,11 @@ nav: - Time field type: content_management/field_types/field_type_reference/timefield.md - 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 API: content_management/collaborative_editing/collaborative_editing_api.md + - Invitation API: content_management/collaborative_editing/invitation_api.md + - Session API: content_management/collaborative_editing/session_api.md - Templating: - Templating: templating/templating.md - Render content: