[Ocs] add comment should return id

Mateu Batle mateu.batle at collabora.co.uk
Fri Sep 10 09:48:38 PDT 2010


 Hi Frank

I was trying this and the id is returned, but I think it would be better
if it is part of the metadata.
Since I think this will be common in many add requests, and all add
operations just add one item.

So instead of this:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message></message>
 </meta>
 <data>
  <comment>
   <id>381686</id>
  </comment>
 </data>
</ocs>

Return this:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message></message>
   <id>381686</id>
  </meta>
</ocs>

What do you think ?

best regards
  Mateu


On 08/25/2010 09:55 AM, Frank Karlitschek wrote:
> Hi,
>
> I add the id as you suggested. Will be live with the next server update tomorrow.
>
> Cheers
> Frank
>
>
>
>
> On 24.08.2010, at 01:52, Mateu Batle wrote:
>
>> Hi all,
>>
>> let's give some life to this new freedesktop list, thanks Frank for
>> getting it :)
>>
>> The request for the new spec is when a new comment is added,
>> I think the response back to the client must include the new id created
>> for the comment.
>> I need this to immediately rate the comment just after creating it.
>>
>> I have thought of a workaround but it is neither elegant, nor efficient
>> nor safe, so please let's get this.
>> The workaround would be get all the comments again, and check date /
>> title / text / user.
>> I think it is small requirement for the server, but a big win for the
>> client.
>>
>> Actually I think this should be for all add / create / new operations,
>> not just for comments.
>>
>> cheers
>>  Mateu
>> _______________________________________________
>> Ocs mailing list
>> Ocs at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/ocs
>
> --
> Frank Karlitschek
> karlitschek at kde.org
>
>
>
>
> _______________________________________________
> Ocs mailing list
> Ocs at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/ocs


-- 
Mateu Batle
Software Engineer
Collabora Ltd.



More information about the Ocs mailing list