This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new a40491614f fixed metadata injection issues. #6054 (#6101)
a40491614f is described below
commit a40491614f71712f358f29cece9ca987273ebdea
Author: Bart Maertens <[email protected]>
AuthorDate: Wed Dec 3 08:49:38 2025 +0100
fixed metadata injection issues. #6054 (#6101)
* fixed metadata injection issues. #6054
* removed commented line. #6054
---
.../salesforce/SalesforceTransformMeta.java | 37 ++++++--
.../salesforceinput/SalesforceInputDialog.java | 4 +-
.../salesforceinput/SalesforceInputField.java | 60 +++++++++---
.../salesforceinput/SalesforceInputMeta.java | 102 ++++++++++++++++-----
4 files changed, 160 insertions(+), 43 deletions(-)
diff --git
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforce/SalesforceTransformMeta.java
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforce/SalesforceTransformMeta.java
index 3208f57714..4b9cf6b9d4 100644
---
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforce/SalesforceTransformMeta.java
+++
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforce/SalesforceTransformMeta.java
@@ -41,32 +41,53 @@ public abstract class SalesforceTransformMeta<
private static final Class<?> PKG = SalesforceTransformMeta.class;
/** The Salesforce Target URL */
- @HopMetadataProperty(key = "targetUrl", injectionKey = "SALESFORCE_URL")
- // @Injection(name = "SALESFORCE_URL")
+ @HopMetadataProperty(
+ key = "targetUrl",
+ injectionKey = "SALESFORCE_URL",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.SALESFORCE_URL")
private String targetUrl;
/** The userName */
- @HopMetadataProperty(key = "username", injectionKey = "SALESFORCE_USERNAME")
+ @HopMetadataProperty(
+ key = "username",
+ injectionKey = "SALESFORCE_USERNAME",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.SALESFORCE_USERNAME")
private String username;
/** The password */
- @HopMetadataProperty(key = "password", injectionKey = "SALESFORCE_PASSWOR",
password = true)
+ @HopMetadataProperty(
+ key = "password",
+ injectionKey = "SALESFORCE_PASSWOR",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.SALESFORCE_PASSWOR",
+ password = true)
private String password;
/** The time out */
- @HopMetadataProperty(key = "timeout", injectionKey = "TIME_OUT")
+ @HopMetadataProperty(
+ key = "timeout",
+ injectionKey = "TIME_OUT",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.TIME_OUT")
private String timeout;
/** The connection compression */
- @HopMetadataProperty(key = "useCompression", injectionKey =
"USE_COMPRESSION")
+ @HopMetadataProperty(
+ key = "useCompression",
+ injectionKey = "USE_COMPRESSION",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.USE_COMPRESSION")
private boolean compression;
/** The Salesforce module */
- @HopMetadataProperty(key = "module", injectionKey = "MODULE")
+ @HopMetadataProperty(
+ key = "module",
+ injectionKey = "MODULE",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.MODULE")
private String module;
/** Salesforce Connection metadata name */
- @HopMetadataProperty(key = "salesforce_connection", injectionKey =
"SALESFORCE_CONNECTION")
+ @HopMetadataProperty(
+ key = "salesforce_connection",
+ injectionKey = "SALESFORCE_CONNECTION",
+ injectionKeyDescription = "SalesforceInputMeta.SALESFORCE_CONNECTION")
private String salesforceConnection;
@Override
diff --git
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputDialog.java
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputDialog.java
index 8596a22f28..66d71c0bcb 100644
---
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputDialog.java
+++
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputDialog.java
@@ -1762,7 +1762,7 @@ public class SalesforceInputDialog extends
SalesforceTransformDialog {
field.isIdLookup()
? BaseMessages.getString(PKG, CONST_SYSTEM_COMBO_YES)
: BaseMessages.getString(PKG, CONST_SYSTEM_COMBO_NO);
- String type = field.getTypeDesc();
+ String type = field.getType();
String format = field.getFormat();
String length = "" + field.getLength();
String prec = "" + field.getPrecision();
@@ -1904,7 +1904,7 @@ public class SalesforceInputDialog extends
SalesforceTransformDialog {
field.setField(item.getText(2));
field.setIdLookup(
BaseMessages.getString(PKG,
CONST_SYSTEM_COMBO_YES).equalsIgnoreCase(item.getText(3)));
- field.setTypeCode(ValueMetaFactory.getIdForValueMeta(item.getText(4)));
+ field.setType(item.getText(4));
field.setFormat(item.getText(5));
field.setLength(Const.toInt(item.getText(6), -1));
field.setPrecision(Const.toInt(item.getText(7), -1));
diff --git
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputField.java
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputField.java
index cec76d61eb..1680065ec7 100644
---
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputField.java
+++
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputField.java
@@ -47,42 +47,78 @@ public class SalesforceInputField implements Cloneable {
public static final String CONST_FIELD = "field";
public static final String CONST_SPACES = " ";
- @HopMetadataProperty(key = "name", injectionKey = "NAME")
+ @HopMetadataProperty(
+ key = "name",
+ injectionKey = "NAME",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.NAME")
private String name;
- @HopMetadataProperty(key = "field", injectionKey = "FIELD")
+ @HopMetadataProperty(
+ key = "field",
+ injectionKey = "FIELD",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.FIELD")
private String field;
- @HopMetadataProperty(key = "type")
+ @HopMetadataProperty(
+ key = "type",
+ injectionKey = "TYPE",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.FIELD")
private String type;
private int typeCode;
- @HopMetadataProperty(key = "length", injectionKey = "LENGTH")
+ @HopMetadataProperty(
+ key = "length",
+ injectionKey = "LENGTH",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.LENGTH")
private int length;
- @HopMetadataProperty(key = "format", injectionKey = "FORMAT")
+ @HopMetadataProperty(
+ key = "format",
+ injectionKey = "FORMAT",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.FORMAT")
private String format;
- @HopMetadataProperty(key = "trimtype")
+ @HopMetadataProperty(
+ key = "trimtype",
+ injectionKey = "TRIM_TYPE",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.TRIM_TYPE")
private int trimType;
- @HopMetadataProperty(key = "precision", injectionKey = "PRECISION")
+ @HopMetadataProperty(
+ key = "precision",
+ injectionKey = "PRECISION",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.PRECISION")
private int precision;
- @HopMetadataProperty(key = "currency", injectionKey = "CURRENCY")
+ @HopMetadataProperty(
+ key = "currency",
+ injectionKey = "CURRENCY",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.CURRENCY")
private String currencySymbol;
- @HopMetadataProperty(key = "decimal", injectionKey = "DECIMAL")
+ @HopMetadataProperty(
+ key = "decimal",
+ injectionKey = "DECIMAL",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.DECIMAL")
private String decimalSymbol;
- @HopMetadataProperty(key = "group", injectionKey = "GROUP")
+ @HopMetadataProperty(
+ key = "group",
+ injectionKey = "GROUP",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.GROUP")
private String groupSymbol;
- @HopMetadataProperty(key = "repeat", injectionKey = "REPEAT")
+ @HopMetadataProperty(
+ key = "repeat",
+ injectionKey = "REPEAT",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.REPEAT")
private boolean repeated;
- @HopMetadataProperty(key = "idlookup", injectionKey = "ISIDLOOKUP")
+ @HopMetadataProperty(
+ key = "idlookup",
+ injectionKey = "ISIDLOOKUP",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.ISLOOKUP")
private boolean idLookup;
@HopMetadataProperty(key = "samples")
diff --git
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputMeta.java
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputMeta.java
index 002ea43f0d..7806d157ff 100644
---
a/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputMeta.java
+++
b/plugins/tech/salesforce/src/main/java/org/apache/hop/pipeline/transforms/salesforceinput/SalesforceInputMeta.java
@@ -60,61 +60,101 @@ public class SalesforceInputMeta
private static final Class<?> PKG = SalesforceInputMeta.class;
/** Flag indicating that we should include the generated SQL in the output */
- @HopMetadataProperty(key = "include_sql", injectionKey =
"INCLUDE_SQL_IN_OUTPUT")
+ @HopMetadataProperty(
+ key = "include_sql",
+ injectionKey = "INCLUDE_SQL_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_SQL_IN_OUTPUT")
private boolean includeSQL;
/** The name of the field in the output containing the generated SQL */
- @HopMetadataProperty(key = "sql_field", injectionKey = "SQL_FIELDNAME")
+ @HopMetadataProperty(
+ key = "sql_field",
+ injectionKey = "SQL_FIELDNAME",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.SQL_FIELDNAME")
private String sqlField;
/** Flag indicating that we should include the server Timestamp in the
output */
- @HopMetadataProperty(key = "include_Timestamp", injectionKey =
"INCLUDE_TIMESTAMP_IN_OUTPUT")
+ @HopMetadataProperty(
+ key = "include_Timestamp",
+ injectionKey = "INCLUDE_TIMESTAMP_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_TIMESTAMP_IN_OUTPUT")
private boolean includeTimestamp;
/** The name of the field in the output containing the server Timestamp */
- @HopMetadataProperty(key = "timstamp_field", injectionKey =
"TIMESTAMP_FIELDNAME")
+ @HopMetadataProperty(
+ key = "timstamp_field",
+ injectionKey = "TIMESTAMP_FIELDNAME",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.TIMESTAMP_FIELDNAME")
private String timestampField;
/** Flag indicating that we should include the filename in the output */
- @HopMetadataProperty(key = "include_targeturl", injectionKey =
"INCLUDE_URL_IN_OUTPUT")
+ @HopMetadataProperty(
+ key = "include_targeturl",
+ injectionKey = "INCLUDE_URL_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_URL_IN_OUTPUT")
private boolean includeTargetURL;
/** The name of the field in the output containing the filename */
- @HopMetadataProperty(key = "targeturl_field", injectionKey = "URL_FIELDNAME")
+ @HopMetadataProperty(
+ key = "targeturl_field",
+ injectionKey = "URL_FIELDNAME",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.URL_FIELDNAME")
private String targetURLField;
/** Flag indicating that we should include the module in the output */
- @HopMetadataProperty(key = "include_module", injectionKey =
"INCLUDE_MODULE_IN_OUTPUT")
+ @HopMetadataProperty(
+ key = "include_module",
+ injectionKey = "INCLUDE_MODULE_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_MODULE_IN_OUTPUT")
private boolean includeModule;
/** The name of the field in the output containing the module */
- @HopMetadataProperty(key = "module_field", injectionKey = "MODULE_FIELDNAME")
+ @HopMetadataProperty(
+ key = "module_field",
+ injectionKey = "MODULE_FIELDNAME",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.MODULE_FIELDNAME")
private String moduleField;
/** Flag indicating that a deletion date field should be included in the
output */
@HopMetadataProperty(
key = "include_deletion_date",
- injectionKey = "INCLUDE_DELETION_DATE_IN_OUTPUT")
+ injectionKey = "INCLUDE_DELETION_DATE_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_DELETION_DATE_IN_OUTPUT")
private boolean includeDeletionDate;
/** The name of the field in the output containing the deletion Date */
- @HopMetadataProperty(key = "deletion_date_field", injectionKey =
"DELETION_DATE_FIELDNAME")
+ @HopMetadataProperty(
+ key = "deletion_date_field",
+ injectionKey = "DELETION_DATE_FIELDNAME",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.DELETION_DATE_FIELDNAME")
private String deletionDateField;
/** Flag indicating that a row number field should be included in the output
*/
- @HopMetadataProperty(key = "include_rownum", injectionKey =
"INCLUDE_ROWNUM_IN_OUTPUT")
+ @HopMetadataProperty(
+ key = "include_rownum",
+ injectionKey = "INCLUDE_ROWNUM_IN_OUTPUT",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.INCLUDE_ROWNUM_IN_OUTPUT")
private boolean includeRowNumber;
/** The name of the field in the output containing the row number */
- @HopMetadataProperty(key = "rownum_field", injectionKey = "ROWNUM_FIELDNAME")
+ @HopMetadataProperty(
+ key = "rownum_field",
+ injectionKey = "ROWNUM_FIELDNAME",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.ROWNUM_FIELDNAME")
private String rowNumberField;
/** The condition */
- @HopMetadataProperty(key = "condition", injectionKey = "QUERY_CONDITION")
+ @HopMetadataProperty(
+ key = "condition",
+ injectionKey = "QUERY_CONDITION",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.QUERY_CONDITION")
private String condition;
/** The maximum number or lines to read */
- @HopMetadataProperty(key = "limit", injectionKey = "LIMIT")
+ @HopMetadataProperty(
+ key = "limit",
+ injectionKey = "LIMIT",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.LIMIT")
private String rowLimit;
/** The fields to return... */
@@ -122,23 +162,37 @@ public class SalesforceInputMeta
key = "field",
groupKey = "fields",
injectionKey = "FIELD",
- injectionGroupKey = "FIELDS")
+ injectionKeyDescription = "SalesforceInputMeta.Injection.FIELD",
+ injectionGroupKey = "FIELDS",
+ injectionGroupDescription = "SalesforceInputMeta.Injection.FIELDS")
private List<SalesforceInputField> fields;
/** option: specify query */
- @HopMetadataProperty(key = "specifyQuery", injectionKey =
"USE_SPECIFIED_QUERY")
+ @HopMetadataProperty(
+ key = "specifyQuery",
+ injectionKey = "USE_SPECIFIED_QUERY",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.USE_SPECIFIED_QUERY")
private boolean specifyQuery;
// ** query entered by user **/
- @HopMetadataProperty(key = "query", injectionKey = "SPECIFY_QUERY")
+ @HopMetadataProperty(
+ key = "query",
+ injectionKey = "SPECIFY_QUERY",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.SPECIFY_QUERY")
private String query;
private int nrFields;
- @HopMetadataProperty(key = "read_to", injectionKey = "END_DATE")
+ @HopMetadataProperty(
+ key = "read_to",
+ injectionKey = "END_DATE",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.END_DATE")
private String readTo;
- @HopMetadataProperty(key = "read_from", injectionKey = "START_DATE")
+ @HopMetadataProperty(
+ key = "read_from",
+ injectionKey = "START_DATE",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.START_DATE")
private String readFrom;
private int recordsFilterCode;
@@ -148,11 +202,17 @@ public class SalesforceInputMeta
private String recordsFilter;
/** Use Salesforce Field API Names instead of Labels for output fields */
- @HopMetadataProperty(key = "use_field_api_names", injectionKey =
"USE_FIELD_API_NAMES")
+ @HopMetadataProperty(
+ key = "use_field_api_names",
+ injectionKey = "USE_FIELD_API_NAMES",
+ injectionKeyDescription =
"SalesforceInputMeta.Injection.USE_FIELD_API_NAMES")
private boolean useFieldApiNames;
/** Query all records including deleted ones */
- @HopMetadataProperty(key = "queryAll", injectionKey = "QUERY_ALL")
+ @HopMetadataProperty(
+ key = "queryAll",
+ injectionKey = "QUERY_ALL",
+ injectionKeyDescription = "SalesforceInputMeta.Injection.QUERY_ALL")
private boolean queryAll;
public SalesforceInputMeta() {