[Building Sakai] EntityBroker returning 200 instead of 204

Aaron Zeckoski azeckoski at unicon.net
Thu Feb 21 03:48:09 PST 2013


For the 5 main CRUD operations (this one you mention is one of them)
the semantics are fairly locked down in order to try to match the
convention here:
http://microformats.org/wiki/rest/urls

However, if you really want to you can always get the response and
request objects and do anything you like to them. In some cases
though, this is going to interfere with what the system us trying to
do and it will overwrite what you tried to do so I don't think that
will work here.
https://source.sakaiproject.org/svn/entitybroker/trunk/api/src/java/org/sakaiproject/entitybroker/entityprovider/capabilities/RequestAware.java

The other alternative is to implement something in the before and
after hooks (probably after in your case):
https://source.sakaiproject.org/svn/entitybroker/trunk/api/src/java/org/sakaiproject/entitybroker/entityprovider/capabilities/RequestInterceptor.java

-AZ


On Thu, Feb 21, 2013 at 5:24 AM, Matthew Buckett
<matthew.buckett at it.ox.ac.uk> wrote:
> For some entity broker operations you typically implement a method and
> perform the operation, however for some local code we would like to
> return some content in the response, but using the API you don't get
> the opportunity is there a way around this?
>
> Eg: For delete you implement public void deleteEntity(EntityReference
> ref, Map<String, Object> params), perform the delete and then
> EntityBroker returns 204 (no content), however I'd like to return the
> ID of the content deleted in the message body and so return 200. Is
> this possible?
>
> --
>   Matthew Buckett, VLE Developer, IT Services, University of Oxford
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



-- 
Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list