sending document url using mail.parameters.text
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2014 01:47 AM
I wanted to send the document url via mail text on share javascript.
i) I've tried
mail.parameters.text = document.properties.url;
and
mail.parameters.text = document.properties.shareUrl;
both returns null.
ii) I tried copying the whole address based on folder name, such as
mail.parameters.text = companyhome.childByNamePath("Sites/test-script/documentLibrary/test.txt");
this returns server error..
iii) And when I tried
mail.parameters.text = document.url;
I get
/d/d/workspace/SpacesStore/7158a48b-4150-40d1-a65e-1a1c7f42ef5d/T%20-%20Copy%20(10).txt
but I cannot simply use this url.
I feel like I'm almost there, please tell me what I'm missing.
Thanks in advance!
i) I've tried
mail.parameters.text = document.properties.url;
and
mail.parameters.text = document.properties.shareUrl;
both returns null.
ii) I tried copying the whole address based on folder name, such as
mail.parameters.text = companyhome.childByNamePath("Sites/test-script/documentLibrary/test.txt");
this returns server error..
iii) And when I tried
mail.parameters.text = document.url;
I get
/d/d/workspace/SpacesStore/7158a48b-4150-40d1-a65e-1a1c7f42ef5d/T%20-%20Copy%20(10).txt
but I cannot simply use this url.
I feel like I'm almost there, please tell me what I'm missing.
Thanks in advance!
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2014 03:07 AM
Which URL you want to send for document?
If you want to send the path to that document then you can use below method.
"document.displayPath" - Will return the physical path. e.g. /Company Home/Test_Space
Hope this helps.
If you want to send the path to that document then you can use below method.
"document.displayPath" - Will return the physical path. e.g. /Company Home/Test_Space
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2014 05:32 AM
Thanks for the reply.
But what I wanted is to display the url in mail.parameters.text which is the same as function ${document.shareUrl} in the template file.
How do I achieve this?
I'm using this method now because I cannot pass bpm_template as mail.parameters.template=bpm_mailTemplate in processdefinition, I get template error…
But what I wanted is to display the url in mail.parameters.text which is the same as function ${document.shareUrl} in the template file.
How do I achieve this?
I'm using this method now because I cannot pass bpm_template as mail.parameters.template=bpm_mailTemplate in processdefinition, I get template error…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2014 07:25 AM
Can you paste that ${document.shareUrl} value here?
In which file you saw this "${document.shareUrl}"?
In which file you saw this "${document.shareUrl}"?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2014 09:02 PM
Data Dictionary > Email Templates > Notify Email Templates > any ftl files
${document.shareUrl}
From here, it returns
http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=workspace://SpacesStore/de1d...
which leads me to the file.
I wanted to use the same function on javascript only.
So far I could use document.nodeRef, it returns me
workspace://SpacesStore/de1d5fe3-44b6-48c8-a18f-c4ad21f7c8cd
so I have to add the front part (http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=) by using string
Is there any way I could directly display
http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=workspace://SpacesStore/de1d...
using javascript?
${document.shareUrl}
From here, it returns
http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=workspace://SpacesStore/de1d...
which leads me to the file.
I wanted to use the same function on javascript only.
So far I could use document.nodeRef, it returns me
workspace://SpacesStore/de1d5fe3-44b6-48c8-a18f-c4ad21f7c8cd
so I have to add the front part (http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=) by using string
Is there any way I could directly display
http://127.0.0.1:8080/share/page/site/ar-rahnu/document-details?nodeRef=workspace://SpacesStore/de1d...
using javascript?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2014 02:29 AM
Can you try to build required URL like this:
var docURL = url.server + "/share/page/site/" + document.getSiteShortName() + "document-details?nodeRef=" + document.nodeRef ;
Hope this helps.
var docURL = url.server + "/share/page/site/" + document.getSiteShortName() + "document-details?nodeRef=" + document.nodeRef ;
Hope this helps.
