Ir al contenido
Otras versiones

Cargando…

OKMUserConfig

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

In all methods you’ll see a parameter named “token”. Because cron tasks are executed in the background without authentication, the methods used in this scenario might use the token parameter. From the default application execution context you must use the “null” value, which indicates the application must use the “user session”.

Description:

Method Return values Description
setHome(String token, String nodeId) void Sets the user’s home.

Example:

package com.openkm;
import com.openkm.api.OKMUserConfig;
import com.openkm.util.ContextWrapper;
public class Test {
public static void main(String[] args) {
try {
OKMUserConfig okmUserConfig = ContextWrapper.getContext().getBean(OKMUserConfig.class);
okmUserConfig.setHome(null, "/okm:root/test");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
getConfig(String token) UserConfig Returns the user configuration.
  • Returned values are:

Example:

package com.openkm;
import com.openkm.api.OKMUserConfig;
import com.openkm.db.bean.UserConfig;
import com.openkm.util.ContextWrapper;
public class Test {
public static void main(String[] args) {
try {
OKMUserConfig okmUserConfig = ContextWrapper.getContext().getBean(OKMUserConfig.class);
UserConfig uc = okmUserConfig.getConfig(null);
System.out.println(uc);
} catch (Exception e) {
e.printStackTrace();
}
}
}