Wizard samples
Basics
Section titled “Basics”Suggested code sample
Section titled “Suggested code sample”First, you must create the webservice 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);At this point you can use all the Wizard methods from “wizard” class as shown below:
ws.wizard.findByUser();Methods
Section titled “Methods”findByUser
Section titled “findByUser”Description:
| Method | Return values | Description |
|---|---|---|
| findByUser() | List |
Returns a list of nodes with a wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); List<WizardNode> list = ws.wizard.findByUser(); foreach (WizardNode wizardNode in list) { Console.WriteLine(wizardNode.toString()); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}findAllByUser
Section titled “findAllByUser”Description:
| Method | Return values | Description |
|---|---|---|
| findAllByUser() | List |
Returns a list of nodes with a wizard for the user. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); List<WizardNode> list = ws.wizard.findAllByUser(); foreach (WizardNode wizardNode in list) { Console.WriteLine(wizardNode.toString()); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}findByUserAndUuid
Section titled “findByUserAndUuid”Description:
| Method | Return values | Description |
|---|---|---|
| findByUserAndUuid(String uuid) | WizardNode | Get the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); WizardNode wn= ws.wizard.findByUserAndUuid("5458e52a-58a5-4b5d-ac89-e4e5837924a9"); Console.WriteLine(wn.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}hasWizardByUserAndNode
Section titled “hasWizardByUserAndNode”Description:
| Method | Return values | Description |
|---|---|---|
| hasWizardByUserAndNode(String uuid) | bool | Returns whether a node has a wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); Console.WriteLine("Has a wizard active: " + ws.wizard.hasWizardByUserAndNode("5458e52a-58a5-4b5d-ac89-e4e5837924a9").toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}deleteAll
Section titled “deleteAll”Description:
| Method | Return values | Description |
|---|---|---|
| deleteAll() | void | Removes all wizards for the user. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.deleteAll(); Console.WriteLine("Delete all"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}postponeNode
Section titled “postponeNode”Description:
| Method | Return values | Description |
|---|---|---|
| postponeNode(String uuid, DateTime date) | void | Postpone a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); DateTime date = DateTime.Now; ws.wizard.postponeNode("5458e52a-58a5-4b5d-ac89-e4e5837924a9", date); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}cancelPostponedNode
Section titled “cancelPostponedNode”Description:
| Method | Return values | Description |
|---|---|---|
| cancelPostponedNode(String uuid) | void | Cancel the postponed node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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);ws.wizard.cancelPostponedNode("5458e52a-58a5-4b5d-ac89-e4e5837924a9"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addDigitalSignature
Section titled “addDigitalSignature”Description:
| Method | Return values | Description |
|---|---|---|
| addDigitalSignature(String uuid, int order) | void | Add a digital signature in the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addDigitalSignature("055b5206-35d0-4351-ba92-c304bbba7ddf",order); Console.WriteLine("Add digital signature"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeDigitalSignature
Section titled “removeDigitalSignature”Description:
| Method | Return values | Description |
|---|---|---|
| removeDigitalSignature(String uuid) | void | Remove a digital signature in the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeDigitalSignature("055b5206-35d0-4351-ba92-c304bbba7ddf"); Console.WriteLine("Remove digital signature"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addShowWizardCategories
Section titled “addShowWizardCategories”Description:
| Method | Return values | Description |
|---|---|---|
| addShowWizardCategories(String uuid, int order) | void | Add show wizard categories to the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addShowWizardCategories("055b5206-35d0-4351-ba92-c304bbba7ddf", order); Console.WriteLine("addShowWizardCategories"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeShowWizardCategories
Section titled “removeShowWizardCategories”Description:
| Method | Return values | Description |
|---|---|---|
| removeShowWizardCategories(String uuid) | void | Remove show wizard categories from the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeShowWizardCategories("055b5206-35d0-4351-ba92-c304bbba7ddf"); Console.WriteLine("removeShowWizardCategories"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addShowWizardKeywords
Section titled “addShowWizardKeywords”Description:
| Method | Return values | Description |
|---|---|---|
| addShowWizardKeywords(String uuid, int order) | void | Add show wizard keywords to the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addShowWizardKeywords("055b5206-35d0-4351-ba92-c304bbba7ddf", order); Console.WriteLine("addShowWizardKeywords"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeShowWizardKeywords
Section titled “removeShowWizardKeywords”Description:
| Method | Return values | Description |
|---|---|---|
| removeShowWizardKeywords(String uuid) | void | Remove show wizard keywords from the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeShowWizardKeywords("055b5206-35d0-4351-ba92-c304bbba7ddf"); Console.WriteLine("removeShowWizardKeywords"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addShowWizardOCRDataCapture
Section titled “addShowWizardOCRDataCapture”Description:
| Method | Return values | Description |
|---|---|---|
| addShowWizardOCRDataCapture(String uuid, int order) | void | Add show wizard OCR data capture to the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addShowWizardOCRDataCapture("055b5206-35d0-4351-ba92-c304bbba7ddf", order); Console.WriteLine("addShowWizardOCRDataCapture"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeShowWizardOCRDataCapture
Section titled “removeShowWizardOCRDataCapture”Description:
| Method | Return values | Description |
|---|---|---|
| removeShowWizardOCRDataCapture(String uuid) | void | Remove show wizard OCR data capture from the wizard of a node. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeShowWizardOCRDataCapture("055b5206-35d0-4351-ba92-c304bbba7ddf"); Console.WriteLine("removeShowWizardOCRDataCapture"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addGroup
Section titled “addGroup”Description:
| Method | Return values | Description |
|---|---|---|
| addGroup(String uuid, String group, int order) | void | Add a metadata group to the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addGroup("055b5206-35d0-4351-ba92-c304bbba7ddf", "okg:testing", order); Console.WriteLine("addGroup"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeGroup
Section titled “removeGroup”Description:
| Method | Return values | Description |
|---|---|---|
| removeGroup(String uuid, String group) | void | Remove a metadata group from the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeGroup("055b5206-35d0-4351-ba92-c304bbba7ddf", "okg:testing"); Console.WriteLine("removeGroup"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}addWorkflow
Section titled “addWorkflow”Description:
| Method | Return values | Description |
|---|---|---|
| addWorkflow(String uuid, String workflow, int order) | void | Add a workflow to the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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 order = 0; ws.wizard.addWorkflow("055b5206-35d0-4351-ba92-c304bbba7ddf", "purchase", order); Console.WriteLine("addWorkflow"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}removeWorkflow
Section titled “removeWorkflow”Description:
| Method | Return values | Description |
|---|---|---|
| removeWorkflow(String uuid, String workflow) | void | Remove a workflow from the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.removeWorkflow("055b5206-35d0-4351-ba92-c304bbba7ddf", "purchase"); Console.WriteLine("removeWorkflow"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}setAutostart
Section titled “setAutostart”Description:
| Method | Return values | Description |
|---|---|---|
| setAutostart(String uuid) | void | Set auto-start for the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.setAutostart("055b5206-35d0-4351-ba92-c304bbba7ddf"); Console.WriteLine("setAutostart"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}deleteByNode
Section titled “deleteByNode”Description:
| Method | Return values | Description |
|---|---|---|
| deleteByNode(String uuid) | void | Delete a node in the wizard. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.util;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;using System.IO;
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); ws.wizard.deleteByNode("055b5206-35d0-4351-ba92-c304bbba7ddf"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } }}