Search samples

Basics

Most methods use QueryParams here there're some tips about how to use them.

VariablesTypeAllow wildcardsRestrictionsDescription

domain

long

No.

Available values:

  • QueryParams.DOCUMENT
  • QueryParams.FOLDER
  • QueryParams.MAIL
  • QueryParams.RECORD

By default the value is set to QueryParams.DOCUMENT.

For searching documents and folders use value:

(QueryParams.DOCUMENT | QueryParams.FOLDER) 

Restrict the search to a node type.

author

String

No.

The value must be a valid userId.

Filter by creator user.

name

String

Yes.

 

Filter by node name.

title

String

Yes.

  Filter by title name.

keywords

List<String>

Yes.

 

Filter by keywords.

categories

List<String>

No.

Values should be categories UUID, not use path value.

Filter by categories.

content

 

Yes.

 

Filter by binary content.

mimeType

 

No.

The value should be a valid and registered MIME type.

Only can be applied to documents node.

Filter by document MIME type.

language

 

No.

The value should be a valid language.

Only can be applied to documents node.

Filter by document language.

folder

 

No.

When empty is used by default "/okm:root" node.

The value should be a valid UUID, not use a path value.

Filter by a folder.

folderRecursive

Boolean

No.

It only makes sense to set this variable to true when the variable folder is not empty.

Enable filter recursively by a folder.

lastModifiedFrom

Calendar

No.

 

Filter by nodes created after a date.

lastModifiedTo

Calendar

No.

 

Filter by nodes created before a date.

mailSubject

String

Yes.

Only applies to mail nodes.

Filter by mail subject field.

mailFrom

String

Yes.

Only applies to mail nodes.

Filter by mail from the field.

mailTo

 

Yes.

Only applies to mail nodes.

Filter by mail to the field.

notes

 

Yes.

 

Filter by notes.

properties

Dictionary<String, String>

Yes on almost.

On metadata field values like "date" cannot be applied wildcards.

The dictionary of the properties is composed of pairs:

('metadata_field_name','metada_field_value")

For example:

Dictionary<String, String> properties = new Dictionary<String, String>();
properties.Add("okp:consulting.name", "name value")

 Filtering by a range of dates:

 DateTime date = DateTime.Now;// today
 DateTime to = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Millisecond); 
 DateTime from = to.AddDays(-3);// three days before
 Dictionary<String,String> properties = new  Dictionary<String,String>();
 properties.Add("okp:consulting.date", ISO8601.formatBasic(from)+","+ISO8601.formatBasic(to));

When filtering by a range of dates you must set both values ( from and to ), otherwise, the filter will be ignored from OpenKM side.

 To filtering by a metadata field of type multiple like this:

<select label="Multiple" name="okp:consulting.multiple" type="multiple">
  <option label="One" value="one"/>
  <option label="Two" value="two"/>
  <option label="Three" value="three" />
</select>

 You should do:

properties.Add("okp:consulting.multiple", "one;two");

 Where "one" and "two" are valid values and character ";" is used as a separator.

Filter by metadata group values.

 

The search operation is done only by AND logic.

Wildcard examples:

VariableExampleDescription

name

test*.html

Any document that starts with the characters "test" and ends with characters ".html"

name

test?.html

Any document that starts with the characters "test" followed by a single character and ends with characters ".html"

name

?test*

Any document where the first character doesn't matter but is followed by the characters, "test".

Suggested code sample

First, you must create the webservice object:

OKMWebservices ws = OKMWebservicesFactory.newInstance(host);

Then should login using the method "login". You can access the "login" method from webservice object "ws" as is shown below:

ws.login(user, password);

Once you are logged with the webservices the session is keep in the webservice Object. Then you can use the other API method

At this point you can use all the Search methods from "search" class as is shown below:

ws.search.find(qParams, null)

Methods

find

Description:

MethodReturn valuesDescription

find(QueryParams queryParams, String propertiesPlugin)

List<QueryResult>

Returns a list of results filtered by the values of the queryParams parameter.


The parameter "propertiesPlugin" must be a canonical class name of the class which implements the NodeProperties interface.

Retrieving entire Objects ( Document, Folder, Record, Mail ) from REST can take a lot of time - marshaling and unmarshalling process - while you are only interesting on using only a few Objects variables. If it's your case you can use NodeProperties classes for retrieving the Object variables what you really need.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);             
try {
ws.login(user, password); QueryParams qParams = new QueryParams(); qParams.domain = QueryParams.DOCUMENT; qParams.name = "test*.html"; foreach (QueryResult qr in ws.search.find(qParams, null)) { System.Console.WriteLine(qr); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findPaginated

Description:

MethodReturn valuesDescription

findPaginated(QueryParams queryParams, int offset, int limit, String propertiesPlugin)

ResultSet

Returns a list of paginated results filtered by the values of the queryParams parameter.

The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" says to skip that many results before the beginning to return results.
  • The parameter "propertiesPlugin" must be the canonical class name of the class which implements the NodeProperties interface.

For example, if your query have 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

Retrieving entire Objects ( Document, Folder, Record, Mail ) from REST can take a lot of time - marshaling and unmarshalling process - while you are only interesting on using only a few Objects variables. If it's your case you can use NodeProperties classes for retrieving the Object variables what you really need.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
try {
ws.login(user, password); QueryParams qParams = new QueryParams(); qParams.domain = QueryParams.DOCUMENT; qParams.name = "test*.html"; ResultSet rs = ws.search.findPaginated(qParams, 0, 10, null); System.Console.WriteLine("Total results:" + rs.total); foreach (QueryResult qr in rs.results) { System.Console.WriteLine(qr); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findSimpleNodeBasePaginated

Description:

MethodReturn valuesDescription

findSimpleNodeBasePaginated(QueryParams queryParams, int offset, int limit)

SimpleNodeBaseResultSet

Returns a list of SimpleNodeBase paginated results filtered by the values of the queryParams parameter.

Because the results of the findSimpleNodeBasePaginated method are objects of type SimpleNodeBase, this method is about 60-70% faster than the other search methods ( these metrics should be taken as orientative values because depends on hardware and the specific scenario where application is running). The other search methods returns objects of type Node what comes with a full node data, the SimpleNodeBase object provide less data but in almost cases should be enought. Specially when the limit is a higher value you will appreciate the difference in the perfomance.

The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" says to skip that many results before the beginning to return results.

For example if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try {
ws.login(user, password); QueryParams qParams = new QueryParams(); qParams.domain = QueryParams.DOCUMENT; qParams.name = "test*"; SimpleNodeBaseResultSet snbrs = ws.search.findSimpleNodeBasePaginated(qp, 0, 10); System.Console.WriteLine("Total results:" + snbrs.total); foreach (SimpleNodeBase snb in snbrs.results) { System.Console.WriteLine(snb.toString()); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getKeywordMap

Description:

MethodReturn valuesDescription

getKeywordMap(String[] filter)

Dictionary<String, int>

Returns a map of keywords with its count value filtered by other keywords.

Example:

  • Doc1.txt has keywords "test", "one", "two".
  • Doc2.txt has keywords "test", "one"
  • Doc3.txt has keywords "test", "three".

The results filtering by "test" -> "one", "two", "three".

The results filtering by "one" -> "test", "two".

The results filtering by "two" -> "test", "one".

The results filtering by "three" -> "test".

The results filtering by "one" and "two" -> "test".

 

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);  
             try {
ws.login(user, password); // All keywords without filtering System.Console.WriteLine("Without filtering"); Dictionary<String, int> keywords = ws.search.getKeywordMap(new String[]{"test", "test2"});
                 foreach (KeyValuePair<string,int> kvp in keywords) { System.Console.WriteLine(kvp.Key + " is used :" + kvp.Value); }
                 // Keywords filtered System.Console.WriteLine("Filtering"); keywords = ws.search.getKeywordMap(new String[]{"test"});
                 foreach (KeyValuePair<string,int> kvp in keywords) { System.Console.WriteLine(kvp.Key + " is used :" + kvp.Value); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getCategorizedDocuments

Description:

MethodReturn valuesDescription

getCategorizedDocuments(String categoryId)

List<Document>

Retrieves a list of all documents related with a category.

The values of the categoryId parameter should be a category folder UUID or path.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);  
             try {
ws.login(user, password); foreach (Document doc in ws.search.getCategorizedDocuments("50b7a5b9-89d2-430e-bbc9-6a6e01662a71")) { System.Console.WriteLine(doc); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

saveSearch

Description:

MethodReturn valuesDescription

saveSearch(QueryParams params)

Long

Saves search parameters.

The variable queryName of the parameter params should have to be initialized.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);             
             try {
ws.login(user, password); QueryParams qParams = new QueryParams(); qParams.domain = QueryParams.DOCUMENT; qParams.name = "test*.html";
                 foreach (QueryResult qr in ws.search.find(qParams)) { System.Console.WriteLine(qr); }
                 // Save the search to be used later qParams.queryName = "sample search"; ws.search.saveSearch(qParams); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

updateSearch

Description:

MethodReturn valuesDescription

updateSearch(QueryParams params)

void

Updates a previously saved search parameters.

Ir can only be updated as a saved search created by the same user who's executing the method.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); foreach (QueryParams qParams in ws.search.getAllSearchs()) { if (qParams.queryName.Equals("sample search")) { // Change some value. qParams.name = "admin*.html"; ws.search.updateSearch(qParams); } } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getSearch

Description:

MethodReturn valuesDescription

getSearch(int qpId)

QueryParams

Gets saved searches parameters.

It can only be retrieved as a saved search created by the same user who's executing the method.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); int qpId = 1; // Some valid search id QueryParams qParams = ws.search.getSearch(qpId); System.Console.WriteLine(qParams); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getAllSearchs

Description:

MethodReturn valuesDescription

getAllSearchs()

List<QueryParams>

Retrieves a list of all saved search parameters.

It can only retrieve the list of the saved searches created by the same user who's executing the method.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); foreach (QueryParams qParams in ws.search.getAllSearchs()) { System.Console.WriteLine(qParams.queryName); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteSearch

Description:

MethodReturn valuesDescription

deleteSearch(int qpId)

void

Deletes a saved search parameters.

It can only be deleted as a saved search created by the same user who's executing the method.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); int qpId = 1; // Some valid search id ws.search.deleteSearch(qpId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findByQueryPaginated

Description:

MethodReturn valuesDescription

findByQueryPaginated(int offset, int limit, String query, String propertiesPlugin) 

ResultSet

Returns a list of paginated results filtered by the values of the parameters.

 

The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" says to skip that many results before the beginning to return results.
  • The parameter "propertiesPlugin" must be the canonical class name of the class which implements the NodeProperties interface.

For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); ResultSet rs = ws.search.findByQueryPaginated(0, 10 ,"name:t*.pdf", null);
System.Console.WriteLine("Total results:" + rs.total);

foreach (QueryResult qr in rs.results)
{
System.Console.WriteLine(qr);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findSimpleNodeBaseByQueryPaginated

Description:

MethodReturn valuesDescription

findSimpleNodeBaseByQueryPaginated(String query, int offset, int limit)

SimpleNodeBaseResultSet

Returns a list of paginated results filtered by the values of the query parameter.

The syntax to use in the statement parameter is the pair 'field:value'. For example:

  • "name:grial" is filtering field name by word grial.

More information about lucene sintaxis at Lucene query syntax.

The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" says to skip that many results before the beginning to return results.

For example if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); SimpleNodeBaseResultSet snbr = ws.search.findSimpleNodeBaseByQueryPaginated("text:grial AND name:t*.pdF", 0, 10);

foreach (SimpleNodeBase nodeBase in snbr.results)
{
if(nodeBase != null)
{
System.Console.WriteLine(nodeBase.toString());
}
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findByQuery

Description:

MethodReturn valuesDescription

findByQuery(String query, String propertiesPlugin)

List<QueryResult>

Returns a list of results filtered by the values of the queryParams parameter.


The parameter "propertiesPlugin" must be a canonical class name of the class which implements the NodeProperties interface.

Retrieving entire Objects ( Document, Folder, Record, Mail ) from REST can take a lot of time - marshaling and unmarshalling process - while you are only interesting on using only a few Objects variables. If it's your case you can use NodeProperties classes for retrieving the Object variables what you really need.

The syntax to use in the statement parameter is the pair 'field:value'. For example:

  • "name:grial" is filtering field name by word grial.

More information about lucene sintaxis at Lucene query syntax.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try {
ws.login(user, password); foreach (QueryResult qr in ws.search.findByQuery("keyword:test AND name:t*.pdf", null)) { System.Console.WriteLine(qr); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findAllDefaultByNodeClass

Description:

MethodReturn valuesDescription

findAllDefaultByNodeClass(long ncId)

List<QueryParams>

Retrieve a list of saved searches of a NodeClass.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password);
long ncId = 1; List<QueryParams> queryParams = ws.search.findAllDefaultByNodeClass(ncId);
foreach (QueryParams qParams in queryParams)
{
System.Console.WriteLine(qParams.queryName);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findWithMetadata

Description:

MethodReturn valuesDescription

findWithMetadata(QueryParams _params, String propertiesPlugin, List<String> groups)

List<QueryResult>

Returns a list of results with metadata values filtered by the queryParams parameter.

  • The parameter "propertiesPlugin" must be a canonical class name of the class which implements the NodeProperties interface.
  • The parameter "groups" must be valid metadata group names.

Retrieving entire Objects ( Document, Folder, Record, Mail ) from REST can take a lot of time - marshalling and unmarshalling process - while you are only interesting on using only few Objects variables. If its your case you can use NodeProperties classes for retrieving the Object variables what you really need.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password);
// QueryParams
QueryParams qp = new QueryParams();
qp.folderRecursive = true;
qp.domain = QueryParams.DOCUMENT | QueryParams.FOLDER | QueryParams.RECORD | QueryParams.MAIL;
qp.name = "test*";

// Properties
Dictionary<string, string> properties = new Dictionary<string, string>();
properties.Add("okp:consulting.name", "test");
qp.properties = properties;

// Groups
List<string> groups = new List<string>();
groups.Add("okg:consulting");

List<QueryResult> queryResults = ws.search.findWithMetadata(qp, null, groups);
foreach (QueryResult qResult in queryResults)
{
System.Console.WriteLine(qResult.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

findWithMetadataPaginated

Description:

MethodReturn valuesDescription

findWithMetadataPaginated(QueryParams queryParams, int offset, int limit, String propertiesPlugin, List<String> groups)

ResultSet

Returns a list of paginated results with metadata values filtered by the queryParams parameter.

The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" says to skip that many results before the beginning to return results.
  • The parameter "propertiesPlugin" must be the canonical class name of the class which implements the NodeProperties interface.
  • The parameter "groups" must be valid metadata group names.

For example if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

Retrieving entire Objects ( Document, Folder, Record, Mail ) from REST can take a lot of time - marshaling and unmarshalling process - while you are only interested in using only a few Object variables. If it's your case you can use NodeProperties classes for retrieving the Object variables that you really need.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password);
// QueryParams
QueryParams qp = new QueryParams();
qp.domain = QueryParams.DOCUMENT | QueryParams.FOLDER | QueryParams.RECORD | QueryParams.MAIL;
qp.name = "test*";

// Properties
Dictionary<string, string> properties = new Dictionary<string, string>();
properties.Add("okp:consulting.name", "test");
qp.properties = properties;

// Groups
List<string> groups = new List<string>();
groups.Add("okg:consulting");

ResultSet resulSet = ws.search.findWithMetadataPaginated(qp, 0, 10, null, groups);
System.Console.WriteLine("Total results: " + rs.total.ToString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getMimeTypes

Description:

MethodReturn valuesDescription

getMimeTypes()

List<MimeType>

Retrieves a list of mimetypes.

Only will be retrieved the list of the mimeTypes that may be used in the search.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password);
foreach (MimeType mimeType in ws.search.getMimeTypes())
{
System.Console.WriteLine(mimeType.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }