二次开发文档

上传人:大米 文档编号:444530688 上传时间:2023-07-09 格式:DOCX 页数:14 大小:40.74KB
返回 下载 相关 举报
二次开发文档_第1页
第1页 / 共14页
二次开发文档_第2页
第2页 / 共14页
二次开发文档_第3页
第3页 / 共14页
二次开发文档_第4页
第4页 / 共14页
二次开发文档_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《二次开发文档》由会员分享,可在线阅读,更多相关《二次开发文档(14页珍藏版)》请在金锄头文库上搜索。

1、Jspxcms 无侵入式插件开发(二次开发)教程之一:概述Jspxcms支持无侵入式插件和二次开发,无需修改系统原有代码,即可无缝整合Entity Service、Controlle、功能菜单、权限、标签、国际化等功能。系统中“插件-简历管理”就是以这种方式实现的,下面就以“简历管理”讲解 Jspxcms 插件和二次开发的方法。本帖隐藏的内容需要回复才可以浏览配置文件位置:/WEBTNF/conf/plugin所有的配置文件都必须在这个目录,在该目录下的配置文件会自动加载。在该目录下新建自己的文件夹,可以是任何名字,如:abc、novel等,本例为 plug。即/WEBTNF/conf/plu

2、gin/plug配置文件说明:功能菜单、权限、国际化、Entity都与这个文件相关。: Dao 的加载。:Service的加载。:后台Controlle的加载。:前台Controlle的加载。:标签的加载。其他与插件开发相关的文件目录/WEB-INF/messages/plugin/plug:后台国际化文件位置/WEBTNF/messages/plugin/plugfore 前台国际化文件位置/WEB-INF/views/plug:后台 jsp文件位置/fil es/1/bluewise插件的前台模版插件源代码包名:无侵入式插件开发(二次开发)教程之二:菜单与权限本帖隐藏的内容需要回复才可以浏

3、览菜单和权限配置文件:/WEBTNF/conf/plugin/plug/一级菜单配置(分号为分割符)1. =;?menuId=650;nav_plug复制代码650:是后台导航一级菜单的编号,编号大小决定菜单的前后位置。其值可以根据需要调整,如330、 970,但不要与系统菜单或其他插件菜单重复。系统菜单通常为,等,系统菜单定义文件在/WEB-INF/conf/:菜单名称。这里使用了国际化,也可以直接用中文,比如“我的插件”。?menuId=650:菜单链接地址。其中650需与前面的值一样。nav_plug:权限值。其中plug通常与配置文件目录名称一样。如目录为abc,则应为nav_abc。

4、也可不一样,但不能与其他一级菜单权限名称一样。二级菜单配置(分号为分割符)复制代码650:二级菜单所属的一级菜单编号。100:二级菜单编号。其值的意义和一级菜单编号一样,用于确定二级菜单的前后位置。:二级菜单名称。可以直接用中文,如“小说管理”。plug/resume/:功能菜单的链接地址。需与Con trolle中的地址对应,否则会找不到页面。plug:resume:list:功能菜单的权限。需与Controlle中lis方法的权限对应,否则会报没有权限。createplug:resume:create:新增按钮的权限值。其中create是国际化,可以用直接用中文,如新增plug:resum

5、e:create。其中plug:resume:create是该按钮的权限值,需与Controlle中对应的create方法权限值一致。copyplug:resume:copy:意义和上面一样,后面的以此类推。代码片段1.package2.Controller3.RequestMapping(/plug/resume)4.public class ResumeController 5.? ? RequiresPermissions(plug:resume:list)6.? ? RequestMapping()7.? ? public String list(8.9.10.? ? Requires

6、Permissions(plug:resume:create)11.? ? RequestMapping()12? ? public String create(Jspxcms无侵入式插件开发(二次开发)教程之三:Entity本帖隐藏的内容需要回复才可以浏览实体类 Entity配置文件:/WEBTNF/conf/plugin/plug/复制代码plug :通常与配置文件所在目录一样,也可不一样,但不能与其他相关配置同名。:Entity所在包名。不使用主键自增策略,将主键放到数据库中的一个表里。1.create tableplug_resume2(3?f_resume_id? intnot nu

7、ll,4?f_site_id?intnot null,5?f name? ?varchar(100) notnullcomment姓名6.?f post? ?varchar(100) notnullcomment应聘职位7. ? ?f_creation_date? ? ?datetime not null comment 投递日期,8. ? ?f_gender? ? ? ? ? char(1) not null default M comment 性别,9. ? ?f_birth_date? ? ? ?datetime comment 出生日期,10. ? ?f_mobile? ? ? ? ?

8、 varchar(100) comment 手机,11. ? ?f_email? ? ? ? ?varchar(100) comment 邮箱,12. ? ?f_expected_salary? ? int comment 期望薪水,13. ? ?f_education_experience longtext comment 教育经历,14. ? ?f_work_experience? ? longtext comment 工作经历,15. ? ?f_remark? ? ? ? ? longtext comment 备注,16. ? ?primary key (f_resume_id)17.

9、)18. engine = innodb;19. alter table plug_resume comment 简历表;20. alter table plug_resume add constraint fk_plug_resume_site foreign key (f_site_id)21. ? ? Preferences cms_site (f_site_id) on delete restrict on update restrict;复制代码1. Entity2. Table(name = plug_resume)3. ? ? ? ? private Integer id;5.

10、?Id6. ?Column(name = f_resume_id, unique = true, nullable = false)7. ?TableGenerator(name = tg_plug_resume, pkColumnValue = plug_resume,table = t_id_table,pkColumnName = f_table, valueColumnName = f_id_value, initialValue = 1, allocationSize = 1)8. ?GeneratedValue(strategy=, generator = tg_plug_resu

11、me)9. ?public Integer getId() 10. ? ? ? ? return ;11? ? ? ? 12. ?public void setId(Integerid) 13. ? ? ? ?= id;14? ? ? ? 15.? ? ? ?.16复制代码需注意以下三个值,其中 plug_resume 为表名1. name = tg_plug_resume, pkColumnValue = plug_resume2. generator = tg_plug_resumeJspxcms无侵入式插件开发(二次开发)教程之四:Dao本帖隐藏的内容需要回复才可以浏览Dao 配置文件:

12、/WEBTNF/conf/plugin/plug/1 ?2. ? ? transaction-manager-ref=transactionManager?3. ? ? entity-manager-factory-ref=entityManagerFactory?4?5. ? ? repository-impl-postfix=Impl6. 复制代码其中为 dao 接口所在包。Dao 使用了 SpringDataJPA 技术。SpringDataJPA 官网:1. public interface ResumeDao extends RepositoryResume, Integer,Res

13、umeDaoPlus 2. ?publicPage findAll(Specificationspec,Pageable pageable);3. ?publicList findAll(Specificationspec,Limitable limitable);4. ?publicResume findOne(Integer id);5. ? ? ? ? public Resume save(Resume bean);6. ? ? ? ? public void delete(Resume bean);7复制代码ResumeDao接口中的方法不用实现。以下接口中的方法均可放到 Resume

14、Dao ,且无需实现复制代码需要实现的 dao 方法,放到 ResumeDaoPlus 接口中。1. public interface ResumeDaoPlus 2. ? ? ? ? public List getList(Integer siteId, Limitable limitable);3复制代码1. public class ResumeDaoImpl implements ResumeDaoPlus 2. ?SuppressWarnings(unchecked)3. ?public List getList(Integer siteId, Limitable limitable) 4. ? ? ? ? JpqlBuilder jpq

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 机械/制造/汽车 > 电气技术

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号