forked from fanruan/finekit
richie
5 years ago
6 changed files with 119 additions and 9 deletions
@ -0,0 +1,25 @@
|
||||
package com.fanruan.api.report; |
||||
|
||||
import com.fanruan.api.util.IOKit; |
||||
import com.fr.base.Icon; |
||||
import com.fr.base.IconManager; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/26 |
||||
* 一些比较杂项的工具类 |
||||
*/ |
||||
public class SundryKit { |
||||
|
||||
/** |
||||
* 将图标加载到内存中,可以供插件使用 |
||||
* |
||||
* @param name 图标的名字 |
||||
* @param path 图标的地址 |
||||
*/ |
||||
public static void loadToolbarIcon(String name, String path) { |
||||
Icon icon = new Icon(name, IOKit.readImage(path)); |
||||
IconManager.getIconManager().addIcon(icon, true); |
||||
} |
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.fanruan.api.report.export; |
||||
|
||||
import com.fr.io.exporter.AbstractAppExporter; |
||||
import com.fr.main.workbook.ResultWorkBook; |
||||
import com.fr.page.PageSetProvider; |
||||
|
||||
import java.io.OutputStream; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/26 |
||||
* 导出接口 |
||||
*/ |
||||
public abstract class BaseAppExporter<T> extends AbstractAppExporter<T> { |
||||
|
||||
public BaseAppExporter() { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
* |
||||
* @param outputStream 输出流 |
||||
* @param pageSetProvider 分页对象 |
||||
* @throws Exception 导出失败则抛出此异常 |
||||
*/ |
||||
@Override |
||||
public void export(OutputStream outputStream, PageSetProvider pageSetProvider) throws Exception { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
* |
||||
* @param outputStream 输出流 |
||||
* @param resultWorkBook 结果报表 |
||||
* @throws Exception 导出失败则抛出此异常 |
||||
*/ |
||||
@Override |
||||
public abstract void export(OutputStream outputStream, ResultWorkBook resultWorkBook) throws Exception; |
||||
|
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fanruan.api.report.export; |
||||
|
||||
import com.fr.io.collection.ExportCollection; |
||||
import com.fr.stable.web.SessionProvider; |
||||
import com.fr.web.core.reserve.Operate; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/26 |
||||
* 导出接口的抽象类 |
||||
*/ |
||||
public abstract class BaseOperate implements Operate { |
||||
|
||||
@Override |
||||
public void setContent(HttpServletRequest req, HttpServletResponse res, String fileName, boolean isEmbed) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void setContent(HttpServletRequest req, HttpServletResponse res, SessionProvider sessionProvider, String fileName, boolean isEmbed) { |
||||
this.setContent(req, res, fileName, isEmbed); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出的实体操作 |
||||
* |
||||
* @param req http请求 |
||||
* @param res http响应 |
||||
* @param sessionProvider 模板访问会话信息 |
||||
* @param fileName 文件名 |
||||
* @return 导出实体操作对象 |
||||
*/ |
||||
@Override |
||||
public abstract ExportCollection newExportCollection(HttpServletRequest req, HttpServletResponse res, SessionProvider sessionProvider, String fileName); |
||||
} |
Loading…
Reference in new issue