[Zope-Checkins] SVN: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py This version of PageTemplateFile seems to work fine although
Log message for revision 65667: This version of PageTemplateFile seems to work fine although it requires further testing. The implementation uses its own Engine and traverse since browser pages configured through ZCML are looked up by a bobo_traverse() hack. However the standdard simpleTraverse() method of zope.tales. expressions only performs the traversal using __getitem__(). So we define our own traverser that also tries a traversal using restrictedTraverse(). The code is still ugly, needs some more cleanup and renaming. Changed: U Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py -=- Modified: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py === --- Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 14:22:51 UTC (rev 65666) +++ Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 16:03:26 UTC (rev 65667) @@ -10,35 +10,97 @@ # FOR A PARTICULAR PURPOSE # ## -Filesystem Page Template module -Zope object encapsulating a Page Template from the filesystem. - +import os -__version__ = '$Revision: 1.30 $'[11:-2] +from Globals import package_home, InitializeClass +from App.config import getConfiguration +from ZopePageTemplate import ZopePageTemplate +from zope.app.content_types import guess_content_type +import AccessControl -import os, AccessControl -from logging import getLogger -from Globals import package_home, DevelopmentMode +from ComputedAttribute import ComputedAttribute +from OFS.SimpleItem import SimpleItem +from Expressions import SecureModuleImporter +from OFS.Traversable import Traversable +from zope.pagetemplate.pagetemplatefile import PageTemplateFile as PTF +from zope.pagetemplate.pagetemplate import PageTemplate as PT + from Shared.DC.Scripts.Script import Script + +from OFS.SimpleItem import Item_w__name__ from Shared.DC.Scripts.Signature import FuncCode -from AccessControl import getSecurityManager -from OFS.Traversable import Traversable -from PageTemplate import PageTemplate -from Expressions import SecureModuleImporter -from ComputedAttribute import ComputedAttribute -from Acquisition import aq_parent, aq_inner -from App.config import getConfiguration -from OFS.SimpleItem import Item_w__name__ -LOG = getLogger('PageTemplateFile') +from zope.tales.tales import ExpressionEngine +from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr, SubPathExpr +from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined +from zope.tales.expressions import SimpleModuleImporter +from zope.tales.pythonexpr import PythonExpr -class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable): -Zope wrapper for filesystem Page Template using TAL, TALES, and METAL +from zope.tales.expressions import PathExpr -meta_type = 'Page Template (File)' +_marker = object() +def extendedSimpleTraverse(object, path_items, econtext): +Traverses a sequence of names, first trying attributes then items. + + +for name in path_items: +next = getattr(object, name, _marker) +if next is not _marker: +object = next +elif hasattr(object, '__getitem__'): +try: +object = object[name] +except: +# FIX bare try..except +object = object.restrictedTraverse(name) +else: +# Allow AttributeError to propagate +object = getattr(object, name) +return object + + + +class MyPathExpr(PathExpr): + +def __init__(self, name, expr, engine, traverser=extendedSimpleTraverse): +self._s = expr +self._name = name +paths = expr.split('|') +self._subexprs = [] +add = self._subexprs.append +for i in range(len(paths)): +path = paths[i].lstrip() +if _parse_expr(path): +# This part is the start of another expression type, +# so glue it back together and compile it. +add(engine.compile('|'.join(paths[i:]).lstrip())) +break +add(SubPathExpr(path, traverser, engine)._eval) + + + +def Engine(): +e = ExpressionEngine() +reg = e.registerType +for pt in MyPathExpr._default_type_names: +reg(pt, MyPathExpr) +reg('string', StringExpr) +reg('python', PythonExpr) +reg('not', NotExpr) +reg('defer', DeferExpr) +e.registerBaseName('modules', SimpleModuleImporter()) +return e + +Engine = Engine() + + + +class PageTemplateFile(SimpleItem, Script, PT, Traversable): + + func_defaults = None func_code = FuncCode((), 0) _v_last_read = 0 @@ -53,32 +115,44 @@
[Zope-Checkins] SVN: Products.Five/trunk/browser/pagetemplatefile.py added preliminary code to make implementation work with the Zope 3 ZPT
Log message for revision 65670: added preliminary code to make implementation work with the Zope 3 ZPT implementation on ajung-final-zpt-integration branch Changed: U Products.Five/trunk/browser/pagetemplatefile.py -=- Modified: Products.Five/trunk/browser/pagetemplatefile.py === --- Products.Five/trunk/browser/pagetemplatefile.py 2006-03-01 16:07:51 UTC (rev 65669) +++ Products.Five/trunk/browser/pagetemplatefile.py 2006-03-01 16:08:49 UTC (rev 65670) @@ -47,6 +47,14 @@ basepath, ext = os.path.splitext(self.filename) self.__name__ = os.path.basename(basepath) + + +# required for the ajung-zpt-final-integration branch +try: +PageTemplateFile.__init__(self, self.filename, _prefix) +except: +pass + def get_path_from_prefix(self, _prefix): if isinstance(_prefix, str): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py moved custom traverser into Five
Log message for revision 65672: moved custom traverser into Five Changed: U Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py -=- Modified: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py === --- Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 16:22:18 UTC (rev 65671) +++ Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 16:53:06 UTC (rev 65672) @@ -32,75 +32,11 @@ from Shared.DC.Scripts.Signature import FuncCode -from zope.tales.tales import ExpressionEngine -from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr, SubPathExpr -from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined -from zope.tales.expressions import SimpleModuleImporter -from zope.tales.pythonexpr import PythonExpr - -from zope.tales.expressions import PathExpr - -_marker = object() - -def extendedSimpleTraverse(object, path_items, econtext): -Traverses a sequence of names, first trying attributes then items. +class PageTemplateFile(SimpleItem, Script, PT, Traversable): + A Zope 2-aware wrapper class around the Zope 3 ZPT +PageTemplateFile implementation. -for name in path_items: -next = getattr(object, name, _marker) -if next is not _marker: -object = next -elif hasattr(object, '__getitem__'): -try: -object = object[name] -except: -# FIX bare try..except -object = object.restrictedTraverse(name) -else: -# Allow AttributeError to propagate -object = getattr(object, name) -return object - - - -class MyPathExpr(PathExpr): - -def __init__(self, name, expr, engine, traverser=extendedSimpleTraverse): -self._s = expr -self._name = name -paths = expr.split('|') -self._subexprs = [] -add = self._subexprs.append -for i in range(len(paths)): -path = paths[i].lstrip() -if _parse_expr(path): -# This part is the start of another expression type, -# so glue it back together and compile it. -add(engine.compile('|'.join(paths[i:]).lstrip())) -break -add(SubPathExpr(path, traverser, engine)._eval) - - - -def Engine(): -e = ExpressionEngine() -reg = e.registerType -for pt in MyPathExpr._default_type_names: -reg(pt, MyPathExpr) -reg('string', StringExpr) -reg('python', PythonExpr) -reg('not', NotExpr) -reg('defer', DeferExpr) -e.registerBaseName('modules', SimpleModuleImporter()) -return e - -Engine = Engine() - - - -class PageTemplateFile(SimpleItem, Script, PT, Traversable): - - func_defaults = None func_code = FuncCode((), 0) _v_last_read = 0 @@ -225,9 +161,6 @@ return None -def pt_getEngine(self): -return Engine - def __getstate__(self): from ZODB.POSException import StorageError raise StorageError, (Instance of AntiPersistent class %s ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/component.txt i renamed the view name last night
Log message for revision 65675: i renamed the view name last night Changed: U Products.Five/branches/philikon-local-components/component/component.txt -=- Modified: Products.Five/branches/philikon-local-components/component/component.txt === --- Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 17:32:51 UTC (rev 65674) +++ Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 18:28:39 UTC (rev 65675) @@ -59,7 +59,7 @@ viewnames = [reg.name for reg in view.templateViewRegistrations()] viewnames.sort() pprint(viewnames) - [u'customizeview.html', u'templateviews.html'] + [u'customizetemplate.html', u'templateviews.html'] Customizing views ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/c More catching up with the renaming
Log message for revision 65676: More catching up with the renaming Changed: U Products.Five/branches/philikon-local-components/component/component.txt U Products.Five/branches/philikon-local-components/component/customizetemplate.pt -=- Modified: Products.Five/branches/philikon-local-components/component/component.txt === --- Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 18:28:39 UTC (rev 65675) +++ Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 18:36:20 UTC (rev 65676) @@ -68,9 +68,9 @@ We can select a view and see its template source: view = zope.component.getMultiAdapter((item, request), - ... name=ucustomizeview.html) + ... name=ucustomizetemplate.html) view = view.__of__(item) - print view.templateSource(u'customizeview.html') #doctest: +ELLIPSIS + print view.templateSource(u'customizetemplate.html') #doctest: +ELLIPSIS html metal:use-macro=context/@@standard_macros/view i18n:domain=zope ... @@ -80,13 +80,13 @@ We now hit the customize button and get a customized ZPT template: - zpt = view.doCustomizeTemplate(u'customizeview.html') + zpt = view.doCustomizeTemplate(u'customizetemplate.html') That actually creates a ZPTPage object in the nearest site (perhaps later we'd like to have the option to pick which of the sites above us should be targeted) - zpt = getattr(site, 'customizeview.html') + zpt = getattr(site, 'customizetemplate.html') print zpt.read() #doctest: +ELLIPSIS html metal:use-macro=context/@@standard_macros/view i18n:domain=zope @@ -104,7 +104,7 @@ from zope.app.component.hooks import setSite setSite(site) view = zope.component.getMultiAdapter((item, request), - ... name=ucustomizeview.html) + ... name=ucustomizetemplate.html) print view() doctest BLANKLINE Modified: Products.Five/branches/philikon-local-components/component/customizetemplate.pt === --- Products.Five/branches/philikon-local-components/component/customizetemplate.pt 2006-03-01 18:28:39 UTC (rev 65675) +++ Products.Five/branches/philikon-local-components/component/customizetemplate.pt 2006-03-01 18:36:20 UTC (rev 65676) @@ -10,7 +10,7 @@ template source /pre - form action=. action=customizeTemplate method=post + form action=. action=@@customizetemplate method=post enctype=multipart/form-data input type=hidden name=viewname value=theviewname ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/browser.py rename variable obj - site
Log message for revision 65677: rename variable obj - site don't reacquire the zpt object Changed: U Products.Five/branches/philikon-local-components/component/browser.py -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 18:36:20 UTC (rev 65676) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 18:36:57 UTC (rev 65677) @@ -86,17 +86,16 @@ src = self.templateSource(viewname) # find the nearest site -obj = self.context -while obj is not None and not IObjectManagerSite.providedBy(obj): -obj = aq_parent(obj) -if obj is None: +site = self.context +while site is not None and not IObjectManagerSite.providedBy(site): +site = aq_parent(site) +if site is None: raise TypeError(No site found) #TODO find right exception zpt = ZPTPage() zpt.source = unicode(src) -obj._setObject(viewname, zpt) #XXX there could be a naming conflict -zpt = getattr(obj, viewname) -components = obj.getSiteManager() +site._setObject(viewname, zpt) #XXX there could be a naming conflict +components = site.getSiteManager() # find out the view registration object so we can get at the # provided and required interfaces ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py some import were missing
Log message for revision 65680: some import were missing Changed: U Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py -=- Modified: Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py === --- Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 20:07:21 UTC (rev 65679) +++ Zope/branches/ajung-final-zpt-integration/lib/python/Products/PageTemplates/PageTemplateFile.py 2006-03-01 21:00:33 UTC (rev 65680) @@ -15,6 +15,7 @@ from Globals import package_home, InitializeClass from App.config import getConfiguration +from Acquisition import aq_parent, aq_inner from ZopePageTemplate import ZopePageTemplate from zope.app.content_types import guess_content_type import AccessControl ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/trunk/browser/pagetemplatefile.py fixed traverser
Log message for revision 65681: fixed traverser Changed: U Products.Five/trunk/browser/pagetemplatefile.py -=- Modified: Products.Five/trunk/browser/pagetemplatefile.py === --- Products.Five/trunk/browser/pagetemplatefile.py 2006-03-01 21:00:33 UTC (rev 65680) +++ Products.Five/trunk/browser/pagetemplatefile.py 2006-03-01 21:13:20 UTC (rev 65681) @@ -42,15 +42,15 @@ next = getattr(object, name, _marker) if next is not _marker: object = next -elif hasattr(object, '__getitem__'): +else: try: -object = object[name] -except KeyError: -# deal with traversal through bobo_traverse() object = object.restrictedTraverse(name) -else: -# Allow AttributeError to propagate -object = getattr(object, name) +except (KeyError, AttributeError): +try: +object = object[name] +except: +object = getattr(object, name) + return object ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/ Use Products.PageTemplates.ZopePageTemplate instead of zope.app.zptpage.ZPTPage
Log message for revision 65682: Use Products.PageTemplates.ZopePageTemplate instead of zope.app.zptpage.ZPTPage because the things we put in an ObjectManager really need to be SimpleItems (grrr). Slightly refactored the view factory (local function instead of class). Also introduced a root object in the doctest because ZopePageTemplate needs to be able to call self.getPhysicalRoot() (which is implicitly acquired). Changed: U Products.Five/branches/philikon-local-components/component/browser.py U Products.Five/branches/philikon-local-components/component/component.txt -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 21:13:20 UTC (rev 65681) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 22:18:14 UTC (rev 65682) @@ -15,10 +15,12 @@ $Id$ -from Acquisition import aq_parent +from Acquisition import aq_parent, aq_acquire, aq_inner from Products.Five.browser import BrowserView from Products.Five.component import enableSite, disableSite from Products.Five.component.interfaces import IObjectManagerSite +from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate +from Products.PageTemplates.Expressions import SecureModuleImporter from zope.interface import providedBy from zope.component import getMultiAdapter @@ -26,7 +28,6 @@ from zope.component.persistentregistry import PersistentComponents from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.component.hooks import clearSite -from zope.app.zptpage import ZPTPage from zope.app.apidoc.presentation import getViews, getViewInfoDictionary class ComponentsView(BrowserView): @@ -92,9 +93,9 @@ if site is None: raise TypeError(No site found) #TODO find right exception -zpt = ZPTPage() -zpt.source = unicode(src) -site._setObject(viewname, zpt) #XXX there could be a naming conflict +id = str(viewname) #XXX this could barf +viewzpt = ZopePageTemplate(id, src) +site._setObject(id, viewzpt) #XXXthere could be a naming conflict components = site.getSiteManager() # find out the view registration object so we can get at the @@ -103,31 +104,50 @@ if reg.name == viewname: break -components.registerAdapter(ZPTViewFactory(zpt), required=reg.required, +components.registerAdapter(viewFactory(viewzpt), required=reg.required, provided=reg.provided, name=viewname) #XXX info? -return zpt +return viewzpt def customizeTemplate(self, viewname): -zpt = self.doCustomizeTemplate(viewname) +viewzpt = self.doCustomizeTemplate(viewname) #TODO use @@absolute_url view -self.request.RESPONSE.redirect(zpt.absolute_url() + /manage_workspace) +self.request.RESPONSE.redirect(viewzpt.absolute_url() + /manage_workspace) -class ZPTViewFactory(object): +def viewFactory(viewzpt): +def view(context, request): +return ZPTView(viewzpt, context, request) +return view -def __init__(self, zptpage): -self.zptpage = zptpage +class ZPTView(BrowserView): -def __call__(self, context, request): -return ZPTView(self.zptpage, context, request) - -class ZPTView(object): - -def __init__(self, zptpage, context, request): -self.zptpage = zptpage +def __init__(self, viewzpt, context, request): +self.viewzpt = viewzpt self.context = context self.request = request -def __call__(self, **kw): -namespace = self.zptpage.pt_getContext(self.context, self.request, **kw) -namespace['view'] = self #XXX get the real view class -return self.zptpage.pt_render(namespace) +#def _zptNamespace(self): +#root = aq_acquire(self.context, 'getPhysicalRoot')() +#here = aq_inner(self.context) +#view = self #XXX get the real view class +#return { +#'template': self.viewzpt, +#'nothing': None, +#'request': request, +#'here': here, +#'context': here, +#'container': here, +#'view': view, +#'root': root, +#'modules': SecureModuleImporter, +#} + +def __call__(self, *args, **kwargs): +view = self #XXX get the real view class + +namespace = self.viewzpt.pt_getContext() +if not kwargs.has_key('args'): +kwargs['args'] = args +namespace['options'] = kwargs +namespace['view'] = view + +return self.viewzpt.pt_render(namespace) Modified: Products.Five/branches/philikon-local-components/component/component.txt
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/ get the template top-level variable namespace right and test it.
Log message for revision 65688: get the template top-level variable namespace right and test it. improve some of the explanations in the doctest. Changed: UU Products.Five/branches/philikon-local-components/component/browser.py U Products.Five/branches/philikon-local-components/component/component.txt -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:07:35 UTC (rev 65687) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:17:05 UTC (rev 65688) @@ -125,29 +125,25 @@ self.context = context self.request = request -#def _zptNamespace(self): -#root = aq_acquire(self.context, 'getPhysicalRoot')() -#here = aq_inner(self.context) -#view = self #XXX get the real view class -#return { -#'template': self.viewzpt, -#'nothing': None, -#'request': request, -#'here': here, -#'context': here, -#'container': here, -#'view': view, -#'root': root, -#'modules': SecureModuleImporter, -#} +def _zptNamespace(self): +root = aq_acquire(self.context, 'getPhysicalRoot')() +here = aq_inner(self.context) +view = self #XXX get the real view class +return { +'template': self.viewzpt, +'nothing': None, +'request': self.request, +'here': here, +'context': here, +'container': here, +'view': view, +'root': root, +'modules': SecureModuleImporter, +} def __call__(self, *args, **kwargs): -view = self #XXX get the real view class - -namespace = self.viewzpt.pt_getContext() +namespace = self._zptNamespace() if not kwargs.has_key('args'): kwargs['args'] = args namespace['options'] = kwargs -namespace['view'] = view - return self.viewzpt.pt_render(namespace) Property changes on: Products.Five/branches/philikon-local-components/component/browser.py ___ Name: svn:keywords + Id Modified: Products.Five/branches/philikon-local-components/component/component.txt === --- Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 23:07:35 UTC (rev 65687) +++ Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 23:17:05 UTC (rev 65688) @@ -17,6 +17,7 @@ from OFS.Application import Application root = Application() + Turning ObjectManagers into a site -- @@ -25,14 +26,15 @@ from OFS.ObjectManager import ObjectManager site = ObjectManager() -We need to add it to the root: +We need to add it to the root so that objects contained in it have a +proper acquisition chain all the way to the top: id = root._setObject('site', site) site = root.site -Make this a real site by using a view that a) sets -``IObjectManagerSite``, b) sets a traversal hook and c) sets a -component registration +Now we make this a real site by using a view that a) sets +``IObjectManagerSite``, b) sets a traversal hook and c) gives the site +a component registration object (formerly known as site manager): import zope.component from zope.publisher.browser import TestRequest @@ -80,7 +82,8 @@ Customizing views - -We can select a view and see its template source: +In the list of template-based browser views we can select one and see +the source of its template: view = zope.component.getMultiAdapter((item, request), ... name=ucustomizetemplate.html) @@ -97,9 +100,9 @@ zpt = view.doCustomizeTemplate(u'customizetemplate.html') -That actually creates a ZPTPage object in the nearest site (perhaps -later we'd like to have the option to pick which of the sites above us -should be targeted) +That actually creates a PageTemplate object in the nearest site +(perhaps later we'd like to have the option to pick which of the sites +above us should be targeted) zpt = getattr(site, 'customizetemplate.html') print zpt.read() #doctest: +ELLIPSIS @@ -111,18 +114,40 @@ ... It also registers this component as a view now, so when we look up the -view again, we get the customized one. Therefore let us customize the -template and look up the view. For that to work, we also need to make -the site the current site: +view again, we get the customized one. Therefore let us actually +change the template to give us some info output: -
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/tests.py expand the id keyword
Log message for revision 65689: expand the id keyword Changed: _U Products.Five/branches/philikon-local-components/component/tests.py -=- Property changes on: Products.Five/branches/philikon-local-components/component/tests.py ___ Name: svn:keywords + Id ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/ Take the original view class for the 'view' object. In order to find it, we
Log message for revision 65693: Take the original view class for the 'view' object. In order to find it, we look for it at the global level (which might not be enough in the future). For this to work we also need to remember its view name. Changed: U Products.Five/branches/philikon-local-components/component/browser.py U Products.Five/branches/philikon-local-components/component/component.txt -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:27:54 UTC (rev 65692) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:53:24 UTC (rev 65693) @@ -22,8 +22,8 @@ from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate from Products.PageTemplates.Expressions import SecureModuleImporter -from zope.interface import providedBy -from zope.component import getMultiAdapter +from zope.interface import Interface, providedBy +from zope.component import getMultiAdapter, getGlobalSiteManager from zope.component.globalregistry import base from zope.component.persistentregistry import PersistentComponents from zope.publisher.interfaces.browser import IBrowserRequest @@ -104,7 +104,8 @@ if reg.name == viewname: break -components.registerAdapter(viewFactory(viewzpt), required=reg.required, +view_factory = viewFactory(viewzpt, viewname) +components.registerAdapter(view_factory, required=reg.required, provided=reg.provided, name=viewname) #XXX info? return viewzpt @@ -113,22 +114,30 @@ #TODO use @@absolute_url view self.request.RESPONSE.redirect(viewzpt.absolute_url() + /manage_workspace) -def viewFactory(viewzpt): +def viewFactory(viewzpt, viewname): def view(context, request): -return ZPTView(viewzpt, context, request) +return ZPTView(viewzpt, viewname, context, request) return view class ZPTView(BrowserView): -def __init__(self, viewzpt, context, request): +def __init__(self, viewzpt, viewname, context, request): self.viewzpt = viewzpt +self.viewname = viewname self.context = context self.request = request +def _findViewClass(self): +gsm = getGlobalSiteManager() +view = gsm.queryMultiAdapter((self.context, self.request), Interface, + name=self.viewname) +if view is not None: +return view +return self + def _zptNamespace(self): root = aq_acquire(self.context, 'getPhysicalRoot')() here = aq_inner(self.context) -view = self #XXX get the real view class return { 'template': self.viewzpt, 'nothing': None, @@ -136,7 +145,7 @@ 'here': here, 'context': here, 'container': here, -'view': view, +'view': self._findViewClass(), 'root': root, 'modules': SecureModuleImporter, } Modified: Products.Five/branches/philikon-local-components/component/component.txt === --- Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 23:27:54 UTC (rev 65692) +++ Products.Five/branches/philikon-local-components/component/component.txt 2006-03-01 23:53:24 UTC (rev 65693) @@ -126,6 +126,7 @@ ... view: tal:var replace=structure nocall:view / ... modules: tal:var replace=structure modules / ... options: tal:var replace=structure options / + ... nothing: tal:var replace=structure nothing / ... , content_type=None) In order to be able to look up the customized view now, we need to @@ -145,9 +146,10 @@ root: Application at template: ZopePageTemplate at customizetemplate.html request: zope.publisher.browser.TestRequest instance URL=http://127.0.0.1 - view: Products.Five.component.browser.ZPTView object at ... + view: Products.Five.metaclass.SimpleViewClass from .../Five/component/customizetemplate.pt object at ... modules: Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at ... options: {'args': ()} + nothing: BLANKLINE Clean up: ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/browser.py Remind myself that we're not doing everything we might have to yet.
Log message for revision 65694: Remind myself that we're not doing everything we might have to yet. Changed: U Products.Five/branches/philikon-local-components/component/browser.py -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:53:24 UTC (rev 65693) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-01 23:56:01 UTC (rev 65694) @@ -128,6 +128,8 @@ self.request = request def _findViewClass(self): +#XXX we might want to walk up to the next site instead, not +# just go to the global one directly gsm = getGlobalSiteManager() view = gsm.queryMultiAdapter((self.context, self.request), Interface, name=self.viewname) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/customizetemplate.pt One action is enough.
Log message for revision 65701: One action is enough. Changed: U Products.Five/branches/philikon-local-components/component/customizetemplate.pt -=- Modified: Products.Five/branches/philikon-local-components/component/customizetemplate.pt === --- Products.Five/branches/philikon-local-components/component/customizetemplate.pt 2006-03-02 00:02:36 UTC (rev 65700) +++ Products.Five/branches/philikon-local-components/component/customizetemplate.pt 2006-03-02 00:18:55 UTC (rev 65701) @@ -10,7 +10,7 @@ template source /pre - form action=. action=@@customizetemplate method=post + form action=@@customizetemplate method=post enctype=multipart/form-data input type=hidden name=viewname value=theviewname ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/browser.py ugh, wrong base classes
Log message for revision 65703: ugh, wrong base classes Changed: U Products.Five/branches/philikon-local-components/component/browser.py -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-03-02 00:19:31 UTC (rev 65702) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-03-02 00:20:09 UTC (rev 65703) @@ -114,7 +114,7 @@ #TODO use @@absolute_url view self.request.RESPONSE.redirect(viewzpt.absolute_url() + /manage_workspace) -class ZPTViewFactory(viewzpt, viewname): +class ZPTViewFactory(object): def __init__(viewzpt, viewname): self.viewzpt = viewzpt ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py Use the Zope2 TALES engine to support Zope2-compatible TALES traversal.
Log message for revision 65715: Use the Zope2 TALES engine to support Zope2-compatible TALES traversal. If that is going to go away, then this will have to be done differently, but at least this fixes several issues where the z3-style PageTemplate implementation didn't do everything that the Zope 2 one did. Changed: U Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py -=- Modified: Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py === --- Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py 2006-03-02 05:08:28 UTC (rev 65714) +++ Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py 2006-03-02 05:42:25 UTC (rev 65715) @@ -38,6 +38,8 @@ from zope.pagetemplate.pagetemplate import PageTemplate from zope.pagetemplate.pagetemplatefile import sniff_type +from Products.PageTemplates.Expressions import getEngine + # regular expression to extract the encoding from the XML preamble encoding_reg= re.compile('\?xml.*?encoding=(.*?).*?\?', re.M) @@ -132,6 +134,9 @@ self.ZBindings_edit(self._default_bindings) self.pt_edit(text, content_type, encoding) +def pt_getEngine(self): +return getEngine() + security.declareProtected(change_page_templates, 'pt_edit') def pt_edit(self, text, content_type, encoding='utf-8'): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Re: [Zope3-dev] Two visions
On Tuesday 28 February 2006 06:51, Martijn Faassen wrote: snip great discussion I think we can just carry on this message. I could not agree more. I have nothing to add at this point. Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Two visions
On Wednesday 01 March 2006 00:33, Jeff Shell wrote: All of these big features are neat and well. But I want less. I don't know how to use less. There are dependencies on zope.app creeping into packages allowed in zope.*, and I understand that more of that is likely to happen in the future. And that terrifies me. Don't be. :-) It is the first step of actually making zope.app *much* smaller. This in turn will mean that you might be able to develop apps without relying on zope.app at all, which is better for you, since you can control the installed components better. I think by finding a good packaging solution and staying the path of reducing zope.app we will achieve what you want. :-) Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Two visions
On Tuesday 28 February 2006 07:39, Martijn Faassen wrote: I know I sound conservative here, but I'm actually happy with the way things are working now. Let's not fix what isn't broken. We can make incremental steps to making it better, and I'm glad people are starting to understand the ideas behind Five, but I don't see the need for a change of direction. A strong +1. Wow, I agree with Martijn for three posts in a row; that has not happened for a long time. :-) Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Tuesday 28 February 2006 11:00, Jim Fulton wrote: Zope 2 is more mature than Zope 3 in a lot of areas. WebDAV and process management are a couple of examples that occur to me off the top of my head. Except that Michael Kerrins recent WebDAV work will shaddow Zope 2's support. If I understand his improved implementation correctly, then it is very, very cool! Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Tuesday 28 February 2006 12:33, Martijn Faassen wrote: Are you kidding? No, I'm not kidding. +1 on the entire post from me too. And I would really like to see the questions he raised answered. We just recovered from this BBB overpromise, now we want to make another one. We also just started to position the Zope 3 name and software correctly in the market and now we are going to confuse people again. That is just plain stupid^M^M^M^M^M^Msilly. Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Wed, Mar 01, 2006 at 09:12:08AM -0500, Stephan Richter wrote: | On Tuesday 28 February 2006 11:00, Jim Fulton wrote: | Zope 2 is more mature than Zope 3 in a lot of areas. WebDAV | and process management are a couple of examples that occur to me | off the top of my head. | | Except that Michael Kerrins recent WebDAV work will shaddow Zope 2's support. | If I understand his improved implementation correctly, then it is very, very | cool! Did you run the litmus tests against it? :) BTW, I'm working on converting the full set of the litmus tests to a functional doctest, will check that in soon. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Wednesday 01 March 2006 09:24, Sidnei da Silva wrote: | Except that Michael Kerrins recent WebDAV work will shaddow Zope 2's | support. If I understand his improved implementation correctly, then it | is very, very cool! Did you run the litmus tests against it? :) I don't know what that is, of course. :-) I think talking to Michael is the better choice here. :-) Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Wed, Mar 01, 2006 at 09:29:05AM -0500, Stephan Richter wrote: | On Wednesday 01 March 2006 09:24, Sidnei da Silva wrote: | | Except that Michael Kerrins recent WebDAV work will shaddow Zope 2's | | support. If I understand his improved implementation correctly, then it | | is very, very cool! | | Did you run the litmus tests against it? :) | | I don't know what that is, of course. :-) I think talking to Michael is the | better choice here. :-) First hit: http://www.google.com/search?q=webdav+litmus+tests What you think about turning those into functional doctests? -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Wednesday 01 March 2006 09:32, Sidnei da Silva wrote: What you think about turning those into functional doctests? Of course a very, very big +1. :-) Though I woul split them up, so that we can only test features that we know we have implemented. Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On Wednesday 01 March 2006 14:32, Sidnei da Silva wrote: On Wed, Mar 01, 2006 at 09:29:05AM -0500, Stephan Richter wrote: | On Wednesday 01 March 2006 09:24, Sidnei da Silva wrote: | | Except that Michael Kerrins recent WebDAV work will shaddow Zope 2's | | support. If I understand his improved implementation correctly, then | | it is very, very cool! | | Did you run the litmus tests against it? :) | | I don't know what that is, of course. :-) I think talking to Michael is | the better choice here. :-) First hit: http://www.google.com/search?q=webdav+litmus+tests What you think about turning those into functional doctests? Never seen that before - found a bunch of bugs with it too :-) Thanks for the link Michael -- Michael Kerrin 55 Fitzwilliam Sq., Dublin 2. Tel: 087 688 3894 ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
Martijn Faassen wrote: Jim Fulton wrote: On Tue, 2006-02-28 at 17:29 +0100, Martijn Faassen wrote: Jim Fulton wrote: [snip] I see Zope 5 being a combination of Zope 2 and Zope 3, keeping the best of both. I think we already have Zope 5, and it's called Zope 2.9. Perhaps I'm wrong. If so, how does Zope 5 differ from Zope 2.9? Are you kidding? No, I'm not kidding. Zope 2.9 is the closest thing to Zope 5 that we have today, that people can work with. Zope 2.10 will hopefully be closer too, and so on. It is not very close. It is not close enough, IMO, to call it Zope 5. Zope 5 will be backward compatible with Zope 2 and Zope 3. It will allow configurations that look a lot like Zope 3. Sounds like the original vision of Zope 3 without the X. I thought we never got around to developing this stuff the last time. Actually, no. We originally said that we would provide a transition path. I said over and over that this was *not* going to be backward compatibility. I guess this was too complex a message. I think your post proves that it was. I saw Five as a key enabling technology for the transition. For some time, I said that Five would gradually narrow the gap between Zope 2 and Zope 3 until the transition would be very small. What changed? I assumed that Zope 3 would become more like Zope 2. That it would provide much the same features, if in somewhat different forms. This is still possible, but I don't really seeit happening. No matter how hard you and others work on Five, it's gonna be pretty hard for people to transition to Zope 3 if it doesn't provide the features they need. It will have the best of both systems, and improvements to both. Zope 2.9 has a lot of two systems. It doesn't have improvements to both, as we see that's clearly the mandate of the Zope 3 project, not of the Zope 2 or Five projects. We improve Zope 2 by taking bits of Zope 3. Mixing these things up into a Zope 5 puddle risks mixing it all up a lot. Yes it does. I think the risks of continuing two application server projects for the forseeable future has greater risks. When do you think all this work will be finished? I don't know. I don't think it has to be that far away, I think it could happen by the end of 2007, but that depends on resources. Who will work on it? There are a lot of people working on Five and on leveraging Zope 3 in Zope 2 now. There are a lot more people working on these efforts than are working on Zope 3. I think that having a single application server, which is an evolution of Zope 2 will encourage a lot more people to invest time. What do we do in the mean time? What do we tell people? We tell people where we're going. We tell people that Zope 2 is not a dead end. That they aren't second class citizens if they stay with Zope 2. We tell the people using Zope 3 now that they won't be left high and dry. That the future single application server will run there applications too. That it can be configured to look a lot like what they're used to now. Do you really feel comfortable promising all that? Based on what I've seen over the last year, I feel comfortable setting it as a goal/vision/roadmap. I can't promise anything. I never suggested I was. How are we not on the course to reaching this featureset, eventually, anyway? I think we're moving along pretty well. I don't see how *saying* what Zope 5 will contain will make it *exist* any time sooner. You seem to be arguing against a roadmap, which is puzzling. Obviously, predictions of the future are imperfect. These sound like useful evolution proposals for Zope 2 and Zope 3 to me... Yes The current story of Zope 2, Five and Zope 3 gets us in the right direction (Zope 5, if you want to call it that, though I would definitely want to introduce yet another name in the mix), step by step. We don't promise too much to people. We don't raise the wrong expecations anymore. What expectations did we raise? AFAIK, the official story is that Zope 3 will eventually replace Zope 2 and that Zope 2 will be augmented with Zope 3 technology to make the transition easier. I don't think there are many people, if any, really working on making Zope 3 a credible replacement for Zope 2. There are people working on making it into something wonderful, but not a replacement for Zope 2. Do you agree that this is the current story? If not, and if *we* cannot agree on what the current story is, think how confused everyone else must be. Everyone in the community is on board. I think many people in the community are extreemely confused. We are already doing the work that's required to reach the ideal of Zope 5. Exactly. The new vision I described attempts to capture reality. There are two parts to the reality: 1. Most of the effort in the Zope community is going toward improving Zope 2 with Zope 3 technology. 2. People working on Zope 3 don't want it to become like Zope 2. They
Re: [Zope3-dev] Re: [Zope-dev] Two visions
Stephan Richter wrote: On Tuesday 28 February 2006 12:33, Martijn Faassen wrote: Are you kidding? No, I'm not kidding. +1 on the entire post from me too. And I would really like to see the questions he raised answered. OK, done. We just recovered from this BBB overpromise, What are you talking about? now we want to make another one. We also just started to position the Zope 3 name and software correctly in the market I'm so reassured. I had the opposite impression. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On 3/1/06, Jim Fulton [EMAIL PROTECTED] wrote: What's your point? That we shouldn't plan? That we shouldn't have a common vision for where we're going, or communicate that vision? Well, not neccesarily. Things change, and the plan for the future has not always been the same. The important part is that we work in the same direction. I think this discusson has been fruitful, and useful, but we don't need to get consensus on a plan yet, because no matter what the plan is, the next few steps are the same: Make Zope2+Five use more and more Zope3 technologies, making the transition smaller. That plan is good at least until July, and probably until december. Commiting to a vision too soon may mean we have to change the vision, which as we have seen, is not an easy communication task to do. So I suggest we commit to the vision of making Zope2 and Zope3 more similar, for the moment, and continue discussing the future for while more, before we commit to a proper vision. The vision we have now may be fluffy and slightly different, but at least we are not pulling in different directions, and that means it's not too fluffy, yet. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
Lennart Regebro wrote: On 3/1/06, Jim Fulton [EMAIL PROTECTED] wrote: What's your point? That we shouldn't plan? That we shouldn't have a common vision for where we're going, or communicate that vision? Well, not neccesarily. Things change, and the plan for the future has not always been the same. The important part is that we work in the same direction. How is that possible if we don't communicate the vision? Are you suggesting a Zope Underground that knows the vision but keeps it secret to avoid making people nervous? ;) I think this discusson has been fruitful, and useful, but we don't need to get consensus on a plan yet, Then how are we going to work on the plan? because no matter what the plan is, the next few steps are the same: Make Zope2+Five use more and more Zope3 technologies, making the transition smaller. That plan is good at least until July, and probably until december. If the plan is to make make Zope 3 a replacement for Zope 2 or even to make them converge, then Zope 3 needs a lot of work that wouldn't be warrented otherwise. Commiting to a vision too soon may mean we have to change the vision, which as we have seen, is not an easy communication task to do. There's nothing wrong with changing the vision as long as it makes sense to do so. Sometimes, you change where you want to go based on what you've learned or on a changing environment. So I suggest we commit to the vision of making Zope2 and Zope3 more similar, for the moment, That implies more work than you realize. You seem to think that making Zope 2 and Zope 3 similar only requires changes to Zope 2. That is not true. It would require a lot of changes to Zope 3 too, changes that I don't think there's a lot of appetite for at this point. and continue discussing the future for while more, before we commit to a proper vision. The vision we have now may be fluffy and slightly different, but at least we are not pulling in different directions, and that means it's not too fluffy, yet. I think a lack of a realistic vision means that we are pulling in different directions. I think this is causing a lot of harm. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
Stephan Richter wrote: On Wednesday 01 March 2006 10:06, Jim Fulton wrote: I don't see how *saying* what Zope 5 will contain will make it *exist* any time sooner. You seem to be arguing against a roadmap, which is puzzling. I don't think Martijn is arguing against a roadmap, he just asserts (and ( agree with him) that the current roadmap using Five is a good one that we should be following for while. What do you think the current roadmap is? I'm not sure we agree onwhat it is. That's a huge problem. BTW, you also have not addressed the naming issue. I think that throwing another name out there will make the community more wary than comfortable. I think that having one name for two radically different, though related, things is very confusing. There are really 2 main technologies that people care about: 1. The Zope app server. This is characterized by things like an object file system, through-the-web scripting and/or development, pluggable course-grained add-ons, etc. 2. The collection of Zope technologies that can be combined and reused in a variety of ways. These technologies support the app server, but they have a life of their own. I think that these efforts are very different and that calling them both zope is very confusing to people. OTOH, there are related. The first builds on the second, which is why, in many ways, Z is a good name for the second. I'll reiterate that the serach term Z is handled well by Google. IANANE (I am not a naming expert). I'm willing to defer to someone else on the names, but I think we do need to distinguish these two efforts more than we do now. I'll note that the fact that the single name Zope 3 refers to both technologies above is very confusing to people. My suggestion would be to move along as we do now, replace the security mechanism, use Zope 3's PTs in Zope 2, even switch the publisher, etc. Do we also fix WebDAV in Zope 3? How about TTW scripting? How about process control? Or all of the other things in Zope 2 that we haven't gotten around to yet? If we aren't going to work on these, don't you think we are giving people false expectations for Zope 3's application server? Then we can revisit our vision.roadmap and see how we can go from there. If you find this unacceptable, then you or someone else must do a much better job explaining the technical details of this vision. Perhaps, although technical details don't belong in a vision. Can you explain the current vision? Can you explain the current roadmap? Do you think we all agree on what it is? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ 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: [Zope3-dev] Re: [Zope-dev] Two visions
On 3/1/06, Jim Fulton [EMAIL PROTECTED] wrote: Lennart Regebro wrote: Well, not neccesarily. Things change, and the plan for the future has not always been the same. The important part is that we work in the same direction. How is that possible if we don't communicate the vision? In the long run it probably isn't. But in the short term it seems to work fine. :) Then how are we going to work on the plan? We don't have to work on a plan. All we need is to work. A plan is only needed when people start working in different directions. If the plan is to make make Zope 3 a replacement for Zope 2 or even to make them converge, then Zope 3 needs a lot of work that wouldn't be warrented otherwise. Maybe, but does it need it just right now? That implies more work than you realize. You seem to think that making Zope 2 and Zope 3 similar only requires changes to Zope 2. So far I think it requires only changes to Zope2, yes. If I'm wrong I would be interested to hear what you think must be changed in Zope 3.3 and 3.4. I think a lack of a realistic vision means that we are pulling in different directions. I think this is causing a lot of harm. OK. It doesn't look like that from here, but I could be wrong. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ 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: [Zope3-dev] Two visions
Stephan Richter wrote: On Tuesday 28 February 2006 07:39, Martijn Faassen wrote: I know I sound conservative here, but I'm actually happy with the way things are working now. Let's not fix what isn't broken. We can make incremental steps to making it better, and I'm glad people are starting to understand the ideas behind Five, but I don't see the need for a change of direction. A strong +1. Wow, I agree with Martijn for three posts in a row; that has not happened for a long time. :-) +1 for me also. S. -- Stéfane Fermigier, Tel: +33 (0)6 63 04 12 77 (mobile). Nuxeo Collaborative Portal Server: http://www.nuxeo.com/cps Gestion de contenu web / portail collaboratif / groupware / open source! ___ 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-PAS] project questions
Jens Vagelpohl schrieb: Zac has asked to step back a bit as the contact for the project and I told him I could take over that part. That includes things like release stewardship. One of the items that had been on my list for a while was to move both the download area as well as the collector out of Zac's member folder on zope.org into the well-known areas, underneath / Collectors and /Products, respectively. +1 on that. This eases development a lot. Regards Tino ___ Zope-PAS mailing list Zope-PAS@zope.org http://mail.zope.org/mailman/listinfo/zope-pas
Re: [ZWeb] Zope 2 web site
On Tue, 28 Feb 2006 18:07:22 +, Chris Withers wrote: I hate to say it in this context, but not if it's Plone based. Once bitten, twice shy and all that. Plone was the big promise for the current zope.org and it simply hasn't delivered... Yes, Chris, your great love for Plone is well-documented. Without knowing much about the details, my take is that the current zope.org woes represent more of a problem with process than one of software. After all, Plone doesn't maintain itself, nor is Plone code the source of problems arising from a mangled Zope migration. I think the community would be well-served by a Zope 2 site that has the following properties, regardless of whether it runs on Plone, CPS, or something else: * The site's functionality should be sufficiently narrowly defined that building and maintaining it are straightforward tasks. I don't think it makes sense to try to maintain all the stuff that has built up on the existing zope.org site over the years. It's fine to keep the old stuff around in its present form, but I don't see much value in trying to continue to forward port it. Splitting the site into an actively maintained part that focuses on software distribution and documentation and a minimally maintained part that continues to serve up the old stuff is one way to accomplish this goal. * The site should be built largely with off-the-shelf components. Since much of the community's energy is focused on Zope 3, it doesn't make sense to invest a lot of work in custom code for a Zope 2 site. Given the sorry state of the current site, having something running sooner rather than later would make all of us look better. PloneHelpCenter and PloneSoftwareCenter work well now. If there are CPS / Silva / whatever alternatives, those would be possibilities as well. * The site should be built with software that is actively maintained independently of a zope2.org site. Since a Zope 2 site is unlikely to receive a lot of ongoing attention, it is best that we use components that have an active support base from other projects. PHC and PSC fit the bill. If there are CPS / Silva / whatever alternatives, they are worth considering as well. Doing nothing means that we are stuck with a broken and unmaintained Plone 1 site as our public face for awhile longer. I don't think any of us really want that. Geoff ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] me too. so what to do ?
Simon Michael wrote: Doing nothing means that we are stuck with a broken and unmaintained Plone 1 site as our public face for awhile longer. I don't think any of us really want that. I piggyback on Geoff's insightful post and say the same thing about Zwiki. It's bad marketing for the project I'm trying to grow here, forgetting about Zope for a moment. I mailed Rob and Jim directly offering to help with an upgrade. They are the only people I know who could unblock the red tape that keeps zope.org static. No response (under their radar, I expect). So where does this leave us ? Isn't it time to fork zope.org ? Not in the destructive bad-feeling sense. I mean isn't it up to we the community to get organized, get focussed and build what we really want, prove with running code and *happy users* that it works, and then come back to see if Zope corp. wants to point zope.org there ? I don't expect one such attempt will be enough, there should be several. I've done it once at zopewiki.org. I'd love to see some plone-based visions of zope.org. May i suggest you have a look at http://codespeak.net/svn/z3/zopeweb/trunk/project.txt ? I'd like to invite you to join the effort - but I don't want to think about forking zope.org and i immediately loose interest when you say plone. Michael -- http://zope.org/Members/d2m http://planetzope.org ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] me too. so what to do ?
On Wed, 01 Mar 2006 21:21:02 +0100, Michael Haubenwallner wrote: May i suggest you have a look at http://codespeak.net/svn/z3/zopeweb/trunk/project.txt ? I'd like to invite you to join the effort - but I don't want to think about forking zope.org and i immediately loose interest when you say plone. Michael, That effort sounds like a fine longer-term solution. I am talking about something that could be deployed quickly with code that works today. The focus would be on distribution and documentation of Zope 2, not of Zope 3. I am suggesting Plone because there are software packages in existence right now that fit the bill pretty well -- the point is to NOT develop anything new but rather to improve the existing zope.org until something better (such as the effort you describe, perhaps) is ready. Geoff ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] Zope 2 web site
Geoff Davis geoff at phds.org writes: On Wed, 01 Mar 2006 17:11:00 +0100, Lennart Regebro wrote: On 3/1/06, Geoff Davis geoff at phds.org wrote: Are there good CPS analogues to PloneSoftwareCenter / PloneHelpCenter? I doubt it, although I have no idea what they do. They run plone.org/products and plone.org/documentation, respectively - they are designed to make it easy for the community to contribute, review and maintain add-in products (complete with issue trackers, roadmaps, documentation sections and release management... all optional of course) and documentation (how-tos, tutorials, reference manuals, error references etc.) They have worked extremely well for Plone, increasing the quality of our documentation tenfold and the availability of third party products to real users tremendously. I was joking, really. ;) (Although CPS has one benefit over Plone; it's faster, especially under loads). Yeah, Plone can be a bit pokey -- we're working on it! With the new caching infrastructure in the CacheFu product, it is quite speedy. plone.org, which uses it, does just fine under heavy traffic. ... and 2 ZEO clients on a single server behind Squid Martin ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] me too. so what to do ?
Jens Vagelpohl jens at dataflake.org writes: This isn't as easy as it seems, and simple provisioning of manpower is only one small part. snip red tape That's so incredibly stupid I can't believe no-one's ever done anything about it. Considering that Zope is largely community-maintained, the community deserves to have some more direct control over the website. As open source developers, we surely all understand that if you make something sufficiently hard, people won't bother even with the best of intentions. zope.org is so miserable it deserves to die or at least be sectioned off to an old.zope.org and locked down, with a new site that has had some proper thinking behind it in its place. My suggestion to the community would be to set up an unofficial Zope site for the time being, running in whatever CMS they want to use, hell, using static HTML in Apache if they wish, that presents the information they want to present and provides the features they want to see, and gives them the power to do so. When the Zope Foundation happens, they can take ownership and find a route towards making such a site official by merging it with or letting it supplant the existing site, if that's appropriate. In open source, this is called forking and happens when the process around the old project became too much misalgigned with the needs and wishes of the community. I don't see why that project's outward facing website should be any different. After all, it's the hard work of Jens and Stephan van W and Andreas and Jim and Gary and Martijn and Stephan R and everyone else that drives Zope forward (and most of those guys are not ZC employees). Do they not deserve to have their efforts appropriately presented ... especially when there are people willing in principle to spend their spare time doing that? Martin ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] me too. so what to do ?
On 1 Mar 2006, at 23:45, Geoff Davis wrote: The issues I am more concerned about are the social / political ones. The signature issue is interesting, but probably surmountable -- all Plone contributors are required to sign a contributor agreement. But don't forget - this agreement is with what many people perceive as big bad Zope Corporation... I know quite a few people who would not sign it because they are paranoid about ZC. 1) If the Plone community were to be good Zope citizens and come up with some volunteers and code for an improved, interim zope.org site, would ZC approve? This is up for ZC to decide. If I was at ZC I would support it as long as a committed and capable subset of the Plone community (not Joe Shmoe off the street, but credible people) is willing to support the Plone side (meaning anything above CMF) 100%. 2) Could we get support from others in the Zope community for infrastructure _not_ related to Plone? I'm one of the people with a login, and I'm willing to support anything up to and including CMF. 3) Could we arrange a reasonable division of labor for systems administration so that things can get done? I'm sure this can be done with ZC cooperation. Personally, I'm in favor of more rather than less central control when it comes to systems administration. If you have many people who are supposed to be responsible then you either have all of them falling over each other when a problem occurs, or no one shows up because the assumption is that another person will pick it up. I guess basically I'm saying if you want to do it, then do it right, otherwise it's not worth the effort. jens ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] me too. so what to do ?
On Wed, 01 Mar 2006 19:07:38 -0500, Jim Fulton wrote: Thanks for your response. If we set something up and make it live for testing / feedback, is there a good way to avoid copyright / trademark headaches? I suppose. What sort of copyright / trademark headaches? Zope Corp owns the Zope trademark and the copyright to the content of zope.org. If a group of people put up a site at interim-zope.plone.org or www.interim-zope.org or whatever and started moving zope.org content over to it with the intention of handing things over to the Zope Foundation, how should they avoid running afoul of trademark / copyright violations? Geoff ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] Zope 2 web site
Geoff, Daily several of us (Michael, Martijn F, Phillip V, and a couple others) utilize #zope-web to try and further work that has been going on for awhile to get a suitable zope.org rolled out and upgraded that the community can be proud of. There are people working on docs, marketing data, newsletters, layout/design upgrades and more. Please participate in the existing drive, not start a new one. :) I'd love to see ya drop by. There's no secret that the current site needs fixing; lets pool the collective interest and get it finished up. Andrew Sawyers On Fri, 2006-02-24 at 12:09 -0500, Geoff Davis wrote: Hi all-- I think the idea of a Zope 3 web site rewrite is a great one. However, since Zope 2 is going to continue to be around for awhile, I am wondering if we might be able to shore up the Zope 2 resources in a reasonable way? Migrating all the community content sounds like a herculean task; I'm talking about doing something with rather narrower scope. Here is what I propose: * Create a new zope.org (or zope2.org) for Zope 2 that is focused on 2 things: 1) Distribution of Zope 2 and related add-ons 2) Documentation * Maintain all the old community content in the current instance and bind the two together using URL rewriting. The Plone community has developed a couple of products for distributing software (PloneSoftwareCenter) and for maintaining documentation (PloneHelpCenter). You can see these in action at http://plone.org/products and http://plone.org/documentation , respectively. I know that zope.org gets a lot of traffic; we also have a product for making Plone play nicely with Squid. I think that people in the Plone community would be willing to help out with getting such a site set up. The bigger task would be moving community content to the new setup. Is there any interest? Geoff ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [Zope] External Methods newbie question
Alric Aneron schrieb: Hello, I see I can only execute python functions in external methods. Is there any way to execute the whole file, not just a certain function? In linux I created a python script, and it doesn't have functions. I just want to execute the whole file. I tried using self or init for function names in Zope and it doesn't want to do it, telling me The specified object, /init/, was not found in module, /test/. Is there a way to execute a file? Yes, you can use os.popen* for example - but what is the point? You would waste memory and CPU cycles in firing another complete interpreter environment. Instead move the commands in the file into a function, use the common pattern: def main(): foo.. bar... if __name__=='__main__': main() As you see in many modules. This was you just import the file as module in your external method and call yourmodule.main() (another question: is there a way to execute bash commands in linux? or is external methods only good for python?) What are bash commands? Builtin commands like if, fi, while, case etc? Or do you mean just external executables (binaries, scripts)? And if so, what are they fore? Python is very capable and you can do most with it as easy/easier then with extra commands. If not, see above for os.popen and friends. Regards Tino ___ 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] product security changes from 2.8 to 2.8.5 - SOLVED
Ed Colmar wrote: My process in moving over the product from the old server was to blame. Here's what I did: export all of the zodb contents, Why would you do this?! and un-tarred the product. This resulted in the error of not finding the python methods, even though it appeard to be connected. Dunno what you mean by python methods here... So, I added the product form the add menu, and copy/pasted the zodb contents, and now it's all happy. What product? For future refrence, is there a call to conenct this class back into the zodb filesystem after it has been moved to a new instance? What class? a ZClass? Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ 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 )
[Zope] Acquisition not working as expected
Hello, sorry to come up with this again. I startet 2 pretty confused threads on the same problem allready: [Zope] Error Value: 'File' object has no attribute 'manage_fixupOwnershipAfterAdd' Re: [Zope] context in fs product Unfortunatly I'm still not getting it right. I implemeted the good advices I got in the 2 Threads, slept over it a couple of nights. Looked at the code again, cleaned it up ... still: no success. Here is what I'm doing: I'm about to write a fs product to report on data generated by the grinder load test tool The load tests produce various log files and sar outputs that will have to be parsed and imported into Zope. The instance of the product is created: def manage_addZLTMS(self,id,title='',REQUEST=None,submit=None): Add a ZLMTS to a folder. id=id.replace(' ','_') zltmsObj=ZLTMS(id,title) id=self._setObject(id, zltmsObj) folder=getattr(self, id) folder.manage_addFolder(id='LoadTests',title='Collection') The LoadTest folder is the place where the imported data will be stored. The base class ... class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager, SimpleItem): ZLMTS object ... has an import method def newLasttest(self, REQUEST=None): new ltc=getattr(self,'LoadTests') ltid = self.genId(ltc) lt=Lasttest() lt.id=ltid ltc._setObject(ltid,lt) self.lt = getattr(ltc,ltid) self.lt.importData(self.manage_targets) This generates and instance of the Lasttest() class and imports the data. Lasttest() subclasses from Folder() and store all imported data in a folder hirarchy under itself. This all works fine and I can browse the imported data in the ZMI. The problems start when I want to access the data. eg.: In the base class I created a test3() method: def test3(self): dsaf return self.getId() I can call this method on whatever folder inside the product instance I want, it will always return the id of the product and not the id of the product I call it on. Why is that? So I thought for some reasons the objects in the folder hirarchy are not acquisition wrapped. So I created another testspace() method in the base class: def testspace(self,REQUEST=None): tests if hasattr(self, 'aq_base'): return 'aq wraped' return 'not aq wraped' I can call this on any object in the folder hirarchy and it returns: 'aq wrapped'. Can so. please help me get this straight or hint towards further analysis that I can do. Thanks in advance. Greetings Roman BTW: I did not post any code of the Lattest() class since the problem is allready present in the folder that holds its instances. Of course I will post any part of the code you want me to. ___ 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] Acquisition not working as expected
+---[ Roman Klesel ]-- | Hello, | class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager, SimpleItem): | ZLMTS object | | ... has an import method | | def newLasttest(self, REQUEST=None): |new | ltc=getattr(self,'LoadTests') | ltid = self.genId(ltc) | lt=Lasttest() | lt.id=ltid | ltc._setObject(ltid,lt) | self.lt = getattr(ltc,ltid) | self.lt.importData(self.manage_targets) | | This generates and instance of the Lasttest() class and imports the data. | Lasttest() subclasses from Folder() and store all imported data in a folder hirarchy under itself. | | This all works fine and I can browse the imported data in the ZMI. The problems start when I want to access the data. | | eg.: | | In the base class I created a test3() method: | | def test3(self): | dsaf | return self.getId() | | I can call this method on whatever folder inside the product instance I want, it will always return the id of the | product and not the id of the product I call it on. | | Why is that? Are you sure your genId() method works? what does return self.id return instead of self.getId() ? -- Andrew Milton [EMAIL PROTECTED] ___ 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] Acquisition not working as expected
Hello Andrew, Andrew Milton schrieb: Are you sure your genId() method works? Well, yes, it does what it's ment to do. It generates an id, a string. Here it is: def genId(self,context): asdf items = [ int(e[2:]) for e in context.objectIds('Folder') ] if items == []: return 'lt10' return 'lt%s' % str(max(items)+1 what does return self.id return instead of self.getId() ? I just checked, there is no difference. Both return the id of the product instance as string. Greetings Roman ___ 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] Acquisition not working as expected
Andrew Milton schrieb: Did you paste this code, because it has errors... Ahh sorry, I missed the last charakter, a ). Here it is again: def genId(self,context): asdf items = [ int(e[2:]) for e in context.objectIds('Folder') ] if items == []: return 'lt10' return 'lt%s' % str(max(items)+1) Greetings Roman ___ 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 )
[Zope] Change owner from external app
Hi. I am writing an external application and I need to modify owner and permissions of zope files from that app. I thought about using HTTP object publishing or XML-RPC, so I checked documentation at http://www.plope.com/Books/2_7Edition/AppendixB.stx#2-45 but I can't find any method to deal with owner/permissions. Is there really no way to do this or am I just missing something? Thanks in advance. Marek Ludha ___ 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] Change owner from external app
*Everything* you can do in the ZMI, you can also do from code. Most of it even via XML-RPC. In case a method you want does not publish nicely to XML-RPC, write a helper script in Zope and RPC that one. Also, install DocFinderTab for all the API doc needs you may have. Stefan On 1. Mär 2006, at 17:32, Marek 'MMx' Ludha wrote: Hi. I am writing an external application and I need to modify owner and permissions of zope files from that app. I thought about using HTTP object publishing or XML-RPC, so I checked documentation at http://www.plope.com/Books/2_7Edition/AppendixB.stx#2-45 but I can't find any method to deal with owner/permissions. Is there really no way to do this or am I just missing something? Thanks in advance. Marek Ludha -- Anything that happens, happens. --Douglas Adams ___ 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 )
[Zope] Re: Zope/Plone logon security strategy etc
ok, thanks. I didn't notice the documentation on your site. On 2/28/06, Dieter Maurer [EMAIL PROTECTED] wrote: michael nt milne wrote at 2006-2-28 15:51 +: I'm probably missing something really obvious but am wondering how you actually implement your product on a live plone site. I've got it installed. Do you just customise the login form that comes with the product and use that on the site? I fear you do not understand the essence of HTTP authentication: For any kind of HTTP authentication (whether basic or digest), it is the browser which gathers the login information. Therefore, you do not have a login form (you can customize on the server). Instead, the browser uses its login dialog (which you might customize, if you are using e.g. Mozilla or Firefox, but is usually out of the server's reach). As written in the documentation on my website, DigestAuth currently only contains a DigestAuthCrumbler which works similar to the CookieCrumbler. More precisely: It takes digest auth information, verifies it and (if successful) presents it like basic auth information to the remaining parts of Zope. The CookieCrumbler works very similar: it takes the information from a cookie and presents it like basic auth information to the remaining parts of Zope. The DigestAuthCrumbler is a bit less transparent. It *MUST* know the user's password in order to verify the validity of the presented auth information (more precisely, a special hash would be sufficient, but usual user folders do not support such hashes). Therefore, it can only be used together with UserFolders providing access to the clear text password. -- Dieter -- Michael ___ 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] Acquisition not working as expected
Roman Klesel wrote at 2006-3-1 13:24 +0100: ... I can call this method on whatever folder inside the product instance I want, it will always return the id of the product and not the id of the product I call it on. I fear you will need to more clearly describe what you mean with the product (on one hand) and the product I call it on (on the other hand). You should clearly state which classes the objects the product and the product I call it on have (classes are the primary influence, the acquisition relation is the secondary influence -- this should should state clearly as well). Note also that objects in your Zope hiearchy are not products (a product is a Zope extension mechanisms usually defining and registering various classes that can be use to create persistent Zope objects). -- 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] Change owner from external app
Marek 'MMx' Ludha wrote at 2006-3-1 17:32 +0100: I am writing an external application and I need to modify owner and permissions of zope files from that app. I thought about using HTTP object publishing or XML-RPC, so I checked documentation at http://www.plope.com/Books/2_7Edition/AppendixB.stx#2-45 but I can't find any method to deal with owner/permissions. Is there really no way to do this or am I just missing something? You know that you can change ownership (be aware that there are two completely different types of ownership!) and permissions via the ZMI. Looking at respective the ZMI source will tell you which methods are used (this is a general approach for anything that can be done in the ZMI). In your special case, you can look at the methods defined in AccessControl/Owned.py (executable ownership control), AccessControl/Role.py (local role control, among others the local role Owner; and role permission mapping). -- 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] Acquisition not working as expected
Dieter Maurer schrieb: I can call this method on whatever folder inside the product instance I want, it will always return the id of the product and not the id of the product I call it on. I fear you will need to more clearly describe what you mean with the product (on one hand) and the product I call it on (on the other hand). Yes sorry I got this wrong. The sentence should be like that: I can call this method on whatever folder inside the product instance (instance of the base class ZLTMS) I want, it will always return the id of the instace of the base class (where the method is defined) and not the id of the object (Folder object or File object) I call it on. Once again: The module that holds the base class looks like this: __doc__=Das ist ZLMTS __version__='0.1' from Globals import InitializeClass, Persistent from Products.PageTemplates.PageTemplateFile import PageTemplateFile from AccessControl import ClassSecurityInfo from AccessControl.Role import RoleManager from Acquisition import Implicit from OFS.SimpleItem import SimpleItem from OFS.PropertyManager import PropertyManager from OFS.ObjectManager import ObjectManager from OFS.Folder import Folder from Lasttest import Lasttest manage_addZLTMSForm=PageTemplateFile('zpt/manage_addZLTMSForm',globals()) def manage_addZLTMS(self,id,title='',REQUEST=None,submit=None): Add a ZLMTS to a folder. id=id.replace(' ','_') #Jetzt wird das Product als Instanz erzeugt ... zltmsObj=ZLTMS(id,title) #... und persitiert id=self._setObject(id, zltmsObj) folder=getattr(self, id) #Create a container for the Loadtests folder.manage_addFolder(id='LoadTests',title='Collection') #irgned ein WODOO falls jemand das PRoduct programmatisch hinzufuegt. if REQUEST is not None: try: destURL=self.DestinationURL() except: destURL=REQUEST['URL1'] REQUEST.RESPONSE.redirect(destURL+'/manage_main') return '' class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager, SimpleItem): ZLMTS object security = ClassSecurityInfo() meta_type = 'ZLMTS' manage_options = ObjectManager.manage_options + ( {'label' : 'View', 'action' : ''}, {'label' : 'Settings', 'action' : 'manage_editSettingsForm'}, ) + PropertyManager.manage_options + SimpleItem.manage_options _properties=({'id':'title','type':'string','mode':'w'}, {'id':'description','type':'text','mode':'w'}, ) def __init__(self, id, title='', description='' ): initialise a new instance of ZLMTS self.id=id self.title=title self.description=description self.location_types=['http','path'] self.manage_targets={'gr_sys' : {'name' : '', 'phy_mem' : '', 'location_sar' : '', 'grinder_home' : '', 'server_start_url' : ''}, 'sys1' : {'name' : '', 'phy_mem' : '', 'location_sar' : '', 'server_start_url' : ''}} and so on ... ___ 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 )