Neos:检查员编辑的路线

时间:2014-12-11 15:05:23

标签: neoscms

我尝试创建一个自己的检查器编辑器,它应该能够通过控制器加载数据。为此,我在标题中呈现了一个LINK标签 - 就像Neos一样 -

<link rel="vendor-package-backend-content" href="http://typo3-neos-1.1.x.dev/vendor.package/backend/content/load />

创建控制器Packages/Application/Vendor.Package/Classes/Vendor/Package/Controller/Backend/ContentController.php

这是文件Configuration/Routes.yaml

-
  name: 'TYPO3 Neos'
  uriPattern: '<TYPO3NeosSubroutes>'
  subRoutes:
    'TYPO3NeosSubroutes':
      package: 'TYPO3.Neos'
      variables:
        'defaultUriSuffix': '.html'

-
  name: 'Vendor Package
  uriPattern: '<VendorPackageSubroutes>'
  subRoutes:
    'VendorPackageSubroutes':
      package: 'Vendor.Package'
      variables:
        'defaultUriSuffix': '.html'

这里是文件Packages/Application/Vendor.Package/Configuration/Routes.yaml

-
  name:  'Backend'
  uriPattern: 'vendor.package/<BackendSubRoutes>'
  defaults:
    '@package':    'Vendor.Package'
    '@action':     'index'
    '@format':     'html'
  subRoutes:
    'BackendSubRoutes':
      package: 'Vendor.Package'
      suffix:  'Backend'

最后是文件Packages/Application/Vendor.Package/Configuration/Routes.Backend.yaml

-
  name: 'Backend Content Controller'
  uriPattern: 'backend/content(/{@action})'
  defaults:
    '@package':    'Vendor.Package'
    '@controller': 'Backend\Content'
  appendExceedingArguments: TRUE

如果现在调用了该网址:http://domain.com/vendor.package/backend/content/index并且找不到网页&#34;错误被抛出。我必须停用TYPO3.Flow.error.exceptionHandler.renderingGroups.notFoundExceptions才能看到更多详细信息:

  

抱歉,找不到您请求的页面。技术细节:

     

找不到内容维度的预设&#34;语言&#34;通过   给定URI段&#34; vendor.package&#34;。 (参考代码:   2014121115590523bc78)

但我不知道如何为尺寸定义/neos的路径段,它的工作原理......

我必须如何配置?

2 个答案:

答案 0 :(得分:0)

尝试将您的供应商路线定义置于主Routs.yaml上方的neos之上。 检查您的Data / Logs / System_Development.log是否符合它的要求。

嗯,并为您的Vendor.Package删除此部分:

  variables:
    'defaultUriSuffix': '.html'

答案 1 :(得分:0)

谢谢塔金。开发日志是一个很好的提示:)我想我已经得到了它,我会分享这个。有几种配置可供选择:

1)通过TS2页面呈现的LINK标签 - 就像Neos一样 - 在标题中需要登录。

<f:security.ifAccess resource="Vendor_Package_BackendAccess">
    <link rel="vendor-package-backend-content" href="http://typo3-neos-1.1.x.dev/vendor.package/backend/content/load />
</f:security.ifAccess>

2)控制器Packages/Application/Vendor.Package/Classes/Vendor/Package/Controller/Backend/ContentController.php

3)文件Configuration/Routes.yaml中的设置:

-
  name: 'Vendor Package
  uriPattern: '<VendorPackageSubroutes>'
  subRoutes:
    'VendorPackageSubroutes':
      package: 'Vendor.Package'
      variables:
        'defaultUriSuffix': '.html'

4)文件Packages/Application/Vendor.Package/Configuration/Routes.yaml

-
  name:  'Backend'
  uriPattern: 'vendor.package/<BackendSubRoutes>'
  defaults:
    '@package':    'Vendor.Package'
    '@action':     'index'
    '@format':     'html'
  subRoutes:
    'BackendSubRoutes':
      package: 'Vendor.Package'
      suffix:  'Backend'

5)文件Packages/Application/Vendor.Package/Configuration/Routes.Backend.yaml

-
  name: 'Backend Content Controller'
  uriPattern: 'backend/content(/{@action})'
  defaults:
    '@package':    'Vendor.Package'
    '@controller': 'Backend\Content'
  appendExceedingArguments: TRUE

6)文件Packages/Application/Vendor.Package/Configuration/Policy.yaml

resources:
  methods:
    Vendor_Package_BackendAccess: 'method(Vendor\Package\Controller\Backend\ContentController->.*Action())'

acls:
  'TYPO3.Neos:Editor':
    methods:
      Vendor_Package_BackendAccess: GRANT

7)至少Packages/Application/Vendor.Package/Configuration/Settings.yaml

  Flow:
    security:
      authentication:
        providers:
          Typo3BackendProvider:
            requestPatterns:
              controllerObjectName: 'TYPO3\Neos\Controller\.*|TYPO3\Neos\Service\.*|TYPO3\Media\Controller\.*|Vendor\Package\Controller\Backend\.*'

8)Packages/Application/Vendor.Package/Configuration/Settings.yaml还有一件事,否则就会出现缺少维度映射的错误原因。

  TYPO3CR:
    contentDimensions:
      'language':
        presets:
          'vendor.packages':
            label: ''
            values: ['mul_ZZ']
            uriSegment: 'vendor.packages'

这将是答案的第一部分:)

但仍有一些问题:

1)这至少是一个包。所以我想知道为什么我必须在Configuration/Routes.yaml中设置东西,这不会是安装过程的一部分(?)。

2)在此示例中,需要覆盖路径Flow.security.authentication.providers.Typo3BackendProvider.requestPatterns.controllerObjectName。我不认为,这是有用的,必须有另一种方式。