Re: [Zope3-Users] z3c.baseregistry question
Dnia piątek, 23 marca 2007 03:15, Stephan Richter napisał: If so I'll be glad to see any introduction or code example of how to use this package. I'm a bit lost after reading baseregistry's doctests. Can you be more specific? I think you can get the gist of things by looking at the ZCML snippets in the main README.txt file and how to register a base registry in the browser/README.txt file. I read these but I must have missed something, because I can't get my code to work. Below are the details. What I try to accomplish is to define default skin for my local site instead of global overrides.zcml. Simplified structure of files in the filesystem: my_product |- site.py |- configure.zcml |- overrides.zcml What I did: 1. I created custom registry instance (site.py - file where my local site is defined): from z3c.baseregistry import baseregistry import zope.component custom = baseregistry.BaseComponents(zope.component.globalSiteManager, 'custom') 2. registered my custom registry (configure.zcml): utility component=.site.custom provides=zope.component.interfaces.IComponents name=custom / 3. set my local site __bases__ (site.py): def setSiteManagerWhenAdded(site, event): site.setSiteManager(LocalSiteManager(site)) sm = site.getSiteManager() custom = zope.component.getUtility(IComponents, name='custom') sm.__bases__ += (custom,) bases = list(sm.__bases__) bases.reverse() sm.__bases__ = bases #what is sm.__bases__ ? print sm.__bases__ #it prints: [BaseComponents custom, LocalSiteManager ++etc++site] 4. placed my_product-overrides.zcml in instance's package-includes: include package=my_product file=override.zcml / 5. placed override.zcml in my_product's root folder: registerIn registry=.site.custom browser:defaultSkin name=MyProductSkin / /registerIn There are no errors when I start my Z3 instance, but the above defaultSkin directive is ignored. What is wrong here? -- Jakub Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] z3c.baseregistry question
Hi! I'd like to register things like default skin or logout adapter (adapter factory=zope.app.security.LogoutSupported /) per application (my local site), not per Zope instance via overrides.zcml. Is it possible to use z3c.baseregistry for that? If so I'll be glad to see any introduction or code example of how to use this package. I'm a bit lost after reading baseregistry's doctests. One more thing - how should I install z3c.baseregistry after I checkouted it from the repository? There is only 'src' folder and no 'setup.py' script. I manually copied files but I suppose it is not a preffered way of installing it. TIA -- Jakub Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope 3 and menus
Dnia wtorek, 13 marca 2007 15:12, Tom Gross napisał: Hi there, I override BrowserMenu from zope.app.publisher.browser.menu and add a entry 'abs_action' to the resulting dictionary. Nice solution. Thanks a lot! -- Jakub Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zope 3 and menus
Hi I've got a problem with menus. I'd like to define a global menu, and then add some options to it depending on actual context (view registered for specific interface). The problem is that when I define global menu element link like: action=/index.html it generates url which omits my folder structure which shold be: root/my_site/index.html and creates: root/index.html. On the other side when i use: action=index.html the url which is created is always relative. I'd like to be able to define my_site (which is in fact a Site object) to be root for actions. What is the correct solution for that? Should I edit global urls before displaying them (add my_site part)? Look at third code snippet below - it generates urls so I can easly change some strings. Is this a proper solution? My code: Menu definition: browser:menu id=monitor_menu title=menu description here / Global menu action (snippet from worldcookery.com code): browser:menuItem for=* menu=monitor_menu title=Start action=/index.html permission=zope.View / Context dependent action: browser:page name=edit.html for=..interfaces.IMonitorConfDB class=.monitor_conf_db_view.MonitorConfDBEditForm permission=zope.View menu=monitor_menu title=Edit config / I display menu using viewlet with template (iirc code from worldcookery book): div id=monitor_menu class=box ul li tal:repeat=item context/@@view_get_menu/monitor_menu a href= tal:attributes=href item/action; title item/description tal:content=item/title/a /li /ul /div -- Jakub Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] viewtemplate
Hi all I recently read Stephan Richter's blog post: http://blogs.lovelysystems.com/srichter/2006/09/20/the-skin-browser-and-lovely-systems-new-development-workflow and intendent scope of viewlets thread: http://thread.gmane.org/gmane.comp.web.zope.zope3.user/4652/focus=4652. I like the idea behind viewtemplate very much (separation of template and view code), but I've some problems with putting all of this together. Let me summarize: 1. Views and Viewlets belong to the layer 2. Templates belong to the skin 3. ViewletManagers belong to.. ? 4. Lovely's packaging practices says that: - views should be placed and registered in project.browser.layer.subpackage_for_the_view_impelentations - templates should be placed and registered in project.browser.skin package - viewletmanagers... ? ViewletManagers may have a class and a template, VMs are called from templates, viewlets are registered for VMs. Shouldn't it be resolved by template tag which registers a template with ViewletManager as it is done for Viewlets and Views? One more thing is a layer declaration such as (from Stephan's post): browser:viewlet name=bloglist for=myproject.interfaces.IBlog manager=myproject.browser.interfaces.IContent view=myproject.browser.blog.BlogPage class=myproject.browser.blog.BlogList layer=myproject.browser.IProjectLayer permission=zope.Public / while template is registered for skin: browser:template template=bloglist.pt layer=myproject.browser.skin.IProjectSkin for=myproject.browser.blog.BlogList / I'm pretty new to the skinnig concept. What is the purpose of IProjectLayer? Is it that views and viewlets are registered to IProjectLayer which is project marker interface, while templates are registered for skins. As a result we have stable project's code base and skins which are just templates. Any discussion on the above topics will be appreciated :) -- Jakub Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Problem with the Zope3 book Example (Can't Browse Interface in Zope 3.2)
Dnia poniedziałek 27 lutego 2006 16:09, Siddhartha Azad napisał: Please let me know if anyone is facing similar problems with this example in Zope 3.2. You're not alone. The same thing here (Zope 3.2, linux) - I've spotted that yesterday and was not able to find why there is no Browse Interfaces tab :(. So thanks for your post, and I hope that someone will give an answer to us :). -- eXt ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Granting Roles - What am I missing?
Dnia sobota 18 lutego 2006 22:52, David Johnson napisał: I created a package which has views that list information from a SQL database. It works great. Would you like to put a bit more informations, about your solution, here? I'm going to build SQL DB based application in near future and I think that such info will be very helpful. Thanks in advance -- eXt ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Zope 3, Windows----Installation ?
[EMAIL PROTECTED] wrote: Hello, Ello! I have downloaded and run the Zope 3 Windows Installer - it seems to complete fine (basically a large compile job). Unfortunately, I cannot find instructions to start Zope and begin learning/developing with it. Have I missed a step? Look at: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/installzope3.html, especially at creating zope instance. Also, the Zope Book (2) describes the install process differently e.g. Site, Security etc options. I think that you looked at Zope 2 Book, and you'd rather should read one of Zope 3 books. Start here: http://dev.zope.org/Zope3 and just go deeper into users section. Take a look also at worldcookery.com and do some googling for Zope 3 tutorials. HTH -- eXt ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users