UserConfig samples

Basics

Suggested code sample

First, you must create the web service object:

OKMWebservices ws = OKMWebservicesFactory.newInstance(host);

Then you should log in using the method "login". You can access the "login" method from the web service object "ws" as shown below:

ws.login(user, password);

Once you are logged in with the web services, the session is kept in the web service object. Then you can use the other API methods.

At this point you can use all the Activity methods from the "userConfig" class as shown below:

ws.userConfig.getConfig();

Methods

getConfig

Description:

MethodReturn valuesDescription

getConfig()

UserConfig

Returns the user settings.

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:8180/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host); try { ws.login(user, password); UserConfig userCfg = ws.userConfig.getConfig();
Console.WriteLine("User: " + userCfg.user); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

setHome

Description:

MethodReturn valuesDescription

setHome(String uuid)

void

Sets the user's home node.

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:8180/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host); try { ws.login(user, password); ws.userConfig.setHome("53751cb7-c462-4320-ba46-4cc33e4667ae"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }
Table of contents [ Hide Show ]