Ir al contenido
Otras versiones

Cargando…

OKMRepository

Esta página aún no está disponible en tu idioma.

On all methods you’ll see parameter named “token”. When accessing application across SOAP the login process returns a token, what is used to identify the user on all the exposed methods. From default application execution context you must use “null” value what indicates to the application must use the “user session”.

Description:

Method Return values Description
getRootFolder(String token) Folder Returns the object Folder of node “/okm:root”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getRootFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getTrashFolder(String token) Folder Returns the object Folder of node “/okm:trash/{userId}”.
  • The returned folder will be the user trash folder.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getTrashFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getTrashFolderBase(String token) Folder Returns the object Folder of node “/okm:trash”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getTrashFolderBase(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getTemplatesFolder(String token) Folder Returns the object Folder of node “/okm:templates”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getTemplatesFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getPersonalFolder(String token) Folder Returns the object Folder of node “/okm:personal/{userId}”.
  • The returned folder will be the user personal folder.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getPersonalFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getPersonalFolderBase(String token) Folder Returns the object Folder of node “/okm:personal”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getPersonalFolderBase(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getMailFolder(String token) Folder Returns the object Folder of node “/okm:mail/{userId}”.
  • The returned folder will be the user mail folder.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getMailFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getMailFolderBase(String token) Folder Returns the object Folder of node “/okm:mail”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getMailFolderBase(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getThesaurusFolder(String token) Folder Returns the object Folder of node “/okm:thesaurus”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getThesaurusFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getCategoriesFolder(String token) Folder Returns the object Folder of node “/okm:categories”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
Folder fld = OKMRepository.getInstance().getCategoriesFolder(null);
System.out.println(fld);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
purgeTrash(String token) Folder Definitively removes from repository all nodes to “/okm:trash/{userId}”.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.Folder;
public class Test {
public static void main(String[] args) {
try {
OKMRepository.getInstance().purgeTrash(null);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getUpdateMessage(String token) String Retrieves a message when there is a new OpenKM release.
  • There’s an official OpenKM update message service available which is based on your local OpenKM version. 

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
public class Test {
public static void main(String[] args) {
try {
String msg = OKMRepository.getInstance().getUpdateMessage(null);
System.out.println(msg);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getRepositoryUuid(String token) String Retrieves the installation unique identifier.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
public class Test {
public static void main(String[] args) {
try {
String uuid = OKMRepository.getInstance().getRepositoryUuid(null);
System.out.println(uuid);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
hasNode(String token, String nodeId) boolean Returns a node that indicate if a node exists or not.
  • The value of the parameter nodeId can be a valid UUID or path.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
public class Test {
public static void main(String[] args) {
try {
boolean found = OKMRepository.getInstance().hasNode(null,"/okm:root/test");
System.out.println(found);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getNodePath(String token, String uuid) String Converts a node UUID to path.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
public class Test {
public static void main(String[] args) {
try {
String path = OKMRepository.getInstance().getNodePath(null, "064ff51a-b815-4f48-a096-b4946876784f");
System.out.println(path);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getNodeUuid(String token, String path) String Converts a node path to UUID.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
public class Test {
public static void main(String[] args) {
try {
String uuid = OKMRepository.getInstance().getNodeUuid(null, "/okm:root/tmp");
System.out.println(uuid);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getAppVersion(String token) AppVersion Returns information about OpenKM version.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.AppVersion;
public class Test {
public static void main(String[] args) {
try {
AppVersion appVersion = OKMRepository.getInstance().getAppVersion(null);
System.out.println(appVersion);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
copyAttributes(String token, String srcId, String dstId, ExtendedAttributes extAttr) void Copy attributes from a node to other..
  • The values of the dstId parameter should be a node UUID or path.

Example:

package com.openkm;
import com.openkm.api.OKMRepository;
import com.openkm.bean.ExtendedAttributes;
public class Test {
public static void main(String[] args) {
try {
ExtendedAttributes extAttr = new ExtendedAttributes();
extAttr.setKeywords(true);
extAttr.setCategories(true);
extAttr.setNotes(true);
extAttr.setPropertyGroups(true);
extAttr.setWiki(true);
OKMRepository.getInstance().copyAttributes(null, "/okm:root/invoice.pdf", "/okm:root/cloned_invoice.pdf", extAttr);
} catch (Exception e) {
e.printStackTrace();
}
}
}