[Fixed]-File browser with Django and Alfresco

1πŸ‘

βœ…

To be honest, I am not a python guy ! But I heard over the official #alfresco IRC channel that cmislib is not so much of an active project, and questions about it only bump once in a while …. The RESTful api however may be considered as a good alternative in your use case:

To access alfresco content using the RESTful api, you should be querying this webscript: /alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>
where :

  • d and a refer to direct / attached mode
  • <workspace>, <store> and <nodeId> reference your content nodeRef
  • <filename> a file name of your choice

So you should be making a GET Request an a URL that looks something like this http://<host>:<port>/alfresco/d/d/workspace/SpacesStore/8444ad61-4734-40e3-b2d4-b8b1c81347fd/myFile.ext

Note : Depending on the permission set on your node, you might need to attach an alf_ticket to the URL for an authenticated alfresco user. Please check this for further insights.


UPDATE 1:
If you have a problem identifying your file nodeRef, then you can setup a repo webscript implementing your custom logic (browsing some folder / searching for a document by name or metadata ….)
If your are not familiar with webscript development check Jeff Pott’s tutorial on the subject

UPDATE 2:
To get started with your webscript development check out Alfresco docs/wiki!

Check this wiki page to learn how to retrieve children for a given node !
Or check this wiki page to learn how to develop webscripts implementing your custom business logic.

0πŸ‘

If you do not have anything against the YUI javascript library (that is no longer actively maintained), you can integrate the object-finder already available in Alfresco Share. The library is in

share/components/object-finder/object-finder.js

You will need to modify it a bit given that you are not inside Share.

To be totally honest, I do not know if it is feasible because it has other dependencies but being a browser site library, in theory can be integrated everywhere.

πŸ‘€Marco Altieri

Leave a comment