Ir al contenido
Otras versiones

Cargando…

Note samples

En la mayoría de los métodos verá el parámetro llamado “nodeId”. El valor de este parámetro puede ser un UUID o un path válido de documento, carpeta, correo o expediente.

Descripción:

Método Valores de retorno Descripción
addNote(String nodeId, String text) Note Añade una nota a un nodo y devuelve un objeto Note.

Ejemplo:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
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, username, password);
try
{
ws.addNote("/okm:root/logo.png", "the note text");
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}

Descripción:

Método Valores de retorno Descripción
getNote(String noteId) Note Recupera la nota.

Ejemplo:

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:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
List<Note> notes = ws.listNotes("/okm:root/logo.png");
if (notes.Count > 0)
{
System.Console.WriteLine(ws.getNote(notes[0].path));
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}

Descripción:

Método Valores de retorno Descripción
deleteNote(String noteId) Note Elimina una nota.

Ejemplo:

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:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
List<Note> notes = ws.listNotes("/okm:root/logo.png");
if (notes.Count > 0)
{
System.Console.WriteLine(ws.deleteNote(notes[0].path));
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}

Descripción:

Método Valores de retorno Descripción
setNote(String noteId, String text) void Cambia el texto de la nota.

Ejemplo:

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:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
List<Note> notes = ws.listNotes("/okm:root/logo.png");
if (notes.Count > 0)
{
ws.setNote(notes[0].path, "text modified");
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}

Descripción:

Método Valores de retorno Descripción
listNotes(String nodeId) List Obtiene una lista con todas las notas de un nodo.

Ejemplo:

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:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
List<Note> notes = ws.listNotes("/okm:root/logo.png");
foreach (Note note in notes)
{
System.Console.WriteLine(note);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}