私は最近のProfessionalPlone4 Developmentの本で、Plone4.1.2のインストールに取り組んでいます。
Dexterityを介してコンテンツタイプを正常に定義し、現在、タイプの1つに対してカスタムビューを作成しようとしています。スキーマとビューは次のように定義されます。
from zope import schema
from plone.directives import form
from five import grok
from ctcc.contenttypes import CTCCTypesMessageFactory as _
class ITrial(form.Schema):
"""A clinical trial."""
title = schema.TextLine(
title = _(u'label_title', default=u'Title'),
required = True,
)
description = schema.Text(
title=_(u'label_description', default=u'Description'),
description = _(u'help_description', default=u'A short summary of the content'),
required = False,
missing_value = u'',
)
class View(grok.View):
grok.context(ITrial)
grok.require('zope2.View')
grok.name('view')
タイプのFTIの関連セクションは次のとおりです。ビューFalse
<alias from="(Default)" to="(selected layout)"/>
<alias from="edit" to="@@edit"/>
<alias from="sharing" to="@@sharing"/>
<alias from="view" to="@@view"/>
<action title="View" action_id="view" category="object" condition_expr=""
url_expr="string:${folder_url}/" visible="True">
<permission value="View"/>
</action>
そして、ctcc.contenttypes /trial_templates / view.ptにあるテンプレート自体は、タイトルと説明を表示するだけです。
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="ctcc.contenttypes">
<body>
<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core">
<div tal:replace="structure context/text/output" />
</metal:content-core>
</metal:content-core>
</body>
</html>
これらすべてが整った状態でこのタイプのインスタンスにアクセスすると、「ページが見つかりません」というエラーが発生します。何かが新しいビューを期待されたパスに結び付けていないようですが、これはPloneでの最初の週なので、どこからこれを追跡し始めるのかわかりません。フォアグラウンドモードでサイトを実行してもエラーは発生しません。
どんな助けでも大歓迎です。