18 changed files with 582 additions and 0 deletions
@ -0,0 +1,120 @@ |
|||||||
|
apply plugin: 'java' |
||||||
|
|
||||||
|
|
||||||
|
ext { |
||||||
|
/** |
||||||
|
* 项目中依赖的jar的路径 |
||||||
|
* 1.如果依赖的jar需要打包到zip中,放置在lib根目录下 |
||||||
|
* 2.如果依赖的jar仅仅是编译时需要,防止在lib下子目录下即可 |
||||||
|
*/ |
||||||
|
libPath = "$projectDir/../webroot/WEB-INF/lib" |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否对插件的class进行加密保护,防止反编译 |
||||||
|
*/ |
||||||
|
guard = false |
||||||
|
|
||||||
|
def pluginInfo = getPluginInfo() |
||||||
|
pluginPre = "fine-plugin" |
||||||
|
pluginName = pluginInfo.id |
||||||
|
pluginVersion = pluginInfo.version |
||||||
|
|
||||||
|
outputPath = "$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/classes" |
||||||
|
} |
||||||
|
|
||||||
|
group = 'com.fr.plugin' |
||||||
|
version = '10.0' |
||||||
|
sourceCompatibility = '8' |
||||||
|
|
||||||
|
sourceSets { |
||||||
|
main { |
||||||
|
java.outputDir = file(outputPath) |
||||||
|
output.resourcesDir = file(outputPath) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
ant.importBuild("encrypt.xml") |
||||||
|
//定义ant变量 |
||||||
|
ant.projectDir = projectDir |
||||||
|
ant.references["compile.classpath"] = ant.path { |
||||||
|
fileset(dir: libPath, includes: '**/*.jar') |
||||||
|
fileset(dir: ".",includes:"**/*.jar" ) |
||||||
|
} |
||||||
|
|
||||||
|
classes.dependsOn('clean') |
||||||
|
|
||||||
|
task copyFiles(type: Copy,dependsOn: 'classes'){ |
||||||
|
from outputPath |
||||||
|
into "$projectDir/classes" |
||||||
|
} |
||||||
|
|
||||||
|
task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas'){ |
||||||
|
from "$projectDir/classes" |
||||||
|
into "$projectDir/transform-classes" |
||||||
|
include "**/*.*" |
||||||
|
} |
||||||
|
jar.dependsOn("preJar") |
||||||
|
|
||||||
|
task makeJar(type: Jar,dependsOn: preJar){ |
||||||
|
from fileTree(dir: "$projectDir/transform-classes") |
||||||
|
baseName pluginPre |
||||||
|
appendix pluginName |
||||||
|
version pluginVersion |
||||||
|
destinationDir = file("$buildDir/libs") |
||||||
|
|
||||||
|
doLast(){ |
||||||
|
delete file("$projectDir/classes") |
||||||
|
delete file("$projectDir/transform-classes") |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
task copyFile(type: Copy,dependsOn: ["makeJar"]){ |
||||||
|
from "$buildDir/libs" |
||||||
|
from("$projectDir/lib") { |
||||||
|
include "*.jar" |
||||||
|
} |
||||||
|
from "$projectDir/plugin.xml" |
||||||
|
into file("$buildDir/temp/plugin") |
||||||
|
} |
||||||
|
|
||||||
|
task zip(type:Zip,dependsOn:["copyFile"]){ |
||||||
|
from "$buildDir/temp/plugin" |
||||||
|
destinationDir file("$buildDir/install") |
||||||
|
baseName pluginPre |
||||||
|
appendix pluginName |
||||||
|
version pluginVersion |
||||||
|
} |
||||||
|
|
||||||
|
//控制build时包含哪些文件,排除哪些文件 |
||||||
|
processResources { |
||||||
|
// exclude everything |
||||||
|
// 用*.css没效果 |
||||||
|
// exclude '**/*.css' |
||||||
|
// except this file |
||||||
|
// include 'xx.xml' |
||||||
|
} |
||||||
|
|
||||||
|
/*读取plugin.xml中的version*/ |
||||||
|
def getPluginInfo(){ |
||||||
|
def xmlFile = file("plugin.xml") |
||||||
|
if (!xmlFile.exists()) { |
||||||
|
return ["id":"none", "version":"1.0.0"] |
||||||
|
} |
||||||
|
def plugin = new XmlParser().parse(xmlFile) |
||||||
|
def version = plugin.version[0].text() |
||||||
|
def id = plugin.id[0].text() |
||||||
|
return ["id":id,"version":version] |
||||||
|
} |
||||||
|
|
||||||
|
repositories { |
||||||
|
mavenLocal() |
||||||
|
maven { |
||||||
|
url = uri('http://mvn.finedevelop.com/repository/maven-public/') |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
dependencies { |
||||||
|
//使用本地jar |
||||||
|
implementation fileTree(dir: 'lib', include: ['**/*.jar']) |
||||||
|
implementation fileTree(dir: libPath, include: ['**/*.jar']) |
||||||
|
} |
@ -0,0 +1,128 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||||
|
<project basedir="." default="jar" name="plugin"> |
||||||
|
<!-- JDK路径,根据自己机器上实际位置修改--> |
||||||
|
<property name="jdk.home" value="D:/Java/jdk1.8.0_181"/> |
||||||
|
|
||||||
|
<property name="libs" value="${basedir}/lib"/> |
||||||
|
<property name="publicLibs" value=""/> |
||||||
|
<property name="reportLibs" value="${basedir}/lib/report"/> |
||||||
|
<property name="destLoc" value="."/> |
||||||
|
<property name="classes" value="classes"/> |
||||||
|
<xmlproperty file="${basedir}/plugin.xml"/> |
||||||
|
<property name="plugin.version" value="1.0.0"/> |
||||||
|
<property name="plugin.name" value="DEMO_Schedule_Task_Show_Type"/> |
||||||
|
<property name="current-version" value="${plugin.version}"/> |
||||||
|
|
||||||
|
<!-- 插件版本--> |
||||||
|
<property name="plugin-version" value="${current-version}"/> |
||||||
|
<!-- 插件名字--> |
||||||
|
<property name="plugin-name" value="extendedCharts"/> |
||||||
|
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/> |
||||||
|
|
||||||
|
<target name="prepare"> |
||||||
|
<delete dir="${classes}"/> |
||||||
|
<delete dir="fr-plugin-${plugin-name}-${plugin-version}"/> |
||||||
|
<xmlproperty file="${basedir}/plugin.xml"/> |
||||||
|
<delete dir="${destLoc}/${plugin.name}"/> |
||||||
|
</target> |
||||||
|
<path id="compile.classpath"> |
||||||
|
<fileset dir="${libs}"> |
||||||
|
<include name="**/*.jar"/> |
||||||
|
</fileset> |
||||||
|
<fileset dir="${publicLibs}"> |
||||||
|
<include name="**/*.jar"/> |
||||||
|
</fileset> |
||||||
|
<!--<fileset dir="${reportLibs}">--> |
||||||
|
<!--<include name="**/*.jar"/>--> |
||||||
|
<!--</fileset>--> |
||||||
|
</path> |
||||||
|
<patternset id="resources4Jar"> |
||||||
|
<exclude name="**/.settings/**"/> |
||||||
|
<exclude name=".classpath"/> |
||||||
|
<exclude name=".project"/> |
||||||
|
|
||||||
|
<exclude name="**/*.java"/> |
||||||
|
<exclude name="**/*.db"/> |
||||||
|
<exclude name="**/*.g"/> |
||||||
|
<exclude name="**/package.html"/> |
||||||
|
</patternset> |
||||||
|
<target name="copy_resources"> |
||||||
|
<echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/> |
||||||
|
<delete dir="tmp"/> |
||||||
|
<copy todir="tmp"> |
||||||
|
<fileset dir="${resources_from}/src/main/resources"> |
||||||
|
<patternset refid="resources4Jar"/> |
||||||
|
</fileset> |
||||||
|
</copy> |
||||||
|
<copy todir="${classes}"> |
||||||
|
<fileset dir="tmp"/> |
||||||
|
</copy> |
||||||
|
<delete dir="tmp"/> |
||||||
|
</target> |
||||||
|
<target name="compile_javas"> |
||||||
|
<echo message="编译${compile_files}下的Java文件"/> |
||||||
|
<javac destdir="${classes}" debug="false" includeantruntime="false" optimize="on" source="${source_jdk_version}" |
||||||
|
target="${target_jdk_version}" |
||||||
|
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}" |
||||||
|
executable="${compile_jdk_version}/bin/javac"> |
||||||
|
<src path="${basedir}/src/main/java"/> |
||||||
|
<exclude name="**/.svn/**"/> |
||||||
|
<compilerarg line="-encoding UTF8 "/> |
||||||
|
<classpath refid="compile.classpath"/> |
||||||
|
</javac> |
||||||
|
</target> |
||||||
|
|
||||||
|
<target name="jar_classes"> |
||||||
|
<echo message="打Jar包:${jar_name}"/> |
||||||
|
<delete file="${basedir}/${jar_name}"/> |
||||||
|
<jar jarfile="${basedir}/${jar_name}"> |
||||||
|
<fileset dir="${classes}"> |
||||||
|
</fileset> |
||||||
|
</jar> |
||||||
|
</target> |
||||||
|
|
||||||
|
<target name="super_jar" depends="prepare"> |
||||||
|
<antcall target="copy_resources"> |
||||||
|
<param name="resources_from" value="${basedir}"/> |
||||||
|
</antcall> |
||||||
|
<antcall target="compile_javas"> |
||||||
|
<param name="source_jdk_version" value="1.8"/> |
||||||
|
<param name="target_jdk_version" value="1.8"/> |
||||||
|
<param name="compile_jdk_version" value="${jdk.home}"/> |
||||||
|
<param name="compile_files" value="${basedir}/src"/> |
||||||
|
</antcall> |
||||||
|
<echo message="compile plugin success!"/> |
||||||
|
|
||||||
|
<antcall target="jar_classes"> |
||||||
|
<param name="jar_name" value="${plugin-jar}"/> |
||||||
|
</antcall> |
||||||
|
<delete dir="${classes}"/> |
||||||
|
|
||||||
|
</target> |
||||||
|
|
||||||
|
<target name="jar" depends="super_jar"> |
||||||
|
<antcall target="zip"/> |
||||||
|
</target> |
||||||
|
|
||||||
|
<target name="zip"> |
||||||
|
<property name="plugin-folder" value="fr-plugin-${plugin-name}-${plugin-version}"/> |
||||||
|
<echo message="----------zip files----------"/> |
||||||
|
<mkdir dir="${plugin-folder}"/> |
||||||
|
<copy todir="${plugin-folder}"> |
||||||
|
<fileset dir="."> |
||||||
|
<include name="${plugin-jar}"/> |
||||||
|
<include name="plugin.xml"/> |
||||||
|
</fileset> |
||||||
|
<fileset dir="${libs}"> |
||||||
|
<include name="*.jar"/> |
||||||
|
<include name="*.dll"/> |
||||||
|
</fileset> |
||||||
|
</copy> |
||||||
|
<zip destfile="${basedir}/${plugin-folder}.zip" basedir="."> |
||||||
|
<include name="${plugin-folder}/*.jar"/> |
||||||
|
<include name="${plugin-folder}/*.dll"/> |
||||||
|
<include name="${plugin-folder}/plugin.xml"/> |
||||||
|
</zip> |
||||||
|
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/> |
||||||
|
</target> |
||||||
|
</project> |
@ -0,0 +1,10 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||||
|
<project> |
||||||
|
<target name="compile_javas" depends="copyFiles"> |
||||||
|
<echo message="编译${compile_files}下的Java文件"/> |
||||||
|
<taskdef name="pretreatment" classname="com.fr.plugin.pack.PluginPretreatmentTask"> |
||||||
|
<classpath refid="compile.classpath"/> |
||||||
|
</taskdef> |
||||||
|
<pretreatment baseDir="${projectDir}"/> |
||||||
|
</target> |
||||||
|
</project> |
@ -0,0 +1,89 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
||||||
|
<output url="file://E:/Tomcat/apache-tomcat-7.0.57-test/webapps/webroot/WEB-INF/plugins/plugin-com.fr.plugin.type.newPreview.v10-1.0/classes" /> |
||||||
|
<output-test url="file://E:/Tomcat/apache-tomcat-7.0.57-test/webapps/webroot/WEB-INF/test-classes" /> |
||||||
|
<content url="file://$MODULE_DIR$"> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" /> |
||||||
|
</content> |
||||||
|
<orderEntry type="inheritedJdk" /> |
||||||
|
<orderEntry type="sourceFolder" forTests="false" /> |
||||||
|
<orderEntry type="module" module-name="decision-report-feature" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.report:engine-report-sdk:10.0" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.webui:decision-webui-report:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="module" module-name="fine-activator-sdk" /> |
||||||
|
<orderEntry type="module" module-name="base-activator-conf" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.core:fine-core-sdk:10.0" level="project" /> |
||||||
|
<orderEntry type="module" module-name="base-datasource-sdk" /> |
||||||
|
<orderEntry type="module" module-name="base-connection" /> |
||||||
|
<orderEntry type="module" module-name="base-dialect" /> |
||||||
|
<orderEntry type="module" module-name="fine-decision-sdk" /> |
||||||
|
<orderEntry type="module" module-name="decision-sdk" /> |
||||||
|
<orderEntry type="module" module-name="decision-web" /> |
||||||
|
<orderEntry type="module" module-name="decision-feature" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.core:base-plugin-db:10.0" level="project" /> |
||||||
|
<orderEntry type="module" module-name="decision-base" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.webui:decision-fineui:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.xerial:sqlite-jdbc:3.21.0.1" level="project" /> |
||||||
|
<orderEntry type="module" module-name="fine-schedule-sdk" /> |
||||||
|
<orderEntry type="module" module-name="schedule-sdk" /> |
||||||
|
<orderEntry type="module" module-name="schedule-web" /> |
||||||
|
<orderEntry type="module" module-name="schedule-feature" /> |
||||||
|
<orderEntry type="module" module-name="schedule-base" /> |
||||||
|
<orderEntry type="module" module-name="schedule-report-feature" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.intelligence:fine-swift:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fineio:fineio:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.core:fine-core:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.activator:fine-activator:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.decision:fine-decision:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.webui:fine-webui:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.intelligence:fine-accumulator:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.datasource:fine-datasource:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.schedule:fine-schedule:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.report:fine-report-engine:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.schedule:fine-schedule-report:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.decision:fine-decision-report:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="module-library"> |
||||||
|
<library name="Maven: jdk:tools:8.0"> |
||||||
|
<CLASSES> |
||||||
|
<root url="jar://D:/Java/jdk1.8.0_181/lib/tools.jar!/" /> |
||||||
|
</CLASSES> |
||||||
|
<JAVADOC /> |
||||||
|
<SOURCES /> |
||||||
|
</library> |
||||||
|
</orderEntry> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.easymock:easymock:3.5.1" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-reflect:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-easymock:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: cglib:cglib-nodep:2.2.2" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito-common:1.7.4" level="project" /> |
||||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.third.server:servlet-api:3.0" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.third.build:ant:1.0" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.fr.third.driver:ojdbc:14" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.17.Final" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.44" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-engine-spider:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-engine-third:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-adapter:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-datamining:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-datamining-third:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-bi-foundation:5.1-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-decision-bi:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: com.finebi:fine-schedule-bi:10.0-RELEASE-SNAPSHOT" level="project" /> |
||||||
|
</component> |
||||||
|
</module> |
@ -0,0 +1,23 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||||
|
<plugin> |
||||||
|
<id>com.fr.plugin.type.newPreview.v10</id> |
||||||
|
<name><![CDATA[自定义预览类型]]></name> |
||||||
|
<active>yes</active> |
||||||
|
<version>1.1</version> |
||||||
|
<env-version>10.0</env-version> |
||||||
|
<jartime>2020-08-24</jartime> |
||||||
|
<vendor>finereport.mata</vendor> |
||||||
|
<description><![CDATA[自定义预览类型]]></description> |
||||||
|
<change-notes><![CDATA[ |
||||||
|
<p>[2020-08-24]自定义预览类型</p> |
||||||
|
]]> |
||||||
|
</change-notes> |
||||||
|
<extra-core> |
||||||
|
<LocaleFinder class="com.fr.plugin.showtype.NewPreviewTypeLocaleFinder"/> |
||||||
|
</extra-core> |
||||||
|
<extra-decision> |
||||||
|
<ScheduleTaskShowTypeProvider class="com.fr.plugin.showtype.NewPreviewScheduleType"/> |
||||||
|
</extra-decision> |
||||||
|
<function-recorder class="com.fr.plugin.showtype.NewPreviewType"/> |
||||||
|
<lifecycle-monitor class="com.fr.plugin.showtype.NewPreviewInitializeMonitor"/> |
||||||
|
</plugin> |
@ -0,0 +1,48 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>plugin</artifactId> |
||||||
|
<groupId>com.fr.maven</groupId> |
||||||
|
<version>10.0</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>plugin-showtype-demo</artifactId> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>com.fr.decision</groupId> |
||||||
|
<artifactId>decision-report-feature</artifactId> |
||||||
|
<version>10.0</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.fr.schedule</groupId> |
||||||
|
<artifactId>schedule-report-feature</artifactId> |
||||||
|
<version>10.0</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
<build> |
||||||
|
<sourceDirectory>${basedir}/src/main/java</sourceDirectory> |
||||||
|
|
||||||
|
<!---如果要更改调试插件,改这里的配置就可以了--> |
||||||
|
<outputDirectory> |
||||||
|
E:/Tomcat/apache-tomcat-7.0.57-test/webapps/webroot/WEB-INF/plugins/plugin-com.fr.plugin.type.newPreview.v10-1.0/classes |
||||||
|
</outputDirectory> |
||||||
|
|
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||||
|
<artifactId>maven-compiler-plugin</artifactId> |
||||||
|
<configuration> |
||||||
|
<source>8</source> |
||||||
|
<target>8</target> |
||||||
|
</configuration> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
|
||||||
|
</project> |
After Width: | Height: | Size: 73 KiB |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.plugin.showtype; |
||||||
|
|
||||||
|
import com.fr.web.struct.Component; |
||||||
|
import com.fr.web.struct.browser.RequestClient; |
||||||
|
import com.fr.web.struct.category.ScriptPath; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author Roger |
||||||
|
* @Date 2020/8/18 19:46 |
||||||
|
* @Version 10.0 |
||||||
|
*/ |
||||||
|
public class NewPreviewComponent extends Component { |
||||||
|
|
||||||
|
public static final NewPreviewComponent KEY = new NewPreviewComponent(); |
||||||
|
|
||||||
|
@Override |
||||||
|
public ScriptPath script(RequestClient requestClient) { |
||||||
|
return ScriptPath.build("com/fr/plugin/showtype/web/show_types.js"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.fr.plugin.showtype; |
||||||
|
|
||||||
|
import com.fr.decision.web.MainComponent; |
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; |
||||||
|
import com.fr.web.struct.Registry; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author Roger |
||||||
|
* @Date 2020/8/27 8:54 |
||||||
|
* @Version 10.0 |
||||||
|
*/ |
||||||
|
public class NewPreviewInitializeMonitor extends AbstractPluginLifecycleMonitor { |
||||||
|
@Override |
||||||
|
public void afterRun(PluginContext pluginContext) { |
||||||
|
Registry.register(MainComponent.class, NewPreviewComponent.KEY); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void beforeStop(PluginContext pluginContext) { |
||||||
|
Registry.remove(MainComponent.class, NewPreviewComponent.KEY); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,43 @@ |
|||||||
|
package com.fr.plugin.showtype; |
||||||
|
|
||||||
|
|
||||||
|
import com.fr.decision.web.DirectoryComponent; |
||||||
|
import com.fr.intelli.record.Focus; |
||||||
|
import com.fr.intelli.record.Original; |
||||||
|
import com.fr.schedule.extension.report.provider.impl.AbstractScheduleTaskShowTypeProvider; |
||||||
|
import com.fr.schedule.feature.job.calculation.BaseCalculationJob; |
||||||
|
import com.fr.web.struct.Atom; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author Roger |
||||||
|
* @Date 2020/11/3 19:00 |
||||||
|
* @Version 10.0 |
||||||
|
*/ |
||||||
|
public class NewPreviewScheduleType extends AbstractScheduleTaskShowTypeProvider { |
||||||
|
|
||||||
|
@Override |
||||||
|
public Atom attach() { |
||||||
|
return DirectoryComponent.KEY; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Atom client() { |
||||||
|
return NewPreviewComponent.KEY; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Class<? extends BaseCalculationJob> typeClass() { |
||||||
|
return ShowTypeTestJob.class; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
@Focus(id = "com.fr.plugin.showtype.v10", text = "Fine-Plugin_New_Preview_Type", source = Original.PLUGIN) |
||||||
|
public int typeValue() { |
||||||
|
return 5; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String typeActorName() { |
||||||
|
return "form_adaptive"; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
package com.fr.plugin.showtype; |
||||||
|
|
||||||
|
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author Roger |
||||||
|
* @Date 2020/8/18 18:24 |
||||||
|
* @Version 10.0 |
||||||
|
*/ |
||||||
|
public class NewPreviewTypeLocaleFinder extends AbstractLocaleFinder { |
||||||
|
@Override |
||||||
|
public String find() { |
||||||
|
return "com/fr/plugin/showtype/locale/newPreview"; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.plugin.showtype; |
||||||
|
|
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
import com.fr.schedule.feature.job.calculation.BaseCalculationJob; |
||||||
|
import com.fr.schedule.feature.job.result.CalculationResult; |
||||||
|
import com.fr.stable.collections.combination.Pair; |
||||||
|
import com.fr.third.v2.org.quartz.JobDataMap; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class ShowTypeTestJob extends BaseCalculationJob { |
||||||
|
@Override |
||||||
|
public Pair<CalculationResult, List<String>> calculation() throws Exception { |
||||||
|
FineLoggerFactory.getLogger().error("job has be executed"); |
||||||
|
JOptionPane.showMessageDialog(null, "job has be executed"); |
||||||
|
System.out.println("job has be executed"); |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean initTemplate(JobDataMap jobDataMap) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
Fine-Plugin_New_Preview_Type=New_Preview_Type |
@ -0,0 +1 @@ |
|||||||
|
Fine-Plugin_New_Preview_Type=New_Preview_Type |
@ -0,0 +1 @@ |
|||||||
|
Fine-Plugin_New_Preview_Type=\u65b0\u9884\u89c8 |
@ -0,0 +1,31 @@ |
|||||||
|
!(function () { |
||||||
|
BI.config("dec.provider.report.template.show_types", function (provider) { |
||||||
|
provider.inject({ |
||||||
|
showTypes: { |
||||||
|
suffix: "frm", |
||||||
|
types: [ |
||||||
|
{ |
||||||
|
text: BI.i18nText("新预览"), |
||||||
|
defaultValue: true, |
||||||
|
value: 5, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
BI.config("dec.provider.report.schedule_template.show_types", function (provider) { |
||||||
|
provider.inject({ |
||||||
|
showTypes: { |
||||||
|
suffix: "frm", |
||||||
|
types: [ |
||||||
|
{ |
||||||
|
text: BI.i18nText("新预览"), |
||||||
|
defaultValue: true, |
||||||
|
value: 5, |
||||||
|
}, |
||||||
|
], |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
||||||
|
}()) |
Loading…
Reference in new issue