cancel
Showing results for 
Search instead for 
Did you mean: 

Access to a node (file)

ruizja
Champ in-the-making
Champ in-the-making
I'm developing a Custom Action and I need help about how I can access a file in Alfresco from Java code. I need access the file for send the full-path to another Java application that need it for process. I found the bin path but I need the path of webdav/cifs/whatever real path.

Someone can help me?
Thanks,
Javier
3 REPLIES 3

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

Have a look at the generateURL method in the org.alfresco.web.ui.common.Utils class.

ruizja
Champ in-the-making
Champ in-the-making
Hello,

Have a look at the generateURL method in the org.alfresco.web.ui.common.Utils class.

First of all, thanks for the response Smiley Happy Sorry but I am a novice in all these subjects. I saw this method and It seems that I need two parameters:

public static java.lang.String generateURL(javax.faces.context.FacesContext context,
                                           Node node,
                                           Utils.URLMode usage)

context and node when I only have action and noderef in my executeImpl method inside myAction class. How I can get this two parameters for my Custom Action?

ruizja
Champ in-the-making
Champ in-the-making
I found a use in the code of Alfresco and adapted in this way:

String filePath = Utils.generateURL(FacesContext.getCurrentInstance(), new Node(actionedUponNodeRef), Utils.URLMode.WEBDAV);

Hello,

Have a look at the generateURL method in the org.alfresco.web.ui.common.Utils class.

First of all, thanks for the response Smiley Happy Sorry but I am a novice in all these subjects. I saw this method and It seems that I need two parameters:

public static java.lang.String generateURL(javax.faces.context.FacesContext context,
                                           Node node,
                                           Utils.URLMode usage)

context and node when I only have action and noderef in my executeImpl method inside myAction class. How I can get this two parameters for my Custom Action?