Skip to content

Commit

Permalink
final commit for v3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Oct 23, 2023
1 parent 2d43118 commit 6d2aff9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,8 @@ private Describable createPluginByDefaultVals(StringBuffer propPath, final Set<S


} else {
//pp.getEnumConstants()


FormFieldType fieldType = pp.formField.type();
if (fieldType == FormFieldType.SELECTABLE || fieldType == FormFieldType.ENUM) {

Expand Down Expand Up @@ -1629,34 +1630,6 @@ public void doSyncDbRecord(Context context) {
this.offlineManager.syncDbRecord(datasourceDb, this, context);
}

// /**
// * 线上控制台使用,用来添加table记录
// *
// * @param context
// */
// public void doSyncTableRecord(Context context) {
// Integer id = this.getInt("id");
// if (id == null) {
// this.addErrorMessage(context, "id不能为空");
// this.setBizResult(context, false);
// return;
// }
// String name = this.getString("name");
// String tableLogicName = this.getString("tableLogicName");
// Integer dbId = this.getInt("db_id");
// if (dbId == null) {
// this.addErrorMessage(context, "db_id不能为空");
// this.setBizResult(context, false);
// return;
// }
// DatasourceTable datasourceTable = new DatasourceTable();
// datasourceTable.setId(id);
// datasourceTable.setName(name);
// datasourceTable.setDbId(dbId);
// Date now = new Date();
// datasourceTable.setCreateTime(now);
// this.offlineManager.syncTableRecord(datasourceTable, this, context);
// }

/**
* 删除db
Expand Down Expand Up @@ -1725,80 +1698,6 @@ public void doGetWorkflowConfig(Context context) {
this.setBizResult(context, this.offlineManager.getWorkflowConfig(id, true));
}

// /**
// * 获取一个工作流的配置
// *
// * @param context
// */
// public void doGetWorkflowConfigBranch(Context context) {
// Integer id = this.getInt("id");
// if (id == null) {
// this.addErrorMessage(context, "请输入工作流id");
// return;
// }
// this.setBizResult(context, this.offlineManager.getWorkflowConfig(id, false));
// }
// /**
// * 获取某个
// *
// * @param context
// */
// public void doGetWorkflowConfigSha1(Context context) {
// String name = this.getString("name");
// if (StringUtils.isBlank(name)) {
// this.addErrorMessage(context, "工作流名字不能为空");
// return;
// }
// String gitSha1 = this.getString("gitSha1");
// if (StringUtils.isBlank(gitSha1)) {
// this.addErrorMessage(context, "请输入正确的commit id");
// return;
// }
// this.setBizResult(context, this.offlineManager.getWorkflowConfig(name,
// gitSha1));
// }
// public void doUseWorkflowChange(Context context) {
// Integer id = this.getInt("id");
// if (id == null) {
// this.addErrorMessage(context, "请传入变更id");
// return;
// }
// this.offlineManager.useWorkflowChange(id, this, context);
// }
// public void doCompareWorkflowChanges(Context context) {
// String path = this.getString("path");
// String fromVersion = this.getString("fromVersion");
// String toVersion = this.getString("toVersion");
// String fromString =
// GitUtils.$().getWorkflowSha(GitUtils.WORKFLOW_GIT_PROJECT_ID, fromVersion,
// path).getTask();
// String toString =
// GitUtils.$().getWorkflowSha(GitUtils.WORKFLOW_GIT_PROJECT_ID, toVersion,
// path).getTask();
// this.setBizResult(context, getTwoStringDiffHtml(fromString, toString));
// }
// private static String getTwoStringDiffHtml(String s1, String s2) {
// StringBuilder sb = new StringBuilder();
// LinkedList<diff_match_patch.Diff> differ = DIFF_MATCH_PATCH.diff_main(s1, s2,
// true);
//
// for (diff_match_patch.Diff d : differ) {
//
// if (d.operation == diff_match_patch.Operation.EQUAL) {
// sb.append(StringEscapeUtils.escapeXml(d.text));
// } else if (d.operation == diff_match_patch.Operation.DELETE) {
// sb.append("<span
// style='text-decoration:line-through;background-color:pink;'>")
// .append(StringEscapeUtils.escapeXml(d.text)).append("</span>");
// } else if (d.operation == diff_match_patch.Operation.INSERT) {
// sb.append("<span
// style=\"background-color:#00FF00;\">").append(StringEscapeUtils.escapeXml(d.text))
// .append("</span>");
// }
//
// }
// return sb.toString();
// }
@Autowired
public void setWfDaoFacade(IWorkflowDAOFacade facade) {
this.offlineDAOFacade = facade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected List<ColumnMetaData> parseTableColMeta(boolean inSink, String jdbcUrl,
// return columns;
}

public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, ResultSet columns1) throws SQLException {
public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, ResultSet columns1) throws SQLException, TableNotFoundException {
return wrapColsMeta(inSink, table, columns1, Collections.emptySet());
}

Expand All @@ -234,11 +234,13 @@ public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, Resul
public static final String KEY_DATA_TYPE = "DATA_TYPE";
public static final String KEY_COLUMN_SIZE = "COLUMN_SIZE";

public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, ResultSet columns1, Set<String> pkCols) throws SQLException {
public List<ColumnMetaData> wrapColsMeta(
boolean inSink, EntityName table, ResultSet columns1, Set<String> pkCols) throws SQLException, TableNotFoundException {
return this.wrapColsMeta(inSink, table, columns1, new CreateColumnMeta(pkCols, columns1));
}

public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, ResultSet columns1, CreateColumnMeta columnMetaCreator) throws SQLException {
public List<ColumnMetaData> wrapColsMeta(
boolean inSink, EntityName table, ResultSet columns1, CreateColumnMeta columnMetaCreator) throws SQLException, TableNotFoundException {

ColumnMetaData colMeta;
String colName = null;
Expand Down Expand Up @@ -290,7 +292,7 @@ public List<ColumnMetaData> wrapColsMeta(boolean inSink, EntityName table, Resul
return columns;
}

protected HashSet<String> createAddedCols(EntityName table) {
protected HashSet<String> createAddedCols(EntityName table) throws TableNotFoundException {
return Sets.newHashSet();
}

Expand Down
69 changes: 38 additions & 31 deletions tis-plugin/src/main/java/com/qlangtech/tis/util/HeteroEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,48 +304,55 @@ public IPluginStore<?> visit(BaseSubFormProperties props) {
// DataxReader.SubFieldFormAppKey<Describable> key =
return HeteroEnum.createDataXReaderAndWriterRelevant(pluginContext, pluginMeta,
new HeteroEnum.DataXReaderAndWriterRelevantCreator<IPluginStore>() {
@Override
public IPluginStore dbRelevant(IPluginContext pluginContext, String saveDbName) {
DataxReader.SubFieldFormAppKey key = new DataxReader.SubFieldFormAppKey<>(pluginContext,
true, saveDbName, props, clazz);
@Override
public IPluginStore dbRelevant(IPluginContext pluginContext, String saveDbName) {
DataxReader.SubFieldFormAppKey key = new DataxReader.SubFieldFormAppKey<>(pluginContext,
true, saveDbName, props, clazz);

return KeyedPluginStore.getPluginStore(key);
}
return KeyedPluginStore.getPluginStore(key);
}

@Override
public IPluginStore appRelevant(IPluginContext pluginContext, String dataxName) {
@Override
public IPluginStore appRelevant(IPluginContext pluginContext, String dataxName) {

DataxReader.SubFieldFormAppKey key = new DataxReader.SubFieldFormAppKey<>(pluginContext,
false, dataxName, props, clazz);
KeyedPluginStore<SelectedTab> subFormStore = KeyedPluginStore.getPluginStore(key);
DataxReader.SubFieldFormAppKey key = new DataxReader.SubFieldFormAppKey<>(pluginContext,
false, dataxName, props, clazz);
KeyedPluginStore<SelectedTab> subFormStore = KeyedPluginStore.getPluginStore(key);

return SelectedTabExtend.wrapSubFormStore(pluginContext,dataxName, subFormStore);
}
});
return SelectedTabExtend.wrapSubFormStore(pluginContext, dataxName, subFormStore);
}
});
}
});
} else {
store = createDataXReaderAndWriterRelevant(pluginContext, pluginMeta,
new DataXReaderAndWriterRelevantCreator<IPluginStore<?>>() {
@Override
public IPluginStore<?> dbRelevant(IPluginContext pluginContext, String saveDbName) {
if (!getReader) {
throw new IllegalStateException("getReader must be true");
store = getDataXReaderAndWriterRelevantPluginStore(pluginContext, getReader, pluginMeta);
}
return store;
}

public static IPluginStore<?> getDataXReaderAndWriterRelevantPluginStore(
IPluginContext pluginContext, boolean getReader, UploadPluginMeta pluginMeta) {
IPluginStore<?> store;
store = createDataXReaderAndWriterRelevant(pluginContext, pluginMeta,
new DataXReaderAndWriterRelevantCreator<IPluginStore<?>>() {
@Override
public IPluginStore<?> dbRelevant(IPluginContext pluginContext, String saveDbName) {
if (!getReader) {
throw new IllegalStateException("getReader must be true");
}
return DataxReader.getPluginStore(pluginContext, true, saveDbName);
}
return DataxReader.getPluginStore(pluginContext, true, saveDbName);
}

@Override
public IPluginStore<?> appRelevant(IPluginContext pluginContext, String dataxName) {
@Override
public IPluginStore<?> appRelevant(IPluginContext pluginContext, String dataxName) {


KeyedPluginStore<?> keyStore = (getReader) ?
DataxReader.getPluginStore(pluginContext, dataxName) :
DataxWriter.getPluginStore(pluginContext, pluginMeta.getProcessModel().resType, dataxName);
return keyStore;
}
});
}
KeyedPluginStore<?> keyStore = getReader ?
DataxReader.getPluginStore(pluginContext, dataxName) :
DataxWriter.getPluginStore(pluginContext, pluginMeta.getProcessModel().resType, dataxName);
return keyStore;
}
});
return store;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,13 @@ public static UploadPluginMeta parse(IPluginContext context, String plugin, bool
}

public List<DataxReader> getDataxReaders(IPluginContext pluginContext) {
return HeteroEnum.DATAX_READER.getPlugins(pluginContext, UploadPluginMeta.parse(pluginContext,
this.name + ":" + DataxUtils.DATAX_NAME + "_" + this.getDataXName(),
useCache));
// return HeteroEnum.DATAX_READER.getPlugins(pluginContext, UploadPluginMeta.parse(pluginContext,
// this.name + ":" + DataxUtils.DATAX_NAME + "_" + this.getDataXName(),
// useCache));
IPluginStore<DataxReader> store = (IPluginStore<DataxReader>) HeteroEnum.getDataXReaderAndWriterRelevantPluginStore(
pluginContext, true, this);
return store.getPlugins();

}

public IPluginEnum getHeteroEnum() {
Expand Down

0 comments on commit 6d2aff9

Please sign in to comment.