cancel
Showing results for 
Search instead for 
Did you mean: 

Public url of document

agz
Champ on-the-rise
Champ on-the-rise
Hi all,
I need to have, via javascript, the public URL of a document, for example:
http://localhost:8080/share/page/site/testsite/document-details?nodeRef=workspace://SpacesStore/c973...

I want this url via javascript because I need to use it in a custom workflow task (Activiti).

How I can get this information of document?

Thanks in advance
7 REPLIES 7

billerby
Champ on-the-rise
Champ on-the-rise
document.url or document.downloadUrl should work?

/Erik

agz
Champ on-the-rise
Champ on-the-rise
I tried with:

document.url:
/d/d/workspace/SpacesStore/0124b03c-a8fb-4cab-9f73-fcd599a7bfd6/filename.doc

and document.downloadUrl:
/d/a/workspace/SpacesStore/0124b03c-a8fb-4cab-9f73-fcd599a7bfd6/filename.doc

That are not what I want.   Smiley Sad

agz
Champ on-the-rise
Champ on-the-rise
no one has a solution to this problem?  :shock:

abarisone
Star Contributor
Star Contributor
Hi,
I think you can use the nodeRef property as reported here http://wiki.alfresco.com/wiki/4.0_JavaScript_API#ScriptNode_API
This will give you the node representation in the form
workspace://SpacesStore/<node Id>

Regards,
Andrea

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
What is it exactly you want to do with that URL?

If the workflow is executed in Alfresco then it has access to all the properties and content in the repository. If what you want is send a link to an external resource (ie. email). Then you'll need to build it.

Regards,
Adei

agz
Champ on-the-rise
Champ on-the-rise
I need to insert the URL in email text.
Ok, I will try to compose it

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
If you use a freemarker template for the email, there are already some parameters to build the URL.

You could use
${url.serverPath}
and that would give you the protocol+host+port of the server, then the rest will need to be filled by you

Regards,
Adei