diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 5434abc092..18c93f74c5 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -9,6 +9,7 @@ import com.fr.design.utils.DesignUtils; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.general.GeneralUtils; +import com.fr.general.web.ParameterConstants; import com.fr.stable.project.ProjectConstants; import com.fr.stable.web.AbstractWebletCreator; @@ -26,7 +27,11 @@ public final class WebPreviewUtils { @SuppressWarnings("unchecked") public static void preview(JTemplate jt, PreviewProvider provider) { String baseRoute = jt.route(); - actionPerformed(jt, baseRoute, provider == null ? Collections.EMPTY_MAP : provider.parametersForPreview(), provider.getActionType()); + if (provider == null) { + actionPerformed(jt, baseRoute, Collections.EMPTY_MAP, ParameterConstants.VIEWLET); + } else { + actionPerformed(jt, baseRoute, provider.parametersForPreview(), provider.getActionType()); + } } private static void actionPerformed(JTemplate jt, String baseRoute, Map map, String actionType) { diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 903418ec93..02a51ad3f2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -104,7 +104,7 @@ public class PluginWebBridge { for (String key : keySet) { jsonObject.put(key, config.get(key).toString()); } - } catch (JSONException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } return jsonObject.toString(); @@ -349,7 +349,7 @@ public class PluginWebBridge { try { Task task = new PluginTask<>(webEngine, callback, new GetPluginFromStoreExecutor(new JSONObject(info))); threadPoolExecutor.submit(task); - } catch (JSONException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginsReaderFromStore.java b/designer-base/src/main/java/com/fr/design/extra/PluginsReaderFromStore.java index 8895e83e45..66341be1a2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginsReaderFromStore.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginsReaderFromStore.java @@ -74,7 +74,7 @@ public class PluginsReaderFromStore { plugins.add(pluginView); } } - } catch (JSONException e) { + } catch (Exception e) { throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Read_Plugin_List_Error")); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index d607352574..cef5c86a08 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -428,8 +428,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt String oldName = fnf.getName(); String suffix = fnf.isDirectory() ? StringUtils.EMPTY : oldName.substring(oldName.lastIndexOf(CoreConstants.DOT), oldName.length()); - oldName = oldName.replaceAll(suffix, StringUtils.EMPTY); - + oldName = oldName.replace(suffix, StringUtils.EMPTY); this.setLayout(new BorderLayout()); this.setModal(true); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index 3b05937087..54bb4addc3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -14,7 +14,7 @@ import java.awt.event.MouseEvent; public class LogMessageBar extends JPanel { private UILabel messageLabel; private int width = 600; - public static volatile LogMessageBar THIS; + private static volatile LogMessageBar THIS; private JFrame dlg = new LogDetailPane().showDialog(); public static LogMessageBar getInstance() { diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 77173cebb5..240176eef7 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -65,12 +65,12 @@ public class DesignUtils { * @return 启动了返回true */ public static boolean isStarted() { -// try { -// new Socket("localhost", port); -// return true; -// } catch (Exception exp) { -// -// } + try { + new Socket("localhost", port); + return true; + } catch (Exception exp) { + + } return false; } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 7e0f3b940a..b0473f8fac 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -218,7 +218,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { break; } } - } catch (JSONException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } paramLocationComboBox.setSelectedIndex(index); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index b71144774d..37f86172ea 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -168,21 +168,17 @@ public class InformationCollector implements XMLReadable, XMLWriter { JSONArray startStopArray = new JSONArray(); for (int i = 0; i < startStop.size(); i++) { JSONObject jo = new JSONObject(); - try { - jo.put(ATTR_START, startStop.get(i).getStartDate()); - jo.put(ATTR_STOP, startStop.get(i).getStopDate()); - startStopArray.put(jo); - DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - content.put(XML_START_STOP, startStopArray); - content.put(XML_UUID, envManager.getUUID()); - content.put(XML_JAR, GeneralUtils.readBuildNO()); - content.put(XML_VERSION, ProductConstants.RELEASE_VERSION); - content.put(XML_USERNAME, MarketConfig.getInstance().getBbsUsername()); - content.put(XML_KEY, envManager.getActivationKey()); - content.put(XML_OS, System.getProperty("os.name")); - } catch (JSONException e) { - FRContext.getLogger().error(e.getMessage(), e); - } + jo.put(ATTR_START, startStop.get(i).getStartDate()); + jo.put(ATTR_STOP, startStop.get(i).getStopDate()); + startStopArray.put(jo); + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + content.put(XML_START_STOP, startStopArray); + content.put(XML_UUID, envManager.getUUID()); + content.put(XML_JAR, GeneralUtils.readBuildNO()); + content.put(XML_VERSION, ProductConstants.RELEASE_VERSION); + content.put(XML_USERNAME, MarketConfig.getInstance().getBbsUsername()); + content.put(XML_KEY, envManager.getActivationKey()); + content.put(XML_OS, System.getProperty("os.name")); } return content; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java index cd878af5a4..832575febe 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java @@ -53,13 +53,9 @@ public class ActionModel extends AlphaCellModel { @Override public JSONObject modelToJson() { JSONObject object = JSONObject.create(); - try { - JSONObject modelObject = JSONObject.create(); - modelObject.put("className", getAction().getClass().getName()).put("searchCount", getSearchCount()); - object.put("result", modelObject).put("cellType", getType().getTypeValue()); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + JSONObject modelObject = JSONObject.create(); + modelObject.put("className", getAction().getClass().getName()).put("searchCount", getSearchCount()); + object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index e149229796..2c608537c0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -42,13 +42,9 @@ public class DocumentModel extends AlphaCellModel { @Override public JSONObject modelToJson() { JSONObject object = JSONObject.create(); - try { - JSONObject modelObject = JSONObject.create(); - modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); - object.put("result", modelObject).put("cellType", getType().getTypeValue()); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error("DocumentModel: " + e.getMessage()); - } + JSONObject modelObject = JSONObject.create(); + modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); + object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java index 28c60bb5e4..7541526ba1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java @@ -37,13 +37,9 @@ public class FileModel extends AlphaCellModel { @Override public JSONObject modelToJson() { JSONObject object = JSONObject.create(); - try { - JSONObject modelObject = JSONObject.create(); - modelObject.put("filePath", getFilePath()).put("searchCount", getSearchCount()); - object.put("result", modelObject).put("cellType", getType().getTypeValue()); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + JSONObject modelObject = JSONObject.create(); + modelObject.put("filePath", getFilePath()).put("searchCount", getSearchCount()); + object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 119d2991bd..84ea70c05c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -87,14 +87,9 @@ public class PluginModel extends AlphaCellModel { @Override public JSONObject modelToJson() { JSONObject object = JSONObject.create(); - try { - JSONObject modelObject = JSONObject.create(); - modelObject.put("name", getName()).put("description", getContent()).put("pic", getImageUrl()).put("version", getVersion()).put("jartime", getJartime()).put("id", getId()).put("pluginid", getPluginId()).put("type", getType().getTypeValue()).put("price", getPrice()).put("link", getLink()).put("searchCount", getSearchCount()); - object.put("result", modelObject).put("cellType", getType().getTypeValue()); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - + JSONObject modelObject = JSONObject.create(); + modelObject.put("name", getName()).put("description", getContent()).put("pic", getImageUrl()).put("version", getVersion()).put("jartime", getJartime()).put("id", getId()).put("pluginid", getPluginId()).put("type", getType().getTypeValue()).put("price", getPrice()).put("link", getLink()).put("searchCount", getSearchCount()); + object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index cb159745fb..d44a9402f6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -55,7 +55,7 @@ public class RobotModel extends AlphaCellModel { } JSONObject jsonObject = new JSONObject(result); return jsonObject.optString("msg"); - } catch (JSONException | IOException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error("get robotmodel content error: " + e.getMessage()); } return null; @@ -69,13 +69,9 @@ public class RobotModel extends AlphaCellModel { @Override public JSONObject modelToJson() throws JSONException { JSONObject object = JSONObject.create(); - try { - JSONObject modelObject = JSONObject.create(); - modelObject.put("title", getTitle()).put("content", getContent()).put("searchCount", getSearchCount()); - object.put("result", modelObject).put("cellType", getType().getTypeValue()); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error("RobotModel: " + e.getMessage()); - } + JSONObject modelObject = JSONObject.create(); + modelObject.put("title", getTitle()).put("content", getContent()).put("searchCount", getSearchCount()); + object.put("result", modelObject).put("cellType", getType().getTypeValue()); return object; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 6310a22331..49f8570147 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -976,11 +976,7 @@ public class AlphaFineDialog extends UIDialog { int resultKind = cellModel.getType().getTypeValue(); String resultValue = CellModelHelper.getResultValueFromModel(cellModel); JSONObject object = JSONObject.create(); - try { - object.put("uuid", uuid).put("activityKey", activityKey).put("username", username).put("createTime", createTime).put("key", key).put("resultKind", resultKind).put("resultValue", resultValue); - } catch (JSONException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + object.put("uuid", uuid).put("activityKey", activityKey).put("username", username).put("createTime", createTime).put("key", key).put("resultKind", resultKind).put("resultValue", resultValue); final HashMap para = new HashMap<>(); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index b5b517c1c1..216c7e9db7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -81,10 +81,8 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { } } } - } catch (JSONException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error("document search error: " + e.getMessage()); - } catch (IOException e) { - FineLoggerFactory.getLogger().error("document search get result error: " + e.getMessage()); } } lessModelList.clear(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 826aa7db22..ddd3bc0fcb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -126,12 +126,8 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } } } - } catch (JSONException e) { - FineLoggerFactory.getLogger().error("plugin search json error :" + e.getMessage()); - } catch (UnsupportedEncodingException e) { - FineLoggerFactory.getLogger().error("plugin search encode error :" + e.getMessage()); - } catch (IOException e) { - FineLoggerFactory.getLogger().error("plugin search get result error :" + e.getMessage()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error("plugin search error :" + e.getMessage()); } } if (searchResult.isEmpty()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java index c101706496..052aaef9fe 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java @@ -100,17 +100,13 @@ public class ErrorInfo { */ public void saveAsJSON(){ JSONObject jo = JSONObject.create(); - try { - jo.put("username", username); - jo.put("uuid", uuid); - jo.put("activekey", activekey); - jo.put("templateid", templateid); - jo.put("uploadtime", uploadtime); - jo.put("logid", logid); - jo.put("log", log); - } catch (JSONException ignore) { - } - + jo.put("username", username); + jo.put("uuid", uuid); + jo.put("activekey", activekey); + jo.put("templateid", templateid); + jo.put("uploadtime", uploadtime); + jo.put("logid", logid); + jo.put("log", log); saveFileToCache(jo); }