cancel
Showing results for 
Search instead for 
Did you mean: 

Access alfresco repository in web page Can or Not

vinothkumar
Champ in-the-making
Champ in-the-making
Hi friendz,
                 I want to know can we access alfresco repository document from web page,plz tell me that first. :cry:
4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
CMIS is a good way to do that. Simply use your favorite language and one of the clients available from the Apache Chemistry project and you'll be well on your way.

Jeff

vinothkumar
Champ in-the-making
Champ in-the-making
To be close,I created a site  with java script,css and html alone,can i access and display the document of alfresco repository in that site dynamically,if yes,can u plz give me guidance to do so,Im thankful to u in advance.

jpotts
World-Class Innovator
World-Class Innovator
There are thousands of tutorials on AJAX available. This is one:
http://net.tutsplus.com/articles/news/how-to-make-ajax-requests-with-raw-javascript/

Now use the techniques in that tutorial (or the AJAX features of your preferred JavaScript library) to make calls against the CMIS AtomPub binding. For example, to get the properties of a file named "test.txt" in a folder in company home called "test", you could execute the following GET:
http://localhost:8080/alfresco/cmisatom/1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9/path?path=/test/test.tx...

The "1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9" in the URL above is my repository's repository ID. If you don't know it, you can get it from the <cmis:repositoryId> element in the response that comes back when you go to:
http://localhost:8080/alfresco/cmisatom

Back to the original call, if you look at the XML that comes back when you ask for the properties, you should see a property called "cmisSmiley SurprisedbjectId". With that, you could get the content with a call like this:
http://localhost:8080/alfresco/cmisatom/1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9/content/test.txt?id=wor...

In my case it is plain text that says, "This is a test.".

All calls to these URLs must use basic authentication, so you'll need to pass in the credentials with each request (or you can get a ticket and pass that).

Hope that helps,

Jeff

omarsiala
Champ in-the-making
Champ in-the-making
how can i synchronize open documents (odt) for editing using cmis javascript library in alfresco share? In other words,I want to open odt document from the alfresco repository using libre office editor and synchronize changes with the repository document version using the cmis javascript library.