cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ParameterDefinition

jesty
Champ in-the-making
Champ in-the-making
Hi folks,
I've created my custom action and it's works, but now I wont add a parameter.
I have add it to the list:
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
       paramList.add(new ParameterDefinitionImpl(PARAM_STOP_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_STOP_FOLDER)));
   }

And I have denined the action in spring context file, but when I add the action and I click button "" the action is added, but I can't set the parameter and when I execute this action I have this exception:

org.alfresco.service.cmr.rule.RuleServiceException: A value for the mandatory parameter stop-folder has not been set on the rule item copy-content-with-struct-action
   at org.alfresco.repo.action.ParameterizedItemAbstractBase.checkMandatoryProperties(ParameterizedItemAbstractBase.java:164)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:117)


Where is my error??? What I forget?

Thanks Smiley Very Happy
5 REPLIES 5

jesty
Champ in-the-making
Champ in-the-making
I have resolve my issue.
I have forget to define the Handler Smiley Happy
Now all worksSmiley Very Happy
Thanks,
Davide

ngchiwing
Champ in-the-making
Champ in-the-making
Hi,


I'm a newbie here. I'm trying to setup a testing custom action with parameter input by jsp. And I've got the same problem.

I'm now using the Alfresco Community 2.1 on Fedora 4. I've added a web-client-config-custom.xml into $TOMCAT/webapps/alfresco/WEB-INF/classes/alfresco/extension. The content of the xml file is :

<alfresco-config>
   <config evaluator="string-compare" condition="Action Wizards">
      <action-handlers>
         <handler name="Test" class="org.alfresco.extension.TestActionHandler" />
      </action-handlers>
   </config>
</alfresco-config>

However, when I execute the "Run Action" wizard and select my custom action and click the "Set Values and Add" button, my customized jsp doesn't pop up. Also, when I click the finish button, a similar error message prompt out.

So, would it be possible if you can share more details on how you fix your problem? Thanks a lot!


Regards,


Wing

burriad
Champ in-the-making
Champ in-the-making
Hi,

I had a similar issue, the (partial) resolution of it included the following steps:
- The Action definition has a public static final String NAME
- This string has to be identical with the bean-id of the action (action-context.xml in the extension folder)
- The respective action handler name has to be identical with the NAME String as well
- The ActionHandler class needs to implement the prepareFor{Edit,Save} methods, so that the properties are correctly copied between the two property maps (see the implementation of an existing action handler as a reference)

Still, in my case, the values from the jsp don't get correctly passed to action handler, but otherwise the jsp is found and executes fine.

Hope this helps.

zomurn
Champ in-the-making
Champ in-the-making
Help, I have the same problem. I respected all task, my jsp works correctly, but the handler is completely ignored (nothing happened although I took care about name and bean id)…

burriad
Champ in-the-making
Champ in-the-making
Hi,

for me, the trouble was implementing the prepareForEdit and prepareForSave methods. Make sure that:
  • The property PROP_DESTINATION gets copied as well

  • That you copy from the input map to the output map
The second bullet point sounds trivial, but is easy to get wrong due to the not-so-optimal naming and the quite inexistent documentation of the method's parameter  :evil:

Here's what you need to do:
  • prepareForEdit: copy the entries from the second argument into the first argument

  • prepareForSave: just the opposite
I can only advise to put debug statements in all handler and action methods as well, otherwise you'll be lost without knowing which methods got called and which were overlooked due to faulty configuration…