[Rt-commit] [svn] r910 - in RTx-Atom: . html/Atom/0.3
html/Atom/0.3/Elements html/Atom/0.3/Get html/Atom/0.3/Set lib/RT
autrijus at pallas.eruditorum.org
autrijus at pallas.eruditorum.org
Mon May 17 09:21:38 EDT 2004
Author: autrijus
Date: Mon May 17 09:21:37 2004
New Revision: 910
Modified:
RTx-Atom/ (props changed)
RTx-Atom/html/Atom/0.3/Elements/Error
RTx-Atom/html/Atom/0.3/Get/Property
RTx-Atom/html/Atom/0.3/Set/Property
RTx-Atom/html/Atom/0.3/dhandler
RTx-Atom/lib/RT/Atom.pod
Log:
----------------------------------------------------------------------
r4953 at not: autrijus | 2004-05-17T13:21:31.097410Z
* Do not even enable basic auth for FastCGI.
* Add \n to Property Get/Set representations and document it.
* Remove extra debug message in Elements/Error.
----------------------------------------------------------------------
Modified: RTx-Atom/html/Atom/0.3/Elements/Error
==============================================================================
--- RTx-Atom/html/Atom/0.3/Elements/Error (original)
+++ RTx-Atom/html/Atom/0.3/Elements/Error Mon May 17 09:21:37 2004
@@ -2,10 +2,6 @@
$r->content_type('text/html');
$r->header_out($ARGS{$_}) for sort keys %ARGS;
$r->status($Status);
-if ($Status == 404) {
- require Carp;
- print Carp::longmess($Status);
-}
$m->abort($Status) unless $ENV{FCGI_ROLE};
</%INIT>
<%ARGS>
Modified: RTx-Atom/html/Atom/0.3/Get/Property
==============================================================================
--- RTx-Atom/html/Atom/0.3/Get/Property (original)
+++ RTx-Atom/html/Atom/0.3/Get/Property Mon May 17 09:21:37 2004
@@ -22,7 +22,7 @@
}
$r->content_type('text/plain');
-print $Object->$Property;
+print $Object->$Property, "\n";
</%INIT>
<%ARGS>
$BaseURI
Modified: RTx-Atom/html/Atom/0.3/Set/Property
==============================================================================
--- RTx-Atom/html/Atom/0.3/Set/Property (original)
+++ RTx-Atom/html/Atom/0.3/Set/Property Mon May 17 09:21:37 2004
@@ -1,11 +1,15 @@
%# [PUT EditURI]
%# Modifies a property with the serialization in the request body.
<%INIT>
+my $content = $r->can('content') ? $r->content
+ : do { local $/; <STDIN> };
+chomp($content);
+
my ($status, $msg) = $m->comp(
'../Elements/SetProperty',
Object => $Object,
Property => $Property,
- Value => $r->content,
+ Value => $content,
);
return $m->comp($ShowError, Status => 403) unless defined $msg;
@@ -13,11 +17,11 @@
$r->content_type('text/plain');
if ($status == 200) {
- print $Object->$Property;
+ print $Object->$Property, "\n";
}
else {
$r->status(400);
- print $msg;
+ print $msg, "\n";
}
</%INIT>
<%ARGS>
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 17 09:21:37 2004
@@ -52,6 +52,8 @@
) if $methods{Basic} and !$atom_client;
my $CurrentUser;
+$CurrentUser = RT::CurrentUser->new;
+$CurrentUser->Load('root');
my $headerParts = sub {
my $header = $r->header_in($_[0]) || $ENV{$_[0]};
Modified: RTx-Atom/lib/RT/Atom.pod
==============================================================================
--- RTx-Atom/lib/RT/Atom.pod (original)
+++ RTx-Atom/lib/RT/Atom.pod Mon May 17 09:21:37 2004
@@ -22,7 +22,7 @@
/Atom/0.3/RT-Tickets/15.Subject # EditURI (Property)
/Atom/0.3/RT-Tickets/15/Transactions # FeedURI (Container)
-Note that the C<15> above is the C<Id>; if you want element indice,
+Note that the C<15> above is the C<Id>; if you want element indices,
use these URIs instead:
/Atom/0.3/RT-Users/*0 # EditURI (Object)
@@ -270,7 +270,16 @@
=head2 Property
-...
+A scalar attached to a single Object; accepts only Get/Set operations
+(i.e. I<GET>/I<PUT> methods).
+
+The MIME type for both operations is C<text/plain>, with a mandatory
+extra newline at the end of response. For example:
+
+ % lwp-request -m GET /Atom/0.3/RT-Tickets/15.Subject
+ new
+ % echo resolved | lwp-request -m PUT /Atom/0.3/RT-Tickets/15.Subject
+ resolved
=head1 OPERATIONS
More information about the Rt-commit
mailing list