FilePlan samples
Suggested code sample
Section titled “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);At this point you can use all the FilePlan methods from “filePlan” class as is shown below:
ws.filePlan.getRootSections();Methods
Section titled “ Methods”getRootSections
Section titled “getRootSections”Description:
| Method | Return values | Description |
|---|---|---|
| getRootSections() | List |
Returns a list of the NodeClassSectionDefinition. |
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);List<NodeClassSectionDefinition> results = ws.filePlan.getRootSections();foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getRootSectionsFilteredBySecurity
Section titled “getRootSectionsFilteredBySecurity”Description:
| Method | Return values | Description |
|---|---|---|
| getRootSectionsFilteredBySecurity(int permissions) | List |
Returns a list of the NodeClassSectionDefinition by permissions. |
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); List<NodeClassSectionDefinition> results = ws.filePlan.getRootSectionsFilteredBySecurity(permissions);foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getChildrenSections
Section titled “ getChildrenSections”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenSections(long parentId) | List |
Returns a list of the NodeClassSectionDefinition by parent section. |
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);long parentId = 1;List<NodeClassSectionDefinition> results = ws.filePlan.getChildrenSections(parentId);foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getChildrenSectionsFilteredBySecurity
Section titled “getChildrenSectionsFilteredBySecurity”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenSectionsFilteredBySecurity(long parentId, int permissions) | List |
Returns a list of the NodeClassSectionDefinition by parent section and permissions. |
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);long parentId = 1;int permissions = Permission.ALL_GRANTS;List<NodeClassSectionDefinition> results = ws.filePlan.getChildrenSectionsFilteredBySecurity(parentId, permissions);foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getChildrenClasses
Section titled “getChildrenClasses”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenClasses(long sectionId) | List |
Returns a list of the NodeClass by section. |
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); long sectionId = 1;List<NodeClass> results = ws.filePlan.getChildrenClasses(sectionId);foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getChildrenClassesFilteredBySecurity
Section titled “getChildrenClassesFilteredBySecurity”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenClassesFilteredBySecurity(long sectionId, int permissions) | List |
Returns a list of the NodeClass by section and permissions. |
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);long sectionId = 1;int permissions = Permission.ALL_GRANTS;List<NodeClass> results = ws.filePlan.getChildrenClassesFilteredBySecurity(sectionId, permissions);foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findNodeClassByPk
Section titled “findNodeClassByPk”Description:
| Method | Return values | Description |
|---|---|---|
| findNodeClassByPk(long id) | NodeClass | Returns 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:8180/openkm";String username = "okmAdmin";String password = "admin";OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try{ws.login(user, password);long id = 0;NodeClass nodeClass= ws.filePlan.findNodeClassByPk(id);System.Console.WriteLine(nodeClass.toString());}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findElectronicRecordClasses
Section titled “findElectronicRecordClasses”Description:
| Method | Return values | Description |
|---|---|---|
| findElectronicRecordClasses() | List |
Returns a list of the NodeClass what are Elecrronic Records. |
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);List<NodeClass> results = ws.filePlan.findElectronicRecordClasses();foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findElectronicRecordClassesFilteredBySecurity
Section titled “findElectronicRecordClassesFilteredBySecurity”Description:
| Method | Return values | Description |
|---|---|---|
| findElectronicRecordClassesFilteredBySecurity(int permissions) | List |
Returns a list of the NodeClass by section and permissions what are Electronic Records. |
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);int permissions = Permission.ALL_GRANTS;List<NodeClass> results = ws.filePlan.findElectronicRecordClassesFilteredBySecurity(permissions);foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findFilteredByCodeOrNameFilteredBySecurity
Section titled “findFilteredByCodeOrNameFilteredBySecurity”Description:
| Method | Return values | Description |
|---|---|---|
| findFilteredByCodeOrNameFilteredBySecurity(String code, String name, int permissions) | List |
Returns a list of the NodeClass by code, name and permissions. |
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);String code = string.Empty;String name = "test";int permissions = Permission.ALL_GRANTS;List<NodeClass> results = ws.filePlan.findFilteredByCodeOrNameFilteredBySecurity(code, name, permissions);foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findSectionFiltered
Section titled “findSectionFiltered”Description:
| Method | Return values | Description |
|---|---|---|
| findSectionFiltered(String code, String name, int permissions) | List |
Returns a list of the NodeClassSectionDefinition by code, name and permissions. |
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);String code = string.Empty;String name = "test";int permissions = Permission.ALL_GRANTS;List<NodeClassSectionDefinition> results = ws.filePlan.findSectionFiltered(code, name, permissions);foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getNodeClassBreadcrumb
Section titled “getNodeClassBreadcrumb”Description:
| Method | Return values | Description |
|---|---|---|
| getNodeClassBreadcrumb(long sectionId) | List |
Returns a list of the NodeClassSectionDefinition what are Electronic Records. |
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); long sectionId = 1;List<NodeClassSectionDefinition> results = ws.filePlan.getNodeClassBreadcrumb(sectionId);foreach (NodeClassSectionDefinition ncsd in results){System.Console.WriteLine(ncsd.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}findAllNodeClasses
Section titled “findAllNodeClasses”Description:
| Method | Return values | Description |
|---|---|---|
| findAllNodeClasses() | List |
Returns a list of the 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:8180/openkm";String username = "okmAdmin";String password = "admin";OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try{ws.login(user, password);List<NodeClass> results = ws.filePlan.findAllNodeClasses();foreach (NodeClass nc in results){System.Console.WriteLine(nc.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getRootSectionsIdWithChildren
Section titled “getRootSectionsIdWithChildren”Description:
| Method | Return values | Description |
|---|---|---|
| getRootSectionsIdWithChildren() | List |
Returns a list of the section ids what have childs and parent is root. |
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);List<long> results = ws.filePlan.getRootSectionsIdWithChildren();foreach (var id in results){System.Console.WriteLine(id.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getChildrenSectionsIdByTenantWithChildren
Section titled “getChildrenSectionsIdByTenantWithChildren”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenSectionsIdByTenantWithChildren(long parendId) | List |
Returns a list of the section ids what have childs with parent equals to parentId and filtered by tenant. |
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);long parentId = 1;List<long> result = ws.filePlan.getChildrenSectionsIdByTenantWithChildren(parentId);foreach (var id in result){System.Console.WriteLine(id.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}