[Rt-commit] [svn] r820 - in RTx-Atom: . html/Atom/0.3 html/Atom/0.3/Search lib/RTx

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Mon May 3 15:41:06 EDT 2004


Author: autrijus
Date: Mon May  3 15:41:05 2004
New Revision: 820

Modified:
   RTx-Atom/   (props changed)
   RTx-Atom/html/Atom/0.3/Search/index
   RTx-Atom/html/Atom/0.3/dhandler
   RTx-Atom/lib/RTx/Atom.pm
Log:
 ----------------------------------------------------------------------
 r4429 at not:  autrijus | 2004-05-03T17:18:16.363330Z
 
 * Use absolute links since Atom readers seem to expect it.
 ----------------------------------------------------------------------
 r4430 at not:  autrijus | 2004-05-03T19:40:40.514844Z
 
 * Provide alias URI examples.
 * Define GET and POST aliases for OPTIONS, PUT and DELETE operations.
 * Spellchecking.
 
 ----------------------------------------------------------------------


Modified: RTx-Atom/html/Atom/0.3/Search/index
==============================================================================
--- RTx-Atom/html/Atom/0.3/Search/index	(original)
+++ RTx-Atom/html/Atom/0.3/Search/index	Mon May  3 15:41:05 2004
@@ -26,13 +26,13 @@
   <entry>
     <title mode="escaped"><% $entry->{Name} || "#$entry->{Id}" %></title>
     <& $Link, Relation => "service.edit", URI => "$FeedURI/$entry->{Id}", Title => loc("Edit"). ": $entry->{Name}", IsEntry => 1 &>
+% if ($entry->{HTML_URI}) {
+    <& $Link, Type => 'text/html', URI => "$RT::WebURL$entry->{HTML_URI}", Title => $entry->{Name} &>
+% }
     <summary mode="escaped"><% $entry->{Description} %></summary>
     <issued><% $entry->{Created} %></issued>
     <modified><% $entry->{LastUpdated} %></modified>
     <id><% $entry->{URI} %></id>
-% if ($entry->{HTML_URI}) {
-    <& $Link, Type => 'text/html', URI => "$RT::WebURL$entry->{HTML_URI}", Title => $entry->{Name} &>
-% }
   </entry>
 % }
   <info></info>

Modified: RTx-Atom/html/Atom/0.3/dhandler
==============================================================================
--- RTx-Atom/html/Atom/0.3/dhandler	(original)
+++ RTx-Atom/html/Atom/0.3/dhandler	Mon May  3 15:41:05 2004
@@ -174,7 +174,7 @@
     last;
 }
 
-my $BaseURI = "$RT::WebPath/Atom/0.3";
+my $BaseURI = "$RT::WebURL/Atom/0.3";
 
 if (!$class and $type) {
     $map = $m->comp('Elements/Introspect', Want => 'RecordToCollection');
@@ -191,7 +191,7 @@
 
 $ARGS{Path} = $path;
 $ARGS{BaseURI} = $BaseURI;
-$ARGS{Link} = "$BaseURI/Elements/Link";
+$ARGS{Link} = "/Atom/0.3/Elements/Link";
 $ARGS{Now} = RT::Date->new($session{CurrentUser});
 $ARGS{Now}->SetToNow;
 

Modified: RTx-Atom/lib/RTx/Atom.pm
==============================================================================
--- RTx-Atom/lib/RTx/Atom.pm	(original)
+++ RTx-Atom/lib/RTx/Atom.pm	Mon May  3 15:41:05 2004
@@ -28,7 +28,7 @@
 The authentication algorithm is describe in
 L<http://www.xml.com/pub/a/2003/12/17/dive.html>
 with one important exception -- that article assumes the shared
-password between client and server is in plaintext, but RT/Atom
+password between client and server is in plaintext, but RT-Atom
 uses this instead:
 
     md5_hex(join(':', $username, $realm, md5_hex($password)));
@@ -40,7 +40,7 @@
 
 =head2 The RT-Atom URI space
 
-XXX - Describe the principal of odd/even depth, verbs and advers here.
+XXX - Describe the principal of odd/even depth, verbs and adverbs here.
 
 Some example canonical URIs are:
 
@@ -55,9 +55,19 @@
     /Atom/0.3/RT-Tickets/15,16,17!update	# PostURI (ResultSet)
     /Atom/0.3/RT-Tickets/15/Transactions	# FeedURI
 
+RT-Atom also supplies alias URIs.  Whenever an user request the URI,
+it is redirected to the canonical URL with a I<301 Moved Permanently>
+status code.  Here are some example aliases:
+
+    /Atom			# /Atom/0.3
+    /Atom/0.3/tickets		# /Atom/0.3/RT-Tickets
+    /Atom/0.3/Tickets		# /Atom/0.3/RT-Tickets
+    /Atom/0.3/Ticket/15		# /Atom/0.3/RT-Tickets/15
+    /Atom/0.3/Users/somename	# /Atom/0.3/Users/1234
+
 =head2 Sample exchange
 
-Create an 'autrijus' user, then add it to all groups that has 'root'
+Create an C<autrijus> user, then add it to all groups that has C<root>
 as member.
 
 First, the B<RT::Client> code:
@@ -79,7 +89,7 @@
     HEAD /Atom/0.3
     Accept: application/x.atom+xml,*/*
 
-	401 Authorization Requred
+	401 Authorization Required
 	WWW-Authenticate: WSSE realm="localhost", profile="UsernameToken"
 
     OPTIONS /Atom/0.3/Users!add
@@ -118,22 +128,23 @@
 
 =head1 OPERATIONS
 
-Here is a list of all operatiive I<verbs> supported by this API,
+Here is a list of all operative I<verbs> supported by this API,
 including their possible response status codes and meanings:
 
-=head2 Search - GET FeedURI
+=head2 Search - I<GET FeedURI>
 
 Search for objects within an container.
 
-Possible query parameters: rows, page, query.
+Possible query parameters: rows, page, query, columns.
 
-If entries are found, the 'Location:' header is set to a ResultSet.
+If entries are found, the 'Location:' header is set to a URL pointing
+to the ResultSet.
 
     200: Success.  Body is the result serialized as an AtomFeed.
     400: Request failed.  Body is error message in text/plain.
     404: There is no container matching the specified URI.
 
-=head2 Get - GET EditURI
+=head2 Get - I<GET EditURI>
 
 Retrieve a representation of an object or property.
 
@@ -143,7 +154,7 @@
     400: Request failed.  Body is error message in text/plain.
     404: There is no object matching the specified URI.
 
-=head2 Put - PUT EditURI
+=head2 Put - I<PUT EditURI>
 
 Modifies an object or property with the serialization in the request body.
 
@@ -151,7 +162,9 @@
     400: Request failed.  Body is error message in text/plain.
     404: There is no object matching the specified URI.
 
-=head2 Remove - DELETE EditURI
+Clients without I<PUT> support may use I<POST EditURI> instead.
+
+=head2 Remove - I<DELETE EditURI>
 
 Remove the specified object.
 
@@ -159,7 +172,10 @@
     400: Request failed.  Body is error message in text/plain.
     404: There is no object matching the specified URI.
 
-=head2 Describe - OPTIONS PostURI | GET PostURI
+Clients without I<DELETE> support may use I<POST EditURI> instead, with an
+empty entry element as the request body.
+
+=head2 Describe - I<OPTIONS PostURI>
 
 On a container, returns the schema of objects acceptable by this container.
 
@@ -169,7 +185,9 @@
     400: Request failed.  Body is error message in text/plain.
     404: There is no container matching the specified URI.
 
-=head2 Add - POST PostURI (Container)
+Clients without I<OPTIONS> support may use I<GET PostURI> instead.
+
+=head2 Add - I<POST PostURI> (Container)
 
 Create a new object from the AtomEntry in the request's body.
 
@@ -178,7 +196,7 @@
     400: Request failed.  Body is error message.
     404: There is no container matching the specified URI.
 
-=head2 Update - POST PostURI (Object)
+=head2 Update - I<POST PostURI> (Object)
 
 Updates an object, using an 'adverb' acceptable to that object's class.
 


More information about the Rt-commit mailing list