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 /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.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
check the method "getPayloadPath" in libs/cq/workflow/global.jsp it might give you a hint as to how to generate an url for a payload path.
CQ uses something called "JcrPathBuilderManager" to turn a payload path in the repository into an url you can click on. You should be using this in your code too.
See the following [0] and [1] for some ideas.
Hope this helps,
Will
[0] http://stackoverflow.com/questions/23787369/implement-inbox-functionality-in-custom-cq-component
[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/workflow/ui/JcrPathBuilderManager.html
Views
Replies
Total Likes
Check the email template & fix there instead at workflow step.
Views
Replies
Total Likes
Sham,
Thanks for the reply.
The inbox url is http://localhost:4502/libs/cq/workflow/content/inbox.html
So, using this, I reached to /libs/cq/workflow/content/inbox page and checked the following files in CRX:
File : Template
But I could not get the code where the link is created.
If you could suggest me any page or path in CRX, which may have the code, it would be a great help.
Thanks in advance
Gagan
Views
Replies
Total Likes
Hi,
check the method "getPayloadPath" in libs/cq/workflow/global.jsp it might give you a hint as to how to generate an url for a payload path.
CQ uses something called "JcrPathBuilderManager" to turn a payload path in the repository into an url you can click on. You should be using this in your code too.
See the following [0] and [1] for some ideas.
Hope this helps,
Will
[0] http://stackoverflow.com/questions/23787369/implement-inbox-functionality-in-custom-cq-component
[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/workflow/ui/JcrPathBuilderManager.html
Views
Replies
Total Likes
Will,
Thanks for the reply.
I could not get any method "getPayloadPath" in libs/cq/workflow/global.jsp
But, I got 'pathBuilder' in /libs/cq/workflow/components/inbox/list/json.jsp.
I wrote a method which will add '/damadmin.html#' as prefix, if it is not added to URL by 'pathBuilder'.
-------------------------------------------------
private String handleDamPathForFolder(Logger log, String payloadUrl, Session session, WorkItem wi)
{
try
{
if(isFolderNode(session, wi))
{
return ("/damadmin.html#"+payloadUrl);
}
}catch (Exception e)
{
log.error("Unable to handle path creation for work item: " + wi.getId(), e);
}
return payloadUrl;
}
------------------------------------
Also, we dont need to change the payload as the folder path, CQ handles it.
Anyway, the URL problem is resolved.
But, now I want to
1. select a child folder by CQ javascript API(Attached the PDF of screenshots.)
In the PDF(Heading as 'folder selection'), we can see the second child folder is selected.
2. open the folder properties as pop up.
In the PDF(Heading as 'folder properties pop up'), we can see the popup.
Both requirements should be done by code and page onload.
Thanks in advance to all
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies