Page 1 of 1

Scripting and WebDAV

PostPosted:Wed Mar 21, 2012 8:09 pm
by ngovinda
I have created a script in a certain folder, so that when a new folder is created it gets renamed, see code below:
Code: Select all
import javax.jcr.*;
import com.openkm.core.*;
import com.openkm.bean.*;
import com.openkm.api.OKMDocument;

String userID = session.getUserID();
String parentDir = com.openkm.util.FileUtils.getParent(eventNode.getPath());
String docName = com.openkm.util.FileUtils.getName(eventNode.getPath());

if (eventType.equals("CREATE_FOLDER")) {
        session.move(eventNode.getPath(), parentDir + "/" +  userID + " " + docName);
        session.save();
}
This works well when OpenKM is accessed via a web browser.

But when I use a WebDAV client (e.g. NetDrive) this script does not work.

I am using version 5.1.7, build 7085.

Any one knows why this happens.

Thanks in advance

Govinda

Re: Scripting and WebDAV

PostPosted:Sun Mar 25, 2012 4:04 pm
by pavila
You need to use a more recent version of OpenKM, for example 5.1.9. But I recommend you a recent night build from http://integration.openkm.com/5.1.x/.

Re: Scripting and WebDAV

PostPosted:Tue Mar 27, 2012 7:18 am
by ngovinda
I did try the newer versions (5.1.8, 5.1.8, etc. also the night build) but the script does not run on these newer versions, see my other post related to this

Regards - Govinda

Re: Scripting and WebDAV

PostPosted:Tue Mar 27, 2012 6:32 pm
by pavila
With newer versions I mean 5.1.9, or even better 5.1.10-SNAPSHOT from http://integration.openkm.com/5.1.x/.