[Zope-Checkins] SVN: Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/ - implemented some unicode encoding conflict resolvers
Log message for revision 71752: - implemented some unicode encoding conflict resolvers - configuration through ZCML - additional useful logging Changed: U Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/Expressions.py U Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/configure.zcml U Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/interfaces.py U Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/unicodeconflictresolver.py -=- Modified: Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 01:31:25 UTC (rev 71751) +++ Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 10:25:20 UTC (rev 71752) @@ -18,8 +18,9 @@ $Id$ -import sys +import logging +from zope.component import getUtility from zope.interface import implements from zope.tales.tales import Context, Iterator from zope.tales.expressions import PathExpr, StringExpr, NotExpr @@ -34,13 +35,17 @@ from MultiMapping import MultiMapping from Acquisition import aq_base from zExceptions import NotFound, Unauthorized + from Products.Five.browser.providerexpression import Z2ProviderExpression from Products.PageTemplates import ZRPythonExpr from Products.PageTemplates.DeferExpr import LazyExpr from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver SecureModuleImporter = ZRPythonExpr._SecureModuleImporter() +LOG = logging.getLogger('Expressions') + # BBB 2005/05/01 -- remove after 12 months import zope.deprecation from zope.deprecation import deprecate @@ -183,9 +188,9 @@ text = self.evaluate(expr) -#print expr, repr(text), text.__class__ if text is self.getDefault() or text is None: +# XXX: should be unicode??? return text if isinstance(text, unicode): @@ -193,26 +198,20 @@ return text elif isinstance(text, str): -# waahhh...a standard string -# trying to be somewhat smart...this must be -# replaced with some kind of configurable -# UnicodeEncodingConflictResolver (what a name) +# bahh...non-unicode string..we need to convert it to unicode +resolver = getUtility(IUnicodeEncodingConflictResolver) try: -return unicode(text) - -except UnicodeDecodeError: -# check for management_page_charset property, default to Python's -# default encoding - -encoding = getattr(self.contexts['context'], 'management_page_charset', sys.getdefaultencoding()) - -try: -return unicode(text, encoding) -except UnicodeDecodeError: -# errors='replace' sucks...it's fine for now -return unicode(text, encoding, 'replace') - +return resolver.resolve(self.contexts['context'], text, expr) +except UnicodeDecodeError,e: +LOG.error(UnicodeDecodeError detected for expression %s\n + Resolver class: %s\n + Exception text: %s\n + Template: %s\n + Rendered text: %r % \ + (expr, resolver.__class__, e, +self.contexts['template'].absolute_url(1), text)) +raise else: # This is a weird culprit ...calling unicode() on non-string Modified: Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/configure.zcml === --- Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/configure.zcml 2007-01-07 01:31:25 UTC (rev 71751) +++ Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/configure.zcml 2007-01-07 10:25:20 UTC (rev 71752) @@ -1,11 +1,8 @@ -configure xmlns=http://namespaces.zope.org/zope; - xmlns:browser=http://namespaces.zope.org/browser; - xmlns:five=http://namespaces.zope.org/five; +configure xmlns=http://namespaces.zope.org/zope; - utility - provides=zope.component.interfaces.IFactory - component=Products.PageTemplates.unicodeconflictresolver.UnicodeEncodingResolverFactory + provides=Products.PageTemplates.interfaces.IUnicodeEncodingConflictResolver + component=Products.PageTemplates.unicodeconflictresolver.DefaultUnicodeEncodingConflictResolver /
[Zope-Checkins] SVN: Zope/trunk/ support for a configurable resolver for UnicodeDecodeErrors
Log message for revision 71753: support for a configurable resolver for UnicodeDecodeErrors Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/Products/PageTemplates/Expressions.py A Zope/trunk/lib/python/Products/PageTemplates/configure.zcml A Zope/trunk/lib/python/Products/PageTemplates/interfaces.py A Zope/trunk/lib/python/Products/PageTemplates/unicodeconflictresolver.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2007-01-07 10:25:20 UTC (rev 71752) +++ Zope/trunk/doc/CHANGES.txt 2007-01-07 10:32:39 UTC (rev 71753) @@ -48,6 +48,10 @@ 'output_encodings' property that controls the conversion from/to unicode for WebDAV/FTP operations. + - the ZPT implementation has now a configurable option in order how to deal +with UnicodeDecodeErrors. A custom UnicodeEncodingConflictResolver can +be configured through ZCML (see Products/PageTemplates/(configure.zcml, +unicodeconflictresolver.py, interfaces.py) Bugs Fixed Modified: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py === --- Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 10:25:20 UTC (rev 71752) +++ Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 10:32:39 UTC (rev 71753) @@ -17,6 +17,10 @@ $Id$ + +import logging + +from zope.component import getUtility from zope.interface import implements from zope.tales.tales import Context, Iterator from zope.tales.expressions import PathExpr, StringExpr, NotExpr @@ -31,13 +35,17 @@ from MultiMapping import MultiMapping from Acquisition import aq_base from zExceptions import NotFound, Unauthorized + from Products.Five.browser.providerexpression import Z2ProviderExpression from Products.PageTemplates import ZRPythonExpr from Products.PageTemplates.DeferExpr import LazyExpr from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver SecureModuleImporter = ZRPythonExpr._SecureModuleImporter() +LOG = logging.getLogger('Expressions') + # BBB 2005/05/01 -- remove after 12 months import zope.deprecation from zope.deprecation import deprecate @@ -173,6 +181,44 @@ domain, msgid, mapping=mapping, context=context, default=default) + +def evaluateText(self, expr): + customized version in order to get rid of unicode +errors for all and ever + + +text = self.evaluate(expr) + +if text is self.getDefault() or text is None: +# XXX: should be unicode??? +return text + +if isinstance(text, unicode): +# we love unicode, nothing to do +return text + +elif isinstance(text, str): +# bahh...non-unicode string..we need to convert it to unicode +resolver = getUtility(IUnicodeEncodingConflictResolver) + +try: +return resolver.resolve(self.contexts['context'], text, expr) +except UnicodeDecodeError,e: +LOG.error(UnicodeDecodeError detected for expression %s\n + Resolver class: %s\n + Exception text: %s\n + Template: %s\n + Rendered text: %r % \ + (expr, resolver.__class__, e, +self.contexts['template'].absolute_url(1), text)) +raise +else: + +# This is a weird culprit ...calling unicode() on non-string +# objects +return unicode(text) + + class ZopeEngine(zope.app.pagetemplate.engine.ZopeEngine): _create_context = ZopeContext Copied: Zope/trunk/lib/python/Products/PageTemplates/configure.zcml (from rev 71752, Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/configure.zcml) Copied: Zope/trunk/lib/python/Products/PageTemplates/interfaces.py (from rev 71752, Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/interfaces.py) Copied: Zope/trunk/lib/python/Products/PageTemplates/unicodeconflictresolver.py (from rev 71752, Zope/branches/ajung-death-to-unicode-errors/lib/python/Products/PageTemplates/unicodeconflictresolver.py) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PageTemplates/ merged UnicodeEncodingConflictResolver
Log message for revision 71756: merged UnicodeEncodingConflictResolver Changed: U Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py U Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py A Zope/branches/2.10/lib/python/Products/PageTemplates/configure.zcml A Zope/branches/2.10/lib/python/Products/PageTemplates/interfaces.py A Zope/branches/2.10/lib/python/Products/PageTemplates/unicodeconflictresolver.py -=- Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 11:13:59 UTC (rev 71755) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 11:30:05 UTC (rev 71756) @@ -17,6 +17,10 @@ $Id$ + +import logging + +from zope.component import getUtility from zope.interface import implements from zope.tales.tales import Context, Iterator from zope.tales.expressions import PathExpr, StringExpr, NotExpr @@ -31,13 +35,17 @@ from MultiMapping import MultiMapping from Acquisition import aq_base from zExceptions import NotFound, Unauthorized + from Products.Five.browser.providerexpression import Z2ProviderExpression from Products.PageTemplates import ZRPythonExpr from Products.PageTemplates.DeferExpr import LazyExpr from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver SecureModuleImporter = ZRPythonExpr._SecureModuleImporter() +LOG = logging.getLogger('Expressions') + # BBB 2005/05/01 -- remove after 12 months import zope.deprecation from zope.deprecation import deprecate @@ -173,6 +181,44 @@ domain, msgid, mapping=mapping, context=context, default=default) + +def evaluateText(self, expr): + customized version in order to get rid of unicode +errors for all and ever + + +text = self.evaluate(expr) + +if text is self.getDefault() or text is None: +# XXX: should be unicode??? +return text + +if isinstance(text, unicode): +# we love unicode, nothing to do +return text + +elif isinstance(text, str): +# bahh...non-unicode string..we need to convert it to unicode +resolver = getUtility(IUnicodeEncodingConflictResolver) + +try: +return resolver.resolve(self.contexts['context'], text, expr) +except UnicodeDecodeError,e: +LOG.error(UnicodeDecodeError detected for expression %s\n + Resolver class: %s\n + Exception text: %s\n + Template: %s\n + Rendered text: %r % \ + (expr, resolver.__class__, e, +self.contexts['template'].absolute_url(1), text)) +raise +else: + +# This is a weird culprit ...calling unicode() on non-string +# objects +return unicode(text) + + class ZopeEngine(zope.app.pagetemplate.engine.ZopeEngine): _create_context = ZopeContext Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py 2007-01-07 11:13:59 UTC (rev 71755) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py 2007-01-07 11:30:05 UTC (rev 71756) @@ -40,7 +40,8 @@ from Products.PageTemplates.PageTemplateFile import guess_type from Products.PageTemplates.Expressions import SecureModuleImporter -from Products.PageTemplates.utils import encodingFromXMLPreamble, charsetFromMetaEquiv, convertToUnicode +from Products.PageTemplates.utils import encodingFromXMLPreamble, \ + charsetFromMetaEquiv, convertToUnicode preferred_encodings = ['utf-8', 'iso-8859-15'] @@ -103,7 +104,8 @@ security.declareProtected(view_management_screens, 'read', 'ZScriptHTML_tryForm') -def __init__(self, id, text=None, content_type='text/html', strict=True, output_encoding='utf-8'): +def __init__(self, id, text=None, content_type='text/html', strict=True, + output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) @@ -139,16 +141,13 @@ charset = charsetFromMetaEquiv(text) if is_unicode: - if charset: encoding = None output_encoding = charset else: encoding = None output_encoding =
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/test added provideUtility() calls for UnicodeEncodingConflictResolver
Log message for revision 71759: added provideUtility() calls for UnicodeEncodingConflictResolver in order to make zopectl test shut up Changed: U Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py U Zope/trunk/lib/python/Products/PageTemplates/tests/testHTMLTests.py U Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py -=- Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py 2007-01-07 11:39:14 UTC (rev 71758) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py 2007-01-07 12:00:13 UTC (rev 71759) @@ -14,9 +14,12 @@ import unittest import zope.component.testing +from zope.component import provideUtility from zope.traversing.adapters import DefaultTraversable from Products.PageTemplates.tests import util from Products.PageTemplates.PageTemplate import PageTemplate +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver +from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver from Acquisition import Implicit from AccessControl import SecurityManager from AccessControl.SecurityManagement import noSecurityManager @@ -50,6 +53,7 @@ def setUp(self): super(DTMLTests, self).setUp() zope.component.provideAdapter(DefaultTraversable, (None,)) +provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver) self.t = AqPageTemplate() self.policy = UnitTestSecurityPolicy() Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testHTMLTests.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/testHTMLTests.py 2007-01-07 11:39:14 UTC (rev 71758) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/testHTMLTests.py 2007-01-07 12:00:13 UTC (rev 71759) @@ -14,11 +14,14 @@ import unittest import zope.component.testing +from zope.component import provideUtility from zope.traversing.adapters import DefaultTraversable from Products.PageTemplates.tests import util from Products.PageTemplates.PageTemplate import PageTemplate from Products.PageTemplates.GlobalTranslationService import \ setGlobalTranslationService +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver +from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver from AccessControl import SecurityManager from AccessControl.SecurityManagement import noSecurityManager @@ -67,6 +70,8 @@ super(HTMLTests, self).setUp() zope.component.provideAdapter(DefaultTraversable, (None,)) +provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver) + self.folder = f = Folder() f.laf = AqPageTemplate() f.t = AqPageTemplate() Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py === --- Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py 2007-01-07 11:39:14 UTC (rev 71758) +++ Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py 2007-01-07 12:00:13 UTC (rev 71759) @@ -15,6 +15,12 @@ TEMPFILENAME = tempfile.mktemp(.zpt) +def setUp(self): +from zope.component import provideUtility +from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver +from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver +provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver) + def tearDown(self): if os.path.exists(self.TEMPFILENAME): os.unlink(self.TEMPFILENAME) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py merge from HEAD
Log message for revision 71764: merge from HEAD Changed: U Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py -=- Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py === --- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 12:29:16 UTC (rev 71763) +++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py 2007-01-07 12:31:44 UTC (rev 71764) @@ -21,6 +21,7 @@ import logging from zope.component import getUtility +from zope.component.interfaces import ComponentLookupError from zope.interface import implements from zope.tales.tales import Context, Iterator from zope.tales.expressions import PathExpr, StringExpr, NotExpr @@ -199,9 +200,17 @@ elif isinstance(text, str): # bahh...non-unicode string..we need to convert it to unicode -resolver = getUtility(IUnicodeEncodingConflictResolver) +# catch ComponentLookupError in order to make tests shut-up. +# This should not be a problem since it won't change the old +# default behavior + try: +resolver = getUtility(IUnicodeEncodingConflictResolver) +except ComponentLookupError: +return unicode(text) + +try: return resolver.resolve(self.contexts['context'], text, expr) except UnicodeDecodeError,e: LOG.error(UnicodeDecodeError detected for expression %s\n ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] ZCML and 'zopectl test'?
Hi, I added Products/PageTemplates/configure.zcml to register an utility. That works fine when running Zope however zopectl test won't work properly anymore because the utility registration does not seem to happen when running the tests. Bug or feature? Andreas pgpB6Sn9gS6El.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] SOAP support?
Hi, I think it would be time to support SOAP out-of-the-box in some way in Zope 2. XMLRPC is still a useful functionality but the whole world speak of web-services and Zope should support building web-services at least on the SOAP level. I am sure that would bring back some more attention to Zope as application-server. There are several SOAP related products available on zope.org. Does anyone know about their functionality, pros cons? I know that there is also some SOAP support available for Plone/Archetypes (I think written by Benjamin Saller). Thoughts? Andreas pgp9qlY9TNM6w.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: ZCML and 'zopectl test'?
Andreas Jung wrote: I added Products/PageTemplates/configure.zcml to register an utility. That works fine when running Zope however zopectl test won't work properly anymore because the utility registration does not seem to happen when running the tests. Bug or feature? Tests need to do their own setup. ZCML isn't magically loaded for tests, unless those tests are run within a layer that loads all ZCML before running the tests. So, there are two options: - modify the setUp() of the tests in question to provideUtility(your_utility) - make the respective tests run in a layer that loads the ZCML. I don't think layer support is on the trunk yet. Whit Morriss has a branch where he added that to Zope 2, but it still hasn't been merged :( Philipp -- http://worldcookery.com -- Professional Zope documentation and training 2nd edition of Web Component Development with Zope 3 is now shipping! ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope 2.10.2 coming up
Hi, I plan to release Zope 2.10.2 in a week or so (don't nail me to a particular date). This will be a beta release because it contains several ZPT changes (as discussed earlier on the list) that must/should be tested. In addition I will merge my latest changes (the UnicodeEncodingConflictResolver stuff) in order to make the handling of UnicodeDecodeErrors (possibly introduced by the changes) configurable. I am aware that this is a new feature which is forbidden by design on a release branch however there is a need to deal with such decoding errors in a reasonable and configurable way. However the default behavior won't change. Andreas pgpffVOdh1drg.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] SOAP support?
Andreas Jung wrote: Hi, I think it would be time to support SOAP out-of-the-box in some way in Zope 2. XMLRPC is still a useful functionality but the whole world speak of web-services and Zope should support building web-services at least on the SOAP level. I am sure that would bring back some more attention to Zope as application-server. There are several SOAP related products available on zope.org. Does anyone know about their functionality, pros cons? I know that there is also some SOAP support available for Plone/Archetypes (I think written by Benjamin Saller). i like the idea ver much, we have been doing a number of projects that needed SOAP connectivity. we always used pythons HTTP/URL-libs to connect to the services. therefore I can not comment available Zope/Plone based tools. Using SOAP implementing these project not only might have been more straight forward but would have left the client (even) more confident to have chosen the right tool. robert begin:vcard fn:robert rottermann n:rottermann;robert email;internet:[EMAIL PROTECTED] tel;work:031 333 10 20 tel;fax:031 333 10 23 tel;home:031 333 36 03 x-mozilla-html:FALSE version:2.1 end:vcard ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 7 OK
Summary of messages to the zope-tests list. Period Sat Jan 6 12:00:00 2007 UTC to Sun Jan 7 12:00:00 2007 UTC. There were 7 messages: 7 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.6 Python-2.1.3 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:09:00 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006985.html Subject: OK : Zope-2.6 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:10:31 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006986.html Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:12:01 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006987.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:13:31 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006988.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:15:01 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006989.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:16:31 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006990.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Sat Jan 6 21:18:01 EST 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-January/006991.html ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] SOAP support?
On 1/7/07, Andreas Jung [EMAIL PROTECTED] wrote: Hi, I think it would be time to support SOAP out-of-the-box in some way in Zope 2. XMLRPC is still a useful functionality but the whole world speak of web-services and Zope should support building web-services at least on the SOAP level. I am sure that would bring back some more attention to Zope as application-server. There are several SOAP related products available on zope.org. Does anyone know about their functionality, pros cons? I know that there is also some SOAP support available for Plone/Archetypes (I think written by Benjamin Saller). Thoughts? We implemented a soap service one year ago, in the end, I was parsing the incoming stream, and generated the soap messages by hand. The available tools at that time were soappy with a zope2 wrapper and zsi 2.0 soappy was already in a stage where the developers said that they dont maintain it any more, and people should use zsi. At that time zsi was mostly dead, but some people were writing, there would be a new version soon. That actually happened, but I never looked into that 2.0 version, because I could read and write soap requests already. The old zsi looked very complicated, and threw errors at my wsdl spec. A bit off topic but I still want to throw it in: If you have the freedom to decide whether you offer soap services or not, please read these texts during your evaluation: http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/ http://www.somebits.com/weblog/tech/bad/whySoapSucks.html Especially the strong typing bites us hard sometimes. If I had to support a soap interface as a server, I would receive a wsdl spec file, and would have to implement the message stubs, so for this part, I would need a wsdl parser that creates method stubs. If I would be a client, I would receive a wsdl spec file and would need a wsdl parser that creates method stubs, that actually make type checks of what I send. In the real worlds I live in, it would not help to make every method automatically available as a soap service, because there are ugly and subtle impendance mismatches, for example, if you would want to transfer sets instead of lists. It would be serious pita, to write a method so that it adheres to a complex, given wsdl spec file, and that is probably most often the case. So maybe, soap support would just mean a good documentation of integration of zsi generated code in your product code. Best regards, Patrick Gerken ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Zope 2.10.2 coming up
Hi! Andreas Jung wrote: I plan to release Zope 2.10.2 in a week or so (don't nail me to a particular date). The Zope 2.10 branch still uses Five 1.5.1. There are a few changes on the Five 1.5 branch (including a security fix) which should become part of Zope 2.10.2. I volunteer to resolve this as follows: Five releases are now linked tightly to specific Zope releases, so it doesn't make much sense to do still separate Five releases. See this thread: http://codespeak.net/pipermail/z3-five/2006q4/001889.html If there are no objections, I'll stitch the Five 1.5 branch HEAD directly into the Zope 2.10 branch (without using svn externals) and Five trunk HEAD into the Zope trunk. This would mean that from now on Five 1.5 and 1.6 are maintained as part of Zope 2. In fact there will be no Five 1.5.2 or 1.6 because there will no longer be any separate releases. Thoughts? Cheers, Yuppie ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Zope 2.10.2 coming up
--On 7. Januar 2007 14:48:43 +0100 yuppie [EMAIL PROTECTED] wrote: If there are no objections, I'll stitch the Five 1.5 branch HEAD directly into the Zope 2.10 branch (without using svn externals) and Five trunk HEAD into the Zope trunk. This would mean that from now on Five 1.5 and 1.6 are maintained as part of Zope 2. In fact there will be no Five 1.5.2 or 1.6 because there will no longer be any separate releases. I don't have a problem with this approach. In fact the change would make clear which version belongs to what. Andreas pgptkCcNo9gqY.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: ZCML and 'zopectl test'?
On Sun, Jan 07, 2007 at 12:14:32PM +0100, Philipp von Weitershausen wrote: So, there are two options: - modify the setUp() of the tests in question to provideUtility(your_utility) - make the respective tests run in a layer that loads the ZCML. I don't think layer support is on the trunk yet. Whit Morriss has a branch where he added that to Zope 2, but it still hasn't been merged :( The testrunner in zope 2 has supported layers for quite a while. I currently use layers in my tests with zope 2.9.1. TestLayersHowTo on zopewiki.org gives a working example. Or do you mean something else by layer support? -- Paul Winkler ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: ZCML and 'zopectl test'?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philipp von Weitershausen wrote: Andreas Jung wrote: I added Products/PageTemplates/configure.zcml to register an utility. That works fine when running Zope however zopectl test won't work properly anymore because the utility registration does not seem to happen when running the tests. Bug or feature? Tests need to do their own setup. ZCML isn't magically loaded for tests, unless those tests are run within a layer that loads all ZCML before running the tests. So, there are two options: - modify the setUp() of the tests in question to provideUtility(your_utility) - make the respective tests run in a layer that loads the ZCML. I don't think layer support is on the trunk yet. Whit Morriss has a branch where he added that to Zope 2, but it still hasn't been merged :( I'm pretty sure that layer support is on the 2.10 branch and the trunk: the CMF trunk tests now depend on it:: $ bin/zopectl show zdctl/zdrun options: schemafile: '/home/tseaver/projects/Zope-CVS/Zope-2.10-branch/lib/python/Zope2/Startup/zopeschema.xml' ... $ bin/zopectl test Running tests via: /home/tseaver/projects/Zope-CVS/bin/python2.4 /home/tseaver/projects/Zope-CVS/Zope-2.10-branch/bin/test.py -v - --config-file /home/tseaver/projects/CMF/cmf_test/z210_cmfhead/etc/zope.conf Parsing /home/tseaver/projects/CMF/cmf_test/z210_cmfhead/etc/zope.conf Running tests at level 1 Running unit tests: Running: . Ran 809 tests with 0 failures and 0 errors in 11.052 seconds. Running Products.CMFCore.testing.FunctionalZCMLLayer tests: Set up Products.CMFCore.testing.FunctionalZCMLLayer in 1.603 seconds. ... Tearing down left over layers: Tear down Products.GenericSetup.testing.ExportImportZCMLLayer in 0.000 seconds. Total: 1351 tests, 0 failures, 0 errors Tres. - -- === Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFoU2z+gerLs4ltQ4RAmxhAKDUo3oEHv8bUIoW/dLMmpeHvMWvdACgy1wU 0P+mwfqR/0MVCICtu5AZ568= =fuE+ -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: ZCML and 'zopectl test'?
On 7 Jan 2007, at 20:44 , Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philipp von Weitershausen wrote: Andreas Jung wrote: I added Products/PageTemplates/configure.zcml to register an utility. That works fine when running Zope however zopectl test won't work properly anymore because the utility registration does not seem to happen when running the tests. Bug or feature? Tests need to do their own setup. ZCML isn't magically loaded for tests, unless those tests are run within a layer that loads all ZCML before running the tests. So, there are two options: - modify the setUp() of the tests in question to provideUtility(your_utility) - make the respective tests run in a layer that loads the ZCML. I don't think layer support is on the trunk yet. Whit Morriss has a branch where he added that to Zope 2, but it still hasn't been merged :( I'm pretty sure that layer support is on the 2.10 branch and the trunk: the CMF trunk tests now depend on it:: I phrased that wrongly. Layer support from the test runner perspective is in Zope 2 since Zope 2.9. But Zope 2 itself actually using test layers is not in any release branch. $ bin/zopectl show zdctl/zdrun options: schemafile: '/home/tseaver/projects/Zope-CVS/Zope-2.10-branch/lib/python/Zope2/ Startup/zopeschema.xml' ... $ bin/zopectl test Running tests via: /home/tseaver/projects/Zope-CVS/bin/python2.4 /home/tseaver/projects/Zope-CVS/Zope-2.10-branch/bin/test.py -v - --config-file /home/tseaver/projects/CMF/cmf_test/z210_cmfhead/etc/zope.conf Parsing /home/tseaver/projects/CMF/cmf_test/z210_cmfhead/etc/zope.conf Running tests at level 1 Running unit tests: Running: .. .. .. .. .. .. .. .. .. .. .. ... Ran 809 tests with 0 failures and 0 errors in 11.052 seconds. Running Products.CMFCore.testing.FunctionalZCMLLayer tests: Set up Products.CMFCore.testing.FunctionalZCMLLayer in 1.603 seconds. ... Tearing down left over layers: Tear down Products.GenericSetup.testing.ExportImportZCMLLayer in 0.000 seconds. Total: 1351 tests, 0 failures, 0 errors Tres. - -- === Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFoU2z+gerLs4ltQ4RAmxhAKDUo3oEHv8bUIoW/dLMmpeHvMWvdACgy1wU 0P+mwfqR/0MVCICtu5AZ568= =fuE+ -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: ZCML and 'zopectl test'?
I just made ZopeTestCase defer all loading until it's layer(essentially deferring the import of ZopeLite which is sort of a subpar way to handle things and using a registry to handle installProducts). most of what happens in zopelite itself should be the layer(rather than carefully isolating the import) http://svn.zope.org/Zope/branches/whitmo-2.10-layers/ lurker, comments? from what I remember, the only issue was with the sandbox tests(for functional tests). basically in sandboxed test you need a fresh zodb for each test iirc. -w ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] saving/creating an object to an exsisting folderish object
'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 3:39:39 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 6. Januar 2007 21:28:06 -0800 Allen Huang [EMAIL PROTECTED] wrote: is there a method that uses 'name'(a str object) as an argument to call upon this folder? to call upon this folder? No idea what you mean. -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
--On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj pgpsghR4tdF60.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
I don't have a problem with manage_addProduct(). I know how it works. Creating objects in a folder is not a problem to me. My problem is the folderish object which I'm trying to find with a string input. If you've read my previous message, the server output error with name.manage_addFile('point', 'a point') because name is a str object and does not have manage_addFile. I understand this. But name is an id to an exsisting folder that I want to access and do operation inside. how would I modify name.manage_addFile('point', 'a point') into a working statement? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 4:06:27 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Wrapping zope with socksify
On 12/17/06, Dieter Maurer [EMAIL PROTECTED] wrote: Patrick Gerken wrote at 2006-12-13 16:13 +0100: ... Now we got the problem that zope randomly crashed. There are many ways crashed can be interpreted. If crashed means died from a fatal signal (SIGSEGV, SIGBUS, SIGABORT, ...), then the analysis of the core file may provide valuable insights. I am sometimes really bad in answering to helpful tipps :-( The last look at it with strace showed that I should not try to debug this thing by using threads. I still dont know the exact signal he emits, but I know now that it is a problem independent of zope, the same access in pure python code now crashes too now and then. We will first try to upgrade to newer versions of python and then see again. Best regards, Patrick Gerken -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners - Original Message From: Allen Huang [EMAIL PROTECTED] To: zope@zope.org Sent: Sunday, January 7, 2007 5:00:03 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object I don't have a problem with manage_addProduct(). I know how it works. Creating objects in a folder is not a problem to me. My problem is the folderish object which I'm trying to find with a string input. If you've read my previous message, the server output error with name.manage_addFile('point', 'a point') because name is a str object and does not have manage_addFile. I understand this. But name is an id to an exsisting folder that I want to access and do operation inside. how would I modify name.manage_addFile('point', 'a point') into a working statement? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 4:06:27 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] about make products
Allen Huang wrote at 2007-1-2 05:24 -0800: I starting to use Zope 2.9 and I'm told not to use ZClass anymore. Instead of make products with in zope, I should make products using python coding and place it in the product folder. But I don't know zope modules will enough to make my own product. Where should I start? Beside the tips from other messages there is also the Zope Developper Guide (ZDG). It describes the product development aspects as for Zope 2.4. But few things changed until Zope 2.8. From Zope 2.8 on, and especially with Zope 2.9 and Zope 2.10, you have also the possibility to use Zope 3 views via Five. You can use them for the management of your instances in place of the formerly directly embedded templates and actions. But everything described in the ZDG still works. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: zope document management
pol wrote at 2007-1-3 23:31 +0100: Dieter Maurer wrote: Maybe, you have a look at LocalFS. It seems to be not compatible with zope 2.9.6 I have copied the LocalFS-1.3-andreas.tar.gz into the products, but it's not even shown in Control Panel - Product Management list. Have i missed anything? Looking in the logfile to find hints about what is causing the LocalFS installation problems. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: Re: [Zope] Limit size download file in Zope wih LocalFS
Alan wrote at 2007-1-5 10:32 +: ... If I try to download a file bigger than 128 kb, I got a smaller file and when I 'cat' it I got the 'object' (like open file '/scratch/ccpngrid/JOBS/PDBS_all.pdb', mode 'rb' at 0x323c7558) Modern versions of LocalFS return a string for files smaller than 128 kB and a filestream_iterator for larger files. Of course, this requires a Zope version that already supports filestream_iterators. Apparently, your Zope version is too old for the LocalFS version you are using. You may upgrade your Zope, downgrade your LocalFS or modify your LocalFS copy to always return a string. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] all_meta_types confusion
Garth B. wrote at 2007-1-5 23:06 -0500: I'm trying to filter the objects that appear in the Add drop down, and I'm having odd results. There are two scenarios. In the first scenario, the active user is a Manager and my folderish object does not have a defined all_meta_types function. Everything shows up in the Add drop down as expected. When I define all_meta_types for my folderish object to only return one kind of object, the Add x button appears as one would expect. In the second scenario, I have a role Editor which controls what kinds of objects the user can add. When I do not have an all_meta_types function defined on my folderish object, only those objects that the role permits the user to add are shown. When I define all_meta_types for my folderish object to only return one of the kinds of objects that the role does permit, the user can't add anything. No Add x button that one would normally see when only able to add a single type of object to a folderish object. You have included the 'permission' definition in your meta_type entry? -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
--On 7. Januar 2007 08:07:28 -0800 Allen Huang [EMAIL PROTECTED] wrote: I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners Why (the hell) are you (still) using DTML (as newbie). You are strongly encouraged to use ZPT. -aj pgpN5Lj6da8Ze.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
Will... I just found out that I'm suppose to migrate to ZPT. But, I start with DTML to begin with and I've be doing it for the past two years, so it's kind hard for me to move on to xml and ZPT right off the bat. But the tag:attribute structure still confuses me. Anyways, thanks for all your help Andreas, couldn't done it without you forcing me to think about my problem. - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Monday, January 8, 2007 4:39:32 AM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 08:07:28 -0800 Allen Huang [EMAIL PROTECTED] wrote: I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners Why (the hell) are you (still) using DTML (as newbie). You are strongly encouraged to use ZPT. -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
Aloha, Allen Huang wrote: Will... I just found out that I'm suppose to migrate to ZPT. But, I start with DTML to begin with and I've be doing it for the past two years, so it's kind hard for me to move on to xml and ZPT right off the bat. But the tag:attribute structure still confuses me. I started using zope right about when TAL/ZPT was fully rolled out (2.4.x or so)...to me the dtml structure is confusing as heck to look at...it's all relative... :-) Go for it, make the switch, eventually you'll be really glad you did. Not the least because almost nobody is going to help you with dtml any more...! TAL is not easy reading for me either but it sure beats the alternatives. I am easily disappointed by other web dev platforms that despite all kinds of other sophistication (ruby-rails, alfresco etc.) still keep using or creating yet one more HTML-munging template language. I mean, how 20th century is that? cheers, John S. -- John Schinnerer - MA, Whole Systems Design -- - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration [EMAIL PROTECTED] http://eco-living.net ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-DB] Basic tsql example using MxODBC Zope DA adaptor?
Am 04.01.2007, 18:47 Uhr, schrieb [EMAIL PROTECTED] [EMAIL PROTECTED]: Hello Everyone, I am relatively new to Zope/Plone, as well as the MxODBC Zope DA adaptor. I am wondering if someone could point me to a basic example that would illustrate how to use the MxODBC Zope DA adaptor outside of a ZSQL method, using the Python API. I am using a script to build transact-sql statements, and it doesn't appear to be possible to pass t-sql into a ZSQL method. You can use the mxODBC ZopeDA to pass in all kinds of SQL, ie. if you wish to generate your SQL dynamically or to make use of bound parameters. This is done using an ExternalMethod as detailed below. However, this will still be within Zope's transacational management and is, thus, not suitable if you wish to manage transactions yourself. If you wish to do this then you should first of all read up on Zope's transactional management to see how to use this. If you wish to use this for something like a batch function then you are probably better of without using Zope at all. ZSQL and ZopeDAs are severely limited and contain antiquated code. This makes it particularly difficult to generate dynamic SQL as often required. It also means that parameters get quoted by the DA which can be messy. An alternative is to use ExternalMethods to call the .execute() method of an mxODBCZopeDA and pass it statements and parameters. Create a file in ~/Extensions, say ODBC_SQL.py This is essentially needs only one function: from Shared.DC.ZRDB import Results def callSQL(connObj, SQL=SELECT value FROM content): results = connObj.execute(SQL) return Results.Results(results) Create a Zope External Method say SQL which points to callSQL in ODBC_SQL. You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = select [Building ID] from [Buildings] \ where [Building Name] = ? results = context.SQL(mymxODBCZopeDA(), statement) return results The results returned are the same as would be returned by a ZSQL-method. Charlie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db