AnsweredAssumed Answered

Alfresco Document Link: 'Remove Document' removes original, too

Question asked by technaton on Aug 22, 2013
Latest reply on Nov 14, 2013 by eleutian
I'm trying to set up a simple web script which provides document links. I've created a document library action and the appropriate controller script,
linkTo.post.js
. Things initially work as expected. I create the link using the <javascript>newParentFolder.addNode(documentNode)</javascript> method.

However, deleting the link also deletes the original. I had a look at the Alfresco source code and found that deleting a document is simply a call to <javascript>node.remove();</javascript>, of which the JavaScript API documentation states that it deletes the node (in contrast to <javascript>folder.removeNode()</javascript>).

Now this is obviously not what I want. Removing the link should remove only the link, not the orginal node. I'd like to mimic the behaviour of Unix symbolic links. I suppose I need to create a special node in the destination folder for that. But how to I do that? Are aspects the right way to go here?

If anybody's interested, my current (alpha-quality) code lives on <a href="https://github.com/Wilhelm-Buechner-Hochschule/link-to">GitHub</a>. The development environment is Alfresco Community 4.2.c.

Thanks a lot in advance!

— Eric

Outcomes