We have created a workflow to send approval mail to approver. The payload is jcr:content of a folder or a PDF.
After the coding, the behaviour is for:
A pdf : It generate right URL as http:///damadmin.html#/content/ab/cd/abc.pdf
A folder : It generate the wrong url as http:///damadmin.html#/content/folder-name/jcr:content
So, for folder, we have updated the code to change the payload as the folder-path instead of folder-path/jcr:content
for that we used,
WorkflowData wfData = wfSession.newWorkflowData("JCR_PATH", folder_node_path);
wfSession.updateWorkflowData(workItem.getWorkflow(), wfData);
After the code change,
When a user modify any dam content like a pdf, the url is correct as http:///damadmin.html#/
but when the user modify a folder properties, the mail sent to approver has the wrong url as http:///
means /damadmin.html# is missing.
We need that the correct link should be added for both PDF and Folder. Thanks in advance.
Issue is resolved.
I am using CQ 5.5.
Sharing my experience.
We don't need to change the payload. The payload can remain as jcr:content
We need to do two things:
Make sure the folder-path/jcr:content has the value in property jcr:title. It will be shown in content column of the inbox page.
For the folder link in inbox page, it must be as /content//jcr:content. The problem is because /damadmin.html# is not added before the url.
This problem is not coming for any Asset or Page.
Solution is:
You need add the following code in /libs/cq/workflow/components/inbox/list/json.jsp
A=> Add private method
We have to write the method isFolderNode which will return true if the node is a folder.
B=>Replace
by the follwoing
JSONWriterUtil.write(writer,"payload",handleDamPathForFolder(log,pathBuilder.getPath(wi), session, wi), JSONWriterUtil.WriteMode.BOTH, xss);