You are not logged in Log in Join
You are here: Home » Members » itsafire » releases » DirArg Product » DirArg Readme » View Document

Log in
Name

Password

 

DirArg Readme

THIS PRODUCT IS OBSOLETE WITH ZOPE >= 2.5 (maybe earlier) use traverse_subpath instead !

A Zope product for passing arguments via URL

Copyright (C) by n@work Internet Informationssysteme GmbH 2000 www.work.de

written by Andreas Elvers ([email protected])

The Product was build upon the nice Boring Product written by gtk. Thanks !

DirArg is distributed under the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) Version 2.1 (February 1999). See the "COPYING" file distributed with this software for more info.

Changes
initial release
Status
initial release
Bugs
hmmm...

Install instructions

Just put the DirArg Folder inside your Product Folder and restart Zope. Now you should be able to add a DirArg Folder through the management interface.

Usage

DirArg is a folderish Product. You may use it like a normal Folder. The only difference is, when it comes to accessing names that do not exist inside the DirArg Folder. The Product will just eat these names and save them for you inside the request Object, so that you can access them inside your methods and objects.

Example:

Let's say you added a DirArg Folder in the Zope root called "dirarg". Inside this folder you have a dtml method called "showme".

The showme methods looks like this:

listing the directory

NameValue

the list

did you pass foo ?

Value of foo is You did not pass foo

Now we call the method:

http://www.somedomain.com/dirarg/color/green/number/42/showme

color, green, number and 42 have been assembled to a list, a directory and are accessible as variables.

The DirArg Product takes pairs of name and value and stores them inside REQUEST. You may access them with:

DirArg_dict This is a dictionary.
DirArg_list This is a simple list.
or as a simple variable. In this example you could use: which would result in green.

In case you pass two or more values with the same name, the value will be a list type containing all values as items.

For more information how this is done, please look inside the DirArg.py file.

Some words about writing this product...

Well first of all I think Zope is a cool thing. No doubt. But writing this little simple product was really a pain. Most of the time I was staring at my a2ps two column printout of BaseRequest.py thinking: "what does this all mean... How much dope did they smoke..." Well, I think I do still not really understand all aspects of the traverse thing inside of Zope, but it was enough to write this product.

Comments in the documentation and mailing list about __bobo_traverse__ was vague. Although quite a few people were asking for a solution of passing arguments via path, there was in most cases the answer: look inside LocalFS. Oh yeah. Cool product, but the __bobo_traverse__ stuff in there was mindblowing. I had much simpler questions at first. "What kind of value does __bobo_traverse__ return ?", "Where should I store the final data". All answers can be found somewhere, but you have to look through the mailing list a lot.

Ok... let's stop whining. This thing is working and I'm happy if it is of any use to you. Bug reports, ideas and impovements are always welcome. Write them to [email protected]