1、新建一个导出处理类继承 smartbi.catalogtree.Exporter,例如 smartbi.extension.test.TestExporter;
2、新建一个导入处理类继承 smartbi.catalogtree.Importer,例如 smartbi.extension.test.TestImporter;
3、在组件激活方法public void activate()中调用catalogTreeModule中的public void registerExporter(Importer importer, Exporter exporter);方法
4、在导出资源时,Smartbi会进行以下步骤:
5、在导入资源时,Smartbi会进行以下步骤:
其中在升级类"UpgradeTask_New.java"中创建了一个知识库表,该表与"ExtSample9_5_File.java"中的描述相对应,该资源代表需要进行导出或导入操作的资源。
资源的创建方法定义在"Sample9_5_Service.java"中,导出操作的实现定义在"Sample9_5_Exporter.java"中,导入操作的实现定义在"Sample9_5_Importer.java"中。测试界面如下:
示例代码下载: Sample9_5.zip |