cancel
Showing results for 
Search instead for 
Did you mean: 

LoggerActionExecuter mandatory parameter

finner
Champ in-the-making
Champ in-the-making
Hi all,
I've deployed the Custom Action project from the SDK and added a rule to a space.
The rule is

Conditions: All Items
Action: Logger Action
Details: Inbound, etc.

When I upload a file to the space and OK the Add Content Dialog I get the following exception:


Please correct the errors below then click OK.

    * A system error happened during the operation: Transaction didn't commit: A value for the mandatory parameter param-log-message has not been set on the rule item logger-action


I know WHY I get the error but I don't know how to assign a value to the parameter.
There were no value fields when I configured the rule/action.

Am I missing an XML / .properties, etc ?

Once again, any / all info appreciated

Finner
5 REPLIES 5

simon
Champ in-the-making
Champ in-the-making
Same problem over here, is there anyone who figured this out? At this point I only dropped the jar archive in the lib folder, I suppose there is some configuration needed as well?

Update 1
Tried adding a logger-action-context.xml in my extension folder like the following:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
   <bean id="logger-action" class="org.alfresco.sample.LoggerActionExecuter" parent="action-executer">
      <property name="nodeService">
         <ref bean="nodeService" />
      </property>
      <property name="publicAction">
         <value>false</value>
      </property>
   </bean>
   <bean id="logger-action-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>org.alfresco.sample.logger-action-messages</value>
         </list>
      </property>
   </bean>
</beans>
It seems to do 'something' because Alfresco complains when I remove the jar file with this file enabled. Now, a few questions:
    1. do I need the I18N part? The wiki mentiones it sometimes and sometimes not?!
    2. it still doesn't work, same configuration error, what's wrong? Something with the I18N file/location/configuration?
Update 2
As found on the French Alfresco forum the handler is missing in the example. I have no idea how to make one so still, if anyone can help… Why are there borken examples in the SDK that is supposed to explain how it works?  Smiley Sad

Update 3
Tested the tagging example and that one works so don't try the logger example, it's broken.

iapilgrim
Champ in-the-making
Champ in-the-making
I got the same error.
Are there any idea?

simon
Champ in-the-making
Champ in-the-making
That specific example doesn't work in the SDK so try one of the others…

dafyddjames
Champ in-the-making
Champ in-the-making
Hmm, two years later I'm still having exactly the same problem.

Relevant JIRA: ALFCOM-1531

amitabhandari1
Champ in-the-making
Champ in-the-making
Hi Finner,

Example is going to work few changes. Here are the steps

Step 1 : Go to executeImpl(Action action, NodeRef actionedUponNodeRef) method of LoggerActionExecuter class and make the highlighted changes:
         protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
          {
                // Get the log message parameter
                // String logMessage = (String)action.getParameterValue(PARAM_LOG_MESSAGE);
                String logMessage = "yeppe Logger Started!!!";

           }
Step 2 : Go to addParameterDefinitions(List<ParameterDefinition> paramList) method and make the highlighted changes:
           protected void addParameterDefinitions(List<ParameterDefinition> paramList)
             {
              // Specify the parameters
              paramList.add(new ParameterDefinitionImpl(PARAM_LOG_MESSAGE, DataTypeDefinition.TEXT, false, getParamDisplayLabel
                                                 (PARAM_LOG_MESSAGE)));
                   paramList.add(new ParameterDefinitionImpl(PARAM_LOG_LEVEL, DataTypeDefinition.TEXT, false, getParamDisplayLabel
                                                 (PARAM_LOG_MESSAGE)));
            }
Step 3:  Compile and start the server
Step 4: Go to RunAction and click Logger Action  . Click Finish
Step 5:  Check tomcat console . You will  find message like
           15:17:44,158 User:admin INFO  [org.alfresco.sample] yeppe Logger Started!!!

Thanks,
Amita Bhandari
Cignex Technologies Pvt Ltd