searchArgs when table rendering

Samuel Reynolds sam at spinwardstars.com
Mon Apr 22 15:58:12 PDT 2002


>Site structure:
>
>mysite.category1.default
>mysite.cateogry2.default
>
>The "default" pages are addresses pointing to another odb table. There is a
>table rendering script in #tools. All that works just fine.
>
>I wanted to add additional functionality, where a link from a page in
>another site could supply a search argument and my table renderer could look
>for it in the page table and act accordingly.
>
>The url would look something like:
>
>  oh.me.com/mysite/category1/default?topic=blah
>
>When I set this up, I get an error "Can't evaluate the expression because
>the name "tools" hasn't been defined."
>
>I suspect this might be due to a limitation of Frontier's table rendering
>scheme, because debugging code indicates that my table renderer is not even
>being called. In fact, even a URL like this will fail:
>
>  oh.me.com/mysite/category1/default

The logic for deciding whether to render a table as a page or
to treat it as a subdirectory doesn't always work  the way you
expect it to. The dynamic webserver doesn't render the table
as a page if The Walk doesn't see #renderTableWith *before*
it gets to the table. And you are probably jumping right over
the directive. If you have...

   storage2
      #renderTableWith "x"
      category1
         topic1
         topic2

...and you set mysite.category1 = @storage2.category1,
mainResponder will never see storage2.#renderTableWith.

It *might* work if you set mysite.categories = @storage2,
and change the request to mysite.categories.category1.

>I'm seeking confirmation and suggestions on how to else to do this. One
>option is to create a single handler page which extracts the url params,
>then POST the values to the appropriate page with tcp.httpClient(). (those
>pages handle form data via loopback).

Your best solution might be an objectNotFoundHandler (ONFH)
(http://spinwardstars.com/frontier-tutorials/onfh/index.html)
at mysite.["#objectNotFoundHandler"].
This would allow you to use a single script in (mysite). The
ONFH could:
1. Validate the requested category against defined categories
   in your "other odb table."
2. Render and return the requested topic subtable/page/whatever
   from the "other odb table."
3. Redirect to a Sorry-not-found page or a search page if
   either 1 or 2 fails.
(There are a few gotchas in working with ONFHs. They're
discussed at the above URL, and at URLs referenced from
there.)

Or you could create a script very much like an ONFH, and put
the address of that script at each of the above locations.
The script could retrieve the category from the request info,
find the requested topic, and call the tableRenderer script.

HTH.

- Sam
- - - - - - - - - - - - - - - - - - - - - - - - - -
I'm currently looking for a new position/contract.
Resume at http://spinwardstars.com/vitae/
- - - - - - - - - - - - - - - - - - - - - - - - - -
_____________________________________________
Samuel Reynolds         sam at spinwardstars.com
Spinward Stars: http://www.spinwardstars.com/




More information about the Frontier-Users mailing list