AnsweredAssumed Answered

Action in Javascript and Evaluator

Question asked by fabienm on Jun 6, 2008
Latest reply on Jul 6, 2010 by rafaelscg
Hi,

I created an action which launches a Javascript and which run well.

This is the config-client code :

   <config evaluator="node-type" condition="dev:_dev_UC">
      <actions>
         <action-group id="document_browse_menu">
            <action idref="valid_content" />
         </action-group>
      </actions>
   </config>
   <config>
      <actions>
         <action id="valid_content">
                 <image>/images/icons/valide_content.gif</image>
                           <label>Valid Content</label>
            <script>workspace://SpacesStore/scripts-valid-content</script>
            <params>
                 <param name="noderef">#{actionContext.nodeRef}</param>
            </params>
         </action>                  
      </actions>
   </config>

Now I want add an custom evaluator to my action.
So I add this row :

<action id="valid_content">

<evaluator>
   org.newDevelopmentManagement.ValidContentEvaluator
</evaluator>

</action>   
     

and the class org.newDevelopmentManagement.ValidContentEvaluator which implents then ActionEvaluator interfaces.

The  AMP file build and WAR update have been in success.  All files are in a good place.
But when I run Alfresco I have some error:

ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org_newDevelopmentManagement_configBootstrap' defined in file [C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org.newDevelopmentManagement\module-context.xml]: Invocation of init method failed; nested exception is org.alfresco.config.ConfigException: Unable to construct action 'valid_content' evaluator classname: org.newDevelopmentManagement.ValidContentEvaluator
Caused by:
org.alfresco.config.ConfigException: Unable to construct action 'valid_content' evaluator classname: org.newDevelopmentManagement.ValidContentEvaluator
   at org.alfresco.web.config.ActionsElementReader.parseActionDefinition(ActionsElementReader.java:222)
   at org.alfresco.web.config.ActionsElementReader.parse(ActionsElementReader.java:92)
   at org.alfresco.config.xml.XMLConfigService.parseConfigElement(XMLConfigService.java:258)
   at org.alfresco.config.xml.XMLConfigService.parse(XMLConfigService.java:114)
   at org.alfresco.config.BaseConfigService.appendConfig(BaseConfigService.java:204)
   at org.alfresco.web.config.WebClientConfigBootstrap.init(WebClientConfigBootstrap.java:72)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1160)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1122)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


I try with no result, to change the name of package. My function "evalutor" in the class ValidContentEvalluator is simple, (it just return true)

I don't know why Alfresco don't want run. May be I forgot something !!

Thanks for your answers.

Fabien.

Outcomes