CSV Import Error

Nous essayons de faire OpenKM aussi intuitif que possible, mais tout avis est bienvenu.

Moderator: dedisoft

Forum rules
Avant de poser une question, merci de regarder la documentation du wiki ou d'utiliser la fonction recherche du forum. Et rappelez vous que nous n'avons ni boule de cristal ni possibilité de lire dans les pensées, aussi pensez à spécifier quelle version d'OpenKM vous utilisez ainsi que la version du navigateur web et du système d'exploitation. Pour de plus amples informations lisez Comment reporter un bug efficacement (anglais).
Post Reply
gerardo
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Fri Apr 13, 2018 11:37 am

CSV Import Error

Post by gerardo » Fri Apr 13, 2018 12:19 pm

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

jllort
Moderator
Moderator
Posts: 10347
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: CSV Import Error

Post by jllort » Sat Apr 14, 2018 8:52 am

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest