[Building Sakai] Tool placement id

Matthew Buckett matthew.buckett at oucs.ox.ac.uk
Thu Apr 29 06:20:59 PDT 2010


On 29 April 2010 14:06, Jaques Smith <jaques at psybergate.co.za> wrote:
>
> We need the tool placement id. Is it possible to get the tool placement id
> without the tool being added to a site?

I think the placement is only generated when the tool is added to the
page. Could you expand on why you need the placement of a tool that
doesn't yet exist?

> And what if the tool is hidden? Is
> there another way to get the id from anywhere in sakai, or out, except
> toolManager.getCurrentPlacement().getId()?

The org.sakaiproject.site.api.ToolConfiguration class extends
placement and is can be got from a Site:

Site site = SiteService.getSite("!gateway");
Collection<ToolConfiguration> toolConfigs = site.getTools(new
String[]{"sakai.createuser"});
for (ToolConfiguration toolConfig: toolConfigs) {
	log.warn("Found placement of: "+ toolConfig.getId())
}

You can also get all the pages (SitePage) from a site and then find
the placements in the pages.

-- 
  Matthew Buckett
  VLE Developer, LTG, Oxford University Computing Services


More information about the sakai-dev mailing list