Search by date range using API

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
kenwong730
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Tue Aug 11, 2020 7:45 am

Search by date range using API

Post by kenwong730 »

Hi all,
I am trying to use API of community version and face a problem below.

I wanna to search file by date range and it returns an unknown exception. Here is the code:

Code: Select all

DateTime dateFF = new DateTime(2020, 8, 6);
DateTime dateTT = new DateTime(2020, 8, 6);

QueryParams qParams = new QueryParams();
qParams.domain = QueryParams.DOCUMENT;
qParams.lastModifiedFrom = dateFF;
qParams.lastModifiedTo = dateTT;  

foreach (QueryResult qr in ws.find(qParams))
{
       System.Console.WriteLine(qr.node.path);
}
the exception:

Code: Select all

com.openkm.sdk4csharp.exception.OKMRestException: SearchImpl (find)
SearchImpl (find): 6/8/2020 00:00:00

com.openkm.sdk4csharp.exception.UnknowException: SearchImpl (find): 6/8/2020 00:00:00
   at com.openkm.sdk4csharp.impl.SearchImpl.find(QueryParams qp)
   at com.openkm.sdk4csharp.impl.SearchImpl.find(QueryParams qp)
   at com.openkm.sdk4csharp.OKMWebservice20.find(QueryParams qp)
   at OKMRest.Program.Main(String[] args) in C:\Users\kenwong\Desktop\OKM\okmtest2\okmtest2\Program.cs:line 73
pherrera
Junior Boarder
Junior Boarder
Posts: 36
Joined: Wed Oct 12, 2016 1:41 pm

Re: Search by date range using API

Post by pherrera »

Hi,

There is indeed a problem with the dates, thanks for sharing.
We will work on this for the next version of the SDK.
Post Reply