All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickntap.tool.calendar.UiCalendarManager Maven / Gradle / Ivy

The newest version!
package com.clickntap.tool.calendar;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.dom4j.Document;
import org.dom4j.Element;
import org.springframework.core.io.Resource;

import com.clickntap.smart.SmartContext;
import com.clickntap.utils.XMLUtils;

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;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy