Browse Source

REPORT-88257 导出API代码适配11.0

release/10.0
Bruce.Deng 2 years ago
parent
commit
3f7ff140f8
  1. 29
      src/main/java/com/fr/io/ExportApi.java

29
src/main/java/com/fr/io/ExportApi.java

@ -7,8 +7,6 @@ import com.fr.config.activator.BaseDBActivator;
import com.fr.config.activator.ConfigurationActivator; import com.fr.config.activator.ConfigurationActivator;
import com.fr.env.operator.CommonOperatorImpl; import com.fr.env.operator.CommonOperatorImpl;
import com.fr.general.I18nResource; import com.fr.general.I18nResource;
import com.fr.general.log.Log4jConfig;
import com.fr.general.log.parser.ExtraPatternParserManager;
import com.fr.health.activator.ModuleHealActivator; import com.fr.health.activator.ModuleHealActivator;
import com.fr.io.exporter.CSVExporter; import com.fr.io.exporter.CSVExporter;
import com.fr.io.exporter.EmbeddedTableDataExporter; import com.fr.io.exporter.EmbeddedTableDataExporter;
@ -27,25 +25,18 @@ import com.fr.report.module.ReportBaseActivator;
import com.fr.report.write.WriteActivator; import com.fr.report.write.WriteActivator;
import com.fr.scheduler.SchedulerActivator; import com.fr.scheduler.SchedulerActivator;
import com.fr.stable.WriteActor; import com.fr.stable.WriteActor;
import com.fr.stable.resource.ResourceLoader;
import com.fr.store.StateServiceActivator; import com.fr.store.StateServiceActivator;
import com.fr.third.apache.log4j.Level;
import com.fr.third.apache.log4j.PropertyConfigurator;
import com.fr.workspace.simple.SimpleWork; import com.fr.workspace.simple.SimpleWork;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties;
public class ExportApi { public class ExportApi {
public static void main(String[] args) { public static void main(String[] args) {
initLog4j();
/**定义报表运行环境,用于执行报表*/ /**定义报表运行环境,用于执行报表*/
com.fr.module.Module module = ActivatorToolBox.simpleLink(new BaseDBActivator(), com.fr.module.Module module = ActivatorToolBox.simpleLink(new BaseDBActivator(),
new ConfigurationActivator(), new ConfigurationActivator(),
@ -138,24 +129,4 @@ public class ExportApi {
} }
} }
private static void initLog4j() {
PropertyConfigurator.configure(loadLog4jPropertiesFromJar(Level.toLevel("INFO")));
}
private static Properties loadLog4jPropertiesFromJar(Level level) {
Properties properties = new Properties();
System.setProperty("LOG_HOME", System.getProperty("user.dir"));
System.setProperty("LOG_ROOT_LEVEL", level.toString());
ExtraPatternParserManager.setSystemProperty();
try {
properties.load(ResourceLoader.getResourceAsStream("/com/fr/general/log/log4j.properties", Log4jConfig.class));
} catch (IOException ignore) {
//do nothing
}
return properties;
}
} }

Loading…
Cancel
Save