• Read File names under a folder using .rep format openkm

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #53548  by nishant8900
 
Hi all,

I need to read all files under a separate folder. I have given the path , when i am trying to read it won't work.
Code: Select all
import com.openkm.api.OKMFolder;
import com.openkm.bean.ContentInfo;

ContentInfo ci = OKMFolder.getInstance().getContentInfo(null, "/okm:root/testfolder");
 String doc=  ci.getDocuments();
print("$$",doc) 
returns null values. Please provide some suggestion guys.

Thanks
 #53568  by nishant8900
 
Hi ,

Even though i tried with that OKMDocument.getInstance().getChildren is not working. Here i am tying as
Code: Select all
for (Document doc : OKMDocument.getInstance().getChildren(null, "/okm:root/testrecord/")) {;
  System.out.println(doc);
  actMap.put("filename",doc);
}
Showing error as
Code: Select all
Class: net.sf.jasperreports.engine.fill.JRExpressionEvalException
Message: Error evaluating expression for source text: $F{filename}
Guide me I don't know how to proceed further.

Thanks
 #53584  by nishant8900
 
Hi ,

I achieved the output for reading files under folder in scripting. I need this for report(.rep) format file. Here is the scripting code,
Code: Select all
import com.openkm.bean.*;
import com.openkm.util.*;
import com.openkm.api.*;

ContentInfo ci = OKMFolder.getInstance().getContentInfo(null,"/okm:root/test");
print(ci.getFolders()+"<br>");
print(ci.getDocuments()+"<br>");
print(ci+"<br>");

for (Document doc : OKMDocument.getInstance().getChildren(null, "/okm:root/test/test_sample_record/")) {
    print(doc.path+"<br>");
}
I need this for my report too. Pls guide for me further.

Thanks
 #53613  by jllort
 
Debug this class https://github.com/openkm/document-mana ... rvlet.java about how parameters are sent in from the UI to the server.

I suggest take UsersLogin report as a template and debug how data is moved from UI into a map or parameters and then used in the scripting https://docs.openkm.com/kcenter/view/ok ... -pack.html

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.