1.自定义标签类

import static cn.com.yhxl.common.web.freemarker.DirectiveUtils.OUT_LIST;
import static freemarker.template.ObjectWrapper.DEFAULT_WRAPPER; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import cn.com.yhxl.jhahi.entity.pm.PmShopArticle;
import cn.com.yhxl.jhahi.entity.pm.PmShopChannel;
import cn.com.yhxl.jhahi.service.pm.IPmShopArticleService;
import cn.com.yhxl.jhahi.service.pm.IPmShopChannelService;
import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel; /**
* 内容列表标签
*/
public class ArticleListDirective implements TemplateDirectiveModel {
/**
* 模板名称
*/
public static final String TPL_NAME = "content_list";
/**
* 栏目id
*/
public static final String PARAM_CHANNEL_ID = "channelId";
/**
* 是否包含子栏目文章0:自身栏目;1:包含子栏目;
*/
public static final String PARAM_CHANNEL_OPTION = "channelOption"; private List<PmShopChannel> list = new ArrayList<>(); @SuppressWarnings({ "unchecked", "deprecation" })
public void execute(Environment env, Map params, TemplateModel[] loopVars,
TemplateDirectiveBody body) throws TemplateException, IOException {
// CmsSite site = FrontUtils.getSite(env);
List<PmShopArticle> list = getList(params, env); Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
params);
paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(list));
Map<String, TemplateModel> origMap = DirectiveUtils
.addParamsToVariable(env, paramWrap);
if (body != null) {
body.render(env.getOut());
}
DirectiveUtils.removeParamsFromVariable(env, paramWrap, origMap);
} protected List<PmShopArticle> getList(Map<String, TemplateModel> params,
Environment env) throws TemplateException {
Long channelId = DirectiveUtils.getLong(PARAM_CHANNEL_ID, params);
Integer channelOption = DirectiveUtils.getInt(PARAM_CHANNEL_OPTION,
params);
if (channelId == null) {
return null;
}
if (channelOption == null) {
channelOption = 0;
}
if (channelOption != null && channelOption == 0) {
if (channelId != null) {
return articleService.getListByChannelId(channelId, null);
}
}else if(channelOption != null && channelOption == 1){
PmShopChannel parentChannel = channelService.findById(channelId);
List<PmShopChannel> list = this.getAllChannelList(channelId);
list.add(parentChannel);
return articleService.getAllChildByChannelId(list);
}
return null;
} private List<PmShopChannel> getAllChannelList(Long parentChannelId){
List<PmShopChannel> childList = channelService.getChilds(parentChannelId);
if (childList!=null&&childList.size()>0) {
list.addAll(childList);
if (childList!=null&&childList.size()>0) {
for (PmShopChannel channel : childList) {
// list.add(channel);
this.getAllChannelList(channel.getScId());
}
}
}
return this.list;
} @Autowired
private IPmShopArticleService articleService;
@Autowired
private IPmShopChannelService channelService; }

2.修改相关配置文件

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVcAAAD3CAIAAAAmOIAVAAAa4klEQVR4nO2dXWgcR4LH5+UIGMyRENmsQbAJgsVZg0VkjNIPkdGLYjCILH6zIRhCc8IxHH4ZP6xZ7YONLd9d2rvSxtm7i+XTRp5zLBGH3QGFrHUheFiIEY6RYdhBnG2tiaPTGhMn8mhmpLqH6o+qruqv+egP1f9HIUY9VdU9o65fV/dM/5UjirO5TkoDcye6aCGlgaQ3CIC4ySW9AQCAhIEFAFAdWAAA1YEFAFAdWAAA1YEFAFAdWAAA1VHLAl9d2G+X8K2Kei6nF+1fK4aW04yK+9eKoeUYzAZFnVnGtBJXYT1J++GrOk/za/HuEIDwZNUCm5ubgUtczLzX4/OrH8wYFUep9WTF0FhXSJq6bOJRrWJoOV3XuRHOW8CjDwCaJJMWuHz5cj6fr9fr9pJ6vZ7P5ycnJ72afHVmf/XxperjS0/LxuM75+7/z6nyp//81Zn9bPFcH3f0L+o5XdftoVgxNPpUsAV8RrDbAkV+wgELgE6SPQs0Go18Pn/gwAFbBFQBdEmj0ZC2+uLM69Wnf/EpX5x53XudzNgr6uYYpb/LHrEIw1u+Akm1iqGx5xWwAOgY2bMAIaRWq9nDfm1tzSUFKV/86vXq4099ykfv/NRn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2eV5RsCn+jUdIijdDPEFulID05j/F+rynqRPn27DtIUF0kp6cge5oeyK1vcKIHQuxnlfHBRS/ZoPERQ2Q/YCXamBacz/C386QCQHfFm34drCAikFuYMgNmCBlILcQRAbsEBKQe4giA1YIDsgdxB0BlgAANWBBeKm3t+PghJz8d8nYYG4SXyHQFGw+O+TsEDcJL5DoChY/PdJWCBuQv5hAGgdWCClwAIgNmCBlBLmD5PL5f7hhRf8Sy4X8m+3JVNGWsb1VegtCiyQUkJa4B9HCv4FFmiJFi2QkZRBe2fzvFvx3tgE7iyOH1ggOdq1bZlJGQyyQGluvPAEc4H4CWmBMIRbISxg00YLZCNlMHguQAiBBeInpAUC+5HWyULuoFcFZrnQOdONT/++G6Np9t3H1s3FkjuauUwSr1eQnZRBWCClhLeAfcCXzgLkpshA7qBXBX65ZwyhV/MQG+MOGvFuGDRpyErKICyQUjo6F0hx7qDXEm7EOss9Ywg9mkfdGDEPkWvoenN4spMyKFiAr0MIIeTJlyOwQNw0PRd4+41usYhtU5872LQFxKwxwlkg0sZIw01lzUUXZChl0N7Z2JRBV7cT10qwQNw0PRc42LfrcH/v4f7eWm2BPji4b5ekcTpzB/kQcVkwoWvEesWmeTX33JgAC0gbVgyjKDSxyU7KYMAZgTUfgQXipum5wMCeHXT82z/f3LND2jyNuYO8BWTBhOJ48746KM019NoYpk8+epBzias7n8ubhGQmZTDAAtargAXipum5QF/PS3Tw03K4v3dfz4vS5unOHWzx47o0fxKZOvDdwZTSxDeI6TFpd/d211zgte7tksZpHyawQHzAAiml6buJXtm5zXVd4NWd21x1spA7CAvEByyQUuK/txwFxX+fhAXiJvEdAkXB4r9PwgJxk/gOgaJg8d8nYQEAVAcWAEB1YAEAVAcW6CzzxXPSkvR2AeDw/zkV2tfPXzTqAAAAAElFTkSuQmCC" alt="" />

3.

yhxl-core-context.xml添加如下内容:

<bean id="article_list" class="cn.com.yhxl.common.web.freemarker.ArticleListDirective"/>

yhxl-web.properties添加如下内容:

directive.article_list=article_list

JEECMS-自定义标签[list]的更多相关文章

  1. JEECMS 自定义标签

    CMS 是”Content Management System” 的缩写,意为” 内容管理系统”. 内容管理系统是企业信息化建设和电子政务的新宠,也是一个相对较新的市场.对于内容管理,业界还没有一个统 ...

  2. JEECMS自定义标签

    查看JEECMS的源代码发现开发者版本还没有类似现成的统计标签,一种解决的办法是使用现有的JEECMS标签,像这样Struts( [@cms_content_list channel=id]${tag ...

  3. Jeecms自定义标签用法[单个内容]

    1.com.jeecms.cms.action.directive包下建立自己的标签类

  4. [原创]JEECMS 自定义标签调用广告版位下的所有广告(利用广告管理管理首页幻灯片)

    JEECMS自带的只有[@cms_advertising]标签,并且官方没有给文档,用法: [@cms_advertising id='3']             <img src=&quo ...

  5. JEECMS自定义标签开发步骤2

    JEECMS自带的只有[@cms_advertising]标签,并且官方没有给文档,用法: [@cms_advertising id='3']             <img src=&quo ...

  6. JEECMS自定义标签开发步骤

    JEECMS自带的只有[@cms_advertising]标签,并且官方没有给文档,用法: [@cms_advertising id='3']             <img src=&quo ...

  7. JEECMS站群管理系统-- 自定义标签及使用自己创建的表的实现过程

    下面是我自己定义的标签mycontent_list 首先,在数据库里创建了一个jc_mycontent的表,其中有id,title,content三个字段 其次,创建了一个实体类 public cla ...

  8. 自己动手编写JEECMS自定义栏目统计标签

    今天想在给Java客二级版面加入栏目文章统计效果,如下图, 查看JEECMS的源代码发现开发者版本还没有类似现成的统计标签,一种解决的办法是使用现有的JEECMS标签,像这样Struts( [@cms ...

  9. [JSP]自定义标签库taglib

    自定义标签的步骤 自定义标签的步骤大概有三步: 1.继承javax.servlet.jsp.tagext.*下提供的几个标签类,如Tag.TagSupport.BodyTagSupport.Simpl ...

  10. [Java] JSP笔记 - 自定义标签

    自定义标签的创建步骤: 自定义标签的四大功能: 自定义标签的类结构: 在 1.0 中呢, 可以将 <body-content> 的值设置为 JSP, 2.0中则不允许在自定义标签体中出现j ...

随机推荐

  1. 宏HASH_GET_FIRST

    /*******************************************************************//** Gets the first struct in a ...

  2. Qt之自定义界面(QMessageBox)

    简述 通过前几节的自定义窗体的学习,我们可以很容易的写出一套属于自己风格的界面框架,通用于各种窗体,比如:QWidget.QDialog.QMainWindow. 大多数窗体的实现都是采用控件堆积来完 ...

  3. web.xml元素介绍

    每一个站的WEB-INF下都有一个web.xml的设定文件,它提供了对我们站台的配置设定.web.xml中定义元素有:◆站台的名称和说明◆针对环境参数(Context)做初始化工作◆Servlet的名 ...

  4. UVa 11526 H(n)

    题意: long long H(int n){ long long res = 0; for( int i = 1; i <= n; i=i+1 ){ res = (res + n/i); } ...

  5. SyntaxHighlighter -- 代码高亮插件

    SyntaxHighlighter 下载文件里面支持皮肤匹配. 地址:http://alexgorbatchev.com/SyntaxHighlighter/

  6. sqlserver错误"试图扩大物理文件时,MODIFY FILE 遇到操作系统错误 112(磁盘空间不足。)。"处理

    正常还原的时候报错: Microsoft SQL-DMO (ODBC SQLState: 42000)---------------------------试图扩大物理文件时,MODIFY FILE  ...

  7. PhoneGap 安装体验

    npm -v #显示版本,检查npm 是否正确安装. npm install express #安装express模块 npm install -g express #加上 -g 启用global安装 ...

  8. (2)Spring集成Quartz定时任务框架介绍和Cron表达式详解

    在JavaEE系统中,我们会经常用到定时任务,比如每天凌晨生成前天报表,每一小时生成汇总数据等等.我们可以使用java.util.Timer结合java.util.TimerTask来完成这项工作,但 ...

  9. Map/Reduce之间的Partitioner接口

    一.Partitioner介绍 Partitioner的作用是对Mapper产生的中间结果进行分片,以便将同一分组的数据交给同一个Reduce处理,它直接影响Reduce阶段的负载均衡(个人理解:就是 ...

  10. SQL点滴之编辑数据(转)

    数据库中的数据编辑是我们遇到的最频繁的工作,这一个随笔中我来总结一下最常用的数据编辑. select into 经常遇到一种情况是,我们希望创建一个新表,表中的数据来源于原有的一个表:原有一个表,但是 ...