Search code examples
sakai

How can I add a new tool to all users My Workspace sites in Sakai?


On the installation guide for EVALSYS it says "The tool should be added to all My Workspaces" but it doesn't give any details about how to do that. This seems like a pretty common thing to do, is there any best practice?


Solution

  • The easiest way to do this is add the tool to the !user site (using the special Admin Sites tool). Find the !user site and then add a page (using the Pages button), then add a tool to that page and select the tool you want to add to all workspaces from the listing. Once this is done, all new My Workspaces will include the tool when they are automatically created the first time a user logs into Sakai.

    NOTE about existing workspaces:

    If you want to also have all existing My Workspaces include the tool then you have to actually remove them so they will be recreated on the next user login (this will cause problems for currently logged in users). This is best done when the system is not running (or at least not being actively used). To do this you need to run SQL like this on your database:

    delete from sakai_site where SITE_ID like '~%' AND SITE_ID <> '~admin';
    

    Alternative method via Sakai webservices:

    There is also a SOAP webservice to do add a tool to all My Workspaces that is available at: http://{your.sakai.server}/sakai-axis/SakaiScript.jws?wsdl

    If you are using Sakai 10+, then the same function is also available via CXF webservice. See the source code here for docs and other methods: https://source.sakaiproject.org/svn/webservices/branches/sakai-10.x/axis/src/webapp/SakaiScript.jws

    public String addNewToolToAllWorkspaces(
        String sessionid, String toolid, String pagetitle, String tooltitle, 
        int pagelayout, int position, boolean popup);
    

    More details about using the Sakai SOAP webservices is available here: https://confluence.sakaiproject.org/display/WEBSVCS/How+to+use+the+Sakai+Web+Services