cancel
Showing results for 
Search instead for 
Did you mean: 

How to got node's url?

oltchuva
Champ in-the-making
Champ in-the-making
Hello,

I'm iterating trough search results and i need to get node's url

 for(ResultSetRow row : results)
            {
                NodeRef currentNodeRef = row.getNodeRef();
                String name = row.getValue(QName.createQName("{http://www.alfresco.org/model/content/1.0}name")).toString();
                String url = …
            }

How can I get URL that points to the node and can be used by user to download node's content? I have NodeRef with id and store information, but it's not a valid url. Any methods that can help me?

Thank you,
Olga
2 REPLIES 2

zaizi
Champ in-the-making
Champ in-the-making
You can use the download servlet as per http://wiki.alfresco.com/wiki/URL_Addressability#DownloadContentServlet to construct the url.

oltchuva
Champ in-the-making
Champ in-the-making
Thank you! Static method on this servlet is exactly what I need:
org.alfresco.web.app.servlet.DownloadContentServlet.generateBrowserURL(nodeRef, filename);