The following are proposed additions to CMP:
POST based user deletion
To support browsers (specifically Safari) that do not support the DELETE method in XMLHttpRequests, I would like to propose
"POST /cmp/user/{username}/delete"
as a synonym for:
"DELETE /cmp/user/{username}".
In addition, to provide better performance for multi-user deletion, I would like to propose
"POST /cmp/user/delete"
with a message body like
"user=user1&user=user2&...&user=userN"
where usernames are url-encoded and Content-Type is "application-www-form-urlencoded" as a synonym for:
"DELETE /cmp/user/user1"
"DELETE /cmp/user/user2"
...
"DELETE /cmp/user/userN"
where a failed deletion (ie, DELETE /cmp/user/root, where root is the overlord) will make the entire
deletion transaction fail. Note that an attempt to delete a non-existent user will appear to succeed. This behavior
is implemented in the DAOs, so it will not be.
Additional user information
To support an administrative interface identical to our current interface, I would like to propose additional information in the response to GET /cmp/users and GET /cmp/user/{username}.
Specifically, I propose we return 3 new pieces of information for each user:
- Date Created (Date) (XML tag <created>)
- Date Modified (Date) (XML tag <modified>)
- Administrator (empty tag) (XML tag <administrator>)
User list paging and sorting
I would like to propose 4 new query parameters for the command "GET /cmp/users":
- ps (page size, ie, number of users per page, default=all users)
- pn (page number to return based on ps, so, and st, default=1)
- so (sort order, ascending or descending, default=ascending)
- st (sort type, [name | username | admin | email | created | modified], default=username)
In addition, we will support the collection paging extensions to the atom protocol:
http://www.ietf.org/html.charters/atompub-charter.html
For example (thanks to Brian Moseley for this example) the url
http://localhost:8080/cosmo/cmp/users?ps=25&pn=2 on a server with 625 users will return:
...
<users>
<link rel="first"
href="http://localhost:8080/cosmo/cmp/users?ps=25" />
<link rel="previous"
href="http://localhost:8080/cosmo/cmp/users?ps=25&pn=1" />
<link rel="next"
href="http://localhost:8080/cosmo/cmp/users?ps=25&pn=3" />
<link rel="last"
href="http://localhost:8080/cosmo/cmp/users?ps=25&pn=25" />
...
</users>
...
--
TravisVachon - 09 Oct 2006