Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-11349

CLONE - 4.1.7.7HF calls onContentUpdate policies twice when using ftp or cifs (once with webdav)

    Details

      Description

      The FTP/CIFS behaviour is a regression caused by HotFix for MNT-10966

      How to reproduce?
      =================
      1) create a plain vanilla 4.1.7.7 (linux pg tomcat)
      2) in your

      tomcat/shared/classes
      

      create a new path:

      mkdir -p org/alfresco/repo/jscript/
      

      3) put a javascript onContentUpdateTest.js file at:

      tomcat/shared/classes/org/alfresco/repo/jscript
      

      with content:

      logger.warn("The content has been updated");
      

      (a longer version is attached)

      4) define a context in

      tomcat/shared/classes/alfresco/extension
      

      with content:

      <?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="on" 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>org/alfresco/repo/jscript/onContentUpdateTest.js</value>
      		            	</constructor-arg>
      		                </bean>
      			</property>
      	  </bean>        
              </property>
      </bean>
      </beans>
      

      5) confirm that content creation triggers the log line similar to:

      2014-03-19 14:58:01,597  WARN  [repo.jscript.ScriptLogger] [http-8080-1] The content has been updated
      

      using webdav:

      a) linux webdav client:

      mount -t davfs -o username=admin http://localhost:8080/alfresco/webdav /mntdav
      echo "hello" >> /mntdav/test1.txt
      

      b) win7 webdav client

      6) now try using other methods

      a) using Explorer
      b) using Share
      c) linux CIFS client

      mount -t cifs -o username=admin,password=admin //localhost/alfresco /mntcifs
      echo "hello" >> /mntcifs/test2.txt
      

      d) using FTP

      Results:
      =======
      The rule is trigered ONCE when using webdav, but TWICE when using other methods.

      Webdav case:

      2014-04-10 17:52:14,472  WARN  [repo.jscript.ScriptLogger] [http-8080-2] The content has been updated
      

      CIFS case:

      2014-04-10 17:52:30,185  WARN  [repo.jscript.ScriptLogger] [AlfJLANWorker5] The content has been updated
      2014-04-10 17:52:30,280  WARN  [repo.jscript.ScriptLogger] [AlfJLANWorker5] The content has been updated
      

      Expected result:
      ================
      The rule is trigered ONCE whatever upload method we choose and we see a log line similar to:

       2014-03-19 14:58:01,597  WARN  [repo.jscript.ScriptLogger] [http-8080-1] The content has been updated
      

      only once.
      There should not be any difference between CIFS, FTP and webdav (and share and explorer)

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  amadon Alex Madon [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel