Page 1 of 1

CSV Import Error

Posted: Fri Apr 13, 2018 12:19 pm
by gerardo
Hi,
I'm trying to run a script to import metadata from an excel csv file. Unfortunately it does not work. OpenKM is installed on a Ubuntu Server edition.

Script Error:

bsh.EvalError: Sourced file: inline evaluation of: ``import java.io.FileReader; import java.io.Reader; import java.util.Iterator; . . . '' : Error in method invocation: Method getDocument() not found in class'com.openkm.bean.QueryResult' : at Line: 58 : in file: inline evaluation of: ``import java.io.FileReader; import java.io.Reader; import java.util.Iterator; . . . '' : queryResult .getDocument ( )

Script Output:
1>>>> /okm:root/doc2.txt

Some suggestions, where am I wrong?

Thanks for helping

Re: CSV Import Error

Posted: Sat Apr 14, 2018 8:52 am
by jllort
The error is clear the method getDocument does not exist into the class QueryResult ( if you take a look at the queryResult class https://github.com/openkm/document-mana ... esult.java should use getNode() method ).

Code: Select all

You should do something like
if (queryResult.getNode() instanceof Document) {
  Document doc = (Document) queryResult.getNode()
}
Seems the code you have applied it corresponds to previous OpenKM version. Can you tell us from where did you copy it?