Hi folks, I'm working on a solution using Alfresco headlessly as an ECM. So i have the core Alfresco services but no share service.
My solution uses PDF renditions to view documents in a custom browser external to Alfresco, so depends on every document having a PDF rendition available. As I understand it (happy for any better steers) the logical way to ensure a PDF rendition is available for each document is a webscript running as a folder rule on my documentLibrary.
The webscript itself seems fairly simple (one line, renditionService.render(document, "{http://www.alfresco.org/model/content/1.0}pdf")). But without share I can't work out how to apply this to my folder. From research I understand that the current REST API cannot query or upload rules, and a deprecated REST API should be use, but I've struggled to find details.
Any pointers appreciated on how to work with rules via REST request, or comments otherwise welcome on if this really is the best way to ensure PDF renditions are available
Thanks!!
Two options come to my mind to solve this problem:
1.Develop a customized rule service web script if you want to use remote rule servcie api.
2.You can create a scheduled job in your application ,in the job call alfresco rendition rest api (https://api-explorer.alfresco.com/api-explorer/#/renditions) to create pdf rendition. I recommend this one.
There are REST APIs available out of box which will help you to manage rules.
https://docs.alfresco.com/5.0/references/RESTful-RuleRulePost.html
Additionally following tool created by Jeff pott could also be useful to you.
https://github.com/jpotts/alfresco-rule-management
I could see that you need two step solution.
1) Create rule which execute the renditon scripts on each content of folder.
2) Create another rule which will ensure that whenever new folder is created it will have new rule applied to it. This could be rule on your root folder of repository.
@ocox Did you ever come up with a solution for this? I'm looking to do the same thing. Sady, many of the links in the replies to your post are broken and therefore don't help me.
I used wayback machine to access the 5.0 docs -
HTH,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.