[Zope] Case sensitivity
One of my pet peeves with web servers is that : mysite.com/Members is different to : mysite.com/members (but there is no difference between MYSITE.COM and mysite.com) is there any way of making Zope case-insensitive? - Ian Sparks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Traversable DTML methods
The one reason that may still exist for not making DTML Methods traversable as you're suggesting would be if you want to call a DTML Method within the acquisition context of another... something that some people may want to do (I never have though). If a DTML Method chops off everything that follows in the URL, then that remaining part of the URL can't be used for acquiring other methods. I don't see DTML Methods as "chopping off" the URL so much as "consuming" parts of it. SQL Methods have this behaviour now : www.mysite.com/flavor/cherry/showme Where "flavor" is a SQL Method which takes a single parameter "cherry" and "showme" is a DTML Document which makes some use of the flavor SQL Method. In this instance "flavor" consumes the next part of the url because it is looking for a parameter and when it is finished hands on control to the next, unconsumed part of the URL "showme". Notice though that I have to have the "showme" DTML Method to actually display the results. If "flavor" was a parmeterized DTML Method my URL could become : www.mysite.com/flavor/cherry which makes more sense to me. In this case the "flavor" DTML Method would consume the "cherry" parameter, perhaps call some SQL Method to get the data for the "cherry" display and then display itself. If the parameters could have defaults then I could have URL's like : www.mysite.com/members/ian/ www.mysite.com/members/ian/home www.mysite.com/members/ian/preferences www.mysite.com/members/ian/todo Where "members" is a DTML method which takes parameters username,subsite (default : "home") and decides what to display based on the parameters passed. This allows my "users" to become virtual (by which I mean DB-based). I can do the last 3 URL's now with SQL Methods ("home", "preferences" and "todo" become DTML documents or methods which are aquired) but I can't do the first URL because SQLMethods don't do any rendering for display. Well, that got rambling but it lays my argument out in full I think. - Ian. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Traversable DTML methods
Kevin Said : Hmm... what does it mean, exactly, to "traverse a DTML method"? DTML Methods don't have subobjects, so it seems like you're basically trying to look up other objects or information via information passed in the URL. That seems like the kind of program logic that is much cleaner in python and that people are trying to keep out of DTML. DTML really does start getting ugly and hairy when you try to put complex logic in it. Dieter Said : Your DTML Methods have (keyword) parameters. From DTML: "method(_.None,_,param1=value1, param2=value2, )" From HTML: "URL to method?param1=value1param2=value2" everything after "?" is URL(plus)encoded. Dieter is right, DTML methods can get parameters from the URL but they don't do it in the same way as SQLMethods and that, to answer Kevins question, is what I mean by making DTML Methods "traversable" (apologies if my terminology is off). I'd like to be able to pass a parameter to a "members" DTML method with a syntax like : www.mysite.com/members/ian which is much nicer than : www.mysite.com/members?user=ian which is what Dieter suggests. From my Zope-newbie perspective I don't see that allowing parameters to DTMLMethods, framed as part of the URL is any more complex than what goes on with SQLMethods but I admit this may be because I have not grasped the Zen of Zope. - Ian Sparks. - Original Message - From: "Dieter Maurer" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, June 11, 2000 7:03 PM Subject: Re: [Zope] Traversable DTML methods Ian Sparks writes: It seems strange to me that SQLMethods are traversable out of the box and "normal" DTML methods are not. It seems to me that traversable DTML methods would be useful (to me this means DTML Methods with parameters). Your DTML Methods have (keyword) parameters. From DTML: "method(_.None,_,param1=value1, param2=value2, )" From HTML: "URL to method?param1=value1param2=value2" everything after "?" is URL(plus)encoded. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Traversable DTML methods
It seems strange to me that SQLMethods are traversable out of the box and "normal" DTML methods are not. It seems to me that traversable DTML methods would be useful (to me this means DTML Methods with parameters). Is this something that might make it into Zope in the future or am I missing something important which means that they simply arn't necessary? - Ian Sparks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How do you call the string?
Martin, I'm no Zope expert but if you have a property with an ID of "prop1" of type string with a value "first_value" set on a DTML Document then inside the document you can say : dtml-var prop1 and "first_value" will be substituted into your code at this point, replacing the "dtml-var prop1" declaration. I am not sure why you want to get the title? You only need to know the ID to get the value. Are you trying to find a way of looping through all the properties defined for a document? If yes, I don't know how to do this but ask again to [EMAIL PROTECTED] for how to do this. Sorry if this doesn't answer your question. - Ian. - Original Message - From: "Martin Seehuusen" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED] Sent: Thursday, June 08, 2000 10:50 AM Subject: Re: [Zope] How do you call the string? Thank you for you help! I think I need to explain a bit more! Sorry for not doing that in the first place! OK, I go into Properties for one of my files! then I choose an ID, say "prop1" Type could be, say "String" then a value, say "first_value". now what I would like is to call the string, and get up the ID and the Value. something like dtml-var type_command result: ID: Prop1 Value: First_Value Hope this explains a bit more! ;) Thank you for your help. Best regards Martin Seehuusen ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] www.mysite.com/Members/someone
Bill, Thanks for the reply. Yes, I would be getting the data from a SQL statement. Let me explain what I am trying to achieve. I want to structure my site like this : http://mysite.com/Members/username so if someone comes to my site with the URL : mysite.com/Members/Ian They would see the Members page for "Ian" (we'll ignore permissions and security for now). As I have said before, one way of doing this is to have a Zope structure : /Members /Ian /Jim /Jane Where Members is a folder, Ian,Jim and Jane are Sub-folders of Members. But I don't want to do this. What if I add a million users? Then I end up with a million member folders which is difficult to manage from Zope. I want to store my users in a database. I have no problem creating a DTML method which calls a SQLMethod passing a parameter "username=Ian" to pull out the data and construct the HTML for delivery. The problem I have is how to construct my site. What I want is something like : /Members /* Where * is a method which catches the rest of the url (/Ian) and does all the necessary processing to return the formatted user page for Ian. I know I'm missing the Zope Zen of this because it must be easy to do in such a well thought-out product. The thought I had was that "Members" could be a SQL method which takes "username" as a parameter, Ian then is passed in as that Username and the necessary data is pulled from the DB. This is fine except that I still need some other method to render the HTML page for delivery to the user and this would extend my url to : www.mysite.com/Members/Ian/rendermethod. The other problem with this is that it clutters the root with the Members SQLMethod and the rendermethod DTML document. I might start adding more URL's like : www.mysite.com/Members/Ian/preferences or www.mysite.com/Members/Ian/pastposts and the "preferences" and "pastposts" documents would end up in the root too. All these things belong in a Members folder, not at the root. I'm missing something important, I'd appreciate any enlightenment you could bring to this. - Ian. - Original Message - From: "Bill Anderson" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 06, 2000 10:32 AM Subject: Re: [Zope] www.mysite.com/Members/someone Ian Sparks wrote: I have the source here, perhaps you can point me to where I should be looking - the PTK is reasonably large. AFAICS the PTK uses a folder called Members and adds folders under that for each registered user : Members Fred FredContent1 FredContent2 FredContent3 Jim JimsContent Nothing database-driven about that. See below... ... I want to produce a home-page on my site using a URL like : http://www.zope.org/Members/Fred I'm a little confused as to how I would go about this in a dynamic way where I would pull the contents of the page out of a database. A non-database way would be to : /Members (folder) /Fred (sub-folder or Document) /Jim (sub-folder or Document) /Jane (sub-folder or Document) But I want to be able to generate the /Members/Fred page dynamically. What exactly would you generate this off of? I would guess from data in a databse (SQL)? If so, you could do a select statement to ge tthe userlist. You would then make a 'template' that built a page from the data in a database, where username==username (ie Fred). But, you could be asking for something completely different. ;) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] www.mysite.com/Members/someone
Hi, I want to produce a home-page on my site using a URL like : http://www.zope.org/Members/Fred I'm a little confused as to how I would go about this in a dynamic way where I would pull the contents of the page out of a database. A non-database way would be to : /Members (folder) /Fred (sub-folder or Document) /Jim (sub-folder or Document) /Jane (sub-folder or Document) But I want to be able to generate the /Members/Fred page dynamically. The SQLMethod part I can do, its the structuring of the objects in the heriarchy which baffles me. Ideally I'd like to have a "Members" folder in /, as this reduces the clutter in /, but then how do I pick up the "Fred" part of the URL once I have traversed into the members folder and apply it as part of a SQLMethod? - Ian Sparks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] www.mysite.com/Members/someone
I have the source here, perhaps you can point me to where I should be looking - the PTK is reasonably large. AFAICS the PTK uses a folder called Members and adds folders under that for each registered user : Members Fred FredContent1 FredContent2 FredContent3 Jim JimsContent Nothing database-driven about that. Thanks for your help. - Ian. - Original Message - From: "Philipp Dunkel" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, June 05, 2000 5:36 PM Subject: Re: [Zope] www.mysite.com/Members/someone At 17:23 05.06.00 +0100, Ian Sparks wrote: Hi, I want to produce a home-page on my site using a URL like : http://www.zope.org/Members/Fred I'm a little confused as to how I would go about this in a dynamic way where I would pull the contents of the page out of a database. A non-database way would be to : /Members (folder) /Fred (sub-folder or Document) /Jim (sub-folder or Document) /Jane (sub-folder or Document) But I want to be able to generate the /Members/Fred page dynamically. The SQLMethod part I can do, its the structuring of the objects in the heriarchy which baffles me. Ideally I'd like to have a "Members" folder in /, as this reduces the clutter in /, but then how do I pick up the "Fred" part of the URL once I have traversed into the members folder and apply it as part of a SQLMethod? - Ian Sparks. You can find a solution in the PTK-Source * Philipp Dunkel ICQ# 60149094 * * zReal Productions* * meet me at DALNet chan #phidu* ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How do you call the string?
I'm not sure what you mean by "call the string"? If you have some properties of a DTML Document you can call them within that document by saying dtml-var variablename. So if you had a property "count" you could say dtml-var count If this doesn't answer your question, try to re-phrase it so we can get a better idea of what you are trying to do. - Ian. - Original Message - From: "Martin Seehuusen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 04, 2000 4:26 PM Subject: [Zope] How do you call the string? Hi! I would like to look up the properties on an html file that I've made. I've made a string on my html file, but I'm not sure how to call it! I've understood that a dtml-in is to be used, but I don't know what the string is called. Could someone help me with that!? /Martin S. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Aquisition questions
Some time back I had an exchange with Mike Pelletier regarding SQL methods and aquisition. We talked about a URL structure : mysite.com/Users/Fred/Flavor/Cherry/test Users is a SQL method which takes a single parameter (value = Fred here). Flavor is another method which takes a single parameters (value = Cherry here). test is a dhtml method which returns values pulled from the SQL methods. I set this test up and it works fine. One of the effects of aquisition is that the URLs : mysite.com/Users/Fred/Flavor/Cherry/test mysite.com/Flavor/Cherry/Users/Fred/test are functionally identical in my simple DHTML test method but they might not be, for instance if both SQLMethods provided a result column "RowID" then dtml-var RowID would contain the ID of whichever SQL method was run last. Suddenly I'm getting a Users RowID when I expected a Flavor RowID. Potentially disasterous. Is there a way to enforce URL's be traversed in a set way? Thus making : mysite.com/Users/Fred/Flavor/Cherry/test valid while mysite.com/Flavor/Cherry/Users/Fred/test becomes invalid. Also, assuming that both SQLMethods provide a "RowID", how do I specify explicitly which one I want, in OO terms : Users.RowID or Flavor.RowID All help appreciated. - Ian Sparks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Aquisition questions
Shane, your idea about extending the URL and putting in an extra folder in the path will work but its a bit of a fix rather than a solution. Right now this isn't a RealLife(TM) problem for me, just part of my trying to get to grips with Zope and its potential pitfalls. Isn't there a way to cause the SQLMethods to provide "UserRowID" and "FlavorRowID" instead? That would be the most logical solution. Again, this is a good idea but it doesn't solve the fundamental problem which is that URL's are meant to be traversed in a particular way, if the "clever" user traverses them in a different way than intended you *could* end up in a mess. - Ian. - Original Message - From: "Shane Hathaway" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 02, 2000 3:40 PM Subject: Re: [Zope] Aquisition questions Ian Sparks wrote: Is there a way to enforce URL's be traversed in a set way? Thus making : mysite.com/Users/Fred/Flavor/Cherry/test valid while mysite.com/Flavor/Cherry/Users/Fred/test becomes invalid. You could set up an object called "Users" that would be found only if the user goes through "Flavor" first. Your example will have to be modified to get it to work. should work: mysite.com/Users/Fred/FlavorFolder/Flavor/Cherry/test should not work: mysite.com/FlavorFolder/Flavor/Cherry/Users/Fred/test FlavorFolder is a folder at the same level as Users. It contains an SQL query called Flavor and an object called Users. The Users object in this folder raises an exception, telling the clever user to back off. Just a possibility. Also, assuming that both SQLMethods provide a "RowID", how do I specify explicitly which one I want, in OO terms : Users.RowID or Flavor.RowID Isn't there a way to cause the SQLMethods to provide "UserRowID" and "FlavorRowID" instead? That would be the most logical solution. Shane ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Linking to Mailing List Managers
Hi, With all the talk about Syndication I started to think about linking with mailing list managers. Ideally I'd like members of my portal site to be given a free email address username@sitename, bouncing all mail to that address to their real email address. In a roles-based membership scheme it would also be nice to be able to send email to role@sitename, so the email goes to all members with that role. Has anyone done anything like this, linking to an existing Mailing List Manager like Majordomo from Zope? I want to manage the whole thing through some Zope management pages. - Ian Sparks. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Interbase / Cacheing - A thought
Hannu, Does PostgresSQL allow you to have dynamic events? By this I mean can you do things like : PostEvent "Update_tblUsers_Record_" + new.RecordID; I believe that in Interbase the events are compiled into the trigger, not interpreted at Runtime so you can't have an Interbase event alert you to a change in a particular record, only that a change has occurred on a table. Coming from a RDBMS background myself I'd prefer to see RDBMS integration be tighter to Zope - properties etc being stored in the database where appropriate. For reasons of speed you don't want to have to go to the DB each time you want a property but having a data-aware object which knows when to update itself would solve this problem nicely. It should also help with load-balancing and failover where you could have a cluster of Zope instances all working on the same monster DB, all being kept in sync. via the event alerter mechanism. Just my thoughts. - Ian. - Original Message - From: "Hannu Krosing" [EMAIL PROTECTED] To: "Ian Sparks" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, June 01, 2000 11:28 AM Subject: Re: [Zope] Interbase / Cacheing - A thought Ian Sparks wrote: Had a thought that I wanted to share. Interbase has a feature known as "event alerts". In a trigger you can post "events" which are just fixed data strings e.g. "DataAdded" or "Insert_tblUsers". PostgreSQL has them too. It's not (afaik) supported by DB-API, but could be used in a DA that talks to some lower level API. A client database connection can register to listen to these events. I don't know if any Zopeish Interbase access method supports this (ODBC doesn't to my knowledge) but it would be incredibly useful for synching cached database objects. Zope could hold a representation of the table data in cached objects for quick access. Each object could have one or more "event" methods which related to a database event. When the database adaptor received an event message from Interbase it could inform all objects with a matching event method (these methods would refresh their cached data with current values from the database). In this way database and Zope cache could be synced *without* having to poll the database at an interval. In all, a very efficient mechanism. Just an idea I wanted to put out there. Thanks for getting it out. I have been contemplating the same for PostgreSQL but have been too lazy to do it myself ;) -- Hannu ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )