ConfigSrv

 

getString

Description:

MethodReturn valuesDescription

getString(String key, String defaultValue)

String

Find the config parameter (as string type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getString("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getText

Description:

MethodReturn valuesDescription

getText(String key, String defaultValue)

String

Find the config parameter (as text type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getText("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getBoolean

Description:

MethodReturn valuesDescription

getBoolean(String key, String defaultValue)

boolean

Find the config parameter (as boolean type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getBoolean("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getInteger

Description:

MethodReturn valuesDescription

getInteger(String key, String defaultValue)

Integer

Find the config parameter (as integer type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getInteger("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getLong

Description:

MethodReturn valuesDescription

getLong(String key, String defaultValue)

long

Find the config parameter (as long type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getLong("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getHtml

Description:

MethodReturn valuesDescription

getHtml(String key, String defaultValue)

String

Find the config parameter (as html type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getHtml("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getPassword

Description:

MethodReturn valuesDescription

getPassword(String key, String defaultValue)

String

Find the config parameter (as password type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
            System.out.println("Config parameter: " + configSrv.getPassword("paramKey", "defaultValue"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

getList

Description:

MethodReturn valuesDescription

getList(String key, String defaultValue)

List<String>

Find the config parameter (as list type) by pk with a default value

Example:

package com.openkm;

import com.openkm.db.service.ConfigSrv;
import com.openkm.util.ContextWrapper;

public class Test {

    public static void main(String[] args) {
        try {
            ConfigSrv configSrv = ContextWrapper.getContext().getBean(ConfigSrv.class);
for (String listElement : configSrv.getList("paramKey", "defaultValue")) {
System.out.println(listElement);
} } catch (Exception e) { e.printStackTrace(); } } }