Browse Source

挂载模板展示类型Demo插件

master
Roger.Chen 4 years ago
commit
5180616856
  1. 0
      README.md
  2. 22
      plugin.xml
  3. 42
      pom.xml
  4. 20
      src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java
  5. 28
      src/main/java/com/fr/plugin/showtype/NewPreviewType.java
  6. 15
      src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java
  7. 28
      src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java
  8. 1
      src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties
  9. 1
      src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties
  10. 1
      src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties
  11. 16
      src/main/resources/com/fr/plugin/showtype/web/show_types.js

22
plugin.xml

@ -0,0 +1,22 @@
<?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.0</version>
<env-version>10.0</env-version>
<jartime>2020-08-26</jartime>
<vendor>finereport.mata</vendor>
<description><![CDATA[新预览显示类型]]></description>
<change-notes><![CDATA[
<p>[2020-08-26]新预览显示类型</p>
]]>
</change-notes>
<extra-core>
<LocaleFinder class="com.fr.plugin.showtype.NewPreviewTypeLocaleFinder"/>
</extra-core>
<extra-decision>
<TemplateShowTypeProvider class="com.fr.plugin.showtype.NewPreviewTypeProvider"/>
</extra-decision>
<function-recorder class="com.fr.plugin.showtype.NewPreviewType"/>
</plugin>

42
pom.xml

@ -0,0 +1,42 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.fr.plugin</groupId>
<artifactId>starter</artifactId>
<version>10.0</version>
</parent>
<artifactId>demo-show-type</artifactId>
<dependencies>
<dependency>
<groupId>com.fr.core</groupId>
<artifactId>fine-core</artifactId>
<version>10.0-RELEASE-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<!---如果要更改调试插件,改这里的配置就可以了-->
<outputDirectory>
${project.basedir}/../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>

20
src/main/java/com/fr/plugin/showtype/NewPreviewComponent.java

@ -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");
}
}

28
src/main/java/com/fr/plugin/showtype/NewPreviewType.java

@ -0,0 +1,28 @@
package com.fr.plugin.showtype;
import com.fr.decision.authority.base.constant.type.show.ShowType;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.record.analyzer.EnableMetrics;
/**
* @Author Roger
* @Date 2020/8/18 18:18
* @Version 10.0
*/
@EnableMetrics
public class NewPreviewType extends ShowType {
public static final NewPreviewType KEY = new NewPreviewType();
@Override
@Focus(id = "com.fr.plugin.showtype.v10", text = "Fine-Plugin_New_Preview_Type", source = Original.PLUGIN)
protected int getTypeValue() {
return 8;
}
@Override
public String getTypeName() {
return "newPreview";
}
}

15
src/main/java/com/fr/plugin/showtype/NewPreviewTypeLocaleFinder.java

@ -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";
}
}

28
src/main/java/com/fr/plugin/showtype/NewPreviewTypeProvider.java

@ -0,0 +1,28 @@
package com.fr.plugin.showtype;
import com.fr.decision.authority.base.constant.type.show.ShowType;
import com.fr.decision.fun.impl.AbstractTemplateShowTypeProvider;
import com.fr.web.struct.Atom;
/**
* @Author Roger
* @Date 2020/8/18 17:42
* @Version 10.0
*/
public class NewPreviewTypeProvider extends AbstractTemplateShowTypeProvider {
@Override
public String nameForShowType() {
return "newPreview";
}
@Override
public ShowType registerShowType() {
return NewPreviewType.KEY;
}
@Override
public Atom client() {
return NewPreviewComponent.KEY;
}
}

1
src/main/resources/com/fr/plugin/showtype/locale/newPreview.properties

@ -0,0 +1 @@
Fine-Plugin_New_Preview_Type=New_Preview_Type

1
src/main/resources/com/fr/plugin/showtype/locale/newPreview_en_US.properties

@ -0,0 +1 @@
Fine-Plugin_New_Preview_Type=New_Preview_Type

1
src/main/resources/com/fr/plugin/showtype/locale/newPreview_zh_CN.properties

@ -0,0 +1 @@
Fine-Plugin_New_Preview_Type=\u65b0\u9884\u89c8

16
src/main/resources/com/fr/plugin/showtype/web/show_types.js

@ -0,0 +1,16 @@
!(function () {
BI.config("dec.provider.report.template.show_types", function (provider) {
provider.inject({
showTypes: {
suffix: "frm",
types: [
{
text: BI.i18nText("新预览"),
defaultValue: true,
value: 8,
},
],
},
});
});
}())
Loading…
Cancel
Save