external next up previous contents index
Next: $web:do_url Up: 14.1 The Low Level Previous: $web: the core Woo

$web:get_htext

$web:get_htext is one of the 3 key verbs in this layer. It is quite complex and a bit difficult to understand because many features have been added over time. It's task is to parse the URL and to hand a URL request in more ``MOO readable form'' to the do_url verb.

Click here to see the current verb on MOOtiny. Note that you can inspect all verbs by using the object browser in the WWW interface.

$web:get_htext first does user authentication:

Next, the URL of the request is parsed.

Special Cases:

There are two types of special cases. In each case, $web:get_htext changes the form request for the special case into a normal url request of the type that $web:do_url can handle. Note that the syntax used in the WOO for all requests is always ``GET'' and not ``POST'', i.e. the total request is appended to the URL as in the examples below. See NCSA'a documentation for further details.

The first special case is verbs that are on $web_root. These verbs appear in the menu at the top right of all pages in the WWW interface.

The second are _web verbs, which appear automatically at the bottom of most objects (lists are produced using <object>:list_web_verbs). When these are used, they produce a form. The url they are converted to consists of <object>:<verb>/arg1/arg2/ which is a standard way to get the results of a specific verb on an object.

It also substitutes those weird html character codes (i.e. ``%7E'' into ``'' (using $www_utils:subst_hext)

So, most of the work of :get_htext is to figure out what type of object you want to access, i.e. it first hunts down ``?'' special requests, e.g. something like:

If this is the case, then :get_htext calls itself with a string built of key, object:<web_verb>, arguments and next time proceeds like below.

The ``normal'' case:

If the the URL is non-''?'' then $web:do_url is called. Here are 2 examples of a calling sequence with the ``who'' $web_root verb and the page verb that appears when you click on a player. The second time :do_url gets called as you can see:

 ************ $web:get_htext
{"/key=628528948/1835?verb=who&do=Do+it%21&command=",
 {"Referer: http://tecfamoo.unige.ch:7777/key=628528948/1835",
  "User-Agent: Mozilla/1.1N (X11; I; SunOS 5.4 sun4m)", "Accept: */*",
  "Accept: image/gif", "Accept: image/x-xbitmap",
  "Accept: image/jpeg", ""},
 #-452}
 ************ $web:get_htext
{"/key=628528948/who",
 {"Referer: http://tecfamoo.unige.ch:7777/key=628528948/1835",......, ""}
}

 ----

 ************ $web:get_htext
{"/key=628528948/1324?web_verb=page&args1=hello+young+man",
 {"Referer: ........"},
#-454}
 ************ $web:get_htext
{"/key=628528948/1324:page_web/hello%20young%20man",
{"Referer: ........ "}
}


next up previous contents index external
Next: $web:do_url Up: 14.1 The Low Level Previous: $web: the core Woo

Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997