[Building Sakai] Sakai's External Integration

Steve Swinsburg steve.swinsburg at gmail.com
Wed Jan 26 03:47:45 PST 2011


Hi Raj,

I would do this via web services.

For the sake of this discussion, you are dealing with a Sakai site.  It sounds like you want to add a URL resource into the Resources tool within a specific site.
So what you can do is use the web services to get the list of sites from Sakai (this service exists). In your external app, the instructor will choose one. Then you will send another web service call to create the URL resource in the Resources tool for the specified site (this service doesnt exist in a release but there are some that could be used).

Passing the userId and session details to the external app is potentially doable. You might be able to use the Sakai macros for this, although I am not sure if they work in this context. THey are essentailly placeholders you can add onto a URL and then Sakai fills in the details. So a URL like http://somewhere?userid=USER_ID&session=SESSION, for example.
See: https://jira.sakaiproject.org/browse/SAK-5464 and the bottom of https://confluence.sakaiproject.org/display/~steve.swinsburg/Pre-configured+web+content+tools

I am not sure if they work in the URL type of Resources. if they do then this is how you could do it.

The other way would be to write a small servlet, and deploy it into Sakai, then pass all URLs through that. It will have access to the Sakai APIs and know who the user is, so can add the info onto the URL and forward you on to the external app. THis would be more secure and mighr be your only way if the Resources tool doesn't support the macros.

In the external app, check the details by calling the SakaiLogin.checkSession service and you are done.

For removing, same deal, call a service to delete that item from Resources.

cheers,
Steve




On 26/01/2011, at 2:03 PM, Raj Muthusamy wrote:

> Hello Steve,
>  
> Thanks for clarifying the Basic LTI functionality. I will look more into this.
>  
> I'm not sure what's the equivalent term (Workspace, Sites or Tools) in Sakai for Courses. Instructors create one or more courses (e.g. English, Match, Biology, etc.) in Sakai. The same Instructors use an external web app (e.g www.mywebsite.com) to manage their documents in an external location. When the Instructors add new document into their external application, I need to do the following.
> Get all the courses from Sakai and list them in the external app so that the Instructors choose the Course into which they like to make the document available as a link that points back to the external web app (www.mywebsite.com?docid=1).
> Post the external link into Sakai under the selected course. This means that when if we go to Sakai and go into the Course, we should see this link through an assigned Title/Description. Each link will have a different document id to point to a document maintained in an external location. When Students click on the link, the link will launch the external app to display the document (within the same Sakai window, if it's supported). This link should pass the user and session details to the external app to confirm this request is coming from Sakai and the user has already been validated.
> Remove the posted link from Sakai if the Instructor later decided she doesn't want to expose the document for the Students anymore.
>  
> For each these above actions, I need to call Sakai (e.g. Web Services) to make things happen.
>  
> Please let me know if these can be done through Basic LTI. If there are similar examples already writtern, please point me over there.
>  
> Thanks,
> Raj
>  
>  
> From: Steve Swinsburg [steve.swinsburg at gmail.com]
> Sent: Tuesday, January 25, 2011 4:32 PM
> To: Raj Muthusamy
> Cc: Sakai-Dev Developers
> Subject: Re: [Building Sakai] Sakai's External Integration
> 
> Hi Raj,
> 
> Basic LTI doesn't work on the concept of specific URL's, it uses a key, which could be a uri like 'sakai.somewhere.edu.au' but could be anything, like 'steve'. What happens is your external application would form up a request with the data it needs, sign it, then send it. You get back a URL which you can use to render tools directly. This is the basic concept. Your external application is then a Basic LTI consumer, talking to the Sakai Basic LTI producer. 
> 
> However, it sounds like you might want to use the web services to request snippets of data from Sakai. What do you mean by 'add or remove URLs to/from a specific course. '
> Do you want to add a Web Content tool to a site that has a URL attached? If so, you want the SakaiScript.addNewPageToSite and addNewToolToPage services-  and one to add the URL to the tool.
> 
> You also want to look at the SakaiLogin.login method to get a session for a user, and the SakaiScript.checkSession service to check it is still active.
> 
> cheers,
> Steve
> 
> 
> On 26/01/2011, at 10:49 AM, Raj Muthusamy wrote:
> 
>> Thanks Chuck and Steve.
>>  
>> I went through the notes you have pointed out. Good resources.
>>  
>> The Basic LTI option is the right option.  However, it may not fit well for my requirement. Please correct me if I’m wrong. Using Basic LTI, I can register a URL (e.g. www.mywebsite.com\content.htm) and let it pass specific parameters to this external website. In my requirement, I do not have a constant URL. It varies with different content ID (e.g. www.mywebsite.com?contentid=1) each time I post a URL. Please let me know if I can register a varying URL through  the Basic LTI tool provider. Also, I cannot pre-register these URLs. The URLs should be dynamically generated by the external web app and sent to the Sakai Courses by calling a Web Service method.
>>  
>> Later, when clicked, the URLs should pass user details to the external web app to make sure the request is coming from Sakai and the user is already logged into Sakai.
>>  
>> The external application that I’m working with is .NET based. If there are Web Services, I could call from the .NET application to add or remove the links to/from Sakai. I couldn’t find existing web services that add or remove URLs to/from a specific course. Are you suggesting I should write a new Web Service following these examples?
>>  
>> If Basic LTI provider can support this varying URL requirement, I would like to go with that. Otherwise, please help me finding or writing the right Web Services to achieve this functionality.
>>  
>> Thanks,
>> Raj
>>  
>>  
>> From: sakai-dev-bounces at collab.sakaiproject.org [mailto:sakai-dev-bounces at collab.sakaiproject.org] On Behalf Of Steve Swinsburg
>> Sent: Monday, January 24, 2011 9:48 PM
>> To: Sakai-Dev Developers
>> Subject: Re: [Building Sakai] Sakai's External Integration
>>  
>> Hi Raj,
>>  
>> I echo Chuck's comments and would use Basic LTI for this. Whilst this can be done via web services, its no where near as elegant or portable. THat said however, if you only want a few pieces of information, the web service can give you what you are after.  
>>  
>> Read over the doc that Chuck sent about the Basic LTI provider in Sakai. 
>>  
>> For web services, you want to look at the webservices module in the Sakai source tree. Find a file called SakaiScript.jws and SakaiLogin.jws. They contain the methods you need to call.
>>  
>> Also, take a look here:
>> https://confluence.sakaiproject.org/display/WEBSVCS/How+to+use+the+Sakai+Web+Services
>>  
>> The awesome portlet that Chuck mentions is here:
>> https://wiki.jasig.org/display/PLT/Sakai+connector+portlet
>>  
>> This embeds entire tools from Sakai into an external system, in this case, uPortal.
>>  
>> cheers,
>> Steve
>>  
>> On 25/01/2011, at 4:19 PM, csev wrote:
>> 
>> 
>> Raj,
>>  
>> These services exist. Here is some sample code that might give you some patterns:
>>  
>> https://source.sakaiproject.org/contrib/portlets/trunk/sakai-dash/
>>  
>> https://source.sakaiproject.org/contrib/portlets/trunk/sakai-launch/
>>  
>> The code might be a little old.  Here is some more documentation you might find helpful:
>>  
>> https://source.sakaiproject.org/svn/reference/trunk/docs/architecture/sakai_charon.doc
>>  
>> You might also be interested in using Basic LTI to do this with a simple shared secret instead of web services, making sessions, etc - it is more secure and performs better and has much cleaner security.
>>  
>> https://source.sakaiproject.org/svn/basiclti/trunk/basiclti-docs/resources/docs/sakai_basiclti_provider.doc
>>  
>> And Steve Swinsberg is the master of using this - he has a uPortal portlet somewhere that does this retrieve/launch completely awesomely.   His stuff is much more modern than the portlets I wrote a whlie back.
>>  
>> Also Lance Speelmon has done a masterful job in using Basic LTI Provider in Sakai CLE to plug it into Sakai OAE.
>>  
>> Many choices :)
>>  
>> /Chuck
>>  
>> On Jan 24, 2011, at 6:20 PM, Raj Muthusamy wrote:
>> 
>> 
>> Dear Sakai Developers,
>>  
>> I’m new to Sakai and exploring various options. I have to integrate Sakai with an external web application. Here is what I’m trying to do.
>> -          Call Sakai’s Web Services to pull list of available Courses and publish dynamic URLs (that will launch an external web app) into selected Courses.
>> -          When the URL is clicked, pass user name (encrypted) to the external app through QueryString.
>> -          Call another Web Services method on Sakai server to make sure the user’s session is still valid to achieve SSO integration.
>>  
>> Please let me know if there are Web Services already available to perform these tasks above. Any examples and/or documentation would be greatly appreciated.
>>  
>> Thanks,
>> Raj
>>  
>>  
>> _______________________________________________
>> 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"
>>  
>> _______________________________________________
>> 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/20110126/61d43de3/attachment.html 


More information about the sakai-dev mailing list