Alfresco and Ruby on Rails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2008 12:59 PM
I want to use Alfresco as the CMS for http://www.mysite.com and develop a custom app with Ruby that can be accessed at http://www.mysite.com/app1. The custom app should only be visible to users who login to Alfresco.
From what I understand so far of Alfresco, both the CMS and RoR can reside on the same server and that the scenario above is possible. Is my interpretation correct? If so, how difficult is it to accomplish?
Thanks very much in advance.
Regards,
Andrew
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2008 11:07 AM
In the case of Ruby on Rails specifically, you might choose to implement a REST API that "talks" ActiveResource (http://wiki.rubyonrails.org/rails/pages/ActiveResource), thereby simplifying the integration on the Rails side. I know of at least one Alfresco implementation that has done this, and have heard of similar techniques being used with other technologies (such as Python) as well.
Cheers,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2008 10:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2010 04:07 PM
In the case of Ruby on Rails specifically, you might choose to implement a REST API that "talks" ActiveResource (http://wiki.rubyonrails.org/rails/pages/ActiveResource), thereby simplifying the integration on the Rails side. I know of at least one Alfresco implementation that has done this, and have heard of similar techniques being used with other technologies (such as Python) as well.
I know it's been a couple of years since this last post, but I was rooting around on the forge and couldn't find any of these webscripts. Nor could I locate any actual code with a google search. My hope was to use Alfresco (our CMS) as a backend for Redmine http://www.redmine.org (our development solution). Is there any chance some of these REST APIs that talk ActiveResource could be shared?

THanks,
Bryce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2010 04:35 PM
Given the age of this thread, perhaps it would be worth creating a new one?
Cheers,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2010 04:01 AM
First of all, it seems no other thread have been created (or I missed it !) that's why I keep on this one.
@pmonks
Any feedbacks from your customer about usability/integration/sustainability of this kind of architecture ?
I'm currently collecting infos on alternatives way of presenting data from an Alfresco repository through external frameworks, that's why I'm interested in your advices.
I've already looked at Surf deeply, Php a bit, but I do need other inputs to complete the overview, especially as I consider myself as a real RoR fan !
I planned to look also around Python, do you have any other ideas ?
Thanks
—
Mathieu BODIN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2010 06:22 PM
So as mentioned above, Alfresco is just used as a repository. Docasu provides some web scripts to do things like list files in a directory, create spaces and new files. But I have been surprised at how few other web scripts are delivered with Alfresco to do the above tasks.
Maybe its because the emphasis is on CMIS. Incidentally Docasu's web scripts return nice simple JSON which can be processed very easily in Javascript. CMIS seems to involve lots of XML building and XML construction, I wonder if the guys who wrote the standard ever tried to write a GUI that uses it. It would be much easier if the results were optionally rendered in JSON. Docasu's web scripts seem like proper RESTful operations, CMIS wraps up complicated instructions inside an XML (ATOM ?) and then makes it look like a RESTful act. (Not much about big XML documents makes me feel restful).
You can always write your own Web Scripts, but you'll need to know Java, Java build environtments, Ant, Javascript, Firebug.
The other issue when calling Alfresco web services from Rails is Authentication. You can either use a ticket or basic authentication (I think)
curl -v "http://xxxx.yyyy.org/alfresco/service/api/login?u=admin&pw=admin"
returns some XML containing
<ticket>TICKET_b7162c9dfcc2a89dac801ff0a27d22ca53a213d0</ticket>
Then use an extra parameter when calling your web scripts &alf_ticket=TICKET_bb280d638daaac387bdc34a6c0b6b128d6b047e8
One thing I have not solved is how to just download a simple file, say a pdf, from Alfresco using another web app or curl. I keep getting a login prompt in html even though I provide basic auth and a valid ticket. I guess this is because the URL for the file is not a web service. Docasu uses the same URL but it is part of Alfresco where as my app is completely different.
I suppose I will have to write a web script to provide the file, but if so I wonder why one does not already exist.
Using Rails with Alfresco is theoretically as simple as finding the right web scripts, but the complexity of CMIS makes it harder than it could be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2010 06:43 PM
GET /alfresco/service/docasu/ui/node/content/{nodeId}
curl -v "http://admin:admin@xxxxx.yyyy.org/alfresco/service/docasu/ui/node/content/5b76387d-3649-46b0-aae7-22..."
I use a Ruby on Rails controller that takes the nodeid as a param and then fetches the file from Alfresco before rendering it back to the browser. This way the credentials for Alfresco are not embedded in the HTML of the Rails app ! The files are rendered in a grid as links to the controller just mentioned with the correct nodeid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2010 02:40 AM
Example:
GET /alfresco/service/api/node/content/workspace/SpacesStore/<node-id>?alf_ticket=<ticket_id>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2010 04:10 AM
There is a Web Script in 3.3.g called
http://admin:admin@xxxx.yyyy.org/alfresco/service/api/node/workspace/SpacesStore/5b76387d-3649-46b0-...
but it produces lots of cmis XML and not the file stream.
I guess I could spend time learning about CMIS but my client is in a rush and the docasu scripts just work.
Jeff Potts wrote a useful document "Getting started with CMIS" (55 pages) and I bought a PACT book called "Alfresco 3 Web Services". Both remind me of the complicated Java/XML web services world that I was trying to move away from with Ruby on Rails and RESTful stuff. I just want to download a file from Alfresco !
Thanks for the suggestion though.
