commit 1459cf034039582bed62c4df06ca829b4824a3c5 Author: onlyxx Date: Sun Dec 20 12:14:45 2020 +0800 lean 4 diff --git a/encrypt.xml b/encrypt.xml new file mode 100644 index 0000000..1401cd1 --- /dev/null +++ b/encrypt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/gson-2.3.1.jar b/lib/gson-2.3.1.jar new file mode 100644 index 0000000..250132c Binary files /dev/null and b/lib/gson-2.3.1.jar differ diff --git a/lib/report/.gitkeep b/lib/report/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..3debd09 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,19 @@ + + com.fr.plugin.fineui.lean + + yes + 1.0 + 10.0 + 2018-07-31 + author + + + [2018-07-31]初始化插件。
+ ]]>
+ + + + + +
\ No newline at end of file diff --git a/src/main/java/com/fr/plugin/LeanFileDef.java b/src/main/java/com/fr/plugin/LeanFileDef.java new file mode 100644 index 0000000..f682a15 --- /dev/null +++ b/src/main/java/com/fr/plugin/LeanFileDef.java @@ -0,0 +1,50 @@ +package com.fr.plugin; + + +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.plugin.transform.FunctionRecorder; +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; + +@FunctionRecorder +public class LeanFileDef extends Component { + public static final LeanFileDef KEY = new LeanFileDef(); + private LeanFileDef(){} + /** + * 返回需要引入的JS脚本路径 + * @param client 请求客户端描述 + * @return JS脚本路径 + */ + public ScriptPath script( RequestClient client ) { + //如果不需要就直接返回 ScriptPath.EMPTY + return ScriptPath.build("com/fr/plugin/web/lean.js"); + } + + /** + * 返回需要引入的CSS样式路径 + * @param client 请求客户端描述 + * @return CSS样式路径 + */ + public StylePath style( RequestClient client ) { + //如果不需要就直接返回 StylePath.EMPTY; + return StylePath.build("com/fr/plugin/web/lean.css"); + } + + /** + * 通过给定的资源过滤器控制是否加载这个资源 + * @return 资源过滤器 + */ + @ExecuteFunctionRecord + public Filter filter() { + return new Filter(){ + @Override + public boolean accept() { + //任何情况下我们都在平台组件加载时加载我们的组件 + return true; + } + }; + } +} diff --git a/src/main/java/com/fr/plugin/LeanHttpHandler.java b/src/main/java/com/fr/plugin/LeanHttpHandler.java new file mode 100644 index 0000000..a4c6e38 --- /dev/null +++ b/src/main/java/com/fr/plugin/LeanHttpHandler.java @@ -0,0 +1,42 @@ +package com.fr.plugin; + +import com.fr.decision.fun.HttpHandler; +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.decision.web.LoginComponent; +import com.fr.decision.webservice.utils.WebServiceUtils; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.Browser; +import com.fr.web.struct.AtomBuilder; +import com.fr.web.struct.PathGroup; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +// +public class LeanHttpHandler extends BaseHttpHandler { + @Override + public RequestMethod getMethod() { + //如果返回null表示 支持任意类型 + //return RequestMethod.GET + //return RequestMethod.POST + return null; + } + + @Override + public String getPath() { + return "/leanFineUI"; + } + + @Override + public boolean isPublic() { + //这里要和注册短url那儿一致 + return true; + } + + @Override + public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { + String html = WebServiceUtils.parseWebPageResourceSafe("com/fr/plugin/web/lean.html",new HashMap<>()); + WebUtils.printAsString(response, html); + } +} diff --git a/src/main/java/com/fr/plugin/LeanHttpProvider.java b/src/main/java/com/fr/plugin/LeanHttpProvider.java new file mode 100644 index 0000000..014092d --- /dev/null +++ b/src/main/java/com/fr/plugin/LeanHttpProvider.java @@ -0,0 +1,13 @@ +package com.fr.plugin; + +import com.fr.decision.fun.HttpHandler; +import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; + +public class LeanHttpProvider extends AbstractHttpHandlerProvider { + @Override + public HttpHandler[] registerHandlers() { + return new HttpHandler[]{ + new LeanHttpHandler() + }; + } +} diff --git a/src/main/java/com/fr/plugin/LeanJSCSSBridge.java b/src/main/java/com/fr/plugin/LeanJSCSSBridge.java new file mode 100644 index 0000000..d4d8dbc --- /dev/null +++ b/src/main/java/com/fr/plugin/LeanJSCSSBridge.java @@ -0,0 +1,20 @@ +package com.fr.plugin; + + +import com.fr.decision.fun.impl.AbstractWebResourceProvider; +import com.fr.decision.web.MainComponent; +import com.fr.web.struct.Atom; + +public class LeanJSCSSBridge extends AbstractWebResourceProvider { + @Override + public Atom attach() { + //在平台主组件加载时添加我们自己的组件 + return MainComponent.KEY; + } + + @Override + public Atom client() { + //我们自己要引入的组件 + return LeanFileDef.KEY; + } +} diff --git a/src/main/java/com/fr/plugin/MyFunctionConstants.java b/src/main/java/com/fr/plugin/MyFunctionConstants.java new file mode 100644 index 0000000..ac36e77 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyFunctionConstants.java @@ -0,0 +1,6 @@ +package com.fr.plugin; + +public class MyFunctionConstants { + + public static final String PLUGIN_ID = "com.fr.plugin.fineui.lean"; +} diff --git a/src/main/java/com/fr/plugin/MyURLAliasProvider.java b/src/main/java/com/fr/plugin/MyURLAliasProvider.java new file mode 100644 index 0000000..23110d8 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyURLAliasProvider.java @@ -0,0 +1,16 @@ +package com.fr.plugin; + +import com.fr.decision.fun.impl.AbstractURLAliasProvider; +import com.fr.decision.webservice.url.alias.URLAlias; +import com.fr.decision.webservice.url.alias.URLAliasFactory; +import com.fr.plugin.transform.FunctionRecorder; + +@FunctionRecorder +public class MyURLAliasProvider extends AbstractURLAliasProvider { + @Override + public URLAlias[] registerAlias() { + return new URLAlias[]{ + URLAliasFactory.createPluginAlias("/leanFineUI123","/leanFineUI",true) + }; + } +} diff --git a/src/main/resources/com/fr/plugin/demo.properties b/src/main/resources/com/fr/plugin/demo.properties new file mode 100644 index 0000000..9bc5f29 --- /dev/null +++ b/src/main/resources/com/fr/plugin/demo.properties @@ -0,0 +1 @@ +Plugin-Test_Function_Abs=Test ABS \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/demo_zh_CN.properties b/src/main/resources/com/fr/plugin/demo_zh_CN.properties new file mode 100644 index 0000000..aa910e8 --- /dev/null +++ b/src/main/resources/com/fr/plugin/demo_zh_CN.properties @@ -0,0 +1 @@ +Plugin-Test_Function_Abs=测试ABS函数 \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/web/lean.css b/src/main/resources/com/fr/plugin/web/lean.css new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/com/fr/plugin/web/lean.html b/src/main/resources/com/fr/plugin/web/lean.html new file mode 100644 index 0000000..1986738 --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/lean.html @@ -0,0 +1,138 @@ + + + + + + + 学习FINE UI工具页 + + + + + + + + +
+
+${somea} +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/web/lean.js b/src/main/resources/com/fr/plugin/web/lean.js new file mode 100644 index 0000000..515e29b --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/lean.js @@ -0,0 +1 @@ +alert("this is my first alert"); \ No newline at end of file