Browse Source
* commit 'f0b2070a45c0522c75f5436b0897ea5cf5984bf4': REPORT-56686 远程设计权限管理看不到cptx 加上.后缀 REPORT-56686 远程设计权限管理看不到cptx 撤销 REPORT-57147 设计器模版默认预览方式不生效 REPORT-57209 共享数据集显示配置兼容 REPORT-51472 平台开启的模版读不到状态的问题 REPORT-56128【开发者预览支持调整模板布局】新自适应-设计画布里拖拽调整组件A大小,挤压绝对画布块,绝对画布块内组件会保持尺寸不变且超出绝对画布块;但开发者调试下,此场景,绝对画布块内组件尺寸适应区域调整。这里要不要统一一下效果啊@kerry REPORT-55481 模板Web属性的顶部和底部工具栏在权限编辑时,顶部工具栏被底部工具栏覆盖research/11.0
superman
3 years ago
11 changed files with 204 additions and 175 deletions
@ -0,0 +1,37 @@
|
||||
package com.fr.design.data.tabledata.strategy; |
||||
|
||||
import com.fr.esd.core.strategy.config.StrategyConfig; |
||||
import com.fr.esd.query.StrategicTableData; |
||||
|
||||
/** |
||||
* @author rinoux |
||||
* @version 10.0 |
||||
* Created by rinoux on 2021/3/19 |
||||
*/ |
||||
public abstract class StrategyConfigHandler<T extends StrategicTableData> { |
||||
|
||||
private final T tableData; |
||||
|
||||
public StrategyConfigHandler(T tableData) { |
||||
this.tableData = tableData; |
||||
} |
||||
|
||||
protected T getTableData() { |
||||
return tableData; |
||||
} |
||||
|
||||
/** |
||||
* 查找配置 |
||||
* |
||||
* @return 缓存配置 |
||||
*/ |
||||
public abstract StrategyConfig find(); |
||||
|
||||
|
||||
/** |
||||
* 保存配置 |
||||
* |
||||
* @param config 缓存配置 |
||||
*/ |
||||
public abstract void save(T saved, StrategyConfig config); |
||||
} |
@ -1,70 +0,0 @@
|
||||
package com.fr.design.data.tabledata.tabledatapane.db; |
||||
|
||||
import com.fr.data.impl.DBTableData; |
||||
import com.fr.esd.core.strategy.config.StrategyConfig; |
||||
import com.fr.esd.event.DSMapping; |
||||
import com.fr.esd.event.DsNameTarget; |
||||
import com.fr.esd.event.StrategyEventsNotifier; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
/** |
||||
* @author rinoux |
||||
* @version 10.0 |
||||
* Created by rinoux on 2021/3/19 |
||||
*/ |
||||
public class ServerStrategyConfigHandler implements StrategyConfigHandler { |
||||
private final DBTableData tableData; |
||||
|
||||
private final String origName; |
||||
|
||||
private final String origConnection; |
||||
|
||||
private final String origQuery; |
||||
|
||||
public ServerStrategyConfigHandler(DBTableData tableData) { |
||||
this.tableData = tableData; |
||||
this.origName = tableData.getDsName(); |
||||
this.origConnection = tableData.getDatabase().toString(); |
||||
this.origQuery = tableData.getQuery(); |
||||
} |
||||
|
||||
@Override |
||||
public StrategyConfig find() { |
||||
StrategyConfig strategyConfig = null; |
||||
if (tableData != null) { |
||||
try { |
||||
strategyConfig = tableData.getStrategyConfig() == null ? null : tableData.getStrategyConfig().clone(); |
||||
} catch (CloneNotSupportedException e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
|
||||
return strategyConfig; |
||||
} |
||||
|
||||
@Override |
||||
public void save(DBTableData saved, StrategyConfig strategyConfig) { |
||||
String conn = saved.getDatabase().toString(); |
||||
String query = saved.getQuery(); |
||||
|
||||
|
||||
//检查数据链接和sql是否修改,如果修改需要触发缓存监听事件
|
||||
if (!conn.equals(origConnection) || !query.equals(origQuery)) { |
||||
if (StringUtils.isNotEmpty(origName)) { |
||||
//新建数据集的origName为null,不用触发
|
||||
StrategyEventsNotifier.modifyDataSet(DSMapping.ofServerDS(new DsNameTarget(origName))); |
||||
} |
||||
} |
||||
|
||||
|
||||
//配置变动事件
|
||||
try { |
||||
final StrategyConfig orig = tableData.getStrategyConfig(); |
||||
saved.setStrategyConfig(strategyConfig.clone()); |
||||
StrategyEventsNotifier.compareAndFireConfigEvents(orig, strategyConfig, DSMapping.ofServerDS(new DsNameTarget(saved.getDsName()))); |
||||
} catch (CloneNotSupportedException e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.fr.design.data.tabledata.tabledatapane.db; |
||||
|
||||
import com.fr.data.impl.DBTableData; |
||||
import com.fr.esd.core.strategy.config.StrategyConfig; |
||||
|
||||
/** |
||||
* @author rinoux |
||||
* @version 10.0 |
||||
* Created by rinoux on 2021/3/19 |
||||
*/ |
||||
public interface StrategyConfigHandler { |
||||
|
||||
StrategyConfig find(); |
||||
|
||||
void save(DBTableData saved, StrategyConfig config); |
||||
} |
@ -1,50 +0,0 @@
|
||||
package com.fr.design.data.tabledata.tabledatapane.db; |
||||
|
||||
import com.fr.base.TableData; |
||||
import com.fr.data.impl.DBTableData; |
||||
import com.fr.design.data.DesignerStrategyConfigUtils; |
||||
import com.fr.design.file.HistoryTemplateListCache; |
||||
import com.fr.esd.core.strategy.config.StrategyConfig; |
||||
import com.fr.esd.query.StrategicTableData; |
||||
import com.fr.workspace.WorkContext; |
||||
|
||||
/** |
||||
* @author rinoux |
||||
* @version 10.0 |
||||
* Created by rinoux on 2021/3/19 |
||||
*/ |
||||
public class TemplateStrategyConfigHandler implements StrategyConfigHandler { |
||||
|
||||
DBTableData tableData; |
||||
|
||||
public TemplateStrategyConfigHandler(DBTableData tableData) { |
||||
this.tableData = tableData; |
||||
} |
||||
|
||||
@Override |
||||
public StrategyConfig find() { |
||||
StrategyConfig strategyConfig = null; |
||||
if (tableData != null) { |
||||
//设置保存数据集的事件检查钩子
|
||||
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath(); |
||||
|
||||
//新建模版此时不存在,不需要注册钩子
|
||||
if (tableData.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) { |
||||
tableData.setXmlSavedHook(new DBTableDataSavedHook(tplPath, tableData)); |
||||
} |
||||
|
||||
//获取当前的缓存配置,没有就创建一份
|
||||
String dsName = tableData.getDsName(); |
||||
|
||||
//这里为了之前兼容插件创建的配置,缓存配置不在DBTableData,而是从模版attr读取
|
||||
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName); |
||||
} |
||||
|
||||
return strategyConfig; |
||||
} |
||||
|
||||
@Override |
||||
public void save(DBTableData saved, StrategyConfig config) { |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue