12-11-2016 10:30 PM
Hello Guys,
I'm creating a Java standalone application that zips a folder from Alfresco 4.1 repository and uploads the zipped folder back. I came across this question Accessing alfresco repository from custom java application which was years ago and I'm not sure if this still applies today.
Based on the comments, the recommended approaches (in order of best to less recommended): Web Scripts, Web Services and RMI.
I've already tried developing using Alfresco Web Scripts months ago and I must say it's easy to implement. What I want to know if this is still the way to go on Alfresco 4.1 or are there any Web scripts available that do what I need to do:
1. Retrieve the folder and all its contents from the site document library (folder to be zipped)
2. Upload zipped folder to the site document library
3. Sets permissions to the zipped file (zipped file hidden to other users, or maybe read-only)
I also came across on Apache Chemistry - OpenCMIS Client API Developer's Guide but I'm still not familiar with this and still need to study on this.
Any thoughts on which is the best approach? Thanks!
12-30-2016 11:55 PM
For #1, to download folders as a zip file, there is already an add-on available. Kindly take a look at "Compress and Download" Share Action (ZIP) | Alfresco Add-ons - Alfresco Customizations . It is mentioned that it works for Enterprise v 4.1. The above link gives all the details about the add-on. I think this add-on would be useful for you. If you are using community version then you might need to verify if it is working for community v 4.1 or not.
For #2, For uploading a file back to Alfresco repository, you should be able to use the upload web script available out-of-the-box. See if it works for you.
For #3, You could apply permissions as required (may be by setting up a business rule when a zip file is uploaded or through behaviour/policies)
Hope this helps.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.