cancel
Showing results for 
Search instead for 
Did you mean: 

override explorer delete?

esource
Champ on-the-rise
Champ on-the-rise
I need to override the default delete behavior in alfresco explorer.  Can I do this through a behavior?  How can I do this?
7 REPLIES 7

mrogers
Star Contributor
Star Contributor
What do you mean by "override the default delete behavior".    By all means you can define a policy implementing your "onDelete" buisness rules.   But you can't interferre with the deletion process itself.

esource
Champ on-the-rise
Champ on-the-rise
there is strange behavior with Alfresco explorer delete.  For example, I create a document called DualParent in TestSpace1.  I then go to TestSpace2 and add the node DualParent from TestSpace1.  Now DualParent is visible in both TestSpace1 and TestSpace2.  TestSpace1 is the primary parent of the document DualParent.  Now if I should delete DualParent in TestSpace1, DualParent is actually still visible in TestSpace2.  If I try to access DualParent in TestSpace2, then I get an error message in explorer explaining thet DualParent is no longer there.  This is strange behavior and not something our clients would want. 

So, I was looking for a way to change the default delete behavior, or override it or somehow have Alfresco behave differently.

A better delete behavior and one I would like to implement would be when delete is selected, a check is made to see if the node has multiple parents, in DualParent's case TestSpace1 and TestSpace2.  One is the primary parent.  One is an association.  If there are multiple parents, then the actual node itself is not deleted, but instead only the association to in this case the primary parent.  This way, we can avoid the error message.  An alternative would be to delete the parent as well as all the associations. 

Do you see what I am getting at?  Why someone would want custom delete behavior?  What would you suggest?  Would the onDelete business rule take care of this?

esource
Champ on-the-rise
Champ on-the-rise
What do you mean by "override the default delete behavior".    By all means you can define a policy implementing your "onDelete" buisness rules.   But you can't interferre with the deletion process itself.

can you explain in more detail what you mean by "onDelete" business rules?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
You have delete Dialog bean.

targa2000
Champ in-the-making
Champ in-the-making
what he means is implementing a behavior that captures actions on the node, for instance onDelete of a node or beforeDeleteNode.

esource
Champ on-the-rise
Champ on-the-rise
yes, thank you.  I have implemented behavior to capture when the node is deleted.  I tried to throw an exception before the node is deleted, but this did not stop the deletion.  Unfortunately it appears I cannot stop the deletion.

glaenen
Champ in-the-making
Champ in-the-making
Hello,

Did you ever solved this issue? I'm facing exactly the same problem.

Thanks,

Glenn