插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.0 KiB

5 years ago
# 帆软插件开发工具套件
5 years ago
## 作用简介
该套件在帆软工程类基础上做了二次封装,仅暴露接口,可以更好的兼容不同版本的非开放API。
比如,要获取报表的会话信息,以前需要调用方法
```java
5 years ago
import com.fr.web.core.SessionPoolManager;
import org.jetbrains.annotations.NotNull;
5 years ago
5 years ago
SessionPoolManager#getSessionIDInfor(@NotNull String sessionID, Class<T> clazz);
```
但可能随着版本的变更,SessionPoolManager变更了一个名字,比如由SessionPoolManager改成了NewSessionPoolManager,
那么所有调用了该API的插件都无法使用,必须要重新修改插件中的该处代码并更新插件才行。
而如果采用可开发工具套件中的方法,则始终都是调用
```java
import com.fanruan.api.session.SessionKit;
import org.jetbrains.annotations.NotNull;
5 years ago
SessionKit#getSession(@NotNull String sessionID);
```
5 years ago
仅仅只需要更新最新版本的开发套件工具包即可让老插件自然适配。
## 提交新API要求
* 所有的API方法的返回值和参数,仅允许使用JDK自带的类、接口类型、枚举类型、插件抽象类、注解或者使用了@Open标记的对象类型。
* 所有的API方法均需要有单元测试覆盖。
* 所有的API方法均需要有javadoc文档说明。
5 years ago
开放类列表见:[非FineKit开放类](docs/claim.md)
5 years ago
## 约定俗成的规范
5 years ago
[命名和设计规范](docs/name.md)
5 years ago
5 years ago
[重写还是继承](docs/design_guide.md)
5 years ago
## 开发接口文档
[开放接口文档](docs/fun/total.md)
## 使用方法
5 years ago
### 生成运行时依赖jar包
先使用gradle打包,执行下面的命令(跳过单元测试)
```
gradle build -x test
```
5 years ago
会在target目录下获得一个形如finekit-10.0-20190815.jar名字jar包,直接作为插件依赖jar包即可。
5 years ago
### 生成javadoc文档
执行maven命令
```
gradle javadoc
5 years ago
```
即可在target/javadocs目录下获取到javadoc文档。
5 years ago
## 如何判断插件中调用的API需要增加到FineKit中
5 years ago
最简单的原则:
1、插件只使用了JDK自带的类、插件接口(包括抽象类)、枚举、以及使用了@Open注解标记的类;
5 years ago
5 years ago
2、插件只使用了包名前缀为com.fr.third的类;
5 years ago
5 years ago
3、插件只使用了包名前缀为com.fanruan.api之外的类;
如果违背了上述三个原则,则需要考虑将使用类加入FineKit中。
5 years ago
## 如何提交新的API
1、先访问[https://code.fanruan.com](https://code.fanruan.com)并注册一个自己的账号;
5 years ago
2、然后将[https://code.fanruan.com/fanruan/finekit](https://code.fanruan.com/fanruan/finekit) fork到自己账户下;
5 years ago
3、克隆FineKit代码到本地,新增相关的API代码,并提交到自己的仓库;
5 years ago
5 years ago
4、提交Pull Request到FineKit主仓库,等待审核通过被合并即可。
## 已完全依赖FineKit的插件
|插件名|源码|
|-----|----|
|redis数据集插件|https://code.fanruan.com/fanruan/demo-tabledata-redis|
|增强公式编辑器插件|https://code.fanruan.com/fanruan/demo-formula-script|
|条件属性之文本对齐插件|https://code.fanruan.com/fanruan/demo-highlight-align|
|评分形态插件|https://code.fanruan.com/fanruan/demo-show-present|
|急速下拉树插件|https://code.fanruan.com/fanruan/demo-widget-ztree|
|网页框插件|https://code.fanruan.com/fanruan/demo-widget-iframe|
|时钟控件|https://code.fanruan.com/fanruan/demo-show-clock|
|ldaps认证插件|https://code.fanruan.com/fanruan/demo-ldaps-passport|
|个人国际化设置插件|https://code.fanruan.com/fanruan/decision-user-language|
|插件配置持久化|https://code.fanruan.com/fanruan/demo-db-access|
|http认证简化插件|https://code.fanruan.com/fanruan/demo-auth-http|
|xml导出插件|https://code.fanruan.com/fanruan/demo-export-xml|
|echarts图表插件|https://code.fanruan.com/fanruan/demo-chart-pie|
|多sheet懒加载插件|https://code.fanruan.com/fanruan/plugin-report-lazy-sheet|
|url直接登录插件|https://code.fanruan.com/fanruan/plugin-decision-url-login|
|elasticsearch数据集|https://code.fanruan.com/fanruan/demo-tabledata-es|