Browse Source

更新辅助事件接口

master
Nicholas.Jee 3 years ago
parent
commit
7898be45f9
  1. 1
      Readme.md
  2. BIN
      lib/report/fine-plugin-data-factory-2.3.3.jar
  3. BIN
      lib/report/fine-plugin-data-factory-2.5.7.jar
  4. 7
      plugin.xml
  5. 29
      src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoFilter.java
  6. 26
      src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoFormatter.java
  7. 31
      src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoPreprocessor.java

1
Readme.md

@ -2,3 +2,4 @@
#### 效果图 #### 效果图
![](image.png) ![](image.png)

BIN
lib/report/fine-plugin-data-factory-2.3.3.jar

Binary file not shown.

BIN
lib/report/fine-plugin-data-factory-2.5.7.jar

Binary file not shown.

7
plugin.xml

@ -4,7 +4,7 @@
<name><![CDATA[数据工厂demo]]></name> <name><![CDATA[数据工厂demo]]></name>
<active>yes</active> <active>yes</active>
<version>1.0</version> <version>1.0</version>
<env-version>10.0</env-version> <env-version>10.0~11.0</env-version>
<jartime>2018-07-31</jartime> <jartime>2018-07-31</jartime>
<vendor>jee</vendor> <vendor>jee</vendor>
<description><![CDATA[ <description><![CDATA[
@ -18,10 +18,13 @@
<extra-core> <extra-core>
<TableDataLoader class="com.fr.plugin.tptj.tabledata.factory.demo.DemoLoader"/> <TableDataLoader class="com.fr.plugin.tptj.tabledata.factory.demo.DemoLoader"/>
<TableDataResolver class="com.fr.plugin.tptj.tabledata.factory.demo.DemoResolver"/> <TableDataResolver class="com.fr.plugin.tptj.tabledata.factory.demo.DemoResolver"/>
<TableDataPreprocessor class="com.fr.plugin.tptj.tabledata.factory.demo.DemoPreprocessor"/>
<TableDataFormatter class="com.fr.plugin.tptj.tabledata.factory.demo.DemoFormatter"/>
<TableDataFilter class="com.fr.plugin.tptj.tabledata.factory.demo.DemoFilter"/>
</extra-core> </extra-core>
<function-recorder class="com.fr.plugin.tptj.tabledata.factory.demo.DemoLoader"/> <function-recorder class="com.fr.plugin.tptj.tabledata.factory.demo.DemoLoader"/>
<dependence> <dependence>
<Item key="com.tptj.plugin.hg.tabledata.factory.v10" type="plugin"/> <!-- 依赖于数据工厂主框架 --> <Item key="com.tptj.plugin.hg.tabledata.factory.v11" type="plugin"/> <!-- 依赖于数据工厂主框架 -->
</dependence> </dependence>
</plugin> </plugin>

29
src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoFilter.java

@ -0,0 +1,29 @@
package com.fr.plugin.tptj.tabledata.factory.demo;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.tptj.plugin.hg.impl.AbstractFilter;
import com.tptj.plugin.hg.stable.SimpleDataModel;
public class DemoFilter extends AbstractFilter {
@Override
public SimpleDataModel doAction(SimpleDataModel simpleDataModel, String s) {
try {
simpleDataModel.removeColumn(simpleDataModel.getColumnCount() - 1);
} catch (TableDataException e) {
FineLoggerFactory.getLogger().error(e, "{}", e.getMessage());
}
return simpleDataModel;
}
@Override
public String getName() {
return "Demo_Filter";
}
@Override
public String getDefaultConfig() {
return StringUtils.EMPTY;
}
}

26
src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoFormatter.java

@ -0,0 +1,26 @@
package com.fr.plugin.tptj.tabledata.factory.demo;
import com.tptj.plugin.hg.impl.AbstractFormatter;
public class DemoFormatter extends AbstractFormatter {
@Override
public Object format(Object o, String s) {
String data = (String) o;
String[] lines = data.split("\n");
StringBuilder result = new StringBuilder();
for (int i = 1; i < lines.length; i++) {
result.append(lines[i]).append("\n");
}
return result.toString();
}
@Override
public String getName() {
return "Demo_Formatter";
}
@Override
public String getDefaultConfig() {
return "";
}
}

31
src/main/java/com/fr/plugin/tptj/tabledata/factory/demo/DemoPreprocessor.java

@ -0,0 +1,31 @@
package com.fr.plugin.tptj.tabledata.factory.demo;
import com.fr.base.Parameter;
import com.fr.json.JSONObject;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.tptj.plugin.hg.impl.AbstractPreprocessor;
public class DemoPreprocessor extends AbstractPreprocessor {
@Override
public ParameterProvider[] process(Calculator calculator, String s) {
JSONObject jo = new JSONObject(s);
ParameterProvider[] results = new ParameterProvider[1];
results[0] = new Parameter("token", jo.get("token"));
//jo.get("token");
return results;
}
@Override
public String getName() {
return "Demo_PreProcess";
}
@Override
public String getDefaultConfig() {
return "{\n" +
" token:token\n" +
"}";
}
}
Loading…
Cancel
Save