From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3d61afbea6c3d54d8371a08214902949@9netics.com> To: 9fans@9fans.net Date: Thu, 20 Nov 2008 15:18:16 -0800 From: Skip Tavakkolian <9nut@9netics.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] web-based plan 9? Topicbox-Message-UUID: 4d081ae0-ead4-11e9-9d60-3106f5b1d025 > - provide access to relational database towards a dedicated fs (with XML > rappresentation of query results, but dont know yet about data manipulation > and error handling) an rdbms interface will be messy; maybe just try to get a ODBC client library. most of the time what is really needed is fast lookup; something like PQ would do. a lot of places use DB to store things that naturally belong in a file heirarchy. > - provide a filesystem capable of transform an XML file with an XSLT > template, so that dbfs and rest webservices could be handled the same way. i see these as filters used by filterfs. the filter to file mapping might be doable using plumber. > - provide a filesystem able to transform a TAL (tag attribute language) > template to XSLT, allowing graphic designer to directly transform the data > provided by programmers in XML without knowing XSLT (just tal and eventually > xpath) > - implement url rewrite (if missing) > - glue all together with a set of filesystem/applications able to handle > the business logic (for example a simpe ecommerce would have a cataloguefs > and a shoppingcartfs) rapidly written towards a dedicated library (may be > something like your cgifs?) it's easy to develop libraries for cgifs. it's all in rc. if you need something special, write a C utility that does the specific thing. > - provide a "sessionfs" able to mount (unmount would be necessary? I > think so...) the correct filesystems/applications for each visitor. srvfs posted to /srv will do; a httpd running with the proper permissions wont have a problem mounting what's posted in /srv. what i have in mind for sessionfs is to keep a stateless http session (using session id's that are consecutive and time sensitive) to carry a conversation with factotum. fyi, here's the rc version of 'save' that uses cgifs: #!/bin/rc . /lib/cgifs/sandbox fn logit { echo $* > log } switch (`{cat request/method}) { case GET POST foo=`{cat request/info} if (! ~ $#foo 0) { foo=`{echo $foo | sed 's/^.//'} logit $foo foo=`{basename $foo '.html'} logit $foo if (test -f /www/save/^$foo^'.data') { bar=$foo^'.data' foo=$foo^'.html' switch (`{cat request/method}) { case POST str = `{cat request/body} case * str = `{cat request/query} } echo at `{date -n} $str >> /www/save/^$bar rit -D /www/save/^$foo > response/body } if not { echo $foo does not exist > response/body } } echo -n text/html > response/content-type echo -n 200 OK > response/reply case * echo -n text/html > response/content-type echo -n 405 Method Not Allowed > response/reply } exit 0