[Building Sakai] Course Tools getting deleted

Nkululeko Phakela Nkululeko.Phakela at wits.ac.za
Fri Jul 20 00:57:45 PDT 2012


Hi Miguel,

This makes a lot of sense. It is interesting that this would happen to a few sites, but not all of them that are using a tool that does this.

I will look into it and see if after doing the changes, the tools don't disappear. The weird part, on the local development machine, this is
never a problem, only in production.

Cheers,
Nguni


-----Original Message-----
From: Miguel Carro Pellicer [mailto:farreri.sakai at gmail.com]
Sent: Fri 7/20/2012 9:54 AM
To: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] Course Tools getting deleted
 
Hi Nkululeko.

Are you using any custom tool to manage sites using SiteService? How you manage this sites?

This is an idea, maybe your problem is that you are using getSites function from siteService, it returns a list of a soft version of Site objects ( Without tools and pages).

If you save this object with siteService.save, you will lose all pages and tools.

Example:

BAD:
        Map<String, String> propertyCriteria =new HashMap<String,String>();
        propertyCriteria.put("favouriteSite","true");
        
        List<Site> templateSites = siteService.getSites(SelectionType.ANY, null, templateId,
                 propertyCriteria, SortType.TITLE_ASC, null);
        Site newSite = (Site) templateSites.get(0);
        newSite.setTitle("New weird title"); <------Setting the title into a soft version of the object Site!
        siteService.save(newSite); <---- You saved the soft version, all pages and tools are lost.

GOOD:
        Map<String, String> propertyCriteria =new HashMap<String,String>();
        propertyCriteria.put("favouriteSite","true");
        
        List<Site> templateSites = siteService.getSites(SelectionType.ANY, null, templateId,
                 propertyCriteria, SortType.TITLE_ASC, null);
        Site softSite = (Site) templateSites.get(0);
        Site newSite = siteService.getSite(softSite.getId());
        newSite.setTitle("New weird title"); <------Setting the title into the object with full data!
        siteService.save(newSite); <---- Saved and everything ok.

Maybe is this problem but i don't know, its only an idea

Hope it helps, Miguel.



El 20/07/2012 9:33, Nkululeko Phakela escribió:


	Hi All, 

	We have been running into a weird problem recently. Some course sites will every now and then have all the tools in the site deleted, and so when one clicks on it, it says Site Unavailable. So then once I go into worksite setup and choose the relevant tools for the course then it appears again. However, this is a recurring problem. What could be the cause of this and what can we do to combat it?

	Any help is appreciated.

	Kind Regards,
	Nguni
	
	 


	 
	
	_______________________________________________
	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"


-- 


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

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

Miguel Carro Pellicer

Technical Manager - Director técnico

miguel.carro at samoo.es <mailto:miguel.carro at samoo.es> 

+34 - 673 80 32 69

Skype: mcpellicer

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.

 

 



<html><p><font face = "verdana" size = "0.8" color = "navy">This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorized signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.</font></p></html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120720/e0456e56/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3022 bytes
Desc: image002.jpg
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120720/e0456e56/attachment.jpg 


More information about the sakai-dev mailing list