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. 26
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java
  9. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java
  10. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  11. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java
  12. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
  13. 12
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
  14. 6
      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. 18
      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.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<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) {
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<Void> 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);
}
}

2
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"));
}
}

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 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);

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 {
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() {

12
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;
}

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;
}
}
} catch (JSONException e) {
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
paramLocationComboBox.setSelectedIndex(index);

26
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;
}

10
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;
}

10
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;
}

10
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;
}

11
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;
}

12
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;
}

6
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<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
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());
} catch (IOException e) {
FineLoggerFactory.getLogger().error("document search get result error: " + e.getMessage());
}
}
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) {
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()) {

18
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);
}

Loading…
Cancel
Save