[Sputnik-list] first zero-config sputnik plugin
Yuri Takhteyev
yuri at sims.berkeley.edu
Wed Jan 2 04:11:08 GMT+3 2008
Now that Sputnik works with LuaRocks, we can use LuaRocks to install
plugins. Here is the first rockified plugin, which offers simple
bug-tracking. As a bug-tracking tool this plugin will need some more
work, so I am showing it now as a proof of concept.)
Install the plugin with:
$SPUTNIK_DIR/luarocks install sputnik-tickets.
Then go to the page called "Tickets". (E.g.,
http://localhost/cgi-bin/sputnik.cgi/Tickets.) Note that this page
didn't exist before you installed the plugin, and now it does. If you
click on "Create New Ticket", you will be taken to an edit form for a
new page ("Ticket:000001"), which has it's prototype pre-set to
"@Ticket" and because of this has a custom edit form. Note that
"@Ticket" is again a new page, which got installed by the plugin.
More specifically, what the plugin does is add four new modules:
sputnik/actions/tickets.lua
sputnik/node_defaults/@Ticket.lua
sputnik/node_defaults/Tickets.lua
sputnik/node_defaults/_translations_for_ticket.lua.lua
The first is a real module that provides a new "show" action for the
"Tickets" page. The other three modules just hold the data for the
new pages. The actual Versium pages will be created on the fly when
they are accessed.
- yuri
--
http://sputnik.freewisdom.org/
More information about the Sputnik-list
mailing list