Browse Source

Merge pull request #2 in ~WIM.ZHAI/xdesign from DESIGN/design:release/10.0 to release/10.0

* commit 'bb46322b0af75c8ae08112c5d254dbba2c140fcb':
  无JIRA任务 findbugs问题
  REPORT-11880 SimilarSearchManeger拼错了....
  REPORT-11950 设计器内插件管理与平台内插件管理的授权字样不一致
final/10.0
Wim.Zhai 6 years ago
parent
commit
8c0eb49069
  1. 2
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  2. 16
      designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java
  3. 5
      designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java
  4. 36
      designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java
  5. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  6. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java
  7. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  8. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
  9. 10
      designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java

2
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -230,7 +230,7 @@ public class PluginUtils {
jo.put("licDamaged", pluginContext.isLicDamaged());
jo.put("available", pluginContext.isAvailable());
jo.put("leftDays", pluginContext.getLeftDays());
jo.put("trial", pluginContext.isOnTrial());
jo.put("onTrial", pluginContext.isOnTrial());
jo.put("deadline", getDeadline(pluginContext));
jo.put("registerFailed", pluginContext.isRegisterFailed());
ja.put(jo);

16
designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java

@ -4,7 +4,11 @@ package com.fr.design.onlineupdate.domain;
* Created by XINZAI on 2018/8/21.
*/
import com.fr.third.org.apache.commons.collections4.collection.UnmodifiableCollection;
import com.fr.third.org.apache.commons.collections4.list.UnmodifiableList;
import java.awt.Color;
import java.util.Arrays;
/**
* 更新升级的常量
@ -28,7 +32,7 @@ public interface UpdateConstants {
int BYTE = 153600;
String[] JARS_FOR_SERVER_X = new String[]{
UnmodifiableList JARS_FOR_SERVER_X = new UnmodifiableList(Arrays.asList(new String[]{
"fine-activator-10.0.jar",
"fine-core-10.0.jar",
"fine-report-engine-10.0.jar",
@ -41,16 +45,16 @@ public interface UpdateConstants {
"fine-datasource-10.0.jar",
"fine-third-10.0.jar",
"fine-accumulator-10.0.jar"
};
}));
String[] JARS_FOR_DESIGNER_X = new String[]{
UnmodifiableList JARS_FOR_DESIGNER_X = new UnmodifiableList(Arrays.asList(new String[]{
"fine-report-designer-10.0.jar",
"aspectjrt.jar"
};
}));
String[] LOG_TYPE = new String[]{
UnmodifiableList LOG_TYPE = new UnmodifiableList(Arrays.asList(new String[]{
"REPORT", "MOBILE", "CHART", "PFC", "BI"
};
}));
}

5
designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java

@ -27,6 +27,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -161,7 +162,7 @@ public class RestoreResultDialog extends JDialog {
}
private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, java.util.List<String> list) {
String[] files = UpdateConstants.JARS_FOR_DESIGNER_X;
List<String> files = UpdateConstants.JARS_FOR_DESIGNER_X;
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
for (String file : files) {
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file),
@ -171,7 +172,7 @@ public class RestoreResultDialog extends JDialog {
}
private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, java.util.List<String> list) {
String[] files = UpdateConstants.JARS_FOR_SERVER_X;
List<String> files = UpdateConstants.JARS_FOR_SERVER_X;
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
for (String file : files) {
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file),

36
designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java

@ -58,12 +58,7 @@ import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -443,8 +438,8 @@ public class UpdateMainDialog extends UIDialog {
return;
}
if (cacheFile.exists()) {
FileReader reader = new FileReader(cacheFile);
BufferedReader br = new BufferedReader(reader);
InputStreamReader streamReader = new InputStreamReader(new FileInputStream(cacheFile), "UTF-8");
BufferedReader br = new BufferedReader(streamReader);
String readStr, updateTimeStr;
while ((readStr = br.readLine()) != null) {
@ -466,7 +461,7 @@ public class UpdateMainDialog extends UIDialog {
}
}
br.close();
reader.close();
streamReader.close();
}
}
@ -490,8 +485,8 @@ public class UpdateMainDialog extends UIDialog {
if (endTime.equals(lastUpdateCacheTime) || jsonArray.length() == 0 || ComparatorUtils.compare(endTime, lastUpdateCacheTime) <= 0) {
return;
}
FileWriter fileWriter = new FileWriter(cacheFile, true);
BufferedWriter bufferWriter = new BufferedWriter(fileWriter);
OutputStreamWriter writerStream = new OutputStreamWriter(new FileOutputStream(cacheFile), "UTF-8");
BufferedWriter bufferWriter = new BufferedWriter(writerStream);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jo = (JSONObject) jsonArray.get(i);
bufferWriter.write((String) jo.get("update") + '\t' + jo.get("title"));
@ -499,7 +494,7 @@ public class UpdateMainDialog extends UIDialog {
bufferWriter.flush();
}
bufferWriter.close();
fileWriter.close();
writerStream.close();
lastUpdateCacheState = UPDATE_CACHE_STATE_SUCCESS;
lastUpdateCacheTime = endTime;
cacheProperty.updateProperty("updateTime", lastUpdateCacheTime);
@ -678,7 +673,7 @@ public class UpdateMainDialog extends UIDialog {
jarCurrentLabel.setText(downloadFileConfig.optString("buildNO"));
}
private void backupFilesFromInstallEnv(String installHome, String todayBackupDir, String[] files) {
private void backupFilesFromInstallEnv(String installHome, String todayBackupDir, List<String> files) {
for (String file : files) {
try {
IOUtils.copy(
@ -690,7 +685,7 @@ public class UpdateMainDialog extends UIDialog {
}
}
private void backupFilesFromInstallLib(String installHome, String todayBackupDir, String[] files) {
private void backupFilesFromInstallLib(String installHome, String todayBackupDir, List<String> files) {
for (String file : files) {
try {
IOUtils.copy(
@ -734,21 +729,22 @@ public class UpdateMainDialog extends UIDialog {
}
//获取服务器jar包列表
private String[] getJARList4Server() {
private List<String> getJARList4Server() {
return UpdateConstants.JARS_FOR_SERVER_X;
}
//获取设计器jar包列表
private String[] getJARList4Designer() {
private List<String> getJARList4Designer() {
return UpdateConstants.JARS_FOR_DESIGNER_X;
}
//获取服务器jar包下载列表
private String[] getDownLoadJAR4Server() {
ArrayList<String> jarList = new ArrayList<String>();
List<String> serverItems = getJARList4Server();
for (DownloadItem downloadItem : downloadItems) {
String downloadItemName = downloadItem.getName();
if (ArrayUtils.contains(getJARList4Server(), downloadItemName)) {
if (serverItems.contains(downloadItemName)) {
jarList.add(downloadItemName);
}
}
@ -758,9 +754,10 @@ public class UpdateMainDialog extends UIDialog {
//获取设计器jar包下载列表
private String[] getDownLoadJAR4Designer() {
ArrayList<String> jarList = new ArrayList<String>();
List<String> designerJarItems = getJARList4Designer();
for (DownloadItem downloadItem : downloadItems) {
String downloadItemName = downloadItem.getName();
if (ArrayUtils.contains(getJARList4Designer(), downloadItemName)) {
if (designerJarItems.contains(downloadItemName)) {
jarList.add(downloadItemName);
}
}
@ -791,7 +788,8 @@ public class UpdateMainDialog extends UIDialog {
//判断是否是有效的日志内容
private boolean isValidLogInfo(String logContent) {
String log = logContent.toUpperCase();
for (String s : UpdateConstants.LOG_TYPE) {
List<String> logType = UpdateConstants.LOG_TYPE;
for (String s : logType) {
if (log.startsWith(s)) {
return true;
}

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -14,7 +14,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.HotIssuesManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManeger;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.general.ProcessCanceledException;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray;
@ -142,7 +142,7 @@ public class AlphaFineHelper {
result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")));
} else if (object instanceof PluginSearchManager) {
result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon")));
} else if (object instanceof SimilarSearchManeger) {
} else if (object instanceof SimilarSearchManager) {
result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Relation_Item")));
} else if (object instanceof HotIssuesManager) {
return new SearchResult();

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/CellModelHelper.java

@ -6,7 +6,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.ActionSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.DocumentSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.FileSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManeger;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.json.JSONObject;
/**
@ -34,7 +34,7 @@ public class CellModelHelper {
break;
case ROBOT:
case RECOMMEND_ROBOT:
cellModel = SimilarSearchManeger.getModelFromCloud(object.optJSONObject(RESULT));
cellModel = SimilarSearchManager.getModelFromCloud(object.optJSONObject(RESULT));
break;
}
return cellModel;

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -32,7 +32,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManeger;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
import com.fr.form.main.Form;
@ -573,7 +573,7 @@ public class AlphaFineDialog extends UIDialog {
}
private void buildSimilarList(final String[] searchText) {
addSearchResult(SimilarSearchManeger.getInstance().getLessSearchResult(searchText));
addSearchResult(SimilarSearchManager.getInstance().getLessSearchResult(searchText));
}
private synchronized void addSearchResult(SearchResult searchResult) {
@ -1052,7 +1052,7 @@ public class AlphaFineDialog extends UIDialog {
break;
case ROBOT:
case RECOMMEND_ROBOT:
moreResult = SimilarSearchManeger.getInstance().getMoreSearchResult(searchTextField.getText());
moreResult = SimilarSearchManager.getInstance().getMoreSearchResult(searchTextField.getText());
break;
case RECOMMEND:
moreResult = RecommendSearchManager.getInstance().getMoreSearchResult(searchTextField.getText());

10
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java → designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java

@ -17,16 +17,16 @@ import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
/**
* Created by alex.sung on 2018/8/3.
*/
public class SimilarSearchManeger implements AlphaFineSearchProvider {
private static volatile SimilarSearchManeger instance;
public class SimilarSearchManager implements AlphaFineSearchProvider {
private static volatile SimilarSearchManager instance;
private SearchResult lessModelList;
private SearchResult moreModelList = new SearchResult();
public static SimilarSearchManeger getInstance() {
public static SimilarSearchManager getInstance() {
if (instance == null) {
synchronized (SimilarSearchManeger.class) {
synchronized (SimilarSearchManager.class) {
if (instance == null) {
instance = new SimilarSearchManeger();
instance = new SimilarSearchManager();
}
}
}

10
designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java

@ -9,7 +9,7 @@ import org.junit.Before;
import org.junit.Test;
public class SearchManegerTest {
SimilarSearchManeger similarSearchManeger;
SimilarSearchManager similarSearchManager;
ComplementAdviceManager complementAdviceManager;
DocumentSearchManager documentSearchManager;
PluginSearchManager pluginSearchManager;
@ -23,7 +23,7 @@ public class SearchManegerTest {
public void setUp() {
recentSearchManager = RecentSearchManager.getInstance();
recommendSearchManager = RecommendSearchManager.getInstance();
similarSearchManeger = SimilarSearchManeger.getInstance();
similarSearchManager = SimilarSearchManager.getInstance();
complementAdviceManager = ComplementAdviceManager.getInstance();
documentSearchManager = DocumentSearchManager.getInstance();
pluginSearchManager = PluginSearchManager.getInstance();
@ -43,7 +43,7 @@ public class SearchManegerTest {
lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"});
Assert.assertNotNull(lessModelList);
lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"});
lessModelList = similarSearchManager.getLessSearchResult(new String[]{"数据集"});
Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT);
lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"});
@ -51,7 +51,7 @@ public class SearchManegerTest {
//返回MoreSearchResult
SearchResult moreModelList;
moreModelList = similarSearchManeger.getMoreSearchResult("数据集");
moreModelList = similarSearchManager.getMoreSearchResult("数据集");
Assert.assertNotNull(moreModelList);
moreModelList = recommendSearchManager.getMoreSearchResult("数据集");
@ -60,7 +60,7 @@ public class SearchManegerTest {
@Test
public void getModelFromCloudTest() {
Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject()));
Assert.assertNotNull(SimilarSearchManager.getModelFromCloud(new JSONObject()));
Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject()));
Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject()));
}

Loading…
Cancel
Save