[Building Sakai] sites, pages, tools

will trillich will at serensoft.com
Wed Apr 1 10:36:29 PDT 2009


Thanks, Steve -- but we don't want "current tool" -- that code is
available all over the place! :)

We want the page and/or worksite of any specific, given, tool-id. As
in !admin > online > locations -- which worksite are these people in?


On Wed, Apr 1, 2009 at 4:36 AM, Steve Swinsburg
<s.swinsburg at lancaster.ac.uk> wrote:
> 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"
>
>



-- 
will trillich
"If you do not change direction, you may end up where you are
heading." -- Lao Tzu


More information about the sakai-dev mailing list