[Building Sakai] sites, pages, tools

Steve Swinsburg s.swinsburg at lancaster.ac.uk
Wed Apr 1 02:36:18 PDT 2009


Hi Will,

You can get the current site that a user is using a tool in by:

String siteId = toolManager.getCurrentPlacement().getContext();

Once you have that site you can find a tool based on something like:

ToolConfiguration toolConfig =  
siteService.getSite(siteId).getToolForCommonId(toolId);

Where toolId is something like sakai.resources".
 From there you should be able to get the info you need?


cheers,
Steve

---
Steve Swinsburg
Portal Systems Developer
Centre for e-Science
Lancaster University
Lancaster
LA1 4YT

email: s.swinsburg at lancaster.ac.uk
phone: +44 (0) 1524 594870







On 1 Apr 2009, at 02:54, will trillich wrote:

> Okay -- this is probably elementary:
>
> Worksites have pages, and pages have tools, right?
>
> Given a tool ID (such as ea052aee-f422-41d5-ad70-97993a2251b6), how do
> we figure out which classes and methods to use, in order to find the
> worksite that that tool is attached to?
>
> Seems like the ToolManager or Tool class should have a field/method
> indicating the page it's on, which should in turn have a field/method
> indicating the worksite the page is on. There's not enough meat in the
> javadocs to tell what's going on (except on rare occasion, we stumble
> into a bit of information but it's seldom).
>
> For example, nightly2 javadocs show how lots of methods in the Tool
> class accept a string or return a string, but there's no description
> of what the string is expected to be, how it should be used, or what
> the output is expected to be. E.g. Tool.getHome() returns a mysterious
> string -- would that be a worksite name or id? page id? some other
> context?
>
> We were hoping for something like
> getSpecificTool(tool_id_string).getToolPage().getPageSite()...
>
> Pointers would be greatly appreciated.
>
> -- 
> will trillich
> "If you do not change direction, you may end up where you are
> heading." -- Lao Tzu
> _______________________________________________
> 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"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090401/92395d6c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2437 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090401/92395d6c/attachment.bin 


More information about the sakai-dev mailing list