[Zope3-Users] Status of zsync
Hi, I'm interested in zsync, but cannot find much information via google. I'm using Zope 3.4b2 and there are docs for zsync but the tool seems not to be included!? I'm developing a small zope app and I want to sync my ZPT pages with the filesystem. Or is there another way to develop ZPT pages via filesystem using a text editor like vim? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ImportError running bin/zopectl run myScript.py
Hi, I try to run a script on my zope instance via bin/zopectl run myScript.py. I get the following error: Traceback (most recent call last): File /Users/domma/develop/zope/demo/bin/scriptzope, line 22, in ? import paths ImportError: No module named paths I cannot find a paths.py on my system. Any hint what I'm doing wrong? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Beginner: Reference to ZPT macros
Hi, I have a simple view. Here is the entry in configure.zcml: browser:page for=.CMS.Page name=index.html class=.CMS.PageView permission=zope.Public template=index.pt menu=zmi_views title=Default View / The view works fine so far, but now I want to use a template macro to implement a common layout. So I created a layout.pt in the same folder as index.pt. In index.pt I try to reference layout.pt like this: div xmlns:metal=http://xml.zope.org/namespaces/metal; metal:use- macro=context/@@layout.pt/macros/default_layout div metal:fill-slot=content div tal:content=structure view/html_content/div /div /div Now I get an TraversalError but I could not figure out why. How do I have to reference layout.pt? Do I have to register the emplate somehow? I work with Philips book, but he uses a template created via ZMI in his example. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Debugging Zope3 with Winpdb
Hi, I try to debug zope 3 with winpdb, but without success. Was anybody able to let zope 3 run within winpdb. Winpdb seems to start my z3.py script but the looses the connection to the process. I see no error messages and I'm quite new to winpdb. Any help would be very appreciated! regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Expressing n:m relationship in ZODB
Hi, there was a discussion about the bad idea to simulate a relational database in ZODB using indexes and unique ids. So I wonder what's the correct way to express a n:m realtionship between objects. For example: I have projects and articles. An article might be relevant for multiple projects and a project might have multiple relevant articles. Could I simply give each object a list containing the related objects? Or is this kind of circular reference a problem? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Expressing n:m relationship in ZODB
Leonardo Rochael Almeida wrote: In usual Object Oriented modeling, an n:m relationship is usually modeled as a collection of relationship objects each one keeping one direct reference to each side of the relationship. Of course, using these systems that already try to model relationships helps you not to reinvent another wheel. I think I understand. So if I would like to reinvent another wheel, just for the educatinal purpose, I should do it like this: If I have IArticle and IProject which should have a relationship, I would introduce IArticleProjectRelation which holds a reference to the related objects. These relation objects will be managed by an IArticleProjectRelationManager which has an interface like: relate(article,project) unrelate(article,project) get_related_articles(project) get_related_projects(article) In that case, IArticleProjectRelation would be an implementation detail of IArticleProjectRelationManager and I do not have to expose it at all. And in Zope 3 terms, I would implement the manager as a local utility. Right so far? If yes, I could add helper methods to IArticle and IProject which encapsulate the access of the utility to hide this detail from the user. Would you do that? Or has it some drawbacks which I don't see yet? thanks for your help, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zope 3 as WSGI app using mod_python
Hi, I'm interested in running Zope 3 via mod_python as WSGI app directly in apache. I like the idea to configure different instances simply in my apache config and don't have to setup different running zope instances. The official docs do not say much about this option, but there is a WSGI handler and I found for example this sample configuration: http://codespeak.net/svn/z3/modzope/trunk/democonf/apache2.conf Could somebody tell me what the status of this stuff is? Is it just an experiment which might be dropped in the future? Has somebody experiences to share? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Create catalog index via script
Hi, I have a workspace object, which I initialize in the IObjectCreatedEvent. I try to add a catalog with an index like this: ensureUtility(workspace,zope.app.intid.interfaces.IIntIds,'',IntIds,asObject=True) catalog=ensureUtility(workspace,zope.app.catalog.interfaces.ICatalog,'',Catalog,asObject=True) catalog[tmp]=CategoryIndex() workspace derives from Folder and is already a Site at this point. The last line causes the following error: ComponentLookupError: (InterfaceClass zope.app.intid.interfaces.IIntIds, '') If I remove the line, it works fine. I can see the Catalog in my Workspace and can add the CategoryIndex without problem!? Seems like I'm missing something in the setup of the IIntIds utility, but I have no idea what it is. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ForbiddenAttribute: ('append', []) using append on PersistentList
Hi, I have implemented a view for a catalog index. The page template contains this little form to add strings to a list of categories: form action=@@add_category method=post input type=text name=name input type=submit /form The view class looks like this: class EditView(object): def categories(self): return self.context.categories def add_category(self,name): self.context.categories.append(name) Together they are registered as: browser:page name=categories.html title=Categories menu=zmi_views permission=zope.ManageServices for=proCoders.interfaces.ICategoryIndex class=.CategoryIndex.EditView template=CategoryIndex.pt / browser:page for=proCoders.interfaces.ICategoryIndex name=add_category class=.CategoryIndex.EditView attribute=add_category permission=zope.ManageServices/ If I submit the form, add_category is called, but I get the following error: ForbiddenAttribute: ('append', []) Any hint what I'm doing wrong? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Custom index implementation
Tom Dossis wrote: You need to specify an addMenuItem directive and associated view in your package browser zcml to enable you to add your index objects via the ZMI. Look at zope/app/catalog/browser/configure.zcml as a starting point, e.g. Thanks for the hint and sorry for asking such obvious things. But I'm still a Zope beginner and digging into a new topic I sometimes forget what I've already learned. :-( regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] testing using placefulSetUp, zcml and events
Hi, I have a content object I want to set up in a IObjectCreatedEvent event handler. I want to use the interactive interpreter to play with this, but it looks like my configure.zcml is not parsed and executed if I use placefulSetUp. How do I have to setup my environment to test zcml configured events from command line? Basically I want to write something like some_setup_method() root[ws]=Workspace() # should trigger and handle IObjectCreatedEvent for key in root[ws).keys(): print key to check if the object is setup correctly. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Create RSS feed
Hi, I want to provide an RSS for a content object which is a site. Seems to me, like this should be a generic functionality so I wonder if there is already some product which I did not found!? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with containment and @@absolut_url
Mats Nordgren wrote: context/articles would return the id's [...] The id is a string which has a title method (capitalize each worlds first letter); this is why your article/title is working. [...] You probably should use context/articles/values for the loop. Thanks, it works now. The availability of 'title' confused me. I didn't knew about this method. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Create complex object
Achim Domma wrote: class IWorkspace(Interface): [...] browser:addform label=Add proCoders Article name=AddArticle.html schema=proCoders.interfaces.IArticle content_factory=proCoders.Article.Article permission=zope.ManageContent fields=title / [...] Thanks to Frank for his solution, but I should not post messages late at night: I simply added the fields=title attribute to the wrong browser:addform. If I add the attribute to the right tag, it works fine. Just for the records, in case somebody has the same problem. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Reference to a COM object (or other external resource) in a Zope object
[EMAIL PROTECTED] wrote: I am creating a kind of Zope proxy to a 3rd party COM object (I'm accessing it using Pywin32 facilities). I have to store a reference to this object somewhere in my Zope object. But, for obvious reasons, this COM object cannot be serialized so I cannot put it in any attribute of my Zope object. On the other side, initialisation of the object on each request is too timecost-consuming. With my still somewhat limited Zope knowledge, I would say it sounds like you should have a look at utilities. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Create complex object
Hi, I have the this interface class IWorkspace(Interface): title = TextLine( title=uTitle, description=uThe title, default=uproCoders Workspace, required=True) projects = Container(title=uProjects, description=uxxx) articles = Container(title=uArticles, description=uxxx) with the following implementation class Workspace(Persistent): implements(IWorkspace) title=u'proCoders workspace' projects=None articles=None To set projects and articles I have registered an event subscriber. The handling functions is defined like this: def onObjectCreated(parent,event): if IWorkspace.providedBy(event.object): workspace=IWorkspace(event.object) workspace.projects=ProjectFolder() workspace.articles=ArticleFolder() I registered an add form with the following zcml statement: browser:addform label=Add proCoders Article name=AddArticle.html schema=proCoders.interfaces.IArticle content_factory=proCoders.Article.Article permission=zope.ManageContent fields=title / I added the fields=title attribute, because I get the following error, if I try to create an instance of Workspace: ComponentLookupError: ((zope.schema._bootstrapfields.Container object ... It's clear to me, that the widgets for projects and articles can not be created, but I tought that if I set fields=title I will not show them!? How do I solve this problem? Should I implement a mix-in class for the add view? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Changes on object not persistent if server is restarted.
Hi, I have written this simple content object: class IArticle(Interface): title = TextLine( title=uTitle, description=uThe title, default=u, required=True) body = Text( title=uBody, description=uArticle Body, default=u, required=True) class Article(object): implements(IArticle) title=u'' body=u'' The body of the article is rendered as restructured text. I can create and edit articles via the automatically generated forms. Everything worked fine, but currently my changes are not persistent if I restart the server. The body is not empty after restart, but holds an older version. I'm working with the SVN version of Zope 3. Any hint what I might be doing wrong? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Changes on object not persistent if server is restarted.
Jachin Rupe wrote: You could try making Acrticle inherit from Persistent. Ups! That's really a very stupid error. Thanks for your fast answer and sorry for bothering the list with such trivial problems. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: How to distribute distinct components among multiple Zope servers?
Reinhold Strobl wrote: Consider the followng example: one company has got a Zope application running on a single server. This applications need the components of e.g. the supplier of the component running on a different server. So I don't want to mirror both, because the both companies are more or less independent. So I assume the only possible is XML-RPC (with its limitations of restricted data types and so on)? I'm not a Zope expert, but to me it sounds like you want to solve a problem with Zope, which it is not intended for. If you want to implement complex distributed scenarios use SOAP, XML-RPC, CORBA, DCOM, ... or whatever suits your needs. Then you could still implement a thin Zope utility, which wraps access to such an service, to allow easy access from within a Zope application. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Skinning in Zope 3.3
Hi, I try to understand how to customize the look feel of my page using the new skin/layer implementation of version 3.3. I followed the example on http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SimplifySkinning but still don't understand on how to change the layout of my page. Could somebody provide a short hint on how to override @@standard_macros/page for the ShanghaiSkin in the example above? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Integrating text indexing engine into Zope 3
Hi, I want to integrate support for a specialized text indexing engine into Zope 3. The engine is able to provide documents which are similar to a reference document. First I had a look at ICatalog, but IInjection seems to be the way to go. Could somebody give me a high level overview on how to use / implement these interfaces? I currently think about the following steps: - Implement the index as local utility. - Define an interface IMyStorageDocument for documents to be stored in my index. - Capture somehow if objects are created or deleted. Check if the object can be adapted to IMyStorageDocument. If yes, store it in the index or remove it. Clients then only have to implement an adapter for documents which should be indexed. To search for documents one could access the index as local utility. I'm still a Zope beginner and would be happy to have some guidance into the right direction. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Understanding authentication
Hi, I have created a folder main below [top] and converted it into a site. I added a PAU to the site management folder and a Principal Folder to the PAU. I registered all utilities. Then I created a new principal demo1 and after that a new subfolder below main. I switched to the subfolder and granted management and view permissions to demo1. But I'm not able to login as demo1!? If I add Session Credentials utility to the PAU, I get an endless loop which tries to redirect to a login.htm. Using Zope Real Basic-Auth the login simply fails. Is there a simple example on how to setup a sub-site with a PAU and to allow login to a principal from this PAU. regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] understanding security
Frank Burkhardt wrote: Do I understand it right, that I do not grant a permission to a principal on a certain object instance? I only grant a permission to use a certain interface!? You can either grant permissions to principals (or groups/roles) globally. Those permissions can be used in multiple ways: * To protect Views. You can only access views you have permissions for (e.g. browser:page ... ) * To protect attributes/methods of classes (*not objects*) (class ...required interface=...) * To define, who is allowed to modify certain attributes (class ...required set_schema=... ) I can follow to this point. That's how I understand Zope security until now. Additionally you may grant permissions (and role memberships) on a per object (*not per class*) basis ( using e.g. the grant.html-View) which effects only a single object. That's what I was looking for, but don't know how to do. For I example: I want to let a user create an object (i.e. a message in a message board). All users with a certain role (i.e. Admins) should be able to edit the new object, but the creating user should also be able to edit it. So I have to give him the persmission to edit. How can I do something like that? regards, Achim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users