FilePlan samples

Basic

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

Once you are logged in to 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 FilePlan methods from the "filePlan" class as shown below:

ws.filePlan.getRootSections();

 Methods

getRootSections

Description:

MethodReturn valuesDescription

getRootSections()

List<NodeClassSectionDefinition>

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

Description:

MethodReturn valuesDescription

getRootSectionsFilteredBySecurity(int permissions)

List<NodeClassSectionDefinition>

Returns a list of the NodeClassSectionDefinition by permissions.

The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

getChildrenSections(long parentId)

List<NodeClassSectionDefinition>

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

Description:

MethodReturn valuesDescription

getChildrenSectionsFilteredBySecurity(long parentId, int permissions)

List<NodeClassSectionDefinition>

Returns a list of the NodeClassSectionDefinition by parent section and permissions.

The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

getChildrenClasses(long sectionId)

List<NodeClass>

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

Description:

MethodReturn valuesDescription

getChildrenClassesFilteredBySecurity(long sectionId, int permissions)

List<NodeClass>

Returns a list of the NodeClass by section and permissions.

The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

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

Description:

MethodReturn valuesDescription

findElectronicRecordClasses()

List<NodeClass>

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

Description:

MethodReturn valuesDescription

findElectronicRecordClassesFilteredBySecurity(int permissions)

List<NodeClass>

Returns a list of the NodeClass by section and permissions that are Electronic Records.

The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

findFilteredByCodeOrNameFilteredBySecurity(String code, String name, int permissions)

List<NodeClass>

Returns a list of the NodeClass by code, name and permissions.

The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

findSectionFiltered(String code, String name, int permissions)

List<NodeClassSectionDefinition>

Returns a list of the NodeClassSectionDefinition by code, name and permissions.


The class com.openkm.sdk4csharp.bean.Permission contains permission values (READ, WRITE, etc.). You should use it in combination with methods that change or get security grants.

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

Description:

MethodReturn valuesDescription

getNodeClassBreadcrumb(long sectionId)

List<NodeClassSectionDefinition>

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

findAllNodeClasses

Description:

MethodReturn valuesDescription

findAllNodeClasses()

List<NodeClass>

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

Description:

MethodReturn valuesDescription

getRootSectionsIdWithChildren()

List<long>

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

getChildrenSectionsIdByTenantWithChildren

Description:

MethodReturn valuesDescription

getChildrenSectionsIdByTenantWithChildren(long parentId)

List<long>

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