[Building Sakai] Setting current placement

Francisco francisco.saez.sakai at gmail.com
Thu Sep 29 04:21:58 PDT 2011


Hi,
this happends for example with private messages ("msgcntr"). When you 
try to send a new message, this tool takes automatically site id and 
tool id from context. So, when you invoke this service from a webservice 
or a restful service, it throws an exception.

I think this also happens with some methods of Samigo.

Of course, the best solution would be to remove this kind of 
dependencies, and allow the tools to manage manually site and tool ids.

Regards,
Francisco

El 28/09/2011 15:05, Noah Botimer escribió:
> Francisco,
>
> I'm curious which service/method you are using that depends on the 
> current placement. This could be an unreasonable dependency on 
> session/request state that would make any non-tool usage more 
> difficult. A good path forward would be to refactor so that the tool 
> (which has an explicit dependency on placement/state) to call the 
> service with its placement.
>
> Thanks,
> -Noah
>
> On Sep 28, 2011, at 7:33 AM, Francisco wrote:
>
>> I finally found the solution. Just add:
>>
>>     Site s = siteService.getSite(siteId);
>>     ToolConfiguration tc = s.getTool(toolId);
>>     Tool t = tc.getTool();
>>
>>     Placement p = new org.sakaiproject.util.Placement(toolId, 
>> t.getId(), t, null, siteId, "");
>>     threadLocalManager.set("sakai:ToolComponent:current.placement", p);
>>     threadLocalManager.set("sakai:ToolComponent:current.tool", t);
>>
>> Regards
>>
>> El 28/09/2011 10:22, Francisco escribió:
>>> Hi,
>>>
>>> there is any way to set the current placement for a site and a tool?
>>>
>>> This is usefull if we work with webservices or restful services.
>>>
>>> Thanks and regards.
>>> -- 
>>>
>>> <Mail Attachment.jpeg><http://www.samoo.es/>
>>>
>>> <http://www.samoo.es/>
>>>
>>> *Francisco Sáez*
>>>
>>> *Analista - Programador*
>>>
>>> francisco.saez at samoo.es <mailto:francisco.saez at samoo.es>
>>>
>>> +34 - 96 393 69 15
>>>
>>> www.samoo.es <http://www.samoo.es/>
>>>
>>> Este  correo  y  sus archivos asociados son privados y 
>>> confidenciales y va dirigido  exclusivamente  a su destinatario. Si 
>>> recibe este correo sin ser el  destinatario del mismo, le rogamos 
>>> proceda a su eliminación y lo ponga en  conocimiento del emisor. La 
>>> difusión por cualquier medio del contenido de  este  correo podría 
>>> ser sancionada conforme a lo previsto en las leyes españolas, Ley 
>>> Orgánica 15/1999 de Protección de Datos de Carácter Personal.  No  
>>> se autoriza la utilización con fines comerciales o para su 
>>> incorporación a ficheros automatizados de las direcciones del emisor 
>>> o del destinatario.”
>>>
>>> This mail and its attached files are confidential and are only and 
>>> exclusively intended to their addressee. In case you may receive 
>>> this mail not being its addressee, we beg you to let us know the 
>>> error by reply and to proceed to destroy it. The circulation by any 
>>> mean of this mail could be penalised in accordance with the Spanish 
>>> legislation. Is not allowed the use of both, the transmitter and the 
>>> addressee’s, address with a commercial aim, or in order to be 
>>> incorporated to automated data process or to any kind of files.
>>>
>>> P Antes de imprimir este correo electrónico piense bien si es 
>>> necesario hacerlo. El medioambiente es cosa de todos.
>>>
>>
>>
>> -- 
>>
>> <image002.jpg><http://www.samoo.es/>
>>
>> <http://www.samoo.es/>
>>
>> *Francisco Sáez*
>>
>> *Analista - Programador*
>>
>> francisco.saez at samoo.es <mailto:francisco.saez at samoo.es>
>>
>> +34 - 96 393 69 15
>>
>> www.samoo.es <http://www.samoo.es/>
>>
>> Este  correo  y  sus archivos asociados son privados y confidenciales 
>> y va dirigido  exclusivamente  a su destinatario. Si recibe este 
>> correo sin ser el  destinatario del mismo, le rogamos proceda a su 
>> eliminación y lo ponga en  conocimiento del emisor. La difusión por 
>> cualquier medio del contenido de  este  correo podría ser sancionada 
>> conforme a lo previsto en las leyes españolas, Ley Orgánica 15/1999 
>> de Protección de Datos de Carácter Personal.  No  se autoriza la 
>> utilización con fines comerciales o para su incorporación a ficheros 
>> automatizados de las direcciones del emisor o del destinatario.”
>>
>> This mail and its attached files are confidential and are only and 
>> exclusively intended to their addressee. In case you may receive this 
>> mail not being its addressee, we beg you to let us know the error by 
>> reply and to proceed to destroy it. The circulation by any mean of 
>> this mail could be penalised in accordance with the Spanish 
>> legislation. Is not allowed the use of both, the transmitter and the 
>> addressee’s, address with a commercial aim, or in order to be 
>> incorporated to automated data process or to any kind of files.
>>
>> P Antes de imprimir este correo electrónico piense bien si es 
>> necesario hacerlo. El medioambiente es cosa de todos.
>>
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org 
>> <mailto: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"
>


-- 

Samoo LOGO<http://www.samoo.es/>

<http://www.samoo.es/>

*Francisco Sáez*

*Analista - Programador*

francisco.saez at samoo.es <mailto:francisco.saez at samoo.es>

+34 - 96 393 69 15

www.samoo.es <http://www.samoo.es>

Este  correo  y  sus archivos asociados son privados y confidenciales y 
va dirigido  exclusivamente  a su destinatario. Si recibe este correo 
sin ser el  destinatario del mismo, le rogamos proceda a su eliminación 
y lo ponga en  conocimiento del emisor. La difusión por cualquier medio 
del contenido de  este  correo podría ser sancionada conforme a lo 
previsto en las leyes españolas, Ley Orgánica 15/1999 de Protección de 
Datos de Carácter Personal.  No  se autoriza la utilización con fines 
comerciales o para su incorporación a ficheros automatizados de las 
direcciones del emisor o del destinatario.”

This mail and its attached files are confidential and are only and 
exclusively intended to their addressee. In case you may receive this 
mail not being its addressee, we beg you to let us know the error by 
reply and to proceed to destroy it. The circulation by any mean of this 
mail could be penalised in accordance with the Spanish legislation. Is 
not allowed the use of both, the transmitter and the addressee’s, 
address with a commercial aim, or in order to be incorporated to 
automated data process or to any kind of files.

P Antes de imprimir este correo electrónico piense bien si es necesario 
hacerlo. El medioambiente es cosa de todos.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110929/c8df7266/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3022 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110929/c8df7266/attachment.jpg 


More information about the sakai-dev mailing list