Add per-class limit support to the tag URI parser; correct location/org thinko
authorMike Rylander <mrylander@gmail.com>
Wed, 3 Aug 2011 18:23:11 +0000 (14:23 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 23 Mar 2012 16:37:50 +0000 (12:37 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>

Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm

index e9c6546..a6679f4 100755 (executable)
@@ -91,8 +91,8 @@ sub parse {
         $self->classname($classname);
         $self->id($id);
         $self->paging(($paging ? [ map { s/^\s*//; s/\s*$//; $_ } split(',', $paging) ] : []));
-        $self->includes(($inc? [ map { s/^\s*//; s/\s*$//; $_ } split(',', $inc) ] : []));
-        $self->org($loc);
+        $self->includes(($inc ? { map { /:/ ? split(':') : ($_,undef) } map { s/^\s*//; s/\s*$//; $_ } split(',', $inc) } : {}));
+        $self->location($loc);
         $self->depth($depth);
         $self->pathinfo($mods);
     }
@@ -122,7 +122,7 @@ sub toURI {
     $tag .= 'U2@' if ($self->version == 2);
     $tag .= $self->classname . '/' . $self->id;
     $tag .= '['. join(',', @{ $self->paging }) . ']' if defined($self->paging);
-    $tag .= '{'. join(',', @{ $self->includes }) . '}' if defined($self->includes);
+    $tag .= '{'. join(',', map { $_ . ':' . $self->includes->{$_} } keys %{ $self->includes }) . '}' if defined($self->includes);
     $tag .= '/' . $self->location if defined($self->location);
     $tag .= '/' . $self->depth if defined($self->depth);
     $tag .= '/' . $self->pathinfo if defined($self->pathinfo);