2

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?

jonespm
  • 382
  • 2
  • 17

2 Answers2

5

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

Aaron Zeckoski
  • 5,016
  • 8
  • 25
  • 48
  • It looks like this script here cleans up the users existing workspaces a little better. https://gist.github.com/buckett/ccf3bc423e214806831e – jonespm Jun 16 '15 at 17:11
1

There is also an Axis webservice to do this that is available when you navigate to http://your.server/sakai-axis/SakaiScript.jws?wsdl. If you are using Sakai 10+, then the same call is also available via CXF.

/** 
 * Adds a tool to all My Workspace sites
 *
 * @param   sessionid       the id of a valid session for the admin user
 * @param   toolid          the id of the tool you want to add (ie sakai.profile2)
 * @param   pagetitle       the title of the page shown in the site navigation
 * @param   tooltitle       the title of the tool shown in the main portlet
 * @param   pagelayout      single or double column (0 or 1). Any other value will revert to 0.
 * @param   position        integer specifying the position within other pages on the site (0 means top, for right at the bottom a large enough number, ie 99)
 * @param   popup           boolean for if it should be a popup window or not
 *
 * @return                  success or exception
 * @throws  AxisFault       
 *
 * Sakai properties:
 *  #specify the list of users to ignore separated by a comma, no spaces. Defaults to 'admin,postmaster'.
 *  webservice.specialUsers=admin,postmaster
 *
 */
public String addNewToolToAllWorkspaces(String sessionid, String toolid, String pagetitle, String tooltitle, int pagelayout, int position, boolean popup) throws AxisFault
Steve Swinsburg
  • 592
  • 2
  • 14