Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

feature/10.0
pengda 4 years ago
parent
commit
f821b43e18
  1. 29
      build.gradle
  2. 15
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java
  4. 8
      designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  6. 8
      designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java
  7. 10
      designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java
  8. 2
      designer-base/src/main/resources/com/fr/design/login/login.js
  9. 3
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

29
build.gradle

@ -28,17 +28,6 @@ dependencies {
api project(':designer-realize')
}
configurations.all {
resolutionStrategy {
force 'com.fr.third:jxbrowser:6.23'
force 'com.fr.third:jxbrowser-mac:6.23'
force 'com.fr.third:jxbrowser-win64:6.23'
force 'com.fr.third:jxbrowser:7.5'
force 'com.fr.third:jxbrowser-mac:7.5'
force 'com.fr.third:jxbrowser-win64:7.5'
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'java-library'
@ -68,18 +57,12 @@ allprojects {
}
dependencies {
implementation ('com.fr.third:jxbrowser:6.23') {
force = true
}
implementation ('com.fr.third:jxbrowser-mac:6.23') {
force = true
}
implementation ('com.fr.third:jxbrowser-win64:6.23') {
force = true
}
implementation 'com.fr.third:jxbrowser:7.5'
implementation 'com.fr.third:jxbrowser-mac:7.5'
implementation 'com.fr.third:jxbrowser-win64:7.5'
implementation 'com.fr.third:jxbrowser:6.23'
implementation 'com.fr.third:jxbrowser-mac:6.23'
implementation 'com.fr.third:jxbrowser-win64:6.23'
implementation 'com.fr.third:jxbrowser-v7:7.5'
implementation 'com.fr.third:jxbrowser-mac-v7:7.5'
implementation 'com.fr.third:jxbrowser-win64-v7:7.5'
implementation 'com.fr.third:jxbrowser-swing:7.5'
implementation 'com.fr.third.server:servlet-api:3.0'
implementation 'org.swingexplorer:swexpl:2.0.1'

15
designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

@ -6,7 +6,6 @@ import com.fr.base.ParameterMapNameSpace;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EscapeSqlHelper;
import com.fr.data.operator.DataOperator;
import com.fr.decision.config.PreventSqlInjConfig;
import com.fr.decision.webservice.v10.config.ConfigService;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.link.MessageWithLink;
@ -19,7 +18,6 @@ import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.injectable.PluginModule;
import com.fr.script.Calculator;
@ -190,11 +188,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
calculator.pushNameSpace(ns);
Parameter[] paras = processParameters(tableData, calculator);
// 所有被转义参数的集合
// 远程时如何获取服务器上的转义字符?这里比较恶心
// 方法1是新增rpc接口,交由服务器去获取转义字符。但是要考虑兼容问题:
// 新设计器jar远程老服务器jar,需要提供Compatible实现,但是这个实现能做什么呢?目前没有老的接口可以去获取服务器的转义字符,仍然啥也做不了;
// 现在采用方法2,通过反射调用PreventSqlInjConfig的刷新方法(因为它是decision模块的private方法,直接改成public仍然有兼容问题)
Reflect.on(PreventSqlInjConfig.class).call("refreshPreventSqlInjConfig");
refreshEscapeSqlHelper();
Set<String> specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras);
// 将参数转义等
Set<TableDataProvider> tableDataProviders = getTableDataProviders();
@ -223,6 +217,13 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
pane.setVisible(true);
}
private static void refreshEscapeSqlHelper() {
EscapeSqlHelper.getInstance().setUseForbidWord(ConfigService.getInstance().getPSIConfig().isUseForbidWord());
EscapeSqlHelper.getInstance().setSelectedForbidWord(ConfigService.getInstance().getPSIConfig().getSelectedForbidWord());
EscapeSqlHelper.getInstance().setUseEscapeSpecialChar(ConfigService.getInstance().getPSIConfig().isUseEscapeSpecialChar());
EscapeSqlHelper.getInstance().setSelectedSpecialChar(ConfigService.getInstance().getPSIConfig().getSelectedSpecialChar());
}
private static boolean isShowSpecialCharSqlPane(List<int[]> specialCharParamIndex) {
return specialCharParamIndex != null && !specialCharParamIndex.isEmpty();
}

5
designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java

@ -68,12 +68,9 @@ public class DesignerLoginHelper {
if (dialog == null) {
if (window instanceof Dialog) {
dialog = new DesignerLoginShowDialog((Dialog) window, designerLoginPane);
} else if (window instanceof Frame) {
dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane);
} else {
return;
dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane);
}
}
dialog.setVisible(true);
}

8
designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java

@ -5,6 +5,7 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.stable.StringUtils;
import javax.swing.WindowConstants;
/**
@ -54,7 +55,12 @@ public class DesignerGuideHelper {
* 激活满一周
*/
private static boolean isActivatedForOneWeek() {
return (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerActivatedTime()) > ONE_WEEK;
DesignerEnvManager manager = DesignerEnvManager.getEnvManager();
String key = manager.getActivationKey();
if (StringUtils.isEmpty(key)) {
return false;
}
return (System.currentTimeMillis() - manager.getDesignerActivatedTime()) > ONE_WEEK;
}
/**

3
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -72,6 +72,7 @@ import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
@ -133,7 +134,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final Integer TOP_LAYER = 200;
private List<DesignerOpenedListener> designerOpenedListenerList = new ArrayList<>();
private List<DesignerOpenedListener> designerOpenedListenerList = new CopyOnWriteArrayList<>();
private ToolBarMenuDock ad;

8
designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java

@ -24,6 +24,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import com.fr.stable.Filter;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -48,7 +49,7 @@ public class ContentObjectManager {
/**
* 放置所有需要替换内容的对象
*/
private Map<String, Set<Object>> objectMap;
private Map<String, Collection<Object>> objectMap;
private final Set<String> set = new HashSet<>();
@ -98,14 +99,13 @@ public class ContentObjectManager {
}
@Nullable
public Map<String, Set<Object>> getObjectMap() {
public Map<String, Collection<Object>> getObjectMap() {
return objectMap;
}
public boolean needContentTip(Object ob, Set<String> nameSet) {
long start = System.currentTimeMillis();
objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance());
for (Map.Entry<String, Set<Object>> entry : objectMap.entrySet()) {
for (Map.Entry<String, Collection<Object>> entry : objectMap.entrySet()) {
for (Object o : entry.getValue()) {
for (String name : nameSet) {
ContentReplacer contentReplacer = map.get(entry.getKey());

10
designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java

@ -29,9 +29,9 @@ import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 默认联动内容替换器实现
@ -106,14 +106,14 @@ public class ContentReplacerCenter {
}
private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) {
Map<String, Set<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
Map<String, Collection<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
if (objectMap != null) {
long start = System.currentTimeMillis();
for (ContentChange contentChange : contentChangeList) {
Set<Object> set = objectMap.get(contentChange.type());
Collection<Object> objects = objectMap.get(contentChange.type());
// 所有需要处理的js等对象
if (set != null) {
for (Object ob : set) {
if (objects != null) {
for (Object ob : objects) {
fireChange(ob, contentChange, contentChangeItemList);
}
}

2
designer-base/src/main/resources/com/fr/design/login/login.js

File diff suppressed because one or more lines are too long

3
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -437,9 +437,10 @@ public class DesignerActivator extends Activator implements Prepare {
manager.setDesignerLoginUsername(MarketConfig.getInstance().getBbsUsername());
manager.setDesignerLoginAppId(MarketConfig.getInstance().getBbsAppId());
manager.setDesignerLoginRefreshToken(MarketConfig.getInstance().getBbsRefreshToken());
manager.setCurrentVersionFirstLaunch(false);
manager.setDesignerLastLoginTime(System.currentTimeMillis());
manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN);
manager.setLastLoginAccount(MarketConfig.getInstance().getBbsUsername());
manager.setCurrentVersionFirstLaunch(false);
DesignerEnvManager.getEnvManager().saveXMLFile();
}
}

Loading…
Cancel
Save