Re: [Zope-CMF] RFC: first stab at viewification

2005-10-22 Thread Jens Vagelpohl


On 22 Oct 2005, at 17:23, Andreas Jung wrote:





--On 21. Oktober 2005 19:27:38 -0400 Tres Seaver  
<[EMAIL PROTECTED]> wrote:




  - Performance on the view version is nearly twice the "classic"
version (14.2 ms vs 24.2 ms on my box).



Any idea why the view version is such slow? I thought the execution  
of trusted code should be faster :-)


Remember that the normal "site furniture" is still the same. Only the  
"content well" is benefiting here.


jens

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] RFC: first stab at viewification

2005-10-22 Thread Andreas Jung




--On 21. Oktober 2005 19:27:38 -0400 Tres Seaver <[EMAIL PROTECTED]> 
wrote:


  - Performance on the view version is nearly twice the "classic"
version (14.2 ms vs 24.2 ms on my box).


Any idea why the view version is such slow? I thought the execution of 
trusted code should be faster :-)


-aj



pgpKp2i7AFXgp.pgp
Description: PGP signature
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] RFC: first stab at viewification

2005-10-22 Thread Jens Vagelpohl


On 22 Oct 2005, at 00:27, Tres Seaver wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I just checked in a preliminary pass at viewifying the
'full_metadata_form' (now 'metadata.html' as a view):

  svn+ssh://svn.zope.org/repos/main/CMF/branches/tseaver-viewification


I expanded the branch by adding a proposed viewification for the Link  
content type, based on Tres' example and code he sent to me a few  
weeks ago.


As mentioned in Tres' note, the five:traversable configuration in  
CMFDefault/configure.zcml is commented out because it breaks other  
CMF tests and you neeed to uncomment it to see the new stuff.  
However, I am seeing breakage in the link views tests themselves  
(traceback below) which I can't quite interpret. This time I doubt it  
is due to a sandbox with old software, I'm working off today's Zope  
2.8 branch, the tseaver-viewification CMF branch and todays Five  
trunk. Can anyone spot what the problem is? Using the views in the  
browser does not show any error, it only pops up during testing.


jens

---
File "/usr/local/zope/28Instance/Products/CMFDefault/browser/tests/ 
linkviews.txt", line 39, in linkviews.txt

Failed example:
print display.renderContent()
Exception raised:
Traceback (most recent call last):
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/zope/ 
testing/doctest.py", line 1315, in __run

compileflags, 1) in test.globs
  File "", line 1, in ?
print display.renderContent()
  File "/usr/local/zope/28Instance/Products/CMFDefault/browser/ 
linkviews.py", line 56, in renderContent

, title=self.context.title
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/Products/ 
PageTemplates/PageTemplate.py", line 110, in __call__

return self.pt_render(extra_context={'options': kwargs})
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/Products/ 
PageTemplates/PageTemplate.py", line 104, in pt_render

tal=not source, strictinsert=0)()
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/TAL/ 
TALInterpreter.py", line 206, in __call__

self.interpret(self.program)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/TAL/ 
TALInterpreter.py", line 250, in interpret

handlers[opcode](self, args)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/TAL/ 
TALInterpreter.py", line 595, in do_insertTranslation

xlated_msgid = self.translate(msgid, default, i18ndict, obj)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/TAL/ 
TALInterpreter.py", line 663, in translate

msgid, i18ndict, default=default)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/Products/ 
PageTemplates/TALES.py", line 261, in translate

target_language=target_language)
  File "/usr/local/zope/CMFHEADInstance/Products/Five/i18n.py",  
line 39, in translate

util = zapi.queryUtility(ITranslationDomain, domain)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/zope/ 
component/__init__.py", line 79, in queryUtility

return getService(Utilities, context).queryUtility(
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/zope/ 
component/__init__.py", line 68, in getService

return getServices(context).getService(name)
  File "/usr/local/zope/opt/Zope-2.8-branch/lib/python/zope/ 
component/service.py", line 109, in getService

raise ComponentLookupError(name)
ComponentLookupError: 'Utilities'
--
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] RFC: first stab at viewification

2005-10-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I just checked in a preliminary pass at viewifying the
'full_metadata_form' (now 'metadata.html' as a view):

  svn+ssh://svn.zope.org/repos/main/CMF/branches/tseaver-viewification

A couple of things to note:

  - I adopted a "don't generalize too soon" approach on this,
rather than trying to come up with a perfect reuse example.
I have two views registered, 'metadata.html' for the template
and 'metadata.py' for the controller to which it POSTs (since
it needs to do redirects).  This is a sort of "hybrid" strategy.

  - Performance on the view version is nearly twice the "classic"
version (14.2 ms vs 24.2 ms on my box).

  - The view code *does* have tests, although they aren't exhaustive.

  - Making Document objects five:traversable broke some other unit
tests, so I left that commented out in CMFDefault/configure.zcml.
To actually exercise the view TTW, you will need to uncomment it.

I need to review Yuppie's branch for folder_contents as well:

  svn+ssh://svn.zope.org/repos/main/CMF/branches/goldegg-folder_contents

Feedback on both branches would be appreciated;  we have folks gathering
here in FXBG to hammer out the remaining viewification plan for CMF 2.0
next week.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDWXlp+gerLs4ltQ4RAoI6AJ9xhMySPf/1CkaULV/Z22IifE+0QACgp9PK
1VKDaRqGVuLp7X/EO5ChAP8=
=ofQ3
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests