Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~alex.sung/design into release/10.0

bugfix/10.0
alex.sung 6 years ago
parent
commit
5934011c6c
  1. 7
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 4
      designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java
  3. 2
      designer-base/src/main/java/com/fr/design/extra/PluginsReaderFromStore.java
  4. 3
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  6. 12
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  7. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  8. 4
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java
  9. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  10. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  11. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java
  12. 5
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
  13. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
  14. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  15. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  16. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  17. 4
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java

7
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.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.AbstractWebletCreator; import com.fr.stable.web.AbstractWebletCreator;
@ -26,7 +27,11 @@ public final class WebPreviewUtils {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static void preview(JTemplate<?, ?> jt, PreviewProvider provider) { public static void preview(JTemplate<?, ?> jt, PreviewProvider provider) {
String baseRoute = jt.route(); 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<String, Object> map, String actionType) { private static void actionPerformed(JTemplate<?, ?> jt, String baseRoute, Map<String, Object> map, String actionType) {

4
designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java

@ -104,7 +104,7 @@ public class PluginWebBridge {
for (String key : keySet) { for (String key : keySet) {
jsonObject.put(key, config.get(key).toString()); jsonObject.put(key, config.get(key).toString());
} }
} catch (JSONException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
return jsonObject.toString(); return jsonObject.toString();
@ -349,7 +349,7 @@ public class PluginWebBridge {
try { try {
Task<Void> task = new PluginTask<>(webEngine, callback, new GetPluginFromStoreExecutor(new JSONObject(info))); Task<Void> task = new PluginTask<>(webEngine, callback, new GetPluginFromStoreExecutor(new JSONObject(info)));
threadPoolExecutor.submit(task); threadPoolExecutor.submit(task);
} catch (JSONException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }

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

@ -74,7 +74,7 @@ public class PluginsReaderFromStore {
plugins.add(pluginView); 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")); throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Read_Plugin_List_Error"));
} }
} }

3
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 oldName = fnf.getName();
String suffix = fnf.isDirectory() ? StringUtils.EMPTY : oldName.substring(oldName.lastIndexOf(CoreConstants.DOT), oldName.length()); 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.setLayout(new BorderLayout());
this.setModal(true); this.setModal(true);

2
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 { public class LogMessageBar extends JPanel {
private UILabel messageLabel; private UILabel messageLabel;
private int width = 600; private int width = 600;
public static volatile LogMessageBar THIS; private static volatile LogMessageBar THIS;
private JFrame dlg = new LogDetailPane().showDialog(); private JFrame dlg = new LogDetailPane().showDialog();
public static LogMessageBar getInstance() { public static LogMessageBar getInstance() {

12
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -65,12 +65,12 @@ public class DesignUtils {
* @return 启动了返回true * @return 启动了返回true
*/ */
public static boolean isStarted() { public static boolean isStarted() {
// try { try {
// new Socket("localhost", port); new Socket("localhost", port);
// return true; return true;
// } catch (Exception exp) { } catch (Exception exp) {
//
// } }
return false; return false;
} }

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -218,7 +218,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
break; break;
} }
} }
} catch (JSONException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
paramLocationComboBox.setSelectedIndex(index); paramLocationComboBox.setSelectedIndex(index);

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

@ -168,7 +168,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
JSONArray startStopArray = new JSONArray(); JSONArray startStopArray = new JSONArray();
for (int i = 0; i < startStop.size(); i++) { for (int i = 0; i < startStop.size(); i++) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
try {
jo.put(ATTR_START, startStop.get(i).getStartDate()); jo.put(ATTR_START, startStop.get(i).getStartDate());
jo.put(ATTR_STOP, startStop.get(i).getStopDate()); jo.put(ATTR_STOP, startStop.get(i).getStopDate());
startStopArray.put(jo); startStopArray.put(jo);
@ -180,9 +179,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
content.put(XML_USERNAME, MarketConfig.getInstance().getBbsUsername()); content.put(XML_USERNAME, MarketConfig.getInstance().getBbsUsername());
content.put(XML_KEY, envManager.getActivationKey()); content.put(XML_KEY, envManager.getActivationKey());
content.put(XML_OS, System.getProperty("os.name")); content.put(XML_OS, System.getProperty("os.name"));
} catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
} }
return content; return content;
} }

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

@ -53,13 +53,9 @@ public class ActionModel extends AlphaCellModel {
@Override @Override
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("className", getAction().getClass().getName()).put("searchCount", getSearchCount()); modelObject.put("className", getAction().getClass().getName()).put("searchCount", getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
} catch (JSONException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return object; return object;
} }

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

@ -42,13 +42,9 @@ public class DocumentModel extends AlphaCellModel {
@Override @Override
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
} catch (JSONException e) {
FineLoggerFactory.getLogger().error("DocumentModel: " + e.getMessage());
}
return object; return object;
} }

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

@ -37,13 +37,9 @@ public class FileModel extends AlphaCellModel {
@Override @Override
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("filePath", getFilePath()).put("searchCount", getSearchCount()); modelObject.put("filePath", getFilePath()).put("searchCount", getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
} catch (JSONException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return object; return object;
} }

5
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java

@ -87,14 +87,9 @@ public class PluginModel extends AlphaCellModel {
@Override @Override
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try {
JSONObject modelObject = JSONObject.create(); 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()); 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()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
} catch (JSONException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return object; return object;
} }

6
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); JSONObject jsonObject = new JSONObject(result);
return jsonObject.optString("msg"); return jsonObject.optString("msg");
} catch (JSONException | IOException e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("get robotmodel content error: " + e.getMessage()); FineLoggerFactory.getLogger().error("get robotmodel content error: " + e.getMessage());
} }
return null; return null;
@ -69,13 +69,9 @@ public class RobotModel extends AlphaCellModel {
@Override @Override
public JSONObject modelToJson() throws JSONException { public JSONObject modelToJson() throws JSONException {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
try {
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("title", getTitle()).put("content", getContent()).put("searchCount", getSearchCount()); modelObject.put("title", getTitle()).put("content", getContent()).put("searchCount", getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
} catch (JSONException e) {
FineLoggerFactory.getLogger().error("RobotModel: " + e.getMessage());
}
return object; return object;
} }

4
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(); int resultKind = cellModel.getType().getTypeValue();
String resultValue = CellModelHelper.getResultValueFromModel(cellModel); String resultValue = CellModelHelper.getResultValueFromModel(cellModel);
JSONObject object = JSONObject.create(); 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); 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);
}
final HashMap<String, String> para = new HashMap<>(); final HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));

4
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()); FineLoggerFactory.getLogger().error("document search error: " + e.getMessage());
} catch (IOException e) {
FineLoggerFactory.getLogger().error("document search get result error: " + e.getMessage());
} }
} }
lessModelList.clear(); lessModelList.clear();

8
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) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("plugin search json error :" + e.getMessage()); FineLoggerFactory.getLogger().error("plugin search 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());
} }
} }
if (searchResult.isEmpty()) { if (searchResult.isEmpty()) {

4
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java

@ -100,7 +100,6 @@ public class ErrorInfo {
*/ */
public void saveAsJSON(){ public void saveAsJSON(){
JSONObject jo = JSONObject.create(); JSONObject jo = JSONObject.create();
try {
jo.put("username", username); jo.put("username", username);
jo.put("uuid", uuid); jo.put("uuid", uuid);
jo.put("activekey", activekey); jo.put("activekey", activekey);
@ -108,9 +107,6 @@ public class ErrorInfo {
jo.put("uploadtime", uploadtime); jo.put("uploadtime", uploadtime);
jo.put("logid", logid); jo.put("logid", logid);
jo.put("log", log); jo.put("log", log);
} catch (JSONException ignore) {
}
saveFileToCache(jo); saveFileToCache(jo);
} }

Loading…
Cancel
Save