cancel
Showing results for 
Search instead for 
Did you mean: 

Need email notification to point to Share not Alfresco

tctim
Champ in-the-making
Champ in-the-making
Hello-

I want to change the following code to point to Share instead of to Alfresco since my users only have access to Share.

From notify_user_email.ftl
**************
You can view it through this link:
https: //mydomain/alfresco${document.url}
*************

An example desired rendered URL would look like this –
https: //mydomain/share/page/site/hq/document-details?nodeRef=workspace://SpacesStore/253ac02f-02a9-4016-a108-bfe98ea8c17b

Where would I find out how to programatically define this?

Thanks,

Tim
14 REPLIES 14

jager13579
Champ in-the-making
Champ in-the-making
Using that sample code from the webscripts, I figured out how to get the site name into the url for the document. The code below assumes you know the folder is a site. I am assuming this because I created a separate email template for sites and choose that template when I create the rule. The code below could be easily extended to check using the qname.

<#assign ref=space.nodeRef>
<#assign displayPaths=document.displayPath?split("/")>
<#assign site=displayPaths[3]>
http://${url.serverPath}/share/page/site/${site}/document-details?nodeRef=${document.nodeRef}

mikeh
Star Contributor
Star Contributor
Hi All,

is this possible? i´ve tried many thing to accomplish that but still not able to do such a thing.

any help is welcome.

thanks
All the code you need is in this thread.

Thanks,
Mike

b_fergerson
Champ in-the-making
Champ in-the-making
What I am trying to achieve can be seen on the document details page for any content item in Share - in the right hand nav there is a box titled Share with "Document URL".  In this box is the URL to this particular document - I need to know how that URL is dynamically generated.  I thought I had it figured out when I changed the URL in the notify_user_email.ftl to http: //mydomain/share/proxy/alfresco-feed/api/node/content${document.url} but the ${document.url} generates a leading /d/d that breaks the URL.

For example -
The URL to the document is:
https: //mydomain/share/proxy/alfresco-feed/api/node/content/workspace/SpacesStore/b2e3c064-9988-422e-8416-05795e70d5fe/notify_user_email-3.ftl

The above example generates the following URL:
https: //mydomain/share/proxy/alfresco-feed/api/node/content/d/d/workspace/SpacesStore/b2e3c064-9988-422e-8416-05795e70d5fe/notify_user_email-3.ftl

Thoughts?

Hate to bump an old thread; however, I ran into the same problem and wanted to share my success. I used this basic concept here and was able to actully just trim off the beining of the string when you use the ${document.url} variable. I used ${document.url?substring(3)} instaed with a begening of https: //mydomain/share/proxy/alfresco-feed/api/node/content and my generated URLs work like a charm!

mpeters
Champ in-the-making
Champ in-the-making
We have done it that way:
${url.serverPath}/share/page/document-details?nodeRef=${document.nodeRef}
${url.serverPath}/share/proxy/alfresco/api/node/content${document.url?substring(4)}
The first link opens the Share page of the document. The second link opens or downloads the document directly.


You may force the download of the document (rather then opening in browser) with:
${url.serverPath}/share/proxy/alfresco/api/node/content${document.url?substring(4)}?a=true
If ${url.serverPath} returns something with localhost or so, consider to set repo.remote.url in alfresco-global.properties.
Example:
repo.remote.url=http://your.domain.com:8080/alfresco
I hope this helps. If you find errors please respond!
🙂

Regards
Markus

vpetrena
Champ in-the-making
Champ in-the-making
Hi, this was very helpful. How would a reference to the folder in which the document is look like?