Hello,
I have coded a module which could get the root folder but I got stuck at the searching and download a document stream by using field values of a LF template.
Could anyone share a .net sample for or any advise? Thanks much.
Here is my code so far:
using PortCMIS;
using PortCMIS.Client;
using PortCMIS.Client.Impl;
using PortCMIS.Data;
using System.Collections.Generic;
using System.Net;
namespace CMISpoc.Utils
{
static public class CMISaccess
{
static public void MainCMISaccess(string pCMISurl)
{
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
SessionFactory factory = SessionFactory.NewInstance();
Dictionary<string, string> parameters = new Dictionary<string, string>
{
[SessionParameter.User] = @"domain\svcLaserfiche_test",
[SessionParameter.Password] = "testPw",
[SessionParameter.BrowserUrl] = "http://Localhost/lfcmis/browser",
[SessionParameter.BindingType] = BindingType.Browser,
[SessionParameter.RepositoryId] = "ChplTst"
};
ISession session = factory.CreateSession(parameters);
IFolder rootFolder = session.GetRootFolder();
}
...
I guess that the key thing is constructing a CMIS query. The problem is that I keep getting error when doing search with field:name parameters.
SELECT * FROM cmis:document WHERE lf:templateName = 'MTR' AND field:PoNumber = '000576'
"exception": "invalidArgument",
"message": "The search is not supported because of field:PoNumber."