Browse Source

合并代码

master
mengao 8 years ago
parent
commit
4d7aa3fc4b
  1. 1
      .gitignore
  2. 1
      designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java
  3. 30
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 22
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  5. 6
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  6. 38
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  7. 0
      designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java

1
.gitignore vendored

@ -3,5 +3,6 @@ designer_base/bin
designer_chart/bin designer_chart/bin
designer_form/bin designer_form/bin
*.iml *.iml
designer_base/src/com/fr/design/locale/.idea

1
designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java → designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.templateinfo; package com.fr.design.mainframe.templateinfo;
import com.fr.base.io.IOFile;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.report.cellcase.CellCase; import com.fr.report.cellcase.CellCase;

30
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -541,21 +541,21 @@ FR-Designer_No=\u3044\u3044\u3048
FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0
FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9
FR-Designer_Parameter-Formula=\u6570\u5F0F FR-Designer_Parameter-Formula=\u6570\u5F0F
FR-Designer_Background_Null= FR-Designer_Background_Null=\u80CC\u666F\u306A\u3057
FR-Designer_Background_Color= FR-Designer_Background_Color=\u8272
FR-Designer_Background_Texture= FR-Designer_Background_Texture=\u67C4
FR-Designer_Background_Pattern= FR-Designer_Background_Pattern=\u6A21\u69D8
FR-Designer_Background_Gradient_Color= FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3\u8272
FR-Designer_Background_Image= FR-Designer_Background_Image=\u5199\u771F
FR-Designer_Background_Clear= FR-Designer_Background_Clear=\u30AF\u30EA\u30A2
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=\u5199\u771F\u3092\u9078\u629E
FR-Designer_Initial_Background_Tips= FR-Designer_Initial_Background_Tips=\u30DC\u30BF\u30F3\u306E\u521D\u671F\u80CC\u666F
FR-Designer_Mouse_Move_Tips= FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F
FR-Designer_Mouse_Click_Tips= FR-Designer_Mouse_Click_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F
FR-Designer-Move_Tab_First= FR-Designer-Move_Tab_First=\u30C8\u30C3\u30D7\u306B\u79FB\u3059
FR-Designer-Move_Tab_End= FR-Designer-Move_Tab_End=\u6700\u5F8C\u306B\u79FB\u3059
FR-Designer-Move_Tab_Next= FR-Designer-Move_Tab_Next=\u5F8C\u308D\u306B\u79FB\u3059
FR-Designer-Move_Tab_Prev= FR-Designer-Move_Tab_Prev=\u524D\u306B\u79FB\u3059
FR-Designer_AxisReversed=\u8EF8\u9006\u914D\u5217 FR-Designer_AxisReversed=\u8EF8\u9006\u914D\u5217
FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A
FR-Designer_Chart_Log_Base=\u5E95\u6570 FR-Designer_Chart_Log_Base=\u5E95\u6570

22
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -563,17 +563,17 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67
FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F
FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002
FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002
FR-Designer_Background_Null= FR-Designer_Background_Null=\u6C92\u6709\u80CC\u666F
FR-Designer_Background_Color= FR-Designer_Background_Color=\u984F\u8272
FR-Designer_Background_Texture= FR-Designer_Background_Texture=\u7D0B\u7406
FR-Designer_Background_Pattern= FR-Designer_Background_Pattern=\u5716\u6848
FR-Designer_Background_Gradient_Color= FR-Designer_Background_Gradient_Color=\u6F38\u8B8A\u8272
FR-Designer_Background_Image= FR-Designer_Background_Image=\u5716\u7247
FR-Designer_Background_Clear= FR-Designer_Background_Clear=\u6E05\u9664
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=\u9078\u64C7\u5716\u7247
FR-Designer_Initial_Background_Tips= FR-Designer_Initial_Background_Tips=\u6309\u9215\u7684\u521D\u59CB\u80CC\u666F
FR-Designer_Mouse_Move_Tips= FR-Designer_Mouse_Move_Tips=\u6ED1\u9F20\u79FB\u52D5\u5230\u6309\u9215\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F
FR-Designer_Mouse_Click_Tips= FR-Designer_Mouse_Click_Tips=\u6ED1\u9F20\u9EDE\u64CA\u6309\u9215\u6642\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F
FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D
FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E
FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5

6
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -111,9 +111,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
// 为收集模版信息作准备 // 为收集模版信息作准备
private void initForCollect() { private void initForCollect() {
if (template.getTemplateID() == null) { template.initTemplateID(); // 为新模板设置 templateID 属性
template.initTemplateID(); // 为新模板设置 templateID 属性
}
if (openTime == 0) { if (openTime == 0) {
openTime = System.currentTimeMillis(); openTime = System.currentTimeMillis();
} }
@ -533,7 +531,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
boolean result = this.saveFile(); boolean result = this.saveFile();
if (result) { if (result) {
DesignerFrameFileDealerPane.getInstance().refresh(); DesignerFrameFileDealerPane.getInstance().refresh();
initForCollect(); // 如果是旧模板另存为新模板,则添加 templateID initForCollect(); // 如果另存为新模板,则添加 templateID
collectInfo(); collectInfo();
} }
//更换最近打开 //更换最近打开

38
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -15,9 +15,7 @@ import org.json.JSONObject;
import java.io.*; import java.io.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.HashMap;
/** /**
* 做模板的过程和耗时收集辅助类 * 做模板的过程和耗时收集辅助类
@ -27,6 +25,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
private static final String FILE_NAME = "tplInfo.ser"; private static final String FILE_NAME = "tplInfo.ser";
private static TemplateInfoCollector instance; private static TemplateInfoCollector instance;
private HashMap<String, HashMap<String, Object>> templateInfoList; private HashMap<String, HashMap<String, Object>> templateInfoList;
private Set<String> removedTemplates; // 已经从 templateInfoList 中删除过的 id 列表,防止重复收集数据
private String designerOpenDate; //设计器最近一次打开日期 private String designerOpenDate; //设计器最近一次打开日期
private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数
private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数
@ -36,6 +35,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private TemplateInfoCollector() { private TemplateInfoCollector() {
templateInfoList = new HashMap<>(); templateInfoList = new HashMap<>();
removedTemplates = new ListSet<>();
setDesignerOpenDate(); setDesignerOpenDate();
} }
@ -77,12 +77,15 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
return instance; return instance;
} }
private static boolean shouldCollectInfo() { private boolean shouldCollectInfo(T t) {
if (t.getTemplateID() == null || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板
return false;
}
return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv();
} }
public static void appendProcess(String log) { public void appendProcess(T t, String log) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo(t)) {
return; return;
} }
// 获取当前编辑的模板 // 获取当前编辑的模板
@ -113,7 +116,14 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
private void saveInfo() { private void saveInfo() {
try { try {
ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile()));
FRLogger.getLogger().info("writing: " + instance.templateInfoList); String log = "";
int count = 1;
for (String key : templateInfoList.keySet()) {
String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString();
log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n");
count ++;
}
FRLogger.getLogger().info("writing tplInfo: \n" + log);
os.writeObject(instance); os.writeObject(instance);
os.close(); os.close();
} catch (Exception ex) { } catch (Exception ex) {
@ -141,7 +151,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) {
if (!shouldCollectInfo()) { if (!shouldCollectInfo(t)) {
return; return;
} }
@ -225,7 +235,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) {
// 清空记录 // 清空记录
FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID"));
templateInfoList.remove(templateInfo.get("templateID")); removeFromTemplateInfoList(templateInfo.get("templateID"));
} }
} }
saveInfo(); saveInfo();
@ -277,12 +287,18 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
} }
// 删除测试模板 // 删除测试模板
for (String key : testTemplateKeys) { for (String key : testTemplateKeys) {
templateInfoList.remove(key); removeFromTemplateInfoList(key);
// System.out.println(key + " is removed...");
} }
return completeTemplatesInfo; return completeTemplatesInfo;
} }
private void removeFromTemplateInfoList(String key) {
templateInfoList.remove(key);
removedTemplates.add(key);
FRLogger.getLogger().info(key + " is removed...");
FRLogger.getLogger().info("removedTemplates: " + removedTemplates);
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private boolean isTestTemplate(HashMap<String, Object> templateInfo) { private boolean isTestTemplate(HashMap<String, Object> templateInfo) {
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get("processMap"); HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get("processMap");

0
designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java → designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java

Loading…
Cancel
Save