Java 类org.jivesoftware.smackx.workgroup.settings.ChatSetting 实例源码

项目:Fastpath-webchat    文件:FormText.java   
public static String getTextSetting(String key, String workgroup) {
    SettingsManager settingsManager = SettingsManager.getInstance();
    ChatSetting chatSettings = settingsManager.getChatSetting(key, workgroup);

    Date now = new Date();
    String date = DATE_FORMATTER.format(now);
    String time = TIME_FORMATTER.format(now);

    if (chatSettings == null) {
        return "";
    }

    String value = chatSettings.getValue();
    value = WebUtils.replace(value, "${time}", time);
    value = WebUtils.replace(value, "${date}", date);
    return value;
}
项目:spark-svn-mirror    文件:FormText.java   
public static String getTextSetting(String key, String workgroup) {
    WorkgroupManager settingsManager = WorkgroupManager.getInstance();
    ChatSetting chatSettings = settingsManager.getChatSetting(key, workgroup);

    Date now = new Date();
    String date = DATE_FORMATTER.format(now);
    String time = TIME_FORMATTER.format(now);

    if (chatSettings == null) {
        return "";
    }

    String value = chatSettings.getValue();
    value = FormUtils.replace(value, "${time}", time);
    value = FormUtils.replace(value, "${date}", date);
    return value;
}
项目:Fastpath-webchat    文件:SettingsManager.java   
public byte[] getImageFromMap(String imageName, String workgroupName) {
    ChatSettings chatSettings = (ChatSettings)this.chatSettings.get(workgroupName);
    ChatSetting imageSetting = chatSettings.getChatSetting(imageName);
    if (imageSetting == null || imageSetting.getValue() == null) {
        return null;
    }
    else {
        byte[] bytes = Base64.decode(imageSetting.getValue());
        return bytes;
    }
}
项目:Smack    文件:Workgroup.java   
/**
 * Returns a single chat setting based on it's identified key.
 *
 * @param key the key to find.
 * @return the ChatSetting if found, otherwise false.
 * @throws XMPPException if an error occurs while getting information from the server.
 * @throws SmackException 
 */
public ChatSetting getChatSetting(String key) throws XMPPException, SmackException {
    ChatSettings chatSettings = getChatSettings(key, -1);
    return chatSettings.getFirstEntry();
}