• Search by date range using API

  • Nous essayons de faire OpenKM aussi intuitif que possible, mais tout avis est bienvenu.
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).
 #50352  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
 #50373  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.

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.