Skip to content

FilePlan samples

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 FilePlan methods from the “filePlan” class as shown below:

ws.filePlan.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());
}
}
}
}

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());
}
}
}
}

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());
}
}
}
}

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());
}
}
}
}

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());
}
}
}
}

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());
}
}
}
}

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());
}
}
}
}

Description:

Method Return values Description
findElectronicRecordClasses() List Returns a list of the NodeClass that 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);
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 that 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());
}
}
}
}

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());
}
}
}
}

Description:

Method Return values Description
getNodeClassBreadcrumb(long sectionId) List Returns a list of the NodeClassSectionDefinition that 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());
}
}
}
}

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());
}
}
}
}

Description:

Method Return values Description
getRootSectionsIdWithChildren() List Returns a list of the section ids that have children and whose 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());
}
}
}
}

Description:

Method Return values Description
getChildrenSectionsIdByTenantWithChildren(long parentId) List Returns a list of the section ids that have children with parent equal to parentId and are 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());
}
}
}
}