2011-10-28 12 views
1

Plone 4.1.2の最新プロフェッショナルPlone 4開発ブックを使用しています。敏捷性タイプに新しいビューを追加すると「ページが見つかりません」という表示アイテムが表示される

私はDexterityを使用してコンテンツタイプを正常に定義しましたが、現在そのタイプのいずれかのカスタムビューを作成しようとしています。スキーマ&ビューは、次のような定義されています。 ビューCTCCに位置 偽

<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> 

そしてテンプレート自体、:ここで

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から関連するセクションです。 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の最初の1週間なので、これをどこから始めるべきか分かりません。フォアグラウンドモードでサイトを実行しているときにエラーが表示されない。

大変助かります。

+0

GenericSetup XMLで何かを変更した後で、portal_setupで適切な手順を再実行する必要があることに注意してください。 –

+0

ZMIのerror_logに移動し、無視された例外リストからNotFoundを削除します。その後、もう一度ビューに移動し、さらに情報があるかどうかを確認します。 –

+0

@JCブランド:この段階では、GenericSetupファイルをまったく変更していません。機敏さのタイプは作成され、うまく動作します。それはpythonファイルにエラーを出すビューを追加した後です。 ありがとう、私は本当にそれをより明確にして、今更新する必要があります。 –

答えて

0

問題は、テンプレートにこの行をした:

<div tal:replace="structure context/text/output" /> 

私は私は最低限だと思ったものに例のテンプレートをバック取り除いていました。デビッド・グリックの提案のおかげで、私はのerror_logで無視例外リストからNOTFOUNDを削除し、次のことを見た:

Module Products.PageTemplates.Expressions, line 225, in evaluateText 
    Module zope.tales.tales, line 696, in evaluate 
    - URL: /opt/plone41/zeocluster/src/ctcc.contenttypes/ctcc/contenttypes/trial_templates/view.pt 
    - Line 13, Column 8 
    - Expression: <PathExpr standard:u'context/text/output'> 
    [...] 
    Module OFS.Traversable, line 299, in unrestrictedTraverse 
    - __traceback_info__: ([], 'text') 
NotFound: text 

今私が問題を引き起こしているとのTALに深く読み始めてきたものを見ることができ、Iなぜそれが失敗しているのかを知ることができます:疑いのある私のための無知。

ありがとうございます!

2

あなたはsetup.pyに依存関係を含めましたか?

install_requires=[ 
    'setuptools', 
    'plone.app.dexterity', 
    ... 
    ], 

あなたはconfigure.zcmlでGrokを初期化しましたか?

<configure 
    xmlns="http://namespaces.zope.org/zope" 
    ... 
    xmlns:grok="http://namespaces.zope.org/grok"> 

    <includeDependencies package="." /> 
    <grok:grok package="." /> 
    ... 

</configure> 

あなたはmetadata.xmlにDexterityのGenericSetupプロファイルを含めましたか?

<metadata> 
<version>1</version> 
<dependencies> 
    <dependency>profile-plone.app.dexterity:default</dependency> 
</dependencies> 
</metadata> 
+0

私のsetup.pyにはplone.app.dexterity [grok]がありますが、それらのすべてが指定されています。基本的な型作成機能がうまく機能していたという質問には、失敗した型のカスタムビューのみが指定されていたはずです。とにかく助けてくれてありがとう。 –

関連する問題