Browse Source

init

pull/1/head
Zhenfei.Li 4 years ago
commit
744a8dd2b7
  1. 7
      .gitignore
  2. 2
      README.md
  3. 121
      build.xml
  4. 32
      plugin.xml
  5. 40
      pom.xml
  6. 17
      src/main/java/com/fr/plugin/pack/ReportBridge.java
  7. 28
      src/main/java/com/fr/plugin/pack/ReportDef.java
  8. 17
      src/main/java/com/fr/plugin/pack/ShowBridge.java
  9. 29
      src/main/java/com/fr/plugin/pack/ShowDef.java
  10. 5
      src/main/resources/com/fr/plugin/pack/report.js
  11. 5
      src/main/resources/com/fr/plugin/pack/show.js

7
.gitignore vendored

@ -0,0 +1,7 @@
.idea
lib
.project
*.iml
.settings
classes/
target/

2
README.md

@ -0,0 +1,2 @@
### 插件调试环境搭建
1.

121
build.xml

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home"/>
<property name="libs" value="${basedir}/lib"/>
<!-- <property name="dependenceLibs" value="${basedir}/dependence"/>-->
<!-- <property name="FRLibs" value="E:\jar-FR\10.0-idea"/>-->
<property name="destLoc" value="."/>
<property name="classes" value="/Users/leezerofly/env/direct-bi/WEB-INF/plugins/plugin-com.fr.plugin.hw.import.excel-2.0.0/classes"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<property name="current-version" value="${plugin.version}"/>
<property name="current-id" value="${plugin.id}"/>
<property name="plugin-version" value="${current-version}"/>
<property name="plugin-name" value="hwExcelExport"/>
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/>
<!-- <target name="prepare">-->
<!-- <delete dir="${classes}"/>-->
<!-- </target>-->
<path id="compile.classpath">
<!-- <fileset dir="${FRLibs}">-->
<!-- <include name="**/*.jar"/>-->
<!-- </fileset>-->
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
<!-- <fileset dir="${dependenceLibs}">-->
<!-- <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\java">-->
<!-- <patternset refid="resources4Jar"/>-->
<!-- </fileset>-->
<!-- </copy>-->
<!-- <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="true" optimize="on" source="${source_jdk_version}"-->
<!-- target="${target_jdk_version}"-->
<!-- fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}"-->
<!-- executable="${compile_jdk_version}/bin/javac" includeantruntime="on">-->
<!-- <src path="${basedir}/src"/>-->
<!-- <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">
<!-- <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="*.jar"/>
<include name="plugin.xml"/>
</fileset>
</copy>
<zip destfile="${basedir}/${plugin-folder}.zip" basedir=".">
<include name="${plugin-folder}/*.jar"/>
<include name="${plugin-folder}/plugin.xml"/>
</zip>
<xmlproperty file="${basedir}/plugin.xml"/>
<delete dir="${plugin-folder}"/>
<delete file="${plugin-jar}" />
</target>
</project>

32
plugin.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin>
<id>com.fr.plugin.pack.request</id>
<name><![CDATA[仪表板请求打包]]></name>
<active>yes</active>
<version>0.0.1</version>
<env-version>10.0</env-version>
<jartime>2020-08-07</jartime>
<vendor>帆软</vendor>
<description><![CDATA[将仪表板获取组件信息的请求打包,提高加载速度]]></description>
<change-notes><![CDATA[]]></change-notes>
<extra-decision>
<WebResourceProvider class="com.fr.plugin.pack.ReportBridge"/>
<WebResourceProvider class="com.fr.plugin.pack.ShowBridge"/>
</extra-decision>
<!-- <extra-decision>-->
<!-- <SystemOptionProvider class="com.fr.plugin.decision.HWOptionProvider"/>-->
<!-- <HttpHandlerProvider class="com.fr.plugin.decision.request.HWHandlerProvider"/>-->
<!-- <URLAliasProvider class="com.fr.plugin.decision.request.HWURLAliasProvider"/>-->
<!-- <HttpHandlerProvider class="com.fr.plugin.decision.ExcelMngHandleBridge"/>-->
<!-- <URLAliasProvider class="com.fr.plugin.decision.ExcelMngAliasBridge"/>-->
<!-- </extra-decision>-->
<!-- <extra-core>-->
<!-- <DBAccessProvider class="com.fr.plugin.decision.ExcelMngConfigAccessBridge"/>-->
<!-- <DBAccessProvider class="com.fr.plugin.decision.ReuseConfigAccessBridge"/>-->
<!-- <DialectCreator class="com.fr.plugin.decision.dialect.DialectCreator"/>-->
<!-- </extra-core>-->
<function-recorder class="com.fr.plugin.decision.ReportBridge"/>
<!-- <function-recorder class="com.fr.plugin.decision.HWOptionProvider"/>-->
</plugin>

40
pom.xml

@ -0,0 +1,40 @@
<?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>
<groupId>com.finebi.project</groupId>
<artifactId>nuclear-maven</artifactId>
<version>5.0-RELEASE-SNAPSHOT</version>
<relativePath>../nuclear-maven/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>plugin-pack-request</artifactId>
<dependencies>
<dependency>
<groupId>com.finebi</groupId>
<artifactId>direct-adapter-sdk</artifactId>
<version>${foundation-version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<outputDirectory>/Users/leezerofly/env/direct-bi/WEB-INF/plugins/plugin-com.fr.plugin.pack.request-0.0.1/classes</outputDirectory>
</build>
</project>

17
src/main/java/com/fr/plugin/pack/ReportBridge.java

@ -0,0 +1,17 @@
package com.fr.plugin.pack;
import com.finebi.conf.internalimp.component.ReportComponent;
import com.fr.decision.fun.impl.AbstractWebResourceProvider;
import com.fr.web.struct.Atom;
public class ReportBridge extends AbstractWebResourceProvider {
@Override
public Atom attach() {
return ReportComponent.KEY;
}
@Override
public Atom client() {
return ReportDef.KEY;
}
}

28
src/main/java/com/fr/plugin/pack/ReportDef.java

@ -0,0 +1,28 @@
package com.fr.plugin.pack;
import com.fr.web.struct.Component;
import com.fr.web.struct.Filter;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
public class ReportDef extends Component {
public static final ReportDef KEY = new ReportDef();
public ReportDef(){}
public ScriptPath script(RequestClient client ) {
return ScriptPath.build("com/fr/plugin/pack/report.js");
}
public StylePath style(RequestClient client ) {
return StylePath.build("com/fr/plugin/pack/report.css");
}
public Filter filter() {
return new Filter(){
@Override
public boolean accept() {
return true;
}
};
}
}

17
src/main/java/com/fr/plugin/pack/ShowBridge.java

@ -0,0 +1,17 @@
package com.fr.plugin.pack;
import com.finebi.conf.internalimp.component.ShowComponent;
import com.fr.decision.fun.impl.AbstractWebResourceProvider;
import com.fr.web.struct.Atom;
public class ShowBridge extends AbstractWebResourceProvider {
@Override
public Atom attach() {
return ShowComponent.KEY;
}
@Override
public Atom client() {
return ShowDef.KEY;
}
}

29
src/main/java/com/fr/plugin/pack/ShowDef.java

@ -0,0 +1,29 @@
package com.fr.plugin.pack;
import com.fr.web.struct.Component;
import com.fr.web.struct.Filter;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
public class ShowDef extends Component {
public static final ShowDef KEY = new ShowDef();
public ShowDef(){}
public ScriptPath script( RequestClient client ) {
return ScriptPath.build("com/fr/plugin/enadaptation/show.js");
}
public StylePath style( RequestClient client ) {
return StylePath.build("com/fr/plugin/enadaptation/show.css");
}
public Filter filter() {
return new Filter(){
@Override
public boolean accept() {
return true;
}
};
}
}

5
src/main/resources/com/fr/plugin/pack/report.js

@ -0,0 +1,5 @@
;(function() {
console.log("report js loaded");
})();

5
src/main/resources/com/fr/plugin/pack/show.js

@ -0,0 +1,5 @@
;(function() {
console.log("show js loaded");
})();
Loading…
Cancel
Save