AnsweredAssumed Answered

How to add custom behaviour to AVM Store?

Question asked by dfundak on Jan 21, 2009
Latest reply on Dec 3, 2009 by skuro
Hi, I'm trying to execute javascript every time file updated at wcm webproject.
I'm trying to add custom javascript behaviour to trigger update of content in AVM store.

I've added bean like this:


<bean id="onUpdateDoc" class="org.alfresco.repo.policy.registration.ClassPolicyRegistration" parent="policyRegistration">
  <property name="policyName">
    <value>{http://www.alfresco.org}onContentUpdate</value>
        </property>
        <property name="className">
            <value>{http://www.alfresco.org/model/content/1.0}content</value>
        </property>
        <property name="behaviour">
           <bean class="org.alfresco.repo.jscript.ScriptBehaviour" parent="scriptBehaviour">
                        <property name="location">
                                <bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
                                <constructor-arg>
                                        <value>alfresco/extension/scripts/onUpdateNode.js</value>
                                </constructor-arg>
                                </bean>
                        </property>
           </bean>
        </property>
    </bean>

When I'am updating files in dcm script get triggered.
But at wcm it doesn't.

Are there any way to trigger update/create content at wcm?

Thanks, sorry for my english.

Outcomes