[Building Sakai] Tool placement id
Jaques Smith
jaques at psybergate.co.za
Thu Apr 29 06:41:45 PDT 2010
Thanks Matthew,
Yes it looks like the placement id only exist after placement, makes sense. I want to use the tool though a Servlet and that must be in the context of the portal. So I need the url http://sakai/portal/<placement-id-here>/myservlet.
Jaques
-----Original Message-----
From: Matthew Buckett [mailto:matthew.buckett at oucs.ox.ac.uk]
Sent: 29 April 2010 03:21 PM
To: Jaques Smith
Cc: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] Tool placement id
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