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.
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
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" <shane@digicool.com> To: "Ian Sparks" <isparks@wmute.u-net.com> Cc: <zope@zope.org> 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 - Zope@zope.org 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 )
participants (2)
-
Ian Sparks -
Shane Hathaway