diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst index 3e040c9b6..0f5bb2708 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst @@ -101,16 +101,106 @@ If you want to support Nextcloud 27 and Nextcloud 28: Added events ^^^^^^^^^^^^ -* ``\OCP\DB\Events\AddMissingIndicesEvent`` to add missing indices to the database schema. +* Typed event ``OCA\DAV\Events\SabrePluginAddEvent`` was added +* Typed event ``OCP\Accounts\UserUpdatedEvent`` was added +* Typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengeFailed`` was added +* Typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed`` was added +* Typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered`` was added +* Typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered`` was added +* Typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderUserDeleted`` was added +* Typed event ``OCP\Comments\CommentsEntityEvent`` was added +* Typed event ``OCP\DB\Events\AddMissingColumnsEvent`` to add missing indices to the database schema. +* Typed event ``OCP\DB\Events\AddMissingIndicesEvent`` to add missing indices to the database schema. +* Typed event ``OCP\DB\Events\AddMissingPrimaryKeyEvent`` to add missing indices to the database schema. +* Typed event ``OCP\Files\Events\NodeAddedToFavorite`` was added +* Typed event ``OCP\Files\Events\NodeRemovedFromFavorite`` was added +* Typed event ``OCP\Share\Events\BeforeShareCreatedEvent`` was added +* Typed event ``OCP\Share\Events\BeforeShareDeletedEvent`` was added +* Typed event ``OCP\Share\Events\ShareAcceptedEvent`` was added +* Typed event ``OCP\Share\Events\ShareDeletedFromSelfEvent`` was added +* Typed event ``OCP\SystemTag\SystemTagsEntityEvent`` was added +* Typed event ``OCP\User\Events\UserFirstTimeLoggedInEvent`` was added Deprecated events ^^^^^^^^^^^^^^^^^ +* ``OC\Console\Application::run`` was deprecated. Listen to the typed event ``OCP\Console\ConsoleEvent`` instead +* ``OCA\DAV\Connector\Sabre::addPlugin`` was deprecated. Listen to the typed event ``OCA\DAV\Events\SabrePluginAddEvent`` instead * ``OCA\Files_Trashbin::moveToTrash`` was deprecated. Listen to the typed event ``OCA\Files_Trashbin\Events\MoveToTrashEvent`` instead +* ``OCA\Files_Trashbin::moveToTrash`` was deprecated. Listen to the typed event ``OCA\Files_Trashbin\Events\MoveToTrashEvent`` instead +* ``OCP\Console\ConsoleEvent::EVENT_RUN`` was deprecated. Listen to the typed event ``OCP\Console\ConsoleEvent`` instead +* ``OCP\Authentication\TwoFactorAuth\RegistryEvent`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered`` and ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered`` instead +* ``OCP\Authentication\TwoFactorAuth\IRegistry::enable`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered`` instead +* ``OCP\Authentication\TwoFactorAuth\IRegistry::disable`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered`` instead +* ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderDisabled`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderUserDeleted`` instead +* ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserDisabled`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengeFailed`` instead +* ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserEnabled`` was deprecated. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed`` instead +* ``OCP\Comments\CommentsEntityEvent::EVENT_ENTITY`` was deprecated. Listen to the typed event ``OCP\Comments\CommentsEntityEvent`` instead +* ``OCP\Comments\ICommentsManager::registerEntity`` was deprecated. Listen to the typed event ``OCP\Comments\CommentsEntityEvent`` instead +* ``OCP\SystemTag\ISystemTagManager::registerEntity`` was deprecated. Listen to the typed event ``OCP\SystemTag\SystemTagsEntityEvent`` instead +* ``OCP\SystemTag\SystemTagsEntityEvent::EVENT_ENTITY`` was deprecated. Listen to the typed event ``OCP\SystemTag\SystemTagsEntityEvent`` instead +* ``OCP\IUser::firstLogin`` was deprecated. Listen to the typed event ``OCP\User\Events\UserFirstTimeLoggedInEvent`` instead Removed events ^^^^^^^^^^^^^^ +* ``OC\AccountManager::userUpdated`` was removed. Listen to the typed event ``OCP\Accounts\UserUpdatedEvent`` instead +* ``OCA\Files::loadAdditionalScripts`` was removed. Listen to the typed event ``OCA\Files\Event\LoadAdditionalScriptsEvent`` instead +* ``OCA\Files\Service\TagService::addFavorite`` was removed. Listen to the typed event ``OCP\Files\Events\NodeAddedToFavorite`` instead +* ``OCA\Files\Service\TagService::removeFavorite`` was removed. Listen to the typed event ``OCP\Files\Events\NodeRemovedFromFavorite`` instead +* ``OCA\Files_Sharing::loadAdditionalScripts`` was removed. Listen to the typed event ``OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent`` instead +* ``OCP\AppFramework\Http\TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS`` (deprecated since 20) was removed. Listen to the typed event ``OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent`` instead +* ``OCP\AppFramework\Http\TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN`` (deprecated since 20) was removed. Listen to the typed event ``OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent`` instead +* ``OCP\AppFramework\Http\TemplateResponse::loadAdditionalScripts`` (deprecated since 20) was removed. Listen to the typed event ``OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent`` instead +* ``OCP\AppFramework\Http\TemplateResponse::loadAdditionalScriptsLoggedIn`` (deprecated since 20) was removed. Listen to the typed event ``OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent`` instead +* ``OCP\Authentication\TwoFactorAuth\IProvider::EVENT_SUCCESS`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed`` instead +* ``OCP\Authentication\TwoFactorAuth\IProvider::EVENT_FAILED`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengeFailed`` instead +* ``OCP\Authentication\TwoFactorAuth\IProvider::failed`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengeFailed`` instead +* ``OCP\Authentication\TwoFactorAuth\IProvider::success`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed`` instead +* ``OCP\IDBConnection::ADD_MISSING_COLUMNS`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingColumnsEvent`` instead +* ``OCP\IDBConnection::ADD_MISSING_INDEXES`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingIndicesEvent`` instead +* ``OCP\IDBConnection::ADD_MISSING_PRIMARY_KEYS`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingPrimaryKeyEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_COLUMNS`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingColumnsEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_COLUMNS_EVENT`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingColumnsEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_INDEXES`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingIndicesEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_INDEXES_EVENT`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingIndicesEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_PRIMARY_KEYS`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingPrimaryKeyEvent`` instead +* ``OCP\IDBConnection::CHECK_MISSING_PRIMARY_KEYS_EVENT`` (deprecated since 22) was removed. Listen to the typed event ``OCP\DB\Events\AddMissingPrimaryKeyEvent`` instead +* ``OCP\IGroup::postAddUser`` was removed. Listen to the typed event ``OCP\Group\Events\UserAddedEvent`` instead +* ``OCP\IGroup::postDelete`` was removed. Listen to the typed event ``OCP\Group\Events\GroupDeletedEvent`` instead +* ``OCP\IGroup::postRemoveUser`` was removed. Listen to the typed event ``OCP\Group\Events\UserRemovedEvent`` instead +* ``OCP\IGroup::preAddUser`` was removed. Listen to the typed event ``OCP\Group\Events\BeforeUserAddedEvent`` instead +* ``OCP\IGroup::preDelete`` was removed. Listen to the typed event ``OCP\Group\Events\BeforeGroupDeletedEvent`` instead +* ``OCP\IGroup::preRemoveUser`` was removed. Listen to the typed event ``OCP\Group\Events\BeforeUserRemovedEvent`` instead +* ``OCP\IPreview::EVENT`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Preview\BeforePreviewFetchedEvent`` instead +* ``OCP\IPreview:PreviewRequested`` (deprecated since 22) was removed. Listen to the typed event ``OCP\Preview\BeforePreviewFetchedEvent`` instead +* ``OCP\IUser::changeUser`` was removed. Listen to the typed event ``OCP\User\Events\UserChangedEvent`` instead +* ``OCP\IUser::postDelete`` (deprecated since 17) was removed. Listen to the typed event ``OCP\User\Events\UserDeletedEvent`` instead +* ``OCP\IUser::postSetPassword`` was removed. Listen to the typed event ``OCP\User\Events\PasswordUpdatedEvent`` instead +* ``OCP\IUser::preDelete`` (deprecated since 17) was removed. Listen to the typed event ``OCP\User\Events\BeforeUserDeletedEvent`` instead +* ``OCP\IUser::preSetPassword`` was removed. Listen to the typed event ``OCP\User\Events\BeforePasswordUpdatedEvent`` instead +* ``OCP\Share::preShare`` was removed. Listen to the typed event ``OCP\Share\Events\BeforeShareCreatedEvent`` instead +* ``OCP\Share::preUnshare`` was removed. Listen to the typed event ``OCP\Share\Events\BeforeShareDeletedEvent`` instead +* ``OCP\Share::postAcceptShare`` was removed. Listen to the typed event ``OCP\Share\Events\ShareAcceptedEvent`` instead +* ``OCP\Share::postShare`` was removed. Listen to the typed event ``OCP\Share\Events\ShareCreatedEvent`` instead +* ``OCP\Share::postUnshare`` was removed. Listen to the typed event ``OCP\Share\Events\ShareDeletedEvent`` instead +* ``OCP\Share::postUnshareFromSelf`` was removed. Listen to the typed event ``OCP\Share\Events\ShareDeletedFromSelfEvent`` instead * ``OCP\WorkflowEngine::registerChecks`` (deprecated since 17) was removed. Listen to the typed event ``OCP\WorkflowEngine\Events\RegisterChecksEvent`` instead * ``OCP\WorkflowEngine::registerEntities`` (deprecated since 17) was removed. Listen to the typed event ``OCP\WorkflowEngine\Events\RegisterEntitiesEvent`` instead * ``OCP\WorkflowEngine::registerOperations`` (deprecated since 17) was removed. Listen to the typed event ``OCP\WorkflowEngine\Events\RegisterOperationsEvent`` instead +* ``\OCP\Collaboration\Resources::loadAdditionalScripts`` was removed. Listen to the typed event ``OCP\Collaboration\Resources\LoadAdditionalScriptsEvent`` instead + + + + + + + + + + + + + + + diff --git a/developer_manual/basics/events.rst b/developer_manual/basics/events.rst index 2d9832801..345534837 100644 --- a/developer_manual/basics/events.rst +++ b/developer_manual/basics/events.rst @@ -13,7 +13,6 @@ Overview The term "events" is a bit broad in Nextcloud and there are multiple ways of emitting them. * `OCP event dispatcher`_ -* `Symfony event dispatcher`_ * `Hooks`_ * `Public Emitter`_ @@ -301,6 +300,13 @@ This event is triggered when a user deletes a card in an address-book. This event is triggered when a user updates a card in an address-book. +``OCA\DAV\Events\SabrePluginAddEvent`` +************************************** + +.. versionadded:: 28 + +This event is triggered during the setup of the SabreDAV server to allow the registration of additional plugins. + ``\OCA\DAV\Events\SabrePluginAuthInitEvent`` ******************************************** @@ -308,8 +314,8 @@ This event is triggered when a user updates a card in an address-book. This event is triggered during the setup of the SabreDAV server to allow the registration of additional authentication backends. -``OCP\BeforeSabrePubliclyLoadedEvent`` -************************************** +``\OCP\BeforeSabrePubliclyLoadedEvent`` +*************************************** .. versionadded:: 26 @@ -392,6 +398,13 @@ This event is triggered right after the LDAP user backend is registered. This event is triggered whenever the viewer is loaded and extensions should be loaded. +``\OCP\Accounts\UserUpdatedEvent`` +********************************** + +.. versionadded:: 28 + +This event is triggered when the account data of a user was updated. + ``\OCP\App\Events\AppEnableEvent`` ********************************** @@ -427,6 +440,31 @@ Emitted before the rendering step of each TemplateResponse. The event holds a fl Emitted when the authentication fails, but only if the login name can be associated with an existing user. +``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengeFailed`` +********************************************************************** + +.. versionadded:: 28 + +``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderChallengePassed`` +********************************************************************** + +.. versionadded:: 28 + +``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered`` +************************************************************************ + +.. versionadded:: 28 + +``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered`` +************************************************************************** + +.. versionadded:: 28 + +``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderUserDeleted`` +****************************************************************** + +.. versionadded:: 28 + ``\OCP\Authentication\TwoFactorAuth\TwoFactorProviderDisabled`` *************************************************************** @@ -439,9 +477,14 @@ Emitted when the authentication fails, but only if the login name can be associa Event emitted when apps might render references like link previews or smart picker widgets. -This can be used to inject scripts for extending that. Further details can be found in the +This can be used to inject scripts for extending that. Further details can be found in the :ref:`Reference providers` deep dive. +``\OCP\Comments\CommentsEntityEvent`` +************************************* + +.. versionadded:: 28 + ``\OCP\Contacts\Events\ContactInteractedWithEvent`` *************************************************** @@ -453,8 +496,19 @@ It is an event that allows apps to notify other components about an interaction Emitters should add at least one identifier (uid, email, federated cloud ID) of the recipient of the interaction. +``\OCP\DB\Events\AddMissingColumnsEvent`` +***************************************** + +.. versionadded:: 28 + +Event to allow apps to register information about missing database columns + +This event will be dispatched for checking on the admin settings and when running +``occ db:add-missing-columns`` which will then create those columns or can be used +to generate the SQL statements for manual execution. + ``\OCP\DB\Events\AddMissingIndicesEvent`` -************************************************ +***************************************** .. versionadded:: 28 @@ -464,6 +518,17 @@ This event will be dispatched for checking on the admin settings and when runnin ``occ db:add-missing-indices`` which will then create those indices or can be used to generate the SQL statements for manual execution. +``\OCP\DB\Events\AddMissingPrimaryKeyEvent`` +******************************************** + +.. versionadded:: 28 + +Event to allow apps to register information about missing database primary keys + +This event will be dispatched for checking on the admin settings and when running +``occ db:add-missing-primary-keys`` which will then create those indices or can be used +to generate the SQL statements for manual execution. + ``\OCP\DirectEditing\RegisterDirectEditorEvent`` ************************************************ @@ -501,11 +566,21 @@ Event to allow to register the direct editor. .. versionadded:: 18 +``\OCP\Files\Events\NodeAddedToFavorite`` +***************************************** + +.. versionadded:: 28 + ``\OCP\Files\Events\NodeRemovedFromCache`` ****************************************** .. versionadded:: 18 +``\OCP\Files\Events\NodeRemovedFromFavorite`` +********************************************* + +.. versionadded:: 28 + ``\OCP\Group\Events\BeforeGroupCreatedEvent`` ********************************************* @@ -570,8 +645,8 @@ Deprecated in 20.0.0 - it can't be guaranteed that this event is triggered in al Emitted before a system mail is sent. It can be used to alter the message. -``OCP\Preview\BeforePreviewFetchedEvent`` -***************************************** +``\OCP\Preview\BeforePreviewFetchedEvent`` +****************************************** .. versionadded:: 26 @@ -603,16 +678,46 @@ WARNING: Using this API incorrectly may make the instance more insecure. Do thin Event that allows to register a feature policy header to a request. +``\OCP\Share\Events\BeforeShareCreatedEvent`` +********************************************* + +.. versionadded:: 28 + +``\OCP\Share\Events\BeforeShareDeletedEvent`` +********************************************* + +.. versionadded:: 28 + +``\OCP\Share\Events\ShareAcceptedEvent`` +**************************************** + +.. versionadded:: 28 + ``\OCP\Share\Events\ShareCreatedEvent`` *************************************** .. versionadded:: 18 +``\OCP\Share\Events\ShareDeletedEvent`` +*************************************** + +.. versionadded:: 21 + +``\OCP\Share\Events\ShareDeletedFromSelfEvent`` +*********************************************** + +.. versionadded:: 28 + ``\OCP\Share\Events\VerifyMountPointEvent`` ******************************************* .. versionadded:: 19 +``\OCP\SystemTag\SystemTagsEntityEvent`` +**************************************** + +.. versionadded:: 28 + ``\OCP\User\Events\BeforeUserLoggedInWithCookieEvent`` ****************************************************** @@ -687,6 +792,11 @@ Emitted before a user is logged out. .. versionadded:: 18 +``\OCP\User\Events\UserFirstTimeLoggedInEvent`` +*********************************************** + +.. versionadded:: 28 + ``\OCP\User\Events\UserLiveStatusEvent`` **************************************** @@ -726,14 +836,6 @@ Emitted when the workflow engine settings page is loaded. .. versionadded:: 18 -Symfony event dispatcher ------------------------- - -.. warning:: Using the Symfony event dispatcher mechanism is discouraged. Use the `OCP event dispatcher`_ abstraction instead. - -tbd - - Hooks -----