[Building Sakai] How to get site id

Diego del Blanco Orobitg diego.delblanco at setival.com
Fri Jun 26 04:23:06 PDT 2009


Dear David,
 
I know that toolManager.getCurrentPlacement() will return null if I invoke
it from a Samigo Services because the request is not made directly from a
tool. Considering this pointing, I've tried to get
toolManager.getCurrentPlacement().getContext() from one of the beans of my
tool, instead to leave Samigo Services to do it for my tool and...I'm
getting the same NPE!!!.

 

My bean looks like this:

 

public class ReivenListBean {

 

....

 

      public ReivenListBean(){
 
            if (ToolManager.getCurrentPlacement()!=null){
                System.out.println(" > toolManager.currentPlacement---> NOT
NULL");
            }else{
                 System.out.println(" > toolManager.currentPlacement --->
NULL");
            }

 

....

}

 

And I declare it in faces-config.xml as a managed session bean. When I
select my tool from a site, I can read the following message at
catalina.out: 
 
> toolManager.currentPlacement ---> NULL
 
I really don't know why!!!!. I have analyzed the link to my tool in Sakai
main page, to see which pattern it follows and be able to check if it is
valid for a tool or not. And here you have what I've found:
Site-info 
<!-- start Tool Body -->      
<div class="portletMainWrap">
<iframe name="Main9bd95d6ax328fx4a14xb2c0xfbbaf22a6145"
 id="Main9bd95d6ax328fx4a14xb2c0xfbbaf22a6145"
 title="Informaci&#243;n del sitio "
 class ="portletMainIframe"
 height="50"
 width="100%"
 frameborder="0"
 marginwidth="0"
 marginheight="0"
 scrolling="auto"
 src="
<http://localhost:8080/portal/tool/9bd95d6a-328f-4a14-b2c0-fbbaf22a6145?pane
l=Main>
http://localhost:8080/portal/tool/9bd95d6a-328f-4a14-b2c0-fbbaf22a6145?panel
=Main">
</iframe>
</div>
<!-- end Tool Body -->            

My Tool
 
<!-- start Tool Body -->      
<div class="portletMainWrap">
 <iframe name="Maine4759e5axcc51x44dcxb9b2x9be7f28ee6ca"
 id="Maine4759e5axcc51x44dcxb9b2x9be7f28ee6ca"
 title="Reiven Content "
 class ="portletMainIframe"
 height="50"
 width="100%"
 frameborder="0"
 marginwidth="0"
 marginheight="0"
 scrolling="auto"
 src="
<http://localhost:8080/portal/tool/e4759e5a-cc51-44dc-b9b2-9be7f28ee6ca?pane
l=Main>
http://localhost:8080/portal/tool/e4759e5a-cc51-44dc-b9b2-9be7f28ee6ca?panel
=Main">
 </iframe>
</div>
<!-- end Tool Body --> 

 

That is, the request is very similar to the one generated for other sakai
tools (site-info, in this case). So, why ToolManager.getCurrentPlacement()
is not usable here? Is any other way of getting Site id? 

 

Following your suggestion from yestarday, I've tried to get ServletContext
using FacesContext.getExternalContext() but I haven't found
sakai.tool.placement at HttpRequestParameters, though I've found
<http://sakai.tool.placement.id/> sakai.tool.placement.id but I don't know
if this other parameter is usefull or not.

 

Does anybody of ouy know what can be happening? I would appreciate any help.

 

Thank you very much in advance.

 

 

 

barrita

 


 <http://www.setival.com/> logo correo

Tlf: 902 05 06 02

Fax: 96 199 42 43

                

 

Diego del Blanco Orobitg

Director del Área de e-Learning y Nuevas Tecnologías

 <mailto:diego.delblanco at setival.com> diego.delblanco at setival.com

Móvil: 653 683 489

 

 

  Oficinas de Valencia

  Parque Tecnológico – Edificio CEEI

  C/Benjamin Franklin, 12

  46980 Valencia

Este mensaje y sus archivos son confidenciales. No está permitida su
reproducción o distribución sin la autorización expresa de SETIVAL SCV. Si
usted no es el destinatario previsto, cualquier uso, acceso o copia de este
mensaje queda desautorizado. Si ha recibido este mensaje por error, por
favor bórrelo e infórmenos por esta misma vía.

De acuerdo con la LSSICE y la LOPD, le comunicamos que sus datos personales
y dirección de correo electrónico forman parte de un fichero automatizado,
cuyo responsable es SETIVAL SCV, siendo la finalidad del fichero el envío de
información de carácter comercial sobre nuestros servicios. Si lo desea
puede ejercer los derechos de oposición, acceso,rectificación y cancelación
de sus datos enviando un mensaje de correo electrónico a
<mailto:setival at setival.com> setival at setival.com indicando en el asunto el
derecho que desea ejercitar. Gracias por su colaboración.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090626/b8b75ace/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 619 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090626/b8b75ace/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 10922 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090626/b8b75ace/attachment-0001.png 


More information about the sakai-dev mailing list