Browse Source

初始化

pull/1/head
richie 6 years ago
parent
commit
0decc137e1
  1. 6
      plugin.xml
  2. 23
      src/main/java/com/fr/plugin/file/submit/oss/OssLifeCycleMonitor.java
  3. 15
      src/main/java/com/fr/plugin/file/submit/oss/conf/FileSubmitOssServerConfig.java
  4. 7
      src/main/resources/com/fr/plugin/file/submit/oss/submit.properties
  5. 7
      src/main/resources/com/fr/plugin/file/submit/oss/submit_zh_CN.properties

6
plugin.xml

@ -2,12 +2,13 @@
<id>com.fr.plugin.file.submit.oss</id>
<name><![CDATA[文件上传下载(OSS)]]></name>
<active>yes</active>
<version>2.4</version>
<version>2.5</version>
<env-version>10.0</env-version>
<jartime>2018-11-02</jartime>
<jartime>2018-11-30</jartime>
<vendor>author</vendor>
<description><![CDATA[文件上传至阿里云的OSS中。]]></description>
<change-notes><![CDATA[
[2018-12-04]提供Oss的可视化配置界面。<br/>
[2018-11-26]修复文件名中包含特殊字符时无法下载的问题。<br/>
[2018-11-21]修复扩展单元格无法正确上传文件的问题。<br/>
[2018-11-06]提供函数OssFile2Image,可以将OSS中的图片文件展示到报表中。<br/>
@ -32,4 +33,5 @@
<HyperlinkProvider class="com.fr.plugin.file.submit.oss.OssHyperlink4Download"/>
</extra-designer>
<function-recorder class="com.fr.plugin.file.submit.oss.job.OssSubmitJob"/>
<lifecycle-monitor class="com.fr.plugin.file.submit.oss.OssLifeCycleMonitor"/>
</plugin>

23
src/main/java/com/fr/plugin/file/submit/oss/OssLifeCycleMonitor.java

@ -0,0 +1,23 @@
package com.fr.plugin.file.submit.oss;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.file.submit.oss.conf.FileSubmitOssServerConfig;
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor;
/**
* @author richie
* @version 10.0
* Created by richie on 2018-12-04
*/
public class OssLifeCycleMonitor extends AbstractPluginLifecycleMonitor {
@Override
public void afterRun(PluginContext pluginContext) {
// 只是为了初始化一下配置类
FileSubmitOssServerConfig.getInstance();
}
@Override
public void beforeStop(PluginContext pluginContext) {
}
}

15
src/main/java/com/fr/plugin/file/submit/oss/conf/FileSubmitOssServerConfig.java

@ -3,10 +3,14 @@ package com.fr.plugin.file.submit.oss.conf;
import com.fr.config.ConfigContext;
import com.fr.config.DefaultConfiguration;
import com.fr.config.Identifier;
import com.fr.config.Status;
import com.fr.config.Visualization;
import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders;
import com.fr.config.holder.impl.ColConf;
import com.fr.config.holder.impl.ObjConf;
import com.fr.intelli.record.Focus;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.collections4.CollectionUtils;
@ -19,6 +23,8 @@ import java.util.Set;
/**
* OSS文件上传下载所使用的OSS配置
*/
@Visualization(category = "Plugin-Oss_Settings")
@EnableMetrics
public class FileSubmitOssServerConfig extends DefaultConfiguration {
private static volatile FileSubmitOssServerConfig instance = null;
@ -31,16 +37,16 @@ public class FileSubmitOssServerConfig extends DefaultConfiguration {
}
// 地域节点配置信息
@Identifier("endPoint")
@Identifier(value = "endPoint", name = "EndPoint", description = "Plugin-Oss_End_Point", status = Status.SHOW)
private Conf<String> endPoint = Holders.simple(StringUtils.EMPTY);
@Identifier("accessKeyId")
@Identifier(value = "accessKeyId", name = "AccessKeyId", description = "Plugin-Oss_AccessKeyId", status = Status.SHOW)
private Conf<String> accessKeyId = Holders.simple(StringUtils.EMPTY);
@Identifier("accessKeySecret")
@Identifier(value = "accessKeySecret", name = "AccessKeySecret", description = "Plugin-Oss_AccessKeySecret", status = Status.SHOW)
private Conf<String> accessKeySecret = Holders.simple(StringUtils.EMPTY);
@Identifier("buckets")
@Identifier(value = "buckets", name = "Buckets", description = "Plugin-Oss_Buckets", status = Status.SHOW)
private ColConf<Collection<String>> buckets = Holders.collection(new ArrayList<String>(), String.class);
public String getEndPoint() {
@ -81,6 +87,7 @@ public class FileSubmitOssServerConfig extends DefaultConfiguration {
}
@Override
@Focus(id="com.fr.plugin.file.submit.oss", text = "Plugin-File_Submit_Oss")
public Object clone() throws CloneNotSupportedException {
FileSubmitOssServerConfig cloned = (FileSubmitOssServerConfig) super.clone();
cloned.endPoint = (Conf<String>) endPoint.clone();

7
src/main/resources/com/fr/plugin/file/submit/oss/submit.properties

@ -6,4 +6,9 @@ Plugin-File_Submit_Oss_File_Name=File name
Plugin-File_Submit_Oss_Editor_Formula=Formula
Plugin-File_Submit_Oss_Disable=Disabled
Plugin-File_Download_Oss=Download(OSS)
Plugin-File_Download_Hyperlink=Hyperlink(OSS)
Plugin-File_Download_Hyperlink=Hyperlink(OSS)
Plugin-Oss_Settings=Oss Settings
Plugin-Oss_End_Point=EndPoint
Plugin-Oss_Buckets=Buckets
Plugin-Oss_AccessKeyId=AccessKeyId
Plugin-Oss_AccessKeySecret=AccessKeySecret

7
src/main/resources/com/fr/plugin/file/submit/oss/submit_zh_CN.properties

@ -6,4 +6,9 @@ Plugin-File_Submit_Oss_File_Name=\u6587\u4EF6\u540D
Plugin-File_Submit_Oss_Editor_Formula=\u516C\u5F0F
Plugin-File_Submit_Oss_Disable=\u4E0D\u53EF\u7F16\u8F91
Plugin-File_Download_Oss=\u6587\u4EF6\u4E0B\u8F7D\uFF08OSS\uFF09
Plugin-File_Download_Hyperlink=\u6587\u4EF6\u4E0B\u8F7D\uFF08OSS\uFF09
Plugin-File_Download_Hyperlink=\u6587\u4EF6\u4E0B\u8F7D\uFF08OSS\uFF09
Plugin-Oss_Settings=OSS\u914D\u7F6E
Plugin-Oss_End_Point=\u5730\u57DF\u8282\u70B9\u4FE1\u606F
Plugin-Oss_Buckets=Buckets
Plugin-Oss_AccessKeyId=AccessKeyId
Plugin-Oss_AccessKeySecret=AccessKeySecret
Loading…
Cancel
Save