Liferay7 BPM门户开发之27: MVC Portlet插件工程开发
官网上的教材说实话实在精简不清晰.
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/creating-an-mvc-portlet
版本7的Action机制换了:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/mvc-action-command
上边的例子有不少java代码直接写在jsp里,感觉有点不舒服,要想想替代方法。
关于新建Portlet就不再赘述,只写过程。只需要简单几步,开发前先需要熟悉Gradle.
1、新建工程 File → New → Liferay Module Project.
如果建立了Liferay Workspace,就在Workspace上建立新Module工程
2、首先修改settings.gradle仓库地址:
目的是不再使用IDE建立的不可用仓库地址,红色部分删除
buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.0.40"
}
repositories {
maven {
url "https://repo1.maven.org/maven2"
}
maven {
url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
}
}
}
3、在build.gradle中增加需要的引用
比如增加spring mvc 、Acitiviti的依赖包,
dependencies { compile 'com.liferay.portal:com.liferay.portal.kernel:2.0.0'
compile 'com.liferay.portal:com.liferay.util.bridges:2.0.0'
compile 'com.liferay.portal:com.liferay.util.taglib:2.0.0'
compile 'com.liferay:com.liferay.application.list.api:1.0.0'
compile 'javax.portlet:portlet-api:2.0'
compile 'javax.servlet:javax.servlet-api:3.0.1'
compile 'org.osgi:org.osgi.service.component.annotations:1.3.0' compileOnly group: "jstl", name: "jstl", version: "1.2"
compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
compileOnly group: "org.activiti", name: "activiti-engine", version: "5.21.0" compile 'org.springframework:spring-webmvc:4.1.6.RELEASE'
compile 'org.springframework:spring-webmvc-portlet:4.1.6.RELEASE'
compile 'org.springframework:spring-aop:4.1.6.RELEASE'
compile 'org.springframework:spring-context:4.1.6.RELEASE'
compile 'org.springframework:spring-core:4.1.6.RELEASE'
compile 'org.springframework:spring-expression:4.1.6.RELEASE'
compile 'org.springframework:spring-web:4.1.6.RELEASE'
compile 'org.springframework:spring-beans:4.1.6.RELEASE'
compile 'org.springframework:spring-jdbc:4.1.6.RELEASE'
compile 'org.slf4j:slf4j-log4j12:1.7.6'
compile 'org.slf4j:slf4j-api:1.7.6' } tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
然后,再项目右键"Gradle" >> "Refresh gradle project"
4、编译、部署,见图1
5、调试,Debug 〉〉 然后选一个Liferay 7.XX server
然后手动添加新建的portlet
发现liferay7的调试非常方便,无论是修改了jsp还是java文件,可以立即(大概3-5秒)重新自动部署,调试简单又快捷。
Liferay7 BPM门户开发之27: MVC Portlet插件工程开发的更多相关文章
- Liferay7 BPM门户开发之36: 使用Portlet filters过滤器做切面AOP
使用Portlet filters过滤器做切面AOP Portlet Filters定义于JSR286 Java Portlet Specification 2.0 Portlet Filters是为 ...
- Liferay7 BPM门户开发之37: Liferay7下的OSGi Hook集成开发
hook开发是Liferay客制扩展的一种方式,比插件灵活,即可以扩展liferay门户,也能对原有特性进行更改,Liferay有许多内置的服务,比如用hook甚至可以覆盖Liferay服务. 可作为 ...
- Liferay7 BPM门户开发之17: Portlet 生命周期
Portlet 生命周期 init() =〉 render() =〉 processAction() =〉 processEvent() =〉 serveResource() =〉destroy() ...
- Liferay7 BPM门户开发之10: 通用流程实现从Servlet到Portlet(Part1)
开发目的: 实现通用流程自动化处理(即实现不需要hardcode代码的bpm统一处理后台,仅需要写少量前端html form代码和拖拽设计BPM定义) 既可独立运行或可依托于Liferay或依托其它门 ...
- Liferay7 BPM门户开发之26: 集成Activiti到Liferay7
开发顺序: 实战任务1,开发BPM管理后台(用于在Liferay管理中心管理Activiti模型上传) 一个熟悉Portlet操作的项目,为开发打好基础. http://www.cnblogs.com ...
- Liferay7 BPM门户开发之12:acitiviti和liferay用户权限体系集成
写到第12章才出现Liferay的内容,希望可以厚积薄发. 我们的目标是不使用不维护Activiti的用户组织架构,只维护Liferay的体系,这样的好处是非常明显的,即不用做组织架构的同步工作. 原 ...
- Liferay7 BPM门户开发之28: Portlet文件上传,及实体类同步更新上传
抓住核心 . Liferay文件上传的核心就是使用UploadPortletRequest类 继承关系java.lang.Object extended byjavax.servlet.Servlet ...
- Liferay7 BPM门户开发之33: Portlet之间通信的3种方式(session、IPC Render Parameter、IPC Event、Cookies)
文章介绍了5种方式,4种是比较常用的: Portlet session IPC Public Render Parameters IPC Event Cookies 参考地址: https://web ...
- Liferay7 BPM门户开发之44: 集成Activiti展示流程列表
处理依赖关系 集成Activiti之前,必须搞清楚其中的依赖关系,才能在Gradle里进行配置. 依赖关系: 例如,其中activiti-engine依赖于activiti-bpmn-converte ...
随机推荐
- JS中delete删除对象属性
1.删除对象属性 function fun(){ this.name = 'mm'; } var obj = new fun(); console.log(obj.name);//mm ...
- 新手接触java
第二个程序,求同时被3,5,7整除
- php中Closure::bind用法(手册记录)
手册中 Closure::bind — 复制一个闭包,绑定指定的$this对象和类作用域. 具体参数可以看手册,这里记录下这个方法的实际用处. <?php trait MetaTrait { p ...
- python学习笔记-Day4(2)
正则表达式 语法: import re #导入模块名 p = re.compile("^[0-9]") #生成要匹配的正则对象 , ^代表从开头匹配,[0-9]代表匹配0至9的任意 ...
- XHTML跟HTML的区别
其实二者并没有什么区别,只是THTML的要求更加严格,比如说 1.XHTML 元素必须被正确地嵌套. 错误:<p><span>this is example.</p> ...
- web storage的用法
Web Storage分为两种: sessionStorage localStorage 从字面意思就可以很清楚的看出来,sessionStorage将数据保存在session中,浏览器关闭也就没了: ...
- 图解CSS的padding,margin,border属性
原文出处:http://hi.baidu.com/sonan/item/af05cf8759810d1cc31627d5 觉得不错,保存以备用. --------------------------- ...
- python 引用和对象理解
今天浏览博客的时候看到这么一句话: python中变量名和对象是分离的:最开始的时候是看到这句话的时候没有反应过来.决定具体搞清楚一下python中变量与对象之间的细节.(其实我感觉应该说 引用和对象 ...
- Github两步认证
获取密钥:ssh-keygen -t rsa 切换到公钥所在路径:cd .ssh 查看该路径下的所有文件:ls 查看公钥:cat id_rsa.pub 获取密钥之后,去https://github. ...
- iOS 开发线程 gcd
基础知识: 下午9:09 一.基础概念 1.什么是GCD 全称是Grand Central Dispath 纯C语言编写,提供非常多且强大的函数,是目前推荐的多线程开发方法,NSOperation ...