[Jifty-commit] r1689 - in jifty/trunk/plugins/REST: . lib lib/Jifty
lib/Jifty/Plugin t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jul 28 22:21:04 EDT 2006
Author: audreyt
Date: Fri Jul 28 22:21:02 2006
New Revision: 1689
Added:
jifty/trunk/plugins/REST/
jifty/trunk/plugins/REST/Makefile.PL
jifty/trunk/plugins/REST/lib/
jifty/trunk/plugins/REST/lib/Jifty/
jifty/trunk/plugins/REST/lib/Jifty/Plugin/
jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST/
jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST.pm
jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm
jifty/trunk/plugins/REST/t/
Log:
* skeleton for plugin rest
Added: jifty/trunk/plugins/REST/Makefile.PL
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/REST/Makefile.PL Fri Jul 28 22:21:02 2006
@@ -0,0 +1,8 @@
+use inc::Module::Install;
+name('Jifty-Plugin-REST');
+version('0.01');
+requires('Jifty' => '0.60507');
+
+#install_share;
+
+WriteAll;
Added: jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST.pm Fri Jul 28 22:21:02 2006
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::REST;
+use base qw/Jifty::Plugin/;
+
+1;
Added: jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm Fri Jul 28 22:21:02 2006
@@ -0,0 +1,62 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::REST;
+use Jifty::Dispatcher -base;
+
+#before '/=/**' => run {
+# authenticate_user();
+# tangent('/login') unless Jifty->web->current_user->id;
+#};
+
+before qr{^ (/=/ .*) \. (js|yml|perl|csv) $}x => run {
+ header(Accept => $2);
+ dispatch $1;
+};
+
+before POST qr{^ (/=/ .*) ! (DELETE|PUT|GET|POST|OPTIONS|HEAD|TRACE|CONNECT) $}x => run {
+ $ENV{REQUEST_METHOD} = $2;
+ dispatch $1;
+};
+
+on GET '/=/model' => \&list_models;
+on GET '/=/model/*' => \&list_model_keys;
+on GET '/=/model/*/*' => \&list_model_items;
+on GET '/=/model/*/*/*' => \&show_item;
+
+on PUT '/=/model/*/*/*' => \&replace_item;
+on DELETE '/=/model/*/*/*' => \&delete_item;
+
+on GET '/=/action' => \&list_actions;
+on GET '/=/action/*' => \&list_action_params;
+on POST '/=/action/*' => \&run_action;
+
+sub list_models {
+}
+
+sub list_model_keys {
+}
+
+sub list_model_items {
+}
+
+sub show_item {
+}
+
+sub replace_item {
+}
+
+sub delete_item {
+}
+
+sub list_actions {
+}
+
+sub list_action_params {
+}
+
+sub run_action {
+}
+
+
+1;
More information about the Jifty-commit
mailing list