Dynamically set action parameters
Posted: Mon Nov 19, 2012 8:18 pm
Hi, once again i have a question about how to use oxygen author API. The API is so great that i'd like to do amazing things and don't know if it's really possible 
I would like to drop an object in the author page, intercept this object in an AuthorDnDListener, find the appropriate custom action, inject parameters depending on the droped object and then invoke the action to insert xml fragment filled with the good datas.
The only one point that i miss is the action's parameters settings.
I can find an action by calling editorAccess.getActionsProvider().getAuthorExtensionActions().get("drop.myObject").
I can't change parameters here, so i tried to change them directly in the action.
I extended the InsertFragmentOperation to fill the configured fragment with the droped object datas.
Here i can retreive the fragment by calling argumentsMap.getArgumentValue("fragment"), then i can fill it with datas. But i'd like to reinject the new fragment in the argumentsMap to call super.doOperation(authorAccess, argumentsMap).
It seems that the arguments has several methods but no setter available. May be there is one but it's obfuscated (i think this is a setter cause of the parameters).
Is there another way to inject parameters in actions? or would it be possible let a clear access to the setter in a future version of Oxygen?
Thanks for all,
Benoit Chery.
4DConcept - France

I would like to drop an object in the author page, intercept this object in an AuthorDnDListener, find the appropriate custom action, inject parameters depending on the droped object and then invoke the action to insert xml fragment filled with the good datas.
The only one point that i miss is the action's parameters settings.
I can find an action by calling editorAccess.getActionsProvider().getAuthorExtensionActions().get("drop.myObject").
I can't change parameters here, so i tried to change them directly in the action.
I extended the InsertFragmentOperation to fill the configured fragment with the droped object datas.
Here i can retreive the fragment by calling argumentsMap.getArgumentValue("fragment"), then i can fill it with datas. But i'd like to reinject the new fragment in the argumentsMap to call super.doOperation(authorAccess, argumentsMap).
It seems that the arguments has several methods but no setter available. May be there is one but it's obfuscated (i think this is a setter cause of the parameters).
Is there another way to inject parameters in actions? or would it be possible let a clear access to the setter in a future version of Oxygen?
Thanks for all,
Benoit Chery.
4DConcept - France