com.clickntap.tool.calendar.UiCalendarManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Stripecube Show documentation
Show all versions of Stripecube Show documentation
Stripecube is an open source Java framework for Web Applications
package com.clickntap.tool.calendar;
import com.clickntap.smart.SmartContext;
import com.clickntap.utils.XMLUtils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.springframework.core.io.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UiCalendarManager {
private Map confMap;
public void setConf(Resource conf) throws Exception {
Document doc = XMLUtils.copyFrom(conf.getInputStream());
confMap = new HashMap();
for (Element element : (List) doc.getRootElement().elements("uicalendar")) {
confMap.put(element.attributeValue("name"), new UICalendarConf(element));
}
}
public UICalendarConf getConf(String channel, SmartContext ctx) {
UICalendarConf conf = confMap.get(channel);
return conf;
}
}