-
Type:
Hot Fix Request
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 4.1.7.3
-
Fix Version/s: 4.1.7.7
-
Component/s: Repository
-
Labels:None
-
Environment:4.1.7 linux pg tomcat
-
Bug Priority:
-
Hot Fix Version:4.1.7.7
-
ACT Numbers:
151121
-
Regression Since:
How to reproduce?
=================
1) create a plain vanilla 4.1.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 various methods:
a) using Explorer
b) using Share
c) using linux CIFS client
mount -t cifs -o username=admin,password=admin //localhost/alfresco /mnt echo "hello" >> /mnt/test2.txt
d) using ftp upload
6) now try using webdav:
a) linux webdav client:
mount -t davfs -o username=admin http://localhost:8080/alfresco/webdav /mnt echo "hello" >> /mnt/test1.txt
b) win7 webdav client
Results:
=======
The rule is NOT trigered when using webdav, no log line is appended to catalina.out.
Expected result:
================
The rule is trigered 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
There should not be any difference between CIFS and webdav.
Notes:
======
a) This is a regression as in 4.0.1, a content creation used to triger the rule. This breaks the customer code.
b) In webdav if you update the content, then you do see the log line.
In cifs you see the log line bot at create and at update time.
c) optionally you can also debug in log4j repo.content.ContentServiceImpl
DEBUG [repo.content.ContentServiceImpl] [http-bio-8080-exec-9] Content property updated: Node Name: MyFile.txt Property: {http://www.alfresco.org/model/content/1.0}content Is new: true Before: null After: contentUrl=store://2014/3/19/17/23/f5b4c090-c5af-4544-99a8-09eb985194c1.bin|mimetype=application/octet-stream|size=321|encoding=UTF-8|locale=en_US_|id=276
- is cloned by
-
MNT-11342 CLONE - 4.1.7 breaks onContentUpdate policies when using webdav
- Closed
- is duplicated by
-
RM-2396 Upload record via WebDAV fails with org.alfresco.repo.security.permissions.AccessDeniedException
- Done
- is related to by
-
MNT-15801 onContentUpdate policies not working for updates via webdav
- Closed
-
MNT-11185 4.1.7.7HF calls onContentUpdate policies twice when using ftp or cifs (once with webdav)
- Closed
-
MNT-17608 Empty document created in Alfresco when uploading over WebDAV with versionable aspect applied
- Closed