[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4898] trunk/rest-handler.pl



Revision: 4898
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4898&view=rev
Author:   einhverfr
Date:     2012-06-16 06:09:10 +0000 (Sat, 16 Jun 2012)
Log Message:
-----------
Variable length urls now supported on rest handler.

Modified Paths:
--------------
    trunk/rest-handler.pl

Modified: trunk/rest-handler.pl
===================================================================
--- trunk/rest-handler.pl	2012-06-15 08:47:37 UTC (rev 4897)
+++ trunk/rest-handler.pl	2012-06-16 06:09:10 UTC (rev 4898)
@@ -270,9 +270,16 @@
         $request->{format} = $1;
     }
 
-    $request->{class_name} = $components[1];
-    $request->{id} = $components[2];
-    $request->{subresource} = $components[3];
+    $request->{classes} = {};
+    $request->{class_name} = '';
+    while (1) {
+        my $class = shift $components;
+        my $id = shift $components;
+        $id = undef if $id = 'all';
+        $request->{class_name} .= "::$class";
+        $request->{classes}->{$class} = $id;
+    }
+    $request->{class_name} =~ s/^:://;
     
     return $request;
 }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.