• Trouble working with Util functions and Repository.ROOT

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #20694  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
 #20983  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 ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.