cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a custom action - stuck

paulkeogh
Champ in-the-making
Champ in-the-making
Hi,

I am trying to add a custom action and am following the wiki docs up to the <TODO> tags and then trying to extrapolate from the mailAction code.

I've got to the point of adding code to the action-services-context.xml file

   <bean id="sendsms" class="org.alfresco.repo.action.executer.SendSMSActionExecuter" parent="action-executer">
      <property name="sendSMSService">
         <ref bean="sendSMSService"></ref>
      </property>
   </bean>
 

for my custom action - when I do this I get the following exception;

javax.faces.FacesException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
org.apache.jasper.JasperException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
javax.faces.el.EvaluationException: org.alfresco.web.bean.wizard.NewRuleWizard

caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.wizard.NewRuleWizard, property: actions

caused by:
java.lang.reflect.InvocationTargetException

caused by:
java.lang.NullPointerException: label

Comment it, it runs again. I'm quite happy hacking and grepping my way through this to figure out whats going on, but can someone give me a pointer on this ? or even how to turn on some more debugging to see whats going on.

Thanx,
3 REPLIES 3

rdanner
Champ in-the-making
Champ in-the-making
Hi,

I am trying to add a custom action and am following the wiki docs up to the <TODO> tags and then trying to extrapolate from the mailAction code.

I've got to the point of adding code to the action-services-context.xml file

   <bean id="sendsms" class="org.alfresco.repo.action.executer.SendSMSActionExecuter" parent="action-executer">
      <property name="sendSMSService">
         <ref bean="sendSMSService"></ref>
      </property>
   </bean>
 

for my custom action - when I do this I get the following exception;

javax.faces.FacesException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
org.apache.jasper.JasperException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{NewRuleWizard.actions}'

caused by:
javax.faces.el.EvaluationException: org.alfresco.web.bean.wizard.NewRuleWizard

caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.wizard.NewRuleWizard, property: actions

caused by:
java.lang.reflect.InvocationTargetException

caused by:
java.lang.NullPointerException: label

Comment it, it runs again. I'm quite happy hacking and grepping my way through this to figure out whats going on, but can someone give me a pointer on this ? or even how to turn on some more debugging to see whats going on.

Thanx,

It sounds like you have an incomplete configuration somewhere.  It has been a while since i wrote a custom action but here is what i remember.

you have to modiify:
   o code your action
   o config your action
   o the code in the rules wizard (unless this model has changed… which it will have to at some point, to some pattern that supports dynamic
extentions)
   o modify the application context-xml to point to your new wizard class + any additional configuration
   o create jsp for under wizard for create and new-action
   o modify the navigation-config.xml
   o modify message.properties in the web client and
   o modify the action-config.properties in the repository

it becomes pretty obvious what you need to modify by looking at a particular example.  in your case… check the email action and copy off that.

Sorry that is not a step by step but it should point out what needs changing so you can tell if you have covered the basis.

-R

paulkeogh
Champ in-the-making
Champ in-the-making
you have to modiify:
   o code your action
   o config your action
   o the code in the rules wizard (unless this model has changed… which it will have to at some point, to some pattern that supports dynamic
extentions)
   o modify the application context-xml to point to your new wizard class + any additional configuration
   o create jsp for under wizard for create and new-action
   o modify the navigation-config.xml
   o modify message.properties in the web client and
   o modify the action-config.properties in the repository
-R

Awesome - thank you !

I was missing the final 2 steps, as I don't know JSF well yet. Actually, I don't know much of any this yet but I'm getting there. Can't beat learning through doing.

I'd update the wiki if I had access   :?

rdanner
Champ in-the-making
Champ in-the-making
To update the wiki just create an account and you are off

http://www.alfresco.org/mediawiki/index.php?title=Special:Userlogin&returnto=Main_Page


just post here if it doesnt  work (the custom action).. and we'll look close but you should be well on your way.