cancel
Showing results for 
Search instead for 
Did you mean: 

Link to documents

shemgp
Champ in-the-making
Champ in-the-making
Hello,

I would like to know if Alfresco community 4.2.f does support creating of links to documents, i mean, like symbolic links in Linux.  If not, how can I convert this code to java? It's in Javascript.

        var symlink = destNode.createNode(fileNode.name, "app:filelink", {
              "cm:destination": fileNode
           });


Thank you.
4 REPLIES 4

technaton
Champ in-the-making
Champ in-the-making
Have a look at the NodeService interface in the Alfresco Javadocs, or at its implementation, org.alfresco.repo.version.NodeServiceImpl.

HTH
Eric

romschn
Star Collaborator
Star Collaborator
You can find the implementation details of above javascript code in org.alfresco.repo.jscript.ScriptNode.class.
Corresponding method to your above implementation is - createNode(String name, String type, Object properties) in ScriptNode.class which in turns makes a call to the following method having detailed implementation - createNode(String name, String type, Object properties, String assocType, String assocName).

Take a look at it and you can use the same logic to implement in your java backed webscript.

Hope this helps.

romschn
Star Collaborator
Star Collaborator

You can find the implementation details of above javascript code in org.alfresco.repo.jscript.ScriptNode.class.
Corresponding method to your above implementation is - createNode(String name, String type, Object properties) in ScriptNode.class which in turns makes a call to the following method having detailed implementation - createNode(String name, String type, Object properties, String assocType, String assocName).

Take a look at it and you can use the same logic to implement in your java backed webscript.

Hope this helps.

rock_tu
Champ on-the-rise
Champ on-the-rise
Hello shemgp
I faced some problme,could you tell me your solution?thank you in advance!