webexcess / notifications
Neos CMS 的异步通知系统
0.201506.2
2015-06-12 15:48 UTC
Requires
- typo3/neos: ~2.0
This package is auto-updated.
Last update: 2024-08-29 03:29:38 UTC
README
此插件为 Neos CMS 提供异步通知。
注意:此包仍在实验阶段,不适合用于生产。
快速开始
- 将插件的路由定义包含到您的
Routes.yaml
文件中
- name: 'WebExcessNotifications' uriPattern: '<WebExcessNotificationsSubroutes>' subRoutes: WebExcessNotificationsSubroutes: package: WebExcess.Notifications
- 在您的应用程序中添加一个通知
/** * @var \WebExcess\Notifications\Domain\Service\NotificationService * @Flow\Inject */ protected $notificationService; public yourAction(){ $this->notificationService->add('info', 'This is an important information'); }
- 在您的 Shell 脚本中添加一个通知
./flow notification:add error "Product import faild" --message "Got malformed XML"
- 访问 Neos 后端,通知就会出现
用户地址
--target "Roles:TYPO3.Neos:Editor,TYPO3.Neos:Administrator"
或 --target "Users:usernamea,usernameb"
TYPO3.Neos:Editor\+
表示具有此角色的每个用户都会收到通知。
TYPO3.Neos:Editor\!
表示即使其他角色有 "+"-后缀,通知的发送也会在第一个具有 "!"-后缀的用户处结束。
如果有一个 "+" 或 "!" 后缀,则其他不带后缀的项都附加 "+"。
重要:如果您在 shell 中,请转义字符 "+" 和 "!"。
默认行为
第一个后端用户是唯一一个会收到通知的用户。
角色限制行为
./flow notification:add info "New Version of Neos CMS is installed" --target "Roles:TYPO3.Neos:Editor"
具有角色 "TYPO3.Neos:Editor" 的第一个后端用户是唯一一个会收到通知的用户。
角色限制行为 - 所有用户
./flow notification:add warning "The Export-Module has a new operating Concept" --target "Roles:TYPO3.Neos:Editor\+"
具有角色 "TYPO3.Neos:Editor" 的所有后端用户都会收到通知。
角色限制行为 - 限制
./flow notification:add error "Newsletter worker has failures" --target "Roles:TYPO3.Neos:Editor\+,TYPO3.Neos:Administrator\!"
具有角色 "TYPO3.Neos:Editor" 的所有后端用户都会收到通知,直到有一个角色为 "TYPO3.Neos:Administrator" 的单个用户收到通知。
TYPO3.Neos:历史集成
要使此功能正常工作,您需要修改 TYPO3\Neos\Controller\Module\Management\HistoryController.php
从
$view->setTypoScriptPathPattern('resource://TYPO3.Neos/Private/TypoScript/Backend');
到
$view->setTypoScriptPathPatterns(array('resource://TYPO3.Neos/Private/TypoScript/Backend', 'resource://WebExcess.Notifications/Private/TypoScript/History'));
并启用它
WebExcess: Notifications: addEventLog: TRUE