9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Skip Tavakkolian <9nut@9netics.com>
To: 9fans@9fans.net
Subject: Re: [9fans] web-based plan 9?
Date: Thu, 20 Nov 2008 15:18:16 -0800	[thread overview]
Message-ID: <3d61afbea6c3d54d8371a08214902949@9netics.com> (raw)
In-Reply-To: <e1d437a40811201415m769e2a1aoe8831563f22070ab@mail.gmail.com>

>    - 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




  reply	other threads:[~2008-11-20 23:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  1:35 Pietro Gagliardi
2008-11-20 14:25 ` Eric Van Hensbergen
2008-11-20 14:37   ` Fco. J. Ballesteros
2008-11-20 14:47     ` Eric Van Hensbergen
2008-11-20 15:07       ` Fco. J. Ballesteros
2008-11-20 15:16         ` Eric Van Hensbergen
2008-11-20 15:21           ` Francisco J Ballesteros
2008-11-20 14:51     ` erik quanstrom
2008-11-20 18:59   ` Skip Tavakkolian
2008-11-20 19:25     ` Skip Tavakkolian
2008-11-20 22:15     ` Giacomo Tesio
2008-11-20 23:18       ` Skip Tavakkolian [this message]
2008-11-21  5:19         ` lucio
2008-11-21 10:15         ` Giacomo Tesio
2008-11-21 11:55           ` matt
2008-11-21 14:01             ` Tom Lieber
2008-11-21 14:34               ` matt
2008-11-21 15:13                 ` Giacomo Tesio
2008-11-21 15:53                   ` matt
2008-11-21 16:05                     ` erik quanstrom
2008-11-21 17:05                     ` Giacomo Tesio
2008-11-21 17:18                       ` erik quanstrom
2008-11-22 20:15                         ` Giacomo Tesio
2008-11-21 17:24                       ` matt
2008-11-21 18:12           ` a

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d61afbea6c3d54d8371a08214902949@9netics.com \
    --to=9nut@9netics.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).