[Cosmo-dev] Re: [commits-sandbox] [sandbox] (vinu) [1343] Not so
well tested,
but a complete feature for addition of members to a group using
Brian Moseley
bcm at osafoundation.org
Tue Dec 19 19:16:23 PST 2006
On 12/19/06, Vinubalaji Gopal <vinu at osafoundation.org> wrote:
> A new group is created using:
> PUT /cmp/group/<newgroupname>
> It may optionally include some members like
> PUT /cmp/group/<newgroupname>
> user=foo&group=bar
no - PUT is for adding a resource to the server; in our case the
resource is an xml description of the group to create. this is i
believe what you have already implemented.
> We will throw an error in case the newgroupname is already present. This
> check will be done in CmpServlet itself.
i don't understand what you mean by "done in CmpServlet itself".
GroupDao should throw a DuplicateGroupNameException if you attempt to
create a group with a name that is already in use. CmpServlet should
catch that exception and send an api error with a custom response code
just like it does for users.
> POST is similar but it assumes that the groupname is already present
> Example:
> POST /cmp/group/<existinggroupname>
> user=foo&group=bar
> Should I throw an error in case /cmp/group/<existinggroupname> does not
> exist?
yes, return a 404. see how CmpServlet.doPut does that for users. (i'd
like to use POST for user updates and will rewrite that part
eventually).
everything else sounds correct.
More information about the cosmo-dev
mailing list