AnsweredAssumed Answered

create a custom java-action

Question asked by mirtunis on Jan 11, 2015
Latest reply on Jan 12, 2015 by mitpatoliya
Hi all ,
I need return a value from a custom action , so i write the action executer class ,here is the code :

public class AddAspectActionExecuter extends ActionExecuterAbstractBase{
   public static String PARAM_RESULT = "result";
   //private BeanFactory beanFactory ;
   protected void executeImpl(Action ruleAction, NodeRef nodeRef) {
      ruleAction.setParameterValue(PARAM_RESULT, "helllloooooooooo");
   protected void addParameterDefinitions(List<ParameterDefinition> arg0) {
      // TODO Auto-generated method stub   

I compile it and i put the JAR in Alfresco\tomcat\webapps\alfresco\WEB-INF\lib
and i configure the action in Spring in the file rule-context.xml here is the code:
<?xml version='1.0' encoding='UTF-8'?>
<bean id="add-aspect" class="org.alfresco.repo.action.executer.AddAspectActionExecuter" parent="action-executer">

i put the file (rule-context.xml) in Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension.

When i try this code in javascript :
var actionOne = actions.create("add-aspect");
the return is null
Maybe I've missed something?
any idea???

Thanks in advance.