cancel
Showing results for 
Search instead for 
Did you mean: 

Download final versions from Moodle

derrin
Champ in-the-making
Champ in-the-making
Hi guys,

I am very new to Alfresco and am probably missing a simple trick.   I manage Moodle, a virtual learning environment.  My employer has asked me to use Alfresco to resolve a problem we have within Moodle.

The problem = In Moodle we are having to upload the same file into many courses.   When we update the file, we have to reload EVERY file into EVERY course.

The idea we have for a solution = Use Alfresco to workflow the updating process on our files - so that we can use the same hyperlink from each of our Moodle courses to the latest edit of a file stored on Alfresco.  We then simply update the file in Alfresco and all of our Moodle courses will continue to point to the latest version of the file without needing to reedit ALL of our courses.

We do NOT want our Moodle end-users to have to log in to Alfresco.  Simply to link to the option to view or download.

Am I right in thinking we can achieve this?   Please help.  :?

Derrin Kent
5 REPLIES 5

dinger
Champ in-the-making
Champ in-the-making
Hi Derrin,

Where are you based?

I've been looking at doing this for my employer. The main problem is with Moodle. If the repository API code had made it into 1.9 (it is now scheduled for 2.0) then this sort of thing would be very straightfoward (no development work required). However, you could still write an integration using Alfresco's PHP API. You could also look at making calls to the new webservice code in moodle.

I'd be interested in knowing your plans,

Rob

mikewaters
Champ in-the-making
Champ in-the-making
Integrating Moodle with Alfresco is a simple matter if you use an SSO layer, such as CAS.

You just need to cas-ify the two applications, following the instructions on the Alfresco wiki. http://wiki.alfresco.com/wiki/Central_Authentication_Service

At least with the released versions of Alfresco you will need to write a bit of Java code. The Moodle side is probably a lot easier since CAS support is built in.

If you don't have CAS then you probably have your users in the Moodle Database, in which case you will have to arrange for CAS to authenticate the users
That means CAS must be able to access the user data, either by calling back into moodle (don't know if that is easy or eve possible) or by exporting your users into (eg) LDAP and modifying your user creation process to suit

I have successfully cas-ified Alfresco on Ubuntu Linux - so I can give you specific help depending on your plaform

The Java code to do CAS should really be part of core Alfresco, its just a small mod to HttpRequestAuthenticationFilter.java.

-Mike
Keem Bay Research

mikewaters
Champ in-the-making
Champ in-the-making
As requested, a bit more information about the "java code":

Alfresco uses Java Servlet Filters to intercept requests, check for user data in the session and do one of a number of things  depending on what it finds eg let the request go, bounce to a login page, log the user in as a guest, etc. I'm not sure of all the details.

If the user logs in via the Alfresco login page then the required user data is placed in the session and user get access to Alfresco.

The CAS integration is also a filter, that gets run first, and checks for its own data in the session and/or a CAS ticket on the URL.  It also either lets the request go or redirects to the CAS login page as appropriate. If authentication succeeds it stores its own user data in the session.

That is the missing link - the Alfresco filters and the CAS filters look in different places for different data, which means that the Alfresco filters don't know that the  CAS filters have authenticated the user and just assumes that the user is not logged in.

The Java code I mentioned is simply there to plug the hole - grab the username stored by CAS and pass it to the Alfresco API.

HTTPRequestAuthenticationFilter is not used by default and appears to be provided for this purpose but it only looks for data in the HTTP header, not the Session, so it needs a small modification to work with CAS.

I will post the version I have, (when I get home from work Smiley Wink but it has at least one issue - admin users do not get admin privileges after using this login mechanism, presumably because the Alfresco login mechanism populates some more data in the session.

If one of the Alfresco engineers can tell us more about how admin users are handled I may be able to fix that issue.

mikewaters
Champ in-the-making
Champ in-the-making
I have added a(nother) wiki page with instructions on configuring CAS with Alfresco. Its not the first but it gives an indication of what I did to get CAS going. might help.

http://wiki.alfresco.com/wiki/Central_Authentication_Service_Configuration

naveenkumar
Champ in-the-making
Champ in-the-making
Hi Mike,

I was trying to configure HTTpAuthenticationFilter for webdav filter.I  use CAS for my log in and am is sucessful -> it redirects to cas login page and authentication for web ui happens.

My problem is with webdav authentication i was trying to use the httpauthenticationfilter (as sample and tried to develop own filter to trust a username and then set it on a header request to pass to header filter)The username is set in my CASfilter.java (setAuthenticateduser method)

session.setAttribute(CASFilter.CAS_FILTER_USER, userName);

When i use session.getAttribute(CASFilter.CAS_FILTER_USER) in httpauthenticationfilter it returns null.

"That is the missing link - the Alfresco filters and the CAS filters look in different places for different data, which means that the Alfresco filters don't know that the CAS filters have authenticated the user and just assumes that the user is not logged in.

The Java code I mentioned is simply there to plug the hole - grab the username stored by CAS and pass it to the Alfresco API."

Could you let me know where or why i am not ble to retrieve the username from session?

Could you pls tell me how to retrieve the currently logged in user?