cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the window.location.host in a workflow?

rodrigoa
Champ in-the-making
Champ in-the-making
Hello,

In my project I have a workflow that has to send an email informing the address of a specific document. How can I get the host of my tomcat?

For example, in one moment I do this:

                     mail.parameters.text = "\n\n\-\-\-\-\-\-\n\n" +
                     "Un nouveau document a été publié.\n\n" +
                     "Nom du document: " + nameFile + "\n\n" +
                     "Commentaires: " + comment + "\n\n" +
                     "Vous pouvez accéder à ce document publié à partir du lien suivant: \n" +
                     "http:\/\/localhost:8080\/share\/page\/site\/publiees\/document-details?nodeRef=workspace:\/\/SpacesStore\/" + nodeRef +
                     "\n\n\-\-\-\-\-";

I need to pass as a parameter the host, to replace the "localhost", because the deploy, at the client, is going be in 3 different environments.

I found out the variable Alfresco.constants.PROXY_URI which gets the window.location.host. How can I get this variable in my workflow code?

Thanks in advance,

Rodrigo Araujo
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Probably you can go for the action class in workflow.
So, that control will be in java where you can easily have the host information using System class and other classes.

nunocardoso
Champ in-the-making
Champ in-the-making
Hi,

I have exactly the same problem. I want to add, in the notification email, links to the documents attached in the workflow.

Sorry, but "Probably you can go for the action class in workflow." doesn't lead us to nowhere.

Is there any way to get the URL context inside the workflow script?