FilePlan samples
Basic
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);
Once you are logged with the webservices the session is keep in the webservice Object. Then you can use the other API method
At this point you can use all the FilePlan methods from "filePlan" class as is shown below:
ws.filePlan.getRootSections();
Methods
getRootSections
Description:
Method | Return values | Description |
---|---|---|
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:
Method | Return values | Description |
---|---|---|
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 are changing or getting 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:
Method | Return values | Description |
---|---|---|
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:
Method | Return values | Description |
---|---|---|
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 are changing or getting 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:
Method | Return values | Description |
---|---|---|
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:
Method | Return values | Description |
---|---|---|
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 are changing or getting 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:
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
Description:
Method | Return values | Description |
---|---|---|
findElectronicRecordClasses() |
List<NodeClass> |
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
Description:
Method | Return values | Description |
---|---|---|
findElectronicRecordClassesFilteredBySecurity(int permissions) |
List<NodeClass> |
Returns a list of the NodeClass by section and permissions what 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 are changing or getting 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:
Method | Return values | Description |
---|---|---|
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 are changing or getting 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:
Method | Return values | Description |
---|---|---|
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 are changing or getting 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:
Method | Return values | Description |
---|---|---|
getNodeClassBreadcrumb(long sectionId) |
List<NodeClassSectionDefinition> |
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
Description:
Method | Return values | Description |
---|---|---|
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());
}
}
}
}