AnsweredAssumed Answered

customizing Folder Picker  and replacing the move action

Question asked by annakan on Apr 8, 2011

I need to be able to replace the move action by a cutom one that is very close from the original one without the same default assumption the stock one does. To learn more about why, you can have a look at this post ;)

I am at a point where I know how to write an action in java, behaviours and do some more things but I am still overwhelmed by the amount of details spread everywhere in the framework, especially share (we know the alfersco guys are at work polishing Share extensibility).

So I wondered if an expert could point me in the right direction (code snippet or pointers to code are fine) to  achieve this.

I don't want to hack the core java code or do un-deployable things, because that is, well, un-deployable ;)

I am ok with duplicating (and renamin) the whole, javascript picker, java code and such into another 'namespace'/project folder  if it makes thing simpler, given that the stock move action will probably be fixed in time. I hope the question I ask may be useful for others anyway. The only thing is I don't know how to do it because there are lots of ties to the YUI framework and lots of "inheritance" that I don't know how to unravel properly.

What I need to do :

I] Learn to call the folder picker from my action, UI side.

a) On an action in the share ui (folder and file details) fire my folder picker with the same interface as today
b) have "my" folder picker return the SOURCE (current) and destination folder, I can also get the current folder from my action if I know what to look up.

II] Then I'll call an action server side to do the job, or maybe I can hook up and call the CMIS version of it (the CMIS version of move does not rely on the assumption that the primary parent of an item is the source folder).
I just need to know how to do that (name of the service, method to call and parameters, the rest I can figure out). If somebody can point me to a code snippet where it happens, It is all good. (for how to call a java based action from the javascript share client side look here

To sum it up the minimum information I think I need to know are :
  1. how to properly call the picker from one of my action

  2. how to retrieve the folder I am in from an action invoked from the share folder view and the "detail" view on a document.
The rest I can manage, even by rewriting the move code into my own action.

Thanks a lot for you help.