File browser with Django and Alfresco - django

I have a Django site and a local install of Alfresco (community edition). One of my model contains a file reference which maps to a document in Alfresco. The view should have a field that spawns a file browser that can access the repository structure within Alfresco so that the user can pick whichever file they want at whichever version.
I looked at the CMSIlib module and it seems to be providing all the interaction I need for the back end code. Although downloading a document seems clunky.
There are lots of Django file browsers but none seem to interface with CMSIlib.
Do I have to code my own or have I missed something?
The version is Alfresco Community v5.0.0 (d r99759-b2) schema 8022 Spring Surf and Spring WebScripts - v5.0.0.

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.

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.

Related

How to integrate 1С with Django?

There is an online store built on Django. How do I set up an exchange of data on products between Django and 1C? I have checked some documentation on the CommerceML format, but it is still unclear how to set it up on the 1C side. As far as I understand, all uploads are configured quite simply. You just need to register the URL of the handler. And then everything happens automatically
Yes, 1с provides an algorithm for interacting with the upload script by which files of product offers are uploaded to the server.
Therefore, you can configure data exchange with external sources and sites, for this in your solution, go to the menu item Administration - Data Exchange and check the box "Data exchange with sites" where you specify the directories and documents involved in the exchange. After downloading the XML files, you just need to process them on the server side. There is information on the developer's forum https://1c-dn.com/forum/forum11/topic2308/ with the methods of exchange settings and API , see if one of the methods suggested there will help you. They also have a blog article about different ways of integration https://1c-dn.com/blog/work-with-http-services-in-1c-part-1-get-method/

I am new to Django can anyone help me with the below task....?

Go through the sample JSON file given here -
https://drive.google.com/open?id=1xZa3UoXZ3uj2j0Q7653iBp1NrT0gKj0Y
This JSON file describes a list of users & their corresponding periods of activity across
multiple months.
Now, design and implement a Django application with User and ActivityPeriod models, write
a custom management command to populate the database with some dummy data and design
an API to serve that data in the JSON format given above.
To build the application with the mentioned requirements you need to have at least a basic understanding of the Django and Django rest framework. There are plenty of learning materials on the web to get started. Mozilla has a very good tutorial to get begin with. Link: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
Similarly, For the REST API, there are free videos on YouTube offered by channels such as Dennis Ivy's, CodingEntrepreneurs which are good to get started with. I would recommend you to check those videos!
All the best!
Happy Coding

Need help to add front-end on slatwall eCommerce

I am trying to build the eCommerce store by using Slatwall and lucee. Slatwall is the ColdFusion based eCommerce framework. The admin part is working fine. But I could not create the user side. I also referred the slatwall documentation. But no luck I couldn't seen any clear example and document for adding the front end on slatwall. If anyone knows help me please?
Slatwall frontend document
As OP says, SlatWall has excellent $upport, that's where they make a living. You now have three choices for a front end:
1) Slatwall latest versions have their own integrated CMS now. I'd recommend you export your product info, install the latest Slatwall, import the data back in.
2) Load MuraCMS, an Open Source Content Management (i.e. front-end) system that has integration to Slatwall (or the other way round, IIRC)
3) Roll your own in ColdFusion after learning ins and outs of the Slatwall api. Not recommended unless you're already CF experienced and have some previous experience with an api, any api.
For completeness I am going to answer this question even though its months old, for anyone else that views this.
You have a couple options here but the easiest way:
There is a complete example of a fully implemented Slatwall site including product listing pages, shopping-cart, and checkout included with Slatwall.
You may view the sample site by visiting http://{yourslatwallsite}/meta/sample
On the sample site, you can choose from the menu to view your products, add them to your cart, or checkout. Make sure your products are both active and published in the admin or you will not see them on the sample site. If you go through the .cfm pages that makeup the sample site, there are many examples documented (as comments in the code). Note that the actual .cfm files will be stored in /public/views/xxx.cfm and the meta folder just references them. /public/views/templates/slatwall-productlisting.cfm for example has complete examples on listing products on the frontend.
The sample site is powerful enough that you could restyle it and use it as your store

Django Music API

I'm currently learning django and working on my project. My project involves sharing my composed music and allowing free downloads to people. Is there an API for django that can enable me to upload my music and enable users to download at will?
Any advice is appreciated.
Thanks.
In general I agree with Rajat, what you are trying to achieve (at least the way you described it), can be done with standard Django forms and file handling. However, this app should have already built in a lot of the stuff you require.
You don't need an API to upload files to your servers.You only need a form to do that.And for enabling your users to download content,you only need links to the files.You can use some api to let only authenticated users download the content from your site.
You can add the file user submitted file in media folder
We then later you can locate it's path to make available for your users

How to integrate multiple image uploading with UPLOADIFY in django administration?

I met the django-uploadify (multiple file uploading) application, but the only template-use is described in wiki of the project. I need to integrate it with django admin. Any ideas?
#rebus and #Mordi have good suggestions; one of those is probably your best bet. Still...
The current implementation of file uploads in web browsers is single file only. That's a limitation of the HTML standards and the browsers themselves. When you see multiple file upload capability (all at once / select multiple) in some web app, something like Flash or Java is in play. You could potentially use a Flash or Java applet (check out Uploadify - about the easiest to work with you'll find), if you wanted, but you'd have to do some work tying it into Django: namely mapping the output of the applet to the input the Django Admin expects on POST.
Personally I found this package to be painful when I attempted to do this locally. It is 7 years old and not maintained. django-filer is a more modern implementation that has this exact functionality built into the admin panel, it was quick to set up and it seems to be maintained a lot better. And the UI is excellent!
If your really set on using uploadify my attempt was quite painful. When I went to the website to download the uploadify jQuery plugin it was a paid download. After looking a bit I found a fork, and was able to get it going locally, but because the python package is old it required a lot of changes from python 2.7..
To integrate this with your project in the admin will definitely require you to write your own custom admin template. In your admin.py you would have to override the default template and methods, this faq has some insights. In your new template you would include the uploadify jquery script and put the upload file field inside the form where your model fields would be. When you upload files the signal sender in the package will fire, and you would just have to intercept the signal and handle it with your intended logic
Very easy to implement multiple image upload with this project:
https://github.com/tstone/django-uploadify