11-13-2020 11:52 AM
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!!
11-13-2020 08:59 PM
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.
11-14-2020 06:15 AM
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.
03-04-2021 09:24 AM
@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.
03-05-2021 07:01 AM
I used wayback machine to access the 5.0 docs -
HTH,
Explore our Alfresco products with the links below. Use labels to filter content by product module.