Bookmarck samples

Basics

On most methods you'll see parameter named "nodeId". The value of this parameter can be a valid document, folder, mail or record UUID or path.

Example of nodeId:

  • Using UUID -> "f123a950-0329-4d62-8328-0ff500fd42db";
  • Using path -> "/okm:root/logo.png"

Methods

getUserBookmarks

Description:

MethodReturn valuesDescription

getUserBookmarks()

List<Bookmark>

Returns a list of all the bookmarks of a user.

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, username, password); try { List<Bookmark> list = ws.getUserBookmarks();
foreach(Bookmark bookmark in list)
{
Console.WriteLine(bookmark.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

createBookmark

Description:

MethodReturn valuesDescription

createBookmark(String nodeId, String name)

void

Create a new bookmark.

The value of the nodeId is the UUID or PATH of the node ( document, folder, mail or record ).

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, username, password); try { Bookmark bookmark = ws.createBookmark("/okm:root/myDoc.docx", "test bookmark");
Console.WriteLine(bookmark.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

renameBookmark

Description:

MethodReturn valuesDescription

renameBookmark(int bookmarkId, String name)

Bookmark

Rename a bookmark

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, username, password); try { int bookmarkId = 1;
Bookmark bookmark = ws.renameBookmark(bookmarkId, "new name bookmark");
Console.WriteLine(bookmark.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteBookmark

Description:

MethodReturn valuesDescription

deleteBookmark(int bookmarkId)

void

Delete a bookmark.

 

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, username, password); try { int bookmarkId = 1;
ws.deleteBookmark(bookmarkId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getBookmark

Description:

MethodReturn valuesDescription

getBookmark(int bookmarkId)

Bookmark

get a bookmark

 

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, username, password); try { int bookmarkId = 1;
Bookmark bookmark = ws.getBookmark(bookmarkId);
Console.WriteLine(bookmark.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }