jeecms系统_自定义对象流程
库内新增对象Products 的流程说明:
第一步:
com.jeecms.cms.entity.assist.base下建立模型基础类,BaseCmsProducts.java
com.jeecms.cms.entity.assist 下建立对象类继承继承模型,CmsProducts.java
com.jeecms.cms.entity.assist.hbm
配置hibernate对象映射,CmsProducts.hbm.xml
src .ehcache-hibernate.xml 缓存对象配置:
<cache name="com.jeecms.cms.entity.assist.CmsProducts"
maxElementsInMemory="100" eternal="false" timeToIdleSeconds="600"timeToLiveSeconds="7200" overflowToDisk="true"/>
第二步:
com.jeecms.cms.dao.assist与数据库交互的持久层DAO接口和实现,ProductsDao.java , ProductsDaoImpl.java ;
配置WebRoot/WEB-INF/config/jeecms-context.xml文件:
<bean id="cmsproductsDao"
class="com.jeecms.cms.dao.assist.impl.CmsProductsDaoImpl"/>
第三步:
com.jeecms.cms.manager.assist
业务层接口和实现,ProductsMng.java , ProductsMngImpl.java
配置WebRoot/WEB-INF/config/jeecms-context.xml文件:
<bean id="cmsProductsMng"
class="com.jeecms.cms.manager.assist.impl.CmsProductsMngImpl"/>
第四步(Action):
com.jeecms.cms.action.front
写Action与前台对接,ProductsAct.java
XML配置:
jeecms-servlet-front-action.xml
<bean id="productsAct"
class="com.jeecms.cms.action.front.ProductsAct"/>
com.jeecms.cms.action.admin.assist (对象添加、删除、修改)
写Action与后台对接, CmsProductsAct.java
XML配置:
jeecms-servlet-admin-action.xml
<bean id="cmsProductsAct"
class="com.jeecms.cms.action.admin.assist.CmsProductsAct"/>
第五步(Directive):
com.jeecms.cms.action.directive (设置并返回标签对象[@cms_products_page])
配置WebRoot/WEB-INF/config/jeecms-context.xml文件:
<bean id="cms_products_page"
class="com.jeecms.cms.action.directive.CmsProductsDirective"/>
<bean id="staticPageSvc"class="com.jeecms.cms.staticpage.StaticPageSvcImpl">
<property name="tplMessageSource"ref="tplMessageSource"/>
<property name="freeMarkerConfigurer">
<bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="freemarkerVariables">
<map>
此处添加标签的配置信息:
<entry key="cms_products_page"value-ref="cms_products_page"/>
配置WebRoot/WEB-INF/config/ Jeecms-servlet-front.xml文件:
<bean id="freemarkerConfig"class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="freemarkerVariables">
<map>
此处添加标签的配置信息:
<entry key="cms_products_page"value-ref="cms_products_page" />
特别注意点:
对象模板位置控制:
com.jeecms.cms.action.front.ProductsAct.java
//方案路径site.getSolutionPath()=”/WEB-INF/t/cms/www/default”
//TPLDIR_SPECIAL="special" 模板位置
// PRODUCTS_INDEX="tpl.productsIndex"; 模板名称
return FrontUtils.getTplPath(request,site.getSolutionPath(),
TPLDIR_SPECIAL, PRODUCTS_INDEX);
PRODUCTS_INDEX对象需要在国际化处进行设置:
WebRoot/WEB-INF/languages/jeecms_tpl/messages_zh_CN.properties:
tpl.productsIndex=products_index
国际化文件说明:
WEB-INF/languages/fck 友情提示
WEB-INF/languages/jeecms_admin (后台)功能页面,如:首页》内容统计statistic.function.content=内容统计
WEB-INF/languages/jeecms_front (前台)友情提示,如:验证码错误。
WEB-INF/languages/jeecms_tpl (前台)功能页面,如:投票内容页,tpl.tagDetail=voteIndex
WEB-INF/languages/jeecore_admin 功能按钮、提示信息,如:global.submit=提交,global.confirm.logout=您确定退出吗?
---------------------
作者:shy13078
来源:CSDN
原文:https://blog.csdn.net/shy13078/article/details/34425573
版权声明:本文为博主原创文章,转载请附上博文链接!