[Building Sakai] Entity Broker - REST getEntities - URL longer than max limit allowed

Aaron Zeckoski azeckoski at unicon.net
Fri Mar 22 03:42:18 PDT 2013


This happens because EB is trying to be too smart for its own good. Just
change the code from returning the object directly to returning it inside
the ActionReturn wrapper and things will work the way you want (you have to
change the method signature as well).

From:
return data;
To:
return new ActionReturn(data);

-AZ


On Fri, Mar 22, 2013 at 4:17 AM, Tania Tritean <TTritean at loi.nl> wrote:

> ****
>
> Hello,****
>
> ** **
>
> I have a question related to the entity broker.****
>
> ** **
>
> We are trying to get a list of data via EB Restfull capability. ****
>
> Normally we would use the method getEntities for this, but the method
> should receive a very long list of arguments so that the URL can be longer
> than the max limit allowed in different browsers.****
>
> ** **
>
> What would be the approach to solve this problem?****
>
> ** **
>
> We tried this:****
>
>    1. To use EntityCustomAction instead of getEntities. This action is
>    mapped with viewKey = entityView.View_NEW to make the action as a
>    post, so that the parameters won’t be in the URL.****
>
>  **-         **the problem is that for a list with one element we get to
> the code in EntityHandlerImpl line 447 ( ****Sakai**** 2.9, EB 1.4.3)****
>
> if (actionReturn.entitiesList.size() > 1) {****
>
>        // correct the view key which should be used now****
>
>        view.setViewKey(EntityView.VIEW_LIST);****
>
>   }****
>
> ** **
>
> So we end up with the error and no data returned: ****
>
> Provider: Attempted to access an entity URL path
> (/loi-activities-history/new.json) using method (POST) for an entity
> (/loi-activities-history) and view (new) when there is no access provider
> to handle the request for prefix (loi-activities-history)****
>
> ** **
>
> ** **
>
> Is there another way to solve our problem?****
>
> ** **
>
> Regards,****
>
> Tania****
>
> Tania Tritean
> Tel.: 035 629 39 23
>
> Leidse Onderwijsinstellingen bv
> Leidsedreef 2
> 2352 BA Leiderdorp
> www.loi.nl
>
>  ------------------------------
>
> [image: Nederland wordt steeds slimmer. Leidse Onderwijsinstellingen]
>
> De informatie verzonden met dit e-mailbericht (en bijlagen) is uitsluitend
> bestemd voor de geadresseerde(n) en zij die van de geadresseerde(n)
> toestemming hebben dit bericht te lezen. Gebruik door anderen dan
> geadresseerde(n) is verboden. De informatie in dit e-mailbericht (en de
> bijlagen) kan vertrouwelijk van aard zijn en kan binnen het bereik vallen
> van een wettelijke geheimhoudingsplicht. Indien u deze e-mail ten onrechte
> ontvangen hebt, wordt u verzocht ons daarvan zo spoedig mogelijk per e-mail
> of telefonisch op de hoogte te stellen, en het ontvangen bericht (en de
> bijlagen) te wissen zonder deze te lezen, te kopiëren of aan derden bekend
> te stellen.
>
> P  Denk aan het milieu voordat u dit bericht print
>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130322/604aecb7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4378 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130322/604aecb7/attachment.gif 


More information about the sakai-dev mailing list