<?xml version="1.0" encoding="UTF-8" ?>

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
  version="2.0">
    
  <description>JSTL 1.1 functions library</description>
  <display-name>JSTL functions sys</display-name>
  <tlib-version>1.1</tlib-version>
  <short-name>fns</short-name>
  <uri>http://java.sun.com/jsp/jstl/functionss</uri>

  <function>
    <description>获取管理路径</description>
    <name>getAdminPath</name>
    <function-class>com.cftech.cfsite.common.config.Global</function-class>
    <function-signature>java.lang.String getAdminPath()</function-signature>
    <example>${fns:getAdminPath()}</example>
  </function>
  <function>
    <description>获取网站路径</description>
    <name>getFrontPath</name>
    <function-class>com.cftech.cfsite.common.config.Global</function-class>
    <function-signature>java.lang.String getFrontPath()</function-signature>
    <example>${fns:getFrontPath()}</example>
  </function>
  <function>
    <description>获取网站URL后缀</description>
    <name>getUrlSuffix</name>
    <function-class>com.cftech.cfsite.common.config.Global</function-class>
    <function-signature>java.lang.String getUrlSuffix()</function-signature>
    <example>${fns:getUrlSuffix()}</example>
  </function>
  <function>
    <description>获取配置</description>
    <name>getConfig</name>
    <function-class>com.cftech.cfsite.common.config.Global</function-class>
    <function-signature>java.lang.String getConfig(java.lang.String)</function-signature>
    <example>${fns:getConfig(key)}</example>
  </function>
  
  <!-- UserUtils -->
  <function>
    <description>获取当前用户对象</description>
    <name>getUser</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>com.cftech.cfsite.modules.sys.entity.User getUser()</function-signature>
    <example>${fns:getUser()}</example>  
  </function>
  <function>
    <description>根据ID获得用户对象</description>
    <name>getUserById</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>com.cftech.cfsite.modules.sys.entity.User getUserById(java.lang.String)</function-signature>
    <example>${fns:getUserById(id)}</example>  
  </function>
  
  <function>
    <description>获取当前用户的菜单对象列表</description>
    <name>getMenuList</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>java.util.List getMenuList()</function-signature>
    <example>${fns:getMenuList()}</example>  
  </function>
  
  <function>
    <description>获取当前用户的区域对象列表</description>
    <name>getAreaList</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>java.util.List getAreaList()</function-signature>
    <example>${fns:getAreaList()}</example>  
  </function>
  
  <function>
    <description>获取当前用户的部门对象列表</description>
    <name>getOfficeList</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>java.util.List getOfficeList()</function-signature>
    <example>${fns:getOfficeList()}</example>  
  </function>
  
  <function>
    <description>获取当前用户缓存</description>
    <name>getCache</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.UserUtils</function-class>
    <function-signature>java.lang.Object getCache(java.lang.String, java.lang.Object)</function-signature>
    <example>${fns:getCache(cacheName, defaultValue)}</example>  
  </function>
	
  <!-- DictUtils -->
  <function>
    <description>获取字典标签</description>
    <name>getDictLabel</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.DictUtils</function-class>
    <function-signature>java.lang.String getDictLabel(java.lang.String, java.lang.String, java.lang.String)</function-signature>
    <example>${fns:getDictLabel(value, type, defaultValue)}</example>  
  </function>

  <function>
    <description>获取字典值</description>
    <name>getDictValue</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.DictUtils</function-class>
    <function-signature>java.lang.String getDictValue(java.lang.String, java.lang.String, java.lang.String)</function-signature>
    <example>${fns:getDictValue(label, type, defaultValue)}</example>  
  </function>
  
  <function>
    <description>获取字典对象列表</description>
    <name>getDictList</name>
    <function-class>com.cftech.cfsite.modules.sys.utils.DictUtils</function-class>
    <function-signature>java.util.List getDictList(java.lang.String)</function-signature>
    <example>${fns:getDictList(type)}</example>  
  </function>
  
  <!-- Encodes -->
  <function>
    <description>URL编码</description>
    <name>urlEncode</name>
    <function-class>com.cftech.cfsite.common.utils.Encodes</function-class>
    <function-signature>java.lang.String urlEncode(java.lang.String)</function-signature>
    <example>${fns:urlEncode(part)}</example>  
  </function>
  <function>
    <description>URL解码</description>
    <name>urlDecode</name>
    <function-class>com.cftech.cfsite.common.utils.Encodes</function-class>
    <function-signature>java.lang.String urlDecode(java.lang.String)</function-signature>
    <example>${fns:urlDecode(part)}</example>  
  </function>
  <function>
    <description>HTML编码</description>
    <name>escapeHtml</name>
    <function-class>com.cftech.cfsite.common.utils.Encodes</function-class>
    <function-signature>java.lang.String escapeHtml(java.lang.String)</function-signature>
    <example>${fns:escapeHtml(html)}</example>  
  </function>
  <function>
    <description>HTML解码</description>
    <name>unescapeHtml</name>
    <function-class>com.cftech.cfsite.common.utils.Encodes</function-class>
    <function-signature>java.lang.String unescapeHtml(java.lang.String)</function-signature>
    <example>${fns:unescapeHtml(html)}</example>  
  </function>
  
  <!-- StringUtils -->
  <function>
    <description>从后边开始截取字符串</description>
    <name>substringAfterLast</name>
    <function-class>org.apache.commons.lang3.StringUtils</function-class>
    <function-signature>java.lang.String substringAfterLast(java.lang.String, java.lang.String)</function-signature>
    <example>${fns:substringAfterLast(str,separator)}</example>  
  </function>
  <function>
    <description>判断字符串是否以某某开头</description>
    <name>startsWith</name>
    <function-class>org.apache.commons.lang3.StringUtils</function-class>
    <function-signature>boolean startsWith(java.lang.CharSequence, java.lang.CharSequence)</function-signature>
    <example>${fns:startsWith(str,prefix)}</example> 
  </function>
  <function>
    <description>判断字符串是否以某某结尾</description>
    <name>endsWith</name>
    <function-class>org.apache.commons.lang3.StringUtils</function-class>
    <function-signature>boolean endsWith(java.lang.CharSequence, java.lang.CharSequence)</function-signature>
    <example>${fns:endsWith(str,suffix)}</example> 
  </function>
  <function>
    <description>缩写字符串，超过最大宽度用“...”表示</description>
    <name>abbr</name>
    <function-class>com.cftech.cfsite.common.utils.StringUtils</function-class>
    <function-signature>java.lang.String abbr(java.lang.String, int)</function-signature>
    <example>${fns:abbr(str,length)}</example>  
  </function>
  <function>
    <description>替换掉HTML标签后缩写字符串，超过最大宽度用“...”表示</description>
    <name>rabbr</name>
    <function-class>com.cftech.cfsite.common.utils.StringUtils</function-class>
    <function-signature>java.lang.String rabbr(java.lang.String, int)</function-signature>
    <example>${fns:rabbr(str,length)}</example>
  </function>
  <function>
    <description>替换掉HTML标签</description>
    <name>replaceHtml</name>
    <function-class>com.cftech.cfsite.common.utils.StringUtils</function-class>
    <function-signature>java.lang.String replaceHtml(java.lang.String)</function-signature>
    <example>${fns:replaceHtml(html)}</example>  
  </function>
  
  <!-- DateUtils -->
  <function>
    <description>获取当前日期</description>
    <name>getDate</name>
    <function-class>com.cftech.cfsite.common.utils.DateUtils</function-class>
    <function-signature>java.lang.String getDate(java.lang.String)</function-signature>
    <example>${fns:getDate(pattern)}</example>  
  </function>
  <function>
    <description>获取过去的天数</description>
    <name>pastDays</name>
    <function-class>com.cftech.cfsite.common.utils.DateUtils</function-class>
    <function-signature>long pastDays(java.util.Date)</function-signature>
    <example>${fns:pastDays(date)}</example>  
  </function>
  
</taglib>
