Forum LAMS for Tech-Heads - General Forum: Re: Re: Advice on how to communicate with an external tool


 
Search: 

7: Re: Re: Advice on how to communicate with an external tool
In response to 6 11/28/08 03:21 PM
[ Reply | Forward ]
Hi Marcin,

thanks for the info, theres just a few things im not so clear about....

If i understand it correctly, what i should do is to get the users in each session to interact via skype. the groups that the teacher has created will actually be the sessions. So, everytime an user is assigned to a session, the tool should update the file with the info about the users.

In order to do this, i have to use the method getSessionsByContentID(Long toolContentID) to get the sessions and then getUsersBySession(Long sessionID) to get the users for each session. But the first method needs the toolcontentid of the tool...where can i get that? that would have to be outside the tool right?

Im basing my new tool on the shareresources one...does that mean id have to implement the methods mentioned earlier on my new tool?

Theres a method called getSkypeForLamsItemsBySessionId()...
what is an "item"?

thanks a lot.

Posted by Daniel Romero

8: Advice on how to communicate with an external tool
In response to 7 12/03/08 11:31 PM
[ Reply | Forward ]
Hi Daniel,
I'm sorry for replying so late.
"If i understand it correctly..." - yes, that's pretty much it. Just remember that it's not always the teacher that creates the groups. In LAMS 2.2 users are able to choose a group they want to participate in.

When a user enteres an activity, the Tool Content ID is provided from LAMS progress engine. If you take a look at start() method in LearningAction in Shared Resources Tool, you will see that that Tool Session ID is extracted from HTTP request and put back as an attribute. Having Tool Session ID you can get Tool Content ID using for example getResourceBySessionId() method in ResourceService.

In your case it might be a good idea to add some code in that start() method that will export the ID to some file that would be later read by your external program. Having this value you can call tool service or database itself to get user data for particular group.

I'm not sure what do you mean when you ask for "item". What does your method do? I'm guessing, though, that "item" is a term used in Shared Resources Tool - it means a single URL or file that is shared among learners. In Q&A tool it would be questions, in Forum it would be topics. I hope I'm guessing right what do you have in mind...

Let us know how it goes.

Thanks

Posted by Marcin Cieslak

9: Re: Advice on how to communicate with an external tool
In response to 8 12/09/08 02:54 PM
[ Reply | Forward ]
Hi Marcin,

Thank you very much for the tips, they`ve been really helpfull. The thing is, that i cant find the method getResourceBySessionId() anywhere in the workspace...maybe its cause im using ver 2.1...

Do you know another way to get the toolcontentid ??

thanks a lot

Posted by Daniel Romero

10: Re: Re: Advice on how to communicate with an external tool
In response to 9 12/09/08 06:24 PM
[ Reply | Forward ]
The method you mention for Shared Resources Tool is in it's service class org.lamsfoundation.lams.tool.rsrc.service.IResourceService and its implementation in org.lamsfoundation.lams.tool.rsrc.service.ResourceServiceImpl. If you were using our ToolBuilder, the name "Resource" most probably has been changed to something else (for example "Skype", if your tool is named so). Still, this method should be available even in version 2.1 - I've checked.

You may also get Tool Content ID when a lesson is created. The original Learning Design is copied and tools get new ID.
You can observe it LamsCoreToolService where the method notifyToolToCopyContent() is called which then calls newInstance() method in Resource class (or any other tool's main class). You could get the Content ID then, but there is a catch: this method newInstance() is called in several other occasions like importing and exporting the tool. It might be tricky to detect which situation occurs at the particular moment. So I think it's better to extract this parameter when coping with LearningAction - it's always somewhere there (as a request parameter or in session map).

Good luck!

Posted by Marcin Cieslak

11: Re: Re: Re: Advice on how to communicate with an external tool
In response to 10 12/10/08 06:12 PM
[ Reply | Forward ]
youre right, im sorry i dont know what happened...i think maybe when i did the search i had the shared resources project closed and didnt notice...thats embarrassing :S thanks a lot!

Posted by Daniel Romero

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum