Skip to content
Other versions

Loading…

Bookmark samples

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.

getUserBookmarks

Description:

Method Return values Description
getUserBookmarks() List 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());
}
}
}
}

Description:

Method Return values Description
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());
}
}
}
}

Description:

Method Return values Description
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());
}
}
}
}

Description:

Method Return values Description
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());
}
}
}
}

Description:

Method Return values Description
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());
}
}
}
}