Page 1 of 1

Trouble working with Util functions and Repository.ROOT

PostPosted:Thu Jan 10, 2013 2:52 pm
by sankar_m
I'm using OpenKm 5.1.10.

I'm having trouble on calling these following functions..
Code: Select all
com.openkm.util.FileUtils.getName(eventNode.getPath()); and
Node rootNode = session.getRootNode().getNode(Repository.ROOT);
for example:
Code: Select all
Node rootNode = session.getRootNode().getNode(Repository.ROOT);
String shellCmd = "sh /home/hcserver/debug.sh" + " = Special Directory " + parentDir;
java.lang.Process p = java.lang.Runtime.getRuntime().exec(shellCmd);
Node myNode = session.getNode(parentDir + "/" + docName);
The codes placed below Repository.ROOT are not getting called.
But when I use TRASH in place of ROOT it works fine.

These are the header files I'm using
Code: Select all
import javax.jcr.*;
import com.openkm.core.*;
import com.openkm.bean.*;
import com.openkm.api.OKMDocument;
import com.openkm.module.base.*;
import com.openkm.bean.Document;
import com.openkm.util.*;
I would appreciate any help..
Thanks
SankarM

Re: Trouble working with Util functions and Repository.ROOT

PostPosted:Sat Jan 12, 2013 5:28 pm
by jllort
You're registering on some node or executing from scripting view ?

Re: Trouble working with Util functions and Repository.ROOT

PostPosted:Fri Jan 18, 2013 12:08 pm
by sankar_m
Thanks for your reply.. And sorry for my late reply.. I'm registering in a node named Test.

Thanks

Re: Trouble working with Util functions and Repository.ROOT

PostPosted:Sun Jan 20, 2013 9:49 am
by jllort
It's really difficult to debug in scripting. I suggest you create some logger ( file ) or make some system.out.println to debug the code. For what I seen the code seems right, but in this cases the only solution is try to debug or log the execution. In version 6.x is more easy building your own smart task or with crontab ( which can use jar file and then debug it into server ).