RE: [Zope-CMF] Design approach questions: unique content-ish items?
Let's use the simplest example I can think of: The site search interface. 1) There's the portal_catalog tool, which does many things, but doesn't do the UI. 2) Presume that a given site only has one site search 3) Presume that you might host many sites, and you might want to provide some configurable content and/or configuration within the content of the search UI (DC Metadata and other things?) 4) You need your own code to "wrap" portal_catalog, put a look/templates to it, customize some search logic, etc ... 5) The location of the search object might be anywhere in the "folder structure" of a given site (root or otherwise). At least I do not want to presume as to where a client might want to put it (beause navigation is usually affected by content structure for better or worst. As are "breadcrumbs"). Items 3, 4, and 5 make me want to do is a content-ish object. Which is what I've done so far. But, its more generic purpose is essentially as a "utility" for the site, at least conceptually. The only difference might be that it's NOT placeless. I however, from a coding perspective, think of it as one. It makes total sense to say getUtility(IMySearch) for instance. This way I don't care where it is, and I'll always get it. There's mechanisms like acquisition, or using superValues() that can achieve something similar, but sill need the object you're looking for to be in the acquisition path. Utilities just have a wider scope (the whole site, or even globally), which seems to make much more sense. I suppose to me it seems that just because the functionality of a utility might apply to a whole site, it doesn't mean it doesn't have a user-facing component such as a UI and hence a "location". My Search object, which presents a nice user friendly interface, has actions registered with portal_types and such, might also have methods that I want to call from somewhere else (i.e. getUtility(IMySearch).lookForSomething()). It is a fairly hybrid object (logic, and UI, and utilitarian). Search is easy to imagine in this scenario, but I have a couple of others scenarios like this, where I have a user facing object/component that has other parts of the site revolving around it. It's a "visual utility" :) Like I said, the idea of a "Site Glossary" might also be a good one. There's only one, it has a search interfaces, shows, results, definitions ... But you might link to it or use it from anywhere in the site. I have no one to talk "zope" to with here at work, so sorry to abuse the list! I'm also learning Zope 3/Component Architecture *through* Zope2/CMF ... J.F. -Original Message- From: Charlie Clark [mailto:[EMAIL PROTECTED] Sent: September 17, 2007 14:20 To: Doyon, Jean-Francois Cc: [EMAIL PROTECTED] Subject: Re: [Zope-CMF] Design approach questions: unique content-ish items? Am 14.09.2007 um 21:21 schrieb Doyon, Jean-Francois: > The simple example is the search stuff. I have a search form, search > results, etc ... build around a content-ish type that in turn uses > portal_catalog. This type should exist only once in the site. It is > in many ways a tool, though it has a user oriented web interface. It > also needs things like DC Metadata support (Corporate policy, ALL our > web pages must have this), and maybe I want to let a site owner > configure other properties of their instance of the search engine. > > Of course, I can just try it, but I'm curious as to high level > thoughts on this type of object, how it can or should be handled, if > anyone has faced this before and how they approach it, etc ... > > Of course, I can't see any way around utilities needing to be in the > root :( I suppose I can fake paths and breadcrumbs or some such thing > if needed ... It's an intriguing post but I think you need to provide more information on the objects & methods you want available for your sites. It sounds a bit like you have something (call it a McGuffin for any film buffs out there) that is installed in the root so that it should be available for any lower level item but it should also be customisable in some way. Why is this different to default instance of the McGuffin installed at root level with local, customised McGuffins installed lower down the hierarchy? This is standard way to do things in Zope, ie. you can overwrite the document_view method of any particular document. Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Design approach questions: unique content-ish items?
I know what you mean, but the problem is that just because it's FOR the site as a whole doesn't mean you want it at the root. Why? Well the main example I can quote is a client that has breadcrumbs on the site, and wants certain things to appear somewhere specific in the navigation of the site. Because the site search is for the whole site, doesn't mean the client doesn't want it to look like it's somewhere in a search folder for instance (maybe other search related things, like the help, live in this folder too?). Due to PT's and their nature, navigation tends to be somewhat automated, so you use location to satisfy navigation. I understand and agree with the fundamental principle of the root as the place for site-wide utilities, but I have to balance that with some real-life practical requirements too :) If I want to be purist about it, what I might need is fake persistent "proxy objects", or symlink-style objects, to satisfy those other needs (the UI side) while still using the useful utility concept (placeless/root). Isn't the concept of something site-wide being at the root mostly motivated because of acquisition though? If you forget about acquisition (using getUtility() means you're not using it), there's no reason it HAS to be there, and forcing it there serves little to no purpose (conceptually, though I understand why they have to be there now in practice). Anyways, now that I know how/why they are placeless and understand more the challenges around them being placeful, I'll have to come up with something else (either place them in the root and workarounds for place/navigation, or no utilities at all). Thanks all! J.F. -Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED] Sent: September 17, 2007 15:22 To: Doyon, Jean-Francois Cc: Charlie Clark; [EMAIL PROTECTED] Subject: RE: [Zope-CMF] Design approach questions: unique content-ish items? Doyon, Jean-Francois wrote at 2007-9-17 15:10 -0400: > ... >But, its more generic purpose is essentially as a "utility" for the site, at least conceptually. The only difference might be that it's NOT placeless. But "utilities for a site" have a natural location: the site root. A "utility" you place deep inside the site are not "utilities for a site" but "utilities for part of a site". -- Dieter ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Design approach questions: unique content-ish items?
Indeed, I suppose that takes care of creation ... I'm more worried about the expense of looking them up. Right now I do a catalog query every time I was to get to such an object, which seems like a lot of overhead. The componentutility from GS wants the object to be in the root for some reason (Although from reading the code, it wasn't always so?). Maybe I can run a provideUtility() on the objects I'm interested in myself manually ... What is the rational for only supporting objects in the root? J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Jung Sent: September 16, 2007 08:05 To: Doyon, Jean-Francois; [EMAIL PROTECTED] Subject: Re: [Zope-CMF] Design approach questions: unique content-ish items? --On 14. September 2007 15:21:28 -0400 "Doyon, Jean-Francois" <[EMAIL PROTECTED]> wrote: > Hello, > > So, I have this situation happen often enough, and I'm not sure what > would be the best way to approach it. The context is a Zope + CMF > (latest) framework deigned to host multiple sites, but where the > content management part is purely internal, we manage sites > internally, and the public facing part is not interactive to users, > they can't log-in, register, or anything like that. > > I have object types that need to exist just once, but need to do much > more than a standard tool is expected to. > > The basic example is the search functionality and user interfaces. > Less obvious is a key feature of one major client site where they have > a mapping tool (as in geographical maps), and many other parts of the > site revolve around it, link to it, etc ... It's in many ways a > utility, but also a contentish/fodlerish type! > > I cannot assume WHERE such an object might be wanted, one client site > could want it in one folder, and another in the root (becaue of > navigation, breadcrumbs, individual site layouts, etc ...). I would create a standard CMF-ish content-type. You can check at creation time if such an object already exists (through a catalog search). If yes, you throw an exception, if not you proceedshould be trivial... -aj ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Design approach questions: unique content-ish items?
Ah, utilities are "placeless" and not location aware. Hmmm that's too bad :( -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doyon, Jean-Francois Sent: September 17, 2007 13:16 To: Andreas Jung; [EMAIL PROTECTED] Subject: RE: [Zope-CMF] Design approach questions: unique content-ish items? Indeed, I suppose that takes care of creation ... I'm more worried about the expense of looking them up. Right now I do a catalog query every time I was to get to such an object, which seems like a lot of overhead. The componentutility from GS wants the object to be in the root for some reason (Although from reading the code, it wasn't always so?). Maybe I can run a provideUtility() on the objects I'm interested in myself manually ... What is the rational for only supporting objects in the root? J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Jung Sent: September 16, 2007 08:05 To: Doyon, Jean-Francois; [EMAIL PROTECTED] Subject: Re: [Zope-CMF] Design approach questions: unique content-ish items? --On 14. September 2007 15:21:28 -0400 "Doyon, Jean-Francois" <[EMAIL PROTECTED]> wrote: > Hello, > > So, I have this situation happen often enough, and I'm not sure what > would be the best way to approach it. The context is a Zope + CMF > (latest) framework deigned to host multiple sites, but where the > content management part is purely internal, we manage sites > internally, and the public facing part is not interactive to users, > they can't log-in, register, or anything like that. > > I have object types that need to exist just once, but need to do much > more than a standard tool is expected to. > > The basic example is the search functionality and user interfaces. > Less obvious is a key feature of one major client site where they have > a mapping tool (as in geographical maps), and many other parts of the > site revolve around it, link to it, etc ... It's in many ways a > utility, but also a contentish/fodlerish type! > > I cannot assume WHERE such an object might be wanted, one client site > could want it in one folder, and another in the root (becaue of > navigation, breadcrumbs, individual site layouts, etc ...). I would create a standard CMF-ish content-type. You can check at creation time if such an object already exists (through a catalog search). If yes, you throw an exception, if not you proceedshould be trivial... -aj ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: Design approach questions: unique content-ish items?
Ah! The idea of more registries is what I'd have to go with I guess ... I'll have a look and debate whether it's worth it :) Thanks for the insight! J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yuppie Sent: September 17, 2007 13:49 To: Zope-CMF List Subject: [Zope-CMF] Re: Design approach questions: unique content-ish items? Hi! Doyon, Jean-Francois wrote: > The componentutility from GS wants the object to be in the root for > some reason (Although from reading the code, it wasn't always so?). > > Maybe I can run a provideUtility() on the objects I'm interested in > myself manually ... What is the rational for only supporting objects > in the root? 1.) Registering objects from sub-folders in the root site manager doesn't work without problems because utilities can't be stored with acquisition wrappers and the re-wrapping always uses the root as context. 2.) It is possible to add additional site managers to sub-folders. That works fine, just the GenericSetup support is missing: http://www.zope.org/Collectors/CMF/500 Cheers, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Design approach questions: unique content-ish items?
Hello, So, I have this situation happen often enough, and I'm not sure what would be the best way to approach it. The context is a Zope + CMF (latest) framework deigned to host multiple sites, but where the content management part is purely internal, we manage sites internally, and the public facing part is not interactive to users, they can't log-in, register, or anything like that. I have object types that need to exist just once, but need to do much more than a standard tool is expected to. The basic example is the search functionality and user interfaces. Less obvious is a key feature of one major client site where they have a mapping tool (as in geographical maps), and many other parts of the site revolve around it, link to it, etc ... It's in many ways a utility, but also a contentish/fodlerish type! I cannot assume WHERE such an object might be wanted, one client site could want it in one folder, and another in the root (becaue of navigation, breadcrumbs, individual site layouts, etc ...). With a mix of permissions, UniqueItem, export/import and so on, I can create objects that can be created only once, and act much like "singletons" but it's tricky and not quite proper ... Now this utility concept comes along from the CA, and it's very handy. The big problem for me seems to be that: - They have to be in the root - They're really meant for tools I guess I'm wanting to have an object that is a hybrid tool/contentish object. It provides functionality, but it also has a website visible interface (actions, templates, etc ...). Also, it's not necessarily in the root. Right now I use the catalog to "find" such objects, which is hardly elegant or efficient. Also, some parts of these objects are user editable (notably the dublin-core stuff), so I really want it to be at least partially manageable by content managers. They however would never need workflow functionality for example. The only thought I've had so far is: - See if I can create a traditional tool, and then extend it with actions, views, etc ... I need to have CMF management interfaces, and have them appear though things like listFolderContents() The simple example is the search stuff. I have a search form, search results, etc ... build around a content-ish type that in turn uses portal_catalog. This type should exist only once in the site. It is in many ways a tool, though it has a user oriented web interface. It also needs things like DC Metadata support (Corporate policy, ALL our web pages must have this), and maybe I want to let a site owner configure other properties of their instance of the search engine. Of course, I can just try it, but I'm curious as to high level thoughts on this type of object, how it can or should be handled, if anyone has faced this before and how they approach it, etc ... Of course, I can't see any way around utilities needing to be in the root :( I suppose I can fake paths and breadcrumbs or some such thing if needed ... Thanks, and a good week-end to you all! Jean-François Doyon Data Dissemination Division | Division de la diffusion des données Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données Earth Sciences Sector | Secteur des sciences de la Terre Natural Resources Canada | Ressources naturelles Canada Ottawa, Canada K1A 0E9 [EMAIL PROTECTED] Telephone | Téléphone 613-992-4902 Facsimile | Télécopieur 613-947-2410 Teletypewriter | Téléimprimeur 613-996-4397 Government of Canada | Gouvernement du Canada ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Problem upgrading 2.0 to 2.1
Hello, OK, I've tried upgrading, and seem to have ironed out most kinks, except for this last one. I can't seem to import the GS profile for MailHost, because the getUtility() call fails: 2007-08-17 14:04:00 ERROR Zope.SiteErrorLog http://:8080/manage_addProduct/ESSPortals/addConfiguredSite Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Products.ESSPortals.factory, line 46, in addConfiguredSite Module Products.GenericSetup.tool, line 313, in runAllImportStepsFromProfile - __traceback_info__: profile-Products.ESSPortals:atlas Module Products.GenericSetup.tool, line 1000, in _runImportStepsFromContext Module Products.GenericSetup.tool, line 966, in _doRunImportStep - __traceback_info__: mailhost Module Products.CMFCore.exportimport.mailhost, line 30, in importMailHost Module zope.component.registry, line 137, in getUtility ComponentLookupError: (, u'') I don't do anything special with this object. I'm using the export/import from CMFCore ... I just have my own profile and XML file for it (looks like there were no changes there). If I add a CMFDefault site, all goes well, mine, no go. I've dug around a bit to see if there are differences between the Portal objects and such, but nothing jumps out at me. The interfaces tab on the MailHost object does show the IMailHost interface ... I'm at a loss, anyone have any ideas? Thanks, Jean-François Doyon Data Dissemination Division | Division de la diffusion des données Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données Earth Sciences Sector | Secteur des sciences de la Terre Natural Resources Canada | Ressources naturelles Canada Ottawa, Canada K1A 0E9 [EMAIL PROTECTED] Telephone | Téléphone 613-992-4902 Facsimile | Télécopieur 613-947-2410 Teletypewriter | Téléimprimeur 613-996-4397 Government of Canada | Gouvernement du Canada ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: Workflowable folders & traversing issues
This does not work with standard Zope + CMF. A private folder with "View" and "Access contents information" unchecked for anonymous, and not acquired, still gets traversed happily, and allows access to objects bewloe it that are published. I guess now I know Plone's version of a folder does what I want, so I'll go digg in there ... Thx, J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Limi Sent: June 7, 2007 12:09 To: [EMAIL PROTECTED] Subject: [Zope-CMF] Re: Workflowable folders & traversing issues On Thu, 07 Jun 2007 05:57:49 -0700, Doyon, Jean-Francois <[EMAIL PROTECTED]> wrote: > OK, so which security setting do I set/unset to prevent traversal then? http://plone.org/documentation/how-to/make-folder-hierarchy-private -- Alexander Limi * http://limi.net ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Workflowable folders & traversing issues
OK, so which security setting do I set/unset to prevent traversal then? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jens Vagelpohl Sent: June 7, 2007 04:49 To: Zope-CMF List Subject: Re: [Zope-CMF] Workflowable folders & traversing issues -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6 Jun 2007, at 19:42, Doyon, Jean-Francois wrote: > Hello, > > I would like to have folders (and/or folder-ish content, if you > prefer), fully wokflowable. > > That is, when a folder is set private, it shouldn't be traversable, > and nothing under it should be accessible to anonymous users (assuming > your standard workflow persmissions). As it stands this isn't the > case, and folders are not workflowed. > > I've looked at using __boob_traverse__ on my Folder class, but that > seems to mess with the security context, as I suddenly start getting > unauthorized errors with something like: > > def __bobo_traverse__(self, REQUEST, name=None): > print 'GOT HERE' > return getattr(self, name, self) > > (Specifically, I can't access properties() on the Folder instance for > example?) If you have your own folder class already you are free to attach any workflow or security settings to it you want. I'm not sure where the problem is. You clearly should not try to enforce security by hacking methods like __bobo_traverse__. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (Darwin) iD8DBQFGZ8ZnRAx5nvEhZLIRAlVKAKC4bqHGP7p4f+8bb86A04xzq7OXUgCfc7Wg 5nm1kBuDuvcYZ7DOwlLxCVc= =aOHo -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Workflowable folders & traversing issues
Hello, I would like to have folders (and/or folder-ish content, if you prefer), fully wokflowable. That is, when a folder is set private, it shouldn't be traversable, and nothing under it should be accessible to anonymous users (assuming your standard workflow persmissions). As it stands this isn't the case, and folders are not workflowed. I've looked at using __boob_traverse__ on my Folder class, but that seems to mess with the security context, as I suddenly start getting unauthorized errors with something like: def __bobo_traverse__(self, REQUEST, name=None): print 'GOT HERE' return getattr(self, name, self) (Specifically, I can't access properties() on the Folder instance for example?) I've looksed at using the registerBeforeTraverse & friends hooks, but those rely on *calling the object* as fas I know (With NameCaller), and I'm not sure overriding __call__ on my Folder class would be such a good idea. I imagine this has been done before? Any thoughts/ideas/solutions? Oh and I didn't see any permission setting that seem to control this also ... that would be ideal of course :) Thanks! Jean-François Doyon Data Dissemination Division | Division de la diffusion des données Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données Earth Sciences Sector | Secteur des sciences de la Terre Natural Resources Canada | Ressources naturelles Canada Ottawa, Canada K1A 0E9 [EMAIL PROTECTED] Telephone | Téléphone 613-992-4902 Facsimile | Télécopieur 613-947-2410 Teletypewriter | Téléimprimeur 613-996-4397 Government of Canada | Gouvernement du Canada ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: GenericSetup Toolset problem
Yup, that's all done too. I just realized I hadn't put in the entry in "import_steps.xml", but now that that's done, doesn't seem to help either. I think I ran into this before and just recreated the whole site ... But now I'd much rather not have to do that ... And in the long run, I have to find a way to add new components without recreating the whole thing! So: - Import/export is done - adapter is done - toolset.xml is done - import_steps.xml is done I guess maybe I'll have to go in through zopectl debug or something like that, see what's going on ... J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raphael Ritz Sent: March 28, 2007 03:55 To: [EMAIL PROTECTED] Subject: [Zope-CMF] Re: GenericSetup Toolset problem Doyon, Jean-Francois schrieb: > Hello, > > I've added a tool to my code base, and registered it in toolset.xml, > gave it import/export logic, etc ... > Did you also register the adapter for the tool to the setup environment? I have something like that in CMFBib's exportimport: http://namespaces.zope.org/zope"; xmlns:five="http://namespaces.zope.org/five"; i18n_domain="cmf" > where in exportimport/bibliographytool I declare: class BibliographyToolXMLAdapter(XMLAdapterBase, ObjectManagerHelpers, PropertyManagerHelpers): """XML im- and exporter for the BibliographyTool. """ adapts(IBibliographyTool, ISetupEnviron) See https://svn.plone.org/svn/collective/CMFBibliographyAT/trunk for the full example. Raphael ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] GenericSetup Toolset problem
On Zope 2.10.2 with CMF 2.0.0 BTW ... From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doyon, Jean-Francois Sent: March 27, 2007 12:57 To: [EMAIL PROTECTED] Subject: [Zope-CMF] GenericSetup Toolset problem Hello, I've added a tool to my code base, and registered it in toolset.xml, gave it import/export logic, etc ... Thing is, it won't show up in my import tab. I've tried re-importing everything, but to no avail. How do I get the new tool registered (and created) into an existing site? Jean-François Doyon Data Dissemination Division | Division de la diffusion des données Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données Earth Sciences Sector | Secteur des sciences de la Terre Natural Resources Canada | Ressources naturelles Canada Ottawa, Canada K1A 0E9 [EMAIL PROTECTED] Telephone | Téléphone 613-992-4902 Facsimile | Télécopieur 613-947-2410 Teletypewriter | Téléimprimeur 613-996-4397 Government of Canada | Gouvernement du Canada ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] GenericSetup Toolset problem
Hello, I've added a tool to my code base, and registered it in toolset.xml, gave it import/export logic, etc ... Thing is, it won't show up in my import tab. I've tried re-importing everything, but to no avail. How do I get the new tool registered (and created) into an existing site? Jean-François Doyon Data Dissemination Division | Division de la diffusion des données Data Management and Dissemination Branch | Direction de la gestion et de la diffusion des données Earth Sciences Sector | Secteur des sciences de la Terre Natural Resources Canada | Ressources naturelles Canada Ottawa, Canada K1A 0E9 [EMAIL PROTECTED] Telephone | Téléphone 613-992-4902 Facsimile | Télécopieur 613-947-2410 Teletypewriter | Téléimprimeur 613-996-4397 Government of Canada | Gouvernement du Canada ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: Internationlisation question
What Philip said :) Note that i18n:target is broken ... See http://zope.org/Collectors/Zope/1114 for a potential solution. If you try to use the currency functionality, you may also run into problems ... In that case, see this post: http://mail.zope.org/pipermail/zope3-users/2006-December/005145.html Cheers, J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp von Weitershausen Sent: February 11, 2007 4:27 PM To: [EMAIL PROTECTED] Subject: [Zope-CMF] Re: Internationlisation question Charlie Clark wrote: >> Zope 3 provides all sorts of localization functionality, including >> numbers, currency and calendaring. > Look in zope.i18n.locales ... > > Yes, I can see what's there but I do not seem to be able to call it > from a page template. If I try the following example from > > http://wiki.zope.org/zope3/ZPTInternationalizationExamples > > i18n:domain="string:calendar" i18n:target="string:de" > i18n:data="python:DateTime()"> > Based on what the id specifies, the date time object is returned in > typical German format: Montag, 1. Januar 2001 (example) > This is quite outdated. It doesn't surprise me you're getting an error here. Like Jean-Francois said, zope.i18n.locales has some good support for formatting datetime values (the Python variant, not Zope's DateTime variant). In Zope 3, this functionality is available through request.locale. In Zope 2, you will have to create the locale object yourself like so: from zope.i18n.interfaces import IUserPreferredLanguages from zope.i18n.locales import locales languages = IUserPreferredLanguages(request) langs = languages.getPreferredLanguages() if langs: parts = (langs[0].split('-') + [None, None])[:3] else: parts = (None, None, None) locale = locales.getLocale(*parts) Then you can format datetimes such as the 'modified' variable in the below example like so: Last modified on My book explains all of this in detail. I suggest picking up a copy :) -- http://worldcookery.com -- Professional Zope documentation and training Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] IObjectAdded vs. manage_afterAdd
Yeah, I'm not seeing a "zope.component.interfaces.IObjectAdded" ... I'm really quite certain I've done everything correctly ... The interface, the registration of the handler, the handler itself and the five:deprecatedManageAddDelete entry. Still ... Nothing. The content class uses __metaclass__ ... Could that be a problem? class MapServerMap(PortalFolder, PortalContent, CLFMetadataImpl): """ Map Server Map Class """ implements(IMapServerMap) __metaclass__ = AutomaticMultilingualProperties That's the only major difference I see with my tool implementation that uses IObjectAddedEvent successfully ... J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doyon, Jean-Francois Sent: January 23, 2007 8:16 AM To: Jens Vagelpohl; Zope-CMF List Subject: RE: [Zope-CMF] IObjectAdded vs. manage_afterAdd Yes, well, I didn't show the code for my handler, but it is there: def added(ob, event): """ Create the first page of a Map Text upon creation. """ print "GOT HERE" try: if not hasattr(ob.aq_explicit, '1'): ob.invokeFactory('Map Text', '1') except: pass I notice however that your example uses "zope.component.interfaces.IObjectAdded" vs. mine which uses "zope.app.container.interfaces.IObjectAddedEvent" ... Like I said, my event handler works for a tool ... But I guess maybe that's not the right event registration ... I'll try your examples. Thanks, J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jens Vagelpohl Sent: January 22, 2007 6:25 PM To: Zope-CMF List Subject: Re: [Zope-CMF] IObjectAdded vs. manage_afterAdd -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22 Jan 2007, at 21:57, Doyon, Jean-Francois wrote: > Hello, > > I'm trying to use IObjectAdded for an object that looks like this: > > class MapServerMap(PortalFolder, PortalContent, CLFMetadataImpl): > """ Map Server Map Class """ > > implements(IMapServerMap) > > Without success ... The event doesn't seem to fire at all. If you want to react to an event you need to do two things: - - mark your content item with an interface (you already did this) - - code up a handler for the event - - register your handler for the event Only implementing some interface is not enough. You could have a function like this somewhere: def handleEvent(ob, event): """ Event subscriber for (IMapServerMap, IObjectAdded) events. """ if event.newParent is not None: and a registration like this: jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFtUexRAx5nvEhZLIRAs64AJ0X3BFyHHvi0t9Xh6PXu9B7owh1CwCgm15n LB0X4yyOEc9+fU5XQjvjHC8= =cB8Z -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] IObjectAdded vs. manage_afterAdd
Yes, well, I didn't show the code for my handler, but it is there: def added(ob, event): """ Create the first page of a Map Text upon creation. """ print "GOT HERE" try: if not hasattr(ob.aq_explicit, '1'): ob.invokeFactory('Map Text', '1') except: pass I notice however that your example uses "zope.component.interfaces.IObjectAdded" vs. mine which uses "zope.app.container.interfaces.IObjectAddedEvent" ... Like I said, my event handler works for a tool ... But I guess maybe that's not the right event registration ... I'll try your examples. Thanks, J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jens Vagelpohl Sent: January 22, 2007 6:25 PM To: Zope-CMF List Subject: Re: [Zope-CMF] IObjectAdded vs. manage_afterAdd -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22 Jan 2007, at 21:57, Doyon, Jean-Francois wrote: > Hello, > > I'm trying to use IObjectAdded for an object that looks like this: > > class MapServerMap(PortalFolder, PortalContent, CLFMetadataImpl): > """ Map Server Map Class """ > > implements(IMapServerMap) > > Without success ... The event doesn't seem to fire at all. If you want to react to an event you need to do two things: - - mark your content item with an interface (you already did this) - - code up a handler for the event - - register your handler for the event Only implementing some interface is not enough. You could have a function like this somewhere: def handleEvent(ob, event): """ Event subscriber for (IMapServerMap, IObjectAdded) events. """ if event.newParent is not None: and a registration like this: jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFtUexRAx5nvEhZLIRAs64AJ0X3BFyHHvi0t9Xh6PXu9B7owh1CwCgm15n LB0X4yyOEc9+fU5XQjvjHC8= =cB8Z -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] IObjectAdded vs. manage_afterAdd
Hello, I'm trying to use IObjectAdded for an object that looks like this: class MapServerMap(PortalFolder, PortalContent, CLFMetadataImpl): """ Map Server Map Class """ implements(IMapServerMap) Without success ... The event doesn't seem to fire at all. I've used the event on a tool successfully however. This doesn't seem to work even if I use five:deprecatedManageAddDelete ... This page seems to suggest it should though: http://codespeak.net/z3/five/event.html "This tells Zope that you acknowledge that your class contains deprecated methods, and ask it to still call them in the proper manner. So Zope will be sending events when an object is added, for instance, and in addition call your old manage_afterAdd method." My configure.zcml contains: Thoughts? Thanks, Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Internationlisation question
Zope 3 provides all sorts of localization functionality, including numbers, currency and calendaring. Look in zope.i18n.locales ... J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Clark Sent: January 8, 2007 10:54 AM To: Lennart Regebro Cc: Zope-CMF List Subject: Re: [Zope-CMF] Internationlisation question Am 07.12.2006 um 12:54 schrieb Lennart Regebro: >> > i18n:translate="datefmt" >>i18n:name="date"> >> >> With i18n:name I get an error that i18n:name needs to be within a >> translation unit and without it I get a cannot iterate over a non- >> sequence. >> >> So, what I am getting wrong? > > This part makes no sense to me: > i18n:"data python: DateTime()" > > Maybe you meant tal:define="data python: DateTime()" ? I don't think so. I've been referring to Andy McKay's book on Plone and he lists i18n:data as an part of the specification but maybe this is specific to Plone? Anyway - what I want to do is have something like "20th January 2007" in some places and "20. Januar 2007" in others on the same site which has no language settings. What is the best way in going about this? Thanks Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] More questions
In that case, simply using something like: Should do it? That will nest the default view of the document though, which risks giving out a main_template inside a main_template. The trick will revolve around which view you want ... If any, or just the raw data. You could create a ZPT specifically for nesting, and use it for embedding, using macros, or access the data directly via the CookedBody method or something like that? (You'll have to dead the CMFDocument code to get the details though). J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Clark Sent: November 22, 2006 11:03 AM To: Doyon, Jean-Francois Cc: Zope-CMF List Subject: Re: [Zope-CMF] More questions Am 22.11.2006 um 16:54 schrieb Doyon, Jean-Francois: > You might want to look at METAL macros ... > > Mydoc: > content > > Myotherdoc: > > > See the ZPT reference for more details ... Thanks, I'm quite happy with the METAL and TALES but this is when I wish to include a CMF document within another. It's a bit like the news box but for none news items. Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] More questions
You might want to look at METAL macros ... Mydoc: content Myotherdoc: See the ZPT reference for more details ... J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Clark Sent: November 22, 2006 10:51 AM To: Zope-CMF List Subject: [Zope-CMF] More questions This is just a quick one: how do I include documents within another document? ie. say I have local_pt which is going has different boxed with text from other documents. I assume I have to call a method on the document to render it correctly but haven't found the right one yet. nearly works but obviously isn't quite right. I thought I'd seen a "render" method somewhere but that doesn't seem to be it either. Charlie -- Charlie Clark Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-938-5360 GSM: +49-178-782-6226 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: Metadata & Tool Questions
Ah ha. Good point about the workflow issues. I haven't tackled that part yet, but indeed, a workflow state/transition would be the best place to validate metadata based on policies ... I'll have a look at what you suggest re: import/export, thanks! As for the vocabularies, it wouldn't be one per type, but just many possible vocabularies, for any given type. The problem is they need to be identified separately within the tool, because at output, the scheme="" of the meta tag needs to be set. So "Subject" can have 3 vocabularies valid for all types, and each needs to know the scheme it belongs to. In the output, it would be: (With vocabulary enforced). As for the remote vocabularies, they're remote, but internal to our organisation, I would be too worried about performance, and can always cache with _v_ attributes or something like that if need be. Thanks Tres, very helpful. J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tres Seaver Sent: October 31, 2006 4:04 PM To: [EMAIL PROTECTED] Subject: [Zope-CMF] Re: Metadata & Tool Questions -----BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doyon, Jean-Francois wrote: > Hello, > > The organization I work for has stringent metadata requirements, and > as such I am now focusing my attention on metadata support in Zope and > the CMF. > > (Zope 2.10, CMF 2.0.0) > > A few questions: > > 1) Are there GenericSetup import/export scripts out there for the > metadata tool? I need to add elements and controlled vocabularies. > > 2) Some DC elements support the idea of schemes for specifying > controlled vocabularies (notably the Subject), has anyone implemented > functionality supporting this in their CMF? Has there been discussion > on the topic? Actually, almost any of the elements could do this: Rights, Format, and Language are also prime candidates. > 3) The policies defined in the metadata tool don't seem to be enforced > in the Dublin Core implementation. Any great reason? > Otherwise, I'm going to try tying specific schema implementations > (Such as DCMI, though I have others) into the tool, for actual policy > enforcement. The reason enforcement isn't "wired in" is because the choice of when to do the enforcement is a business policy: some sites may require that the constraints be enforced whenever posting from the metadata form; others may require it only at a given workflow transition. The choice is therefore in the implementor's hands. > Right now it's looking like my end goal is: > > 1) GenericSetup-driven tool configuration, for per site metadata > policy definitions. The GS representation might be: - Tool writes one XML file per schema into a 'metadata' subdirectory of the profile. 'DCMI' (which is always present) will be treated the same way. - The schema XML file should be a container for elements, each of which contains per-type policies. E.g.: Press Release Product Announcement ... ... ... Having the 'content_type' attribute blank for a policy would mark it as the default. > 2) Extension beyond DCMI The tool already supports additional schemas as subobjects. There are generic APIs which take a schema ID as their first argument. > 3) Support many possible vocabularies through scheme support for a > given element policy. Already there, if I understand you (vocabulary for an element can be sete on a per-content-type basis). > 3) Support remote vocabularies through web services/xml files. *Not* there. This would need essentially a replacement of the tool, at the moment (there are big-time performance implications of out-of-process vocabularies). > 4) Tie schema implementation such as DublinCoreImpl into the policy > tool for enforcement. Policy driven. Should be tied in to "modified" or "workflow transition" events, rather than hard-wired in. > This is a fair amount of work, so before I embark upon it, I figured > I'd see who's done/thought what out there along those lines ... Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFR7pY+gerLs4ltQ4RAt+xAJ9DA12Z2FFjRI3CUFOnTAN5g7SuVwCgt+Po lgePKptsTVi/6/1RbvlU6Rg= =nyZX -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Metadata & Tool Questions
Hello, The organization I work for has stringent metadata requirements, and as such I am now focusing my attention on metadata support in Zope and the CMF. (Zope 2.10, CMF 2.0.0) A few questions: 1) Are there GenericSetup import/export scripts out there for the metadata tool? I need to add elements and controlled vocabularies. 2) Some DC elements support the idea of schemes for specifying controlled vocabularies (notably the Subject), has anyone implemented functionality supporting this in their CMF? Has there been discussion on the topic? 3) The policies defined in the metadata tool don't seem to be enforced in the Dublin Core implementation. Any great reason? Otherwise, I'm going to try tying specific schema implementations (Such as DCMI, though I have others) into the tool, for actual policy enforcement. Right now it's looking like my end goal is: 1) GenericSetup-driven tool configuration, for per site metadata policy definitions. 2) Extension beyond DCMI 3) Support many possible vocabularies through scheme support for a given element policy. 3) Support remote vocabularies through web services/xml files. 4) Tie schema implementation such as DublinCoreImpl into the policy tool for enforcement. This is a fair amount of work, so before I embark upon it, I figured I'd see who's done/thought what out there along those lines ... Thanks, Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: .metadata files, latin-1 vs. unicode, and encoding errors
+1 Especially since the FSMetadata class isn't a mix-in so it turns out getting to the site instance's encoding isn't easy. Want me to file a bug? J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dieter Maurer Sent: September 5, 2006 3:00 PM To: Florent Guillaume Cc: Doyon, Jean-Francois; Zope CMF Subject: Re: [Zope-CMF] Re: .metadata files, latin-1 vs. unicode,and encoding errors Florent Guillaume wrote at 2006-9-4 20:38 +0200: >I'd say it would be cleaner to let the .metadata specify its own >encoding, for instance with a # coding: utf-8 at the top, and pasrse >that in FSMetadata. I find this a good suggestions -- but would use the declaration syntax used also in (e.g.) Python. -- Dieter ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: .metadata files, latin-1 vs. unicode, and encoding errors
Yup, thanks, just figured out the problem, I was decoding improperly. I've patched FSMetadata._nullParser to decode for me. I hardcoded latin_1_decode, but I guess your suggestion is cleaner! Thanks, J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yuppie Sent: August 28, 2006 2:25 PM To: Doyon, Jean-Francois; Zope-CMF List Subject: [Zope-CMF] Re: .metadata files, latin-1 vs. unicode,and encoding errors Hi Jean-François! Doyon, Jean-Francois wrote: > My app started throwing unicode errors, and I've tracked it down to the fact > I have accents in .metadata files. > > This becomes a problem when a unicode string sneaks into the page to be > rendered, at which time StringIO.getvalue() bombs. > > Normally I'd try to get rid of the unicode string, but in this case it seems > like it's coming from the i18n machinery (The result of a translation), and > as such, might not be very desirable for me to mess with it. > > For example I have an FSImage with a title that in french contains an > accented character. > > When calling the tag() method on the image, I end up with a with > high bit characters. > > The same page will contain i18n:translate results, which are unicode. > > And voila. > > I tried making the FSMetadata logic return a unicode string instead of a > regular string, but that didn't work (not too clear on why, the logging > module started throwing errors?). > > I also tried using HTML entities such as é in there, but looks like > HTML title= or alt= doesn't render them? > > Anyone have any ideas how I might get around this? I'm out of ideas > :( I guess you are using CMF 2.0. In CMF 2.0 all data used in PageTemplates has to be unicode (or ASCII). AFAICS you have to convert the value returned by tag(). CMFDefault utils has a 'decode' function that uses the default_charset of the site to decode the string. HTH, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] .metadata files, latin-1 vs. unicode, and encoding errors
Hello, My app started throwing unicode errors, and I've tracked it down to the fact I have accents in .metadata files. This becomes a problem when a unicode string sneaks into the page to be rendered, at which time StringIO.getvalue() bombs. Normally I'd try to get rid of the unicode string, but in this case it seems like it's coming from the i18n machinery (The result of a translation), and as such, might not be very desirable for me to mess with it. For example I have an FSImage with a title that in french contains an accented character. When calling the tag() method on the image, I end up with a with high bit characters. The same page will contain i18n:translate results, which are unicode. And voila. I tried making the FSMetadata logic return a unicode string instead of a regular string, but that didn't work (not too clear on why, the logging module started throwing errors?). I also tried using HTML entities such as é in there, but looks like HTML title= or alt= doesn't render them? Anyone have any ideas how I might get around this? I'm out of ideas :( Thanks, Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Creating content type instances with Generic Setup
Hello, Is this possible? I would like a given profile to create some content (as opposed to tools) at portal creation time. My reading so far suggests only toolset.xml and therefore tools and related information can be loaded via Generic Setup. Am I wrong? And if not, can anyone suggest an elegant alternative? As best I can tell Generic Setup doesn't know about invokeFactory or any of that. I suppose I could create a tool to do it in 2 steps :) Thoughts? Thanks, Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Simple question re: GenericSetup & Type Info
Odd, I thought I'd tried that ... Must've been a different variation! Guess I missed that one, sorry. Thanks though, problem solved :) J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jens Vagelpohl Sent: August 23, 2006 4:15 PM To: Zope-CMF List Subject: Re: [Zope-CMF] Simple question re: GenericSetup & Type Info -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23 Aug 2006, at 21:40, Doyon, Jean-Francois wrote: > Hello, > > What's the format for: > > A simple grep found this for me in CMFTopic on the trunk: jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFE7LdORAx5nvEhZLIRAoiqAJ95lC9ztLP5EWmegERzhposVssRCACeN4zj o+W/QKhQpRRD0ps0XqZUBwU= =aAx9 -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Simple question re: GenericSetup & Type Info
Hello, What's the format for: ? I tried a couple of things without success: Topic Text Topic Text And a few others I forget now ... Thanks! Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
RE: [Zope-CMF] Re: Adding EXTENSIONs after site creation
Yes, by "both" I mean I check one box in the Import tab, and 2 things show up. I select one extension, and the 2 extensions defined against that particular interface show up. I haven't done it yet, but I suspect when I add a third, all 3 will appear :) Ah ok ... Thanks for the explanation re: "active site configuration". From what you say, I think the behavior I'd expected was that switching profiles would change what is listed in Import in that only the things related to that profile can be imported. So if my extension defines one import step, I switch to that active configuration, go to the import tab, and see ONE import step, NOT a cumulated list. Once this is done, I can go back to my site profile, and see that the Import/Export tabs now have a new item. At least that's how, I as as user expected it to work. Switching profiles and always seeing a big list of things that I know have nothing to do with the selected profile, is counter intuitive IMO. Anyways, back to the original problem, I just want to make sure the intent is to have the ability to add extentions after the creation of a site. So long as the answer is yes, I can live with that for now, knowing I can develop certain things as extensions. I can help track down the bug later, right now I'm still focused on core functionality. Thanks! J.F. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yuppie Sent: June 9, 2006 3:30 AM To: Doyon, Jean-Francois; Zope-CMF List Subject: [Zope-CMF] Re: Adding EXTENSIONs after site creation Hi! Doyon, Jean-Francois wrote: > > So far, I've figured out I can go to portal_setup properties and > change the "active configuration" to the extension one. I can then do > an import of that extension from the Import tab. I then switch back > the active configuration. > > This was working well when I only had one extension, but I now have > two, and what I've noticed is that no matter which I select, BOTH get installed! > > They have different adapters, interface definitions, and everything. > And in the log, only the one adapter claims to do an import ... Yet both show up! > > Is this normal? What am I missing? What do you mean by "BOTH get installed"? Settings from two different profiles are imported at once? That sounds strange. > Also related, what exactly is meant by "active site configuration" anyways? "active site configuration" is the profile used by the import tab. But the import tab shows *all* registered handlers, not just those useful for the "active site configuration". If you run the steps each step looks for related configuration files in the "active site configuration" and if it can't find them it does nothing. Switching to a new "active site configuration" also registers the import and export handlers specified in the profile. That way you can register new handlers for export without overriding your site settings by an import. I'm not happy with the setup tool and its user interface. It is still almost the same as in CMF 1.5, all the work done on GenericSetup was focused on improving the setup handlers. HTH, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Adding EXTENSIONs after site creation
Hello, Using Zope 2.9.3 and CMF 2.0.0 I'm deciding on what should be EXTENSION profiles, vs. BASE, and what should go in each. One criteria is whether an EXTENSION can be added later on, after a given site has existed for a while. So I created 2 EXTENSIONs, and am using a different for_ interface. (So CMFDefault doesn't get in my way) When I add these extensions at portal creation time, all is well. I'm a little confused as to the steps to create them after that. So far, I've figured out I can go to portal_setup properties and change the "active configuration" to the extension one. I can then do an import of that extension from the Import tab. I then switch back the active configuration. This was working well when I only had one extension, but I now have two, and what I've noticed is that no matter which I select, BOTH get installed! They have different adapters, interface definitions, and everything. And in the log, only the one adapter claims to do an import ... Yet both show up! Is this normal? What am I missing? Also related, what exactly is meant by "active site configuration" anyways? To send positive thoughts: This GenericSetup thing is beautiful. The ability to have easily configured multiple portals on a similar code base/installation should proove very useful! Also allows lots of sharing of components. I'm also starting ot get used to the Five/Zope 3 way of doing things, and learning to love it :) Thanks, Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Problem with GenericSetup adapter
Hi, Finally started working on migrating to Zope 2.9.3/CMF 2! Trying to get some GenericSetup functionality around my classes. I've created my own "adapter" which is based on PropertiesXMLAdapter (for now). For some reason however, queryMultiAdapter seems intent on returning PropertiesXMLAdapter, and not my own! I have: class PortalLocalizerTool(UniqueObject, SimpleItemWithProperties): implements(IPortalLocalizer) http://namespaces.zope.org/zope";> class PortalLocalizerXMLAdapter(XMLAdapterBase, PropertyManagerHelpers): """ XML im- and exporter for properties. """ adapts(IPortalLocalizer, ISetupEnviron) --- The import step works but using the wrong adapter :( Did I miss something? Thanks! Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] FS Skins and Last-Modified
Hello, I have several FS based skins that use DTML ... I've been controlling caching through the usual: This has worked well for me for some time now ... But, for some reason, now it seems bobobase_modification_time comes out wrong :( It's stuck at some date in October, even though the files are far more recent. This is causing problems with web browsers that have stale code when they shouldn't, breaks my AJAX interfaces, etc ... I saw FSObject has getModTime(), but I can't seem to call it from anywhere? I tried in the header, or in a separate Python Script, to no avail. So for now, clients are still being told that their months old .js file has not been modified, even though it has :( (Which is causing me nightmares) Any know what's going on? A quick fix? A better idea? Any help would be greatly appreciated! (This is Zope 2.7.4 with CMF 1.5.0 running on ZEO, I'm working on a major rewrite with much more up to date versions ...) Jean-François Doyon Internet Service Development and Systems Support / Spécialiste de dèveloppements internet et soutien technique Canada Centre for Remote Sensing/Centre Canadien de télédétection Natural Resources Canada/Ressources Naturelles Canada http://atlas.gc.ca Tel./Tél.: (613) 992-4902 Fax: (613) 947-2410 ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests