Browse Source
* commit '941ae19584a631226c66844b2d1fd1cb167a2421': pom use kit update kit update update md sample update id DEC-8925 插件上传代码feature/10.0
17 changed files with 378 additions and 3 deletions
@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<project basedir="." default="jar" name="fileserver-seed"> |
||||
<!-- JDK路径,根据自己机器上实际位置修改--> |
||||
<property name="jdk.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"/> |
||||
|
||||
<property name="libs" value="${basedir}/lib"/> |
||||
<property name="publicLibs" value=""/> |
||||
<property name="destLoc" value="."/> |
||||
<property name="classes" value="classes"/> |
||||
|
||||
<xmlproperty file="${basedir}/plugin.xml"/> |
||||
<property name="current-version" value="${plugin.version}"/> |
||||
|
||||
<!-- 插件版本--> |
||||
<property name="plugin-version" value="${current-version}"/> |
||||
<!-- 插件名字--> |
||||
<property name="plugin-name" value="decision-fileserver-seed"/> |
||||
<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> |
||||
</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" 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"/> |
||||
<exclude name="**/.svn/**"/> |
||||
<compilerarg line="-encoding UTF8 "/> |
||||
<classpath refid="compile.classpath"/> |
||||
</javac> |
||||
<taskdef name="pretreatment" classname="com.fr.plugin.pack.PluginPretreatmentTask"> |
||||
<classpath refid="compile.classpath"/> |
||||
</taskdef> |
||||
<pretreatment baseDir="${basedir}"/> |
||||
</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.6"/> |
||||
<param name="target_jdk_version" value="1.6"/> |
||||
<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> |
||||
</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"/> |
||||
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/> |
||||
</target> |
||||
</project> |
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<plugin> |
||||
<id>com.fr.plugin.decision.fileserver.seed</id> |
||||
<name><![CDATA[共享外部目录]]></name> |
||||
<active>yes</active> |
||||
<hidden>no</hidden> |
||||
<version>1.0</version> |
||||
<env-version>10.0</env-version> |
||||
<jartime>2018-10-30</jartime> |
||||
<vendor>rinoux</vendor> |
||||
<description><![CDATA[以某个集群一致的文件夹作为资源仓库,比如NAS,共享磁盘挂载目录]]></description> |
||||
<change-notes><![CDATA[无]]></change-notes> |
||||
<!--主包--> |
||||
<main-package>com.fr.plugin</main-package> |
||||
<!--功能记录点类--> |
||||
<function-recorder class="com.fr.plugin.seed.repository.SEEDFactoryProvider"/> |
||||
|
||||
<extra-core> |
||||
<LocaleFinder class="com.fr.plugin.seed.repository.SEEDLocaleFinder"/> |
||||
</extra-core> |
||||
<extra-decision> |
||||
<WebResourceProvider class="com.fr.plugin.seed.repository.decision.SEEDWebResource"/> |
||||
</extra-decision> |
||||
<extra-core> |
||||
<ResourceRepositoryFactoryProvider class="com.fr.plugin.seed.repository.SEEDFactoryProvider"/> |
||||
</extra-core> |
||||
</plugin> |
@ -0,0 +1,30 @@
|
||||
<?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> |
||||
|
||||
<packaging>jar</packaging> |
||||
<artifactId>com.fr.plugin.***m</artifactId> |
||||
<build> |
||||
<!---如果要更改调试插件,改这里的配置就可以了--> |
||||
<outputDirectory> |
||||
${project.basedir}\..\webroot\WEB-INF\plugins\plugin-com.fr.plugin.***-版本\classes |
||||
</outputDirectory> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<configuration> |
||||
<source>6</source> |
||||
<target>6</target> |
||||
</configuration> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
</project> |
@ -1,4 +1,15 @@
|
||||
## 共享外部目录插件 |
||||
- 进入集群管理/文件服务器,协议选择共享外部目录,设置目录; |
||||
- 集群下所有节点的目录相同,目录下的内容应该用其它方式保证一致,比如linux的file sync、NAS挂载或者其它手段; |
||||
- 要求服务器启动用户对此目录有读写权限; |
||||
> Shared Ensured External Directory |
||||
|
||||
### 使用 |
||||
- 进入`智能运维`/`集群配置`/`文件服务器`,协议选择`共享外部目录`,设置目录路径; |
||||
- 集群下所有节点的目录相同,目录下的内容应该用其它方式保证一致,比如*linux的file sync*、*NAS挂载*或者其它手段; |
||||
- 要求服务器启动用户对此目录有**读写权限**; |
||||
|
||||
### 示例: |
||||
 |
||||
|
||||
|
||||
|
||||
### 文档见 |
||||
[产品使用文档](https://kms.finedevelop.com/pages/viewpage.action?pageId=45603124) |
After Width: | Height: | Size: 40 KiB |
@ -0,0 +1,33 @@
|
||||
package com.fr.plugin.seed.repository; |
||||
|
||||
import com.fanruan.api.io.ResourceModuleKit; |
||||
import com.fr.io.base.provider.RepositoryFactoryProvider; |
||||
import com.fr.io.fun.AbstractRepositoryFactoryProvider; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.plugin.seed.repository.core.SEEDRepositoryFactory; |
||||
import com.fr.plugin.transform.ExecuteFunctionRecord; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
|
||||
/** |
||||
* SEED, Shared Ensured External Directory共享外部目录 |
||||
* <p> |
||||
* Created by rinoux on 2018-11-30. |
||||
*/ |
||||
@FunctionRecorder |
||||
public class SEEDFactoryProvider extends AbstractRepositoryFactoryProvider { |
||||
private static final SEEDRepositoryFactory FACTORY = new SEEDRepositoryFactory(); |
||||
|
||||
static { |
||||
try { |
||||
ResourceModuleKit.addFactory(FACTORY); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error("Add repository factory {} failed.", FACTORY.getIdentity()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@ExecuteFunctionRecord |
||||
public RepositoryFactoryProvider getFactory() { |
||||
return FACTORY; |
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.fr.plugin.seed.repository; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||
|
||||
/** |
||||
* @author rinoux |
||||
* @version 10.0 |
||||
* Created by rinoux on 2019/9/5 |
||||
*/ |
||||
public class SEEDLocaleFinder extends AbstractLocaleFinder { |
||||
@Override |
||||
public String find() { |
||||
return "com/fr/plugin/locale/seed"; |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.plugin.seed.repository.core; |
||||
|
||||
import com.fr.io.base.provider.impl.SimpleRepositoryFactory; |
||||
import com.fr.io.config.RepositoryConfig; |
||||
import com.fr.io.repository.ResourceRepository; |
||||
import com.fr.io.repository.base.fs.FileSystemRepository; |
||||
|
||||
/** |
||||
* Created by rinoux on 2018-11-30. |
||||
*/ |
||||
public class SEEDRepositoryFactory extends SimpleRepositoryFactory { |
||||
|
||||
public SEEDRepositoryFactory() { |
||||
super("SEED"); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public ResourceRepository produce(String repoName, String workRoot) { |
||||
return new FileSystemRepository(repoName, workRoot); |
||||
} |
||||
} |
@ -0,0 +1,18 @@
|
||||
package com.fr.plugin.seed.repository.decision; |
||||
|
||||
import com.fr.web.struct.Component; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
|
||||
/** |
||||
* Created by rinoux on 2018-11-30. |
||||
*/ |
||||
public class SEEDComponent extends Component { |
||||
|
||||
public static final SEEDComponent KEY = new SEEDComponent(); |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("com/fr/plugin/seed/repository/decision/js/bundle.js"); |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.plugin.seed.repository.decision; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||
import com.fr.decision.web.MainComponent; |
||||
import com.fr.web.struct.Atom; |
||||
|
||||
/** |
||||
* Created by rinoux on 2018-11-30. |
||||
*/ |
||||
public class SEEDWebResource extends AbstractWebResourceProvider { |
||||
@Override |
||||
public Atom attach() { |
||||
return MainComponent.KEY; |
||||
} |
||||
|
||||
@Override |
||||
public Atom client() { |
||||
return SEEDComponent.KEY; |
||||
} |
||||
} |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=\u5171\u4EAB\u5916\u90E8\u76EE\u5F55 |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=Shared External Directory |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=\u5171\u6709\u5916\u90E8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=\uACF5\uC720 \uC678\uBD80 \uB514\uB809\uD1A0\uB9AC |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=\u5171\u4EAB\u5916\u90E8\u76EE\u5F55 |
@ -0,0 +1 @@
|
||||
Plugin-Seed_Title=\u5171\u4EAB\u5916\u90E8\u76EE\u9304 |
@ -0,0 +1,71 @@
|
||||
BI.config("dec.constant.intelligence.cluster.file.server", function (items) { |
||||
items.push({ |
||||
value: "SEED", |
||||
id: "decision-intelligence-cluster-file-seed", // id
|
||||
text: BI.i18nText("Plugin-Seed_Title"), // 文字
|
||||
cardType: "dec.intelligence.cluster.file.seed" |
||||
}); |
||||
return items; |
||||
}); |
||||
|
||||
|
||||
!(function () { |
||||
var LABEL_WIDTH = 116, EDITOR_WIDTH = 300; |
||||
var SEED = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "dec-cluster-ftp", |
||||
value: {} |
||||
}, |
||||
|
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.intelligence.cluster.file.seed", { |
||||
value: this.options.value |
||||
}); |
||||
}, |
||||
|
||||
watch: {}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
return { |
||||
type: "bi.vertical", |
||||
tgap: 15, |
||||
items: [] |
||||
}; |
||||
}, |
||||
|
||||
getValue: function () { |
||||
return {}; |
||||
}, |
||||
|
||||
validation: function () { |
||||
return true; |
||||
} |
||||
}); |
||||
BI.shortcut("dec.intelligence.cluster.file.seed", SEED); |
||||
})(); |
||||
|
||||
|
||||
!(function () { |
||||
var Model = BI.inherit(Fix.Model, { |
||||
|
||||
state: function () { |
||||
var val = this.options.value; |
||||
return {}; |
||||
}, |
||||
|
||||
computed: { |
||||
encodingArray: function () { |
||||
return BI.map(DecCst.EncodeConstants.ENCODING_ARRAY, function (i, v) { |
||||
return { |
||||
value: v |
||||
}; |
||||
}); |
||||
} |
||||
}, |
||||
|
||||
actions: {} |
||||
}); |
||||
BI.model("dec.model.intelligence.cluster.file.seed", Model); |
||||
})(); |
Loading…
Reference in new issue