Search in sources :

Example 1 with Resources

use of com.haulmont.cuba.core.global.Resources in project cuba by cuba-platform.

the class CreditsLoader method load.

public CreditsLoader load() {
    String configProperty = AppContext.getProperty("cuba.creditsConfig");
    if (StringUtils.isBlank(configProperty)) {
        log.info("Property cuba.creditsConfig is empty");
        return this;
    }
    StrTokenizer tokenizer = new StrTokenizer(configProperty);
    String[] locations = tokenizer.getTokenArray();
    for (String location : locations) {
        Resources resources = AppBeans.get(Resources.NAME);
        String xml = resources.getResourceAsString(location);
        if (xml == null) {
            log.debug("Resource {} not found, ignore it", location);
            continue;
        }
        Element rootElement = Dom4j.readDocument(xml).getRootElement();
        loadLicenses(rootElement);
        loadConfig(rootElement);
    }
    Collections.sort(items);
    return this;
}
Also used : Element(org.dom4j.Element) Resources(com.haulmont.cuba.core.global.Resources) StrTokenizer(org.apache.commons.lang.text.StrTokenizer)

Aggregations

Resources (com.haulmont.cuba.core.global.Resources)1 StrTokenizer (org.apache.commons.lang.text.StrTokenizer)1 Element (org.dom4j.Element)1