Home
The Toolkit for Online Communities
15938 Community Members, 0 members online, 2288 visitors today
Log In Register

Site Nodes Proposal (Draft)

OpenACS Home : xowiki : Site Nodes Proposal (Draft)
Search · Index
Previous Month June 2013
Sun Mon Tue Wed Thu Fri Sat
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 (1) 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6

Popular tags

ad_form , ADP , ajax , aolserver , asynchronous , bgdelivery , bugtracker , COMET , cvs , debian , emacs , FreeBSD , includelets , install , installation , installers , javascript , libthread , linux , monitoring , nginx , oracle , osx , patches , performance , postgres , pound , redhat , selenium , ssl

No registered users in community xowiki
in last 30 minutes

Contributors

OpenACS.org

Site Nodes Proposal (Draft)

Site Nodes Proposal (Draft)

State of This Document

This proposal should be considered a rough draft as it has not yet been reviewed by any core team members.  The response::* api has been renamed and moved to a separate proposal (templatehead).

Goals of this proposal, ie. why change site nodes?

I believe the changes in this proposal would:

Suggested Changes

Abstractly, the changes I'm suggesting are:
I have implemented the above ideas in a copy of the site_nodes datamodel called 'locations'.  Together with dynamic types I've used locations to create dynamic wizards and a data driven form builder which could be considered proofs of the concept.  

Implementation Detail

Multiple Root Nodes

This can be achieved by treating site_nodes at depth 1 as root nodes; ie. the children of the current singleton root node would be root nodes in their own right. 

The overall root site node is created during the kernel datamodel installation.  The URL space for the main site, as we know it currently, would be created as a child of this root node with its root (at depth 1) being assigned an acs_magic_object.  I propose the magic object be called 'default_site_root'.  The root of the site nodes tree would therefore look something like this:

image:site-nodes-tree.svg

Despite the lack of a specific 'node_id' or 'url' option in some cases, the site_nodes::* api is designed to allow you to identify a site node by either its url or node_id.  I would propose that functions which currently accept a node_id would carry out their function on the specified node regardless of which tree the node belongs to.  Functions which accept a url parameter to identify the site_node would be given an optional 'root_id' switch which defaults to the 'default_site_root' magic object.  The 'root_id' switch would allow you to look up a node by url in a different tree.

By default all hostnames are considered mapped to the 'default_site_root' node.  In this proposal the host_node_map could be used to assign hostnames to alternate root nodes.  Although I don't think their is enough support in the toolkit as a whole for templates/packages/objects which appear simultaneously at different paths below a hostname, this aspect of the host_node_map would continue to function as before.

Method Mapped URLs

Many MVC frameworks incorporate the idea of mapping handler functions (or controllers if you like) to urls - this much is pretty well understood.  Exactly how a particular method should be selected for given URL may be a matter for debate.  For example, some members of the core team have discussed with me the idea that the selection should be based in part on the data type of the object mounted on a site node.  Personally, I would go for the simplest option: store the name of the function to call in the site node.  I'll leave this part to be defined after there has been more discussion.

Site Node Parameters

These would be implemented using a fairly standard skinny tables approach similar to package parameters.

Impact On Existing Code

Currently I believe the code that would be affected by these changes amounts to: