0

I've a set of thumbnail sizes initially configured in "/etc/workflow/models/dam/update_asset.html", as time past, I would like to add in additional set of sizes eg. 200x200, 300x300. How do I manually trigger the thumbnail creation workflow step without reuploading all the dam assets? Is it possible for an author to go to the "/damadmin", choose any image and click on workflow to manually trigger the thumbnail creation workflow step?

version: cq5.6.1

I'm still open to manual triggering of workflow. Another answer to this question thanks to dave, is to touch/update the original rendition's jcr:lastModified "/content/dam/./jcr:content/renditions/original/jcr:content"

Many thanks in advance

Jianhong
  • 899
  • 9
  • 11

2 Answers2

1

Was faced with a similar problem when creating new rendition sizes. One solution is to create an admin page (via a custom component/template) where given a particular path, will update the Last modified date of the assets under that tree.

This will then trigger the Update Asset workflow without the need for creating an additional workflow.

anotherdave
  • 6,656
  • 4
  • 34
  • 65
  • thanks for your reply, is it possible for an author to go to the "/damadmin", choose the any image and click on workflow to manually trigger the thumbnail creation workflow step? – Jianhong Jul 02 '14 at 08:30
  • Not that I've seen without creating a custom workflow, though it's an option we didn't look into in depth as it won't scale well regardless. If you have 100s of images in the DAM when you add a new rendition size, manually updating each one is a large burden on the editor. – anotherdave Jul 02 '14 at 08:32
  • if i were to implement what is mentioned in your answer, all i need to do is to "touch"/update the /content/dam/./jcr:content/jcr:lastModified? – Jianhong Jul 02 '14 at 09:30
  • Yes exactly, updating the `jcr:lastModified` to current time will trigger the workflow for that asset. – anotherdave Jul 02 '14 at 09:43
  • i tried to update the asset's jcr:lastModified date and verified that the date is being updated correctly, however, the workflow doesn't seem to be triggered. This is the code snippet on how I update the jcr:lastModified "Session sess = resourceResolver.adaptTo(Session.class); String asset = "/content/dam/mac/BG_stories.jpg/jcr:content"; try { Node n = sess.getNode(asset); n.setProperty("jcr:lastModified", Calendar.getInstance()); sess.save(); } catch (Exception e) { out.println(e.getMessage()); }" – Jianhong Jul 03 '14 at 03:51
  • voted your answer just need to touch the original rendition's jcr:lastModified: "/content/dam/./jcr:content/renditions/original/jcr:content" – Jianhong Jul 03 '14 at 04:27
1

Manually Trigger Workflow

Options 1. Update asset lastModified

  1. Click "Start" from Workflows console

http://localhost:4502/libs/cq/workflow/content/console.html

and provide Asset+"/jcr:content/renditions/original" as Payload

  1. Curl:

curl -u admin:admin 'http://localhost:4502/etc/workflow/instances' -F  "model=/etc/workflow/models/dam/update_asset/jcr:content/model" -F "_charset_=utf-8" -F ":status=browser" -F "payload=/content/dam/geometrixx-media/articles/andrew-novokov.jpg/jcr:content/renditions/original" -F "workflowTitle=" -F "startComment=" -F "payloadType=JCR_PATH"
  1. Write Java Service spaghetti to do this

  2. Write Javascript spaghetti to do this

  3. Update DAM Asset UI as per

http://experience-aem.blogspot.hk/2014/09/aem-6-classic-ui-starting-workflow-from-asset-editor.html
  1. Add a menu item to context menu in DAM Asset tree to allow bulk trigger

  2. Create a new similar to Tree Activate that just triggers the workflow

Max Barrass
  • 2,776
  • 1
  • 19
  • 10