Referenziertes Objekt mit dessen Template / Macro rendern

3 messages Options
Embed this post
Permalink
Stefan Antonelli-2

Referenziertes Objekt mit dessen Template / Macro rendern

Reply Threaded More More options
Print post
Permalink
Hallo Zusammen,

ich möchte gerne folgende Diskussion aufgreifen:

http://plone.org/support/region/de#nabble-td2364189

Wie kann ich ein referenziertes Objekt unter Verwendung von dessen
Main-Macro zuverlässig rendern?

In der Diskussion werden SimpleAlias und bda.contentproxy erwähnt. Die
beiden habe ich mir zusätzlich zu den Tabbed Subpages angeschaut. Alle
Varianten funktionieren solange ich Standard Content Typen referenziere.
Sobald ich auf ein Objekt verweise das einen Browser View verwendet
steigen die Produkte aus.

Getestet habe ich das sowohl mit eigenen CTs als auch mit den Content
Typen aus Aspelis optilux-Package (man weiß ja nie).

Plone 3.1.7 (auf Linux Debian)
Python 2.4.6
Zope 2.10.6-final

Hat da jemand eine Idee?

Gruß, Stefan.



Hier der Traceback wenn ich mit SimpleAlias auf ein Cinema verweise:

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: exceptions.KeyError: 'target_view_macro'
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 949, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 949, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 855, in do_condition
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 855, in do_condition
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/develop/project/products/SimpleAlias/skins/SimpleAlias/alias_view.pt
   - Line 33, Column 10
   - Expression: <PathExpr standard:u'here/targetMainMacro'>
   - Names:
      {'container': <PloneSite at /plone>,
       'context': <Alias at /plone/cinema>,
       'default': <object object at 0x7f2bc130e200>,
       'here': <Alias at /plone/cinema>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xc886440>,
       'request': <HTTPRequest, URL=http://localhost:8080/plone/cinema/alias_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at /plone/alias_view used for /plone/cinema>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module Products.SimpleAlias.content.alias, line 183, in targetMainMacro
AttributeError: macros



Und hier ein Traceback wenn ich bda.contentproxy verwendet:

2009-09-25 12:08:37 ERROR Zope.SiteErrorLog http://localhost:8080/plone/atproxiedcontent.2009-09-25.2910273263/@@proxy
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.Five.browser.metaconfigure, line 417, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 891, in do_useMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 525, in do_optTag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 949, in do_defineSlot
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 534, in do_optTag_tal
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 745, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 221, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 11, Column 2
   - Expression: <PathExpr standard:'view/content/@@proxiedcontent'>
   - Names:
      {'container': <ATProxiedContent at /plone/atproxiedcontent.2009-09-25.2910273263>,
       'context': <ATProxiedContent at /plone/atproxiedcontent.2009-09-25.2910273263>,
       'default': <object object at 0x7f2bc130e200>,
       'here': <ATProxiedContent at /plone/atproxiedcontent.2009-09-25.2910273263>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /develop/project/eggs/bda.contentproxy-1.0_beta4-py2.4.egg/bda/contentproxy/browser/proxy.pt object at 0xdae7e50>,)},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xc4f85a8>,
       'request': <HTTPRequest, URL=http://localhost:8080/plone/atproxiedcontent.2009-09-25.2910273263/@@proxy>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0xdbfc650>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /develop/project/eggs/bda.contentproxy-1.0_beta4-py2.4.egg/bda/contentproxy/browser/proxy.pt object at 0xdae7e50>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xdbfc710>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module Products.Five.browser.metaconfigure, line 417, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: exceptions.KeyError: 'view_template'
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 521, in do_optTag
  Module zope.tal.talinterpreter, line 516, in no_tag
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 870, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 11, Column 4
   - Expression: <PathExpr standard:'view_template/macros/main'>
   - Names:
      {'container': <Cinema at /plone/folder/cinema>,
       'context': <Cinema at /plone/folder/cinema>,
       'default': <object object at 0x7f2bc130e200>,
       'here': <Cinema at /plone/folder/cinema>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /develop/project/eggs/bda.contentproxy-1.0_beta4-py2.4.egg/bda/contentproxy/browser/content.pt object at 0xdae7250>,)},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xdc02cf8>,
       'request': <HTTPRequest, URL=http://localhost:8080/plone/atproxiedcontent.2009-09-25.2910273263/@@proxy>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0xdae7610>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /develop/project/eggs/bda.contentproxy-1.0_beta4-py2.4.egg/bda/contentproxy/browser/content.pt object at 0xdae7250>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0xdae7590>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 153, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 103, in trustedBoboAwareZopeTraverse
  Module zope.traversing.adapters, line 164, in traversePathElement
   - __traceback_info__: (<Products.Five.metaclass.CinemaView object at 0xdae6b10>, 'macros')
  Module zope.traversing.adapters, line 52, in traverse
   - __traceback_info__: (<Products.Five.metaclass.CinemaView object at 0xdae6b10>, 'macros', ['main'])
TraversalError: (<Products.Five.metaclass.CinemaView object at 0xdae6b10>, 'macros')







_______________________________________________
zope mailing list
[hidden email]
https://mail.dzug.org/mailman/listinfo/zope
Jens W. klein-2

Re: Referenziertes Objekt mit dessen Template / Macro rendern

Reply Threaded More More options
Print post
Permalink
Am Freitag, den 25.09.2009, 13:32 +0200 schrieb Stefan Antonelli:

> Hallo Zusammen,
>
> ich möchte gerne folgende Diskussion aufgreifen:
>
> http://plone.org/support/region/de#nabble-td2364189
>
> Wie kann ich ein referenziertes Objekt unter Verwendung von dessen
> Main-Macro zuverlässig rendern?
>
> In der Diskussion werden SimpleAlias und bda.contentproxy erwähnt. Die
> beiden habe ich mir zusätzlich zu den Tabbed Subpages angeschaut. Alle
> Varianten funktionieren solange ich Standard Content Typen referenziere.
> Sobald ich auf ein Objekt verweise das einen Browser View verwendet
> steigen die Produkte aus.
Also wir verwenden unseren bda.contentproxy fast ausschliesslich mit
browserviews. Das Ding tut ja eh nicht so viel.

Was ist denn der genaue Fehler, bzw wie sieht Dein Code aus?

greetz Jens

--
Jens W. Klein
Software Architect
Managing Director, General Partner
+43 512 890077

Klein & Partner KEG          WEB APPLICATIONS,  ZOPE,  PLONE, HOSTING
BlueDynamics Alliance        production: concept, development, design
http://bluedynamics.com      consulting: analysis, coaching, training
http://zoplo.com             management: projects, process, community






_______________________________________________
zope mailing list
[hidden email]
https://mail.dzug.org/mailman/listinfo/zope
Stefan Antonelli-2

Re: Referenziertes Objekt mit dessen Template / Macro rendern

Reply Threaded More More options
Print post
Permalink
Hallo Jens,

> Also wir verwenden unseren bda.contentproxy fast ausschliesslich mit
> browserviews. Das Ding tut ja eh nicht so viel.
>
> Was ist denn der genaue Fehler, bzw wie sieht Dein Code aus?

ich bin für jeden Hinweis dankbar. Was kann dir denn neben dem Traceback
noch weiterhelfen?

Zum Code: Der basiert auf Aspelis Buch. Dem Teil liegt ja etwas Code
bei, damit hab ich die drei Produkte getestet um den Fehler
reproduzieren zu können:

http://www.packtpub.com/support/book/Professional-Plone-web-applications-CMS

Entpacken, bootstrap, in der buildout.cfg den contentproxy ergänzen,
buildout laufen lassen und fertig.

Wenn Du dann z.b. auf den Content Type Cinema referenzierst kommt der
Traceback.

Mit welchen Produkten (plone.org oder pypi) funktioniert das Package
denn, dann teste ich das auch mal in meiner Umgebung.

Gruß, Stefan.




_______________________________________________
zope mailing list
[hidden email]
https://mail.dzug.org/mailman/listinfo/zope