@SuppressWarnings("unchecked") public void execute( Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { CmsSite site = FrontUtils.getSite(env); InvokeType type = DirectiveUtils.getInvokeType(params); Pagination page = bbsTopicMng.getMemberTopic( site.getId(), getCreaterId(params), FrontUtils.getPageNo(env), FrontUtils.getCount(params)); Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(params); paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page)); Map<String, TemplateModel> origMap = DirectiveUtils.addParamsToVariable(env, paramWrap); if (InvokeType.custom == type) { FrontUtils.includeTpl(TPL_MY_TOPIC, site, params, env); FrontUtils.includePagination(site, params, env); } else if (InvokeType.body == type) { body.render(env.getOut()); FrontUtils.includePagination(site, params, env); } else { throw new RuntimeException("invoke type not handled: " + type); } DirectiveUtils.removeParamsFromVariable(env, paramWrap, origMap); }