Guys -- I'd like to run this design by you for any client-side implications. In
particular, I don't know how a Restlet ResourceException is received at the
client. If don't hear from you, I'll proceed as described here. Dave.
This is what the code will look like in XxxResource classes for
- storeRepresentation() - PUT
- acceptRepresentation() - POST but not POSTs or portions of POSTs that are
read only operations
- removeRepresentations() - DELETE
***** Example from UserResource.java *****
@Override
public void storeRepresentation(Representation entity)
throws ResourceException {
if (!constants.canInsertUsers()) {
throw new ResourceException(Status.CLIENT_ERROR_FORBIDDEN,
"This operation is currently disabled on this server.");
}
........
Each constants.canXxxXxx() method is mapped to these properties in the
wbcserver.properties file in the config directory of a deployed server.
# enable/disable operations that affect server data
can-add-data-files = false
can-change-data-files = false
can-delete-data-files = false
can-insert-datawrappers = false
can-insert-tangibles = false
can-update-tangibles = false
can-delete-tangibles = false
can-insert-users = false
can-update-users = false
Original issue reported on code.google.com by stephen....@gmail.com on 23 Jul 2010 at 6:01
Original issue reported on code.google.com by
stephen....@gmail.com
on 23 Jul 2010 at 6:01