Skip to content

Commit 9c47fcd

Browse files
authored
Merge pull request #5279 from sramazzina/5263
fix #5263
2 parents 451667f + 7f2a311 commit 9c47fcd

File tree

5 files changed

+64
-29
lines changed

5 files changed

+64
-29
lines changed

plugins/transforms/selectvalues/src/main/java/org/apache/hop/pipeline/transforms/selectvalues/DeleteField.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
@Setter
2727
public class DeleteField implements Cloneable {
2828

29-
@HopMetadataProperty(key = "name", injectionKey = "REMOVE_NAME", injectionGroupKey = "REMOVE")
29+
@HopMetadataProperty(
30+
key = "name",
31+
injectionKeyDescription = "SelectValues.Injection.REMOVE_NAME",
32+
injectionKey = "REMOVE_NAME")
3033
private String name;
3134

3235
public DeleteField() {}

plugins/transforms/selectvalues/src/main/java/org/apache/hop/pipeline/transforms/selectvalues/SelectField.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,30 @@ public class SelectField {
2828
public SelectField() {}
2929

3030
/** Select: Name of the selected field */
31-
@HopMetadataProperty(key = "name", injectionKey = "FIELD_NAME", injectionGroupKey = "FIELD")
31+
@HopMetadataProperty(
32+
key = "name",
33+
injectionKey = "FIELD_NAME",
34+
injectionKeyDescription = "SelectValues.Injection.FIELD_NAME")
3235
private String name;
3336

3437
/** Select: Rename to ... */
35-
// @Injection(name = "FIELD_RENAME", group = "FIELDS")
36-
@HopMetadataProperty(key = "rename", injectionKey = "FIELD_RENAME", injectionGroupKey = "FIELD")
38+
@HopMetadataProperty(
39+
key = "rename",
40+
injectionKey = "FIELD_RENAME",
41+
injectionKeyDescription = "SelectValues.Injection.FIELD_RENAME")
3742
private String rename;
3843

3944
/** Select: length of field */
40-
// @Injection(name = "FIELD_LENGTH", group = "FIELDS")
41-
@HopMetadataProperty(key = "length", injectionKey = "FIELD_LENGTH", injectionGroupKey = "FIELD")
45+
@HopMetadataProperty(
46+
key = "length",
47+
injectionKey = "FIELD_LENGTH",
48+
injectionKeyDescription = "SelectValues.Injection.FIELD_LENGTH")
4249
private int length = SelectValuesMeta.UNDEFINED;
4350

4451
/** Select: Precision of field (for numbers) */
45-
// @Injection(name = "FIELD_PRECISION", group = "FIELDS")
4652
@HopMetadataProperty(
4753
key = "precision",
4854
injectionKey = "FIELD_PRECISION",
49-
injectionGroupKey = "FIELD")
55+
injectionKeyDescription = "SelectValues.Injection.FIELD_PRECISION")
5056
private int precision = SelectValuesMeta.UNDEFINED;
5157
}

plugins/transforms/selectvalues/src/main/java/org/apache/hop/pipeline/transforms/selectvalues/SelectMetadataChange.java

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import lombok.Getter;
2121
import lombok.Setter;
22+
import org.apache.hop.core.row.IValueMeta;
2223
import org.apache.hop.core.row.value.ValueMetaFactory;
2324
import org.apache.hop.metadata.api.HopMetadataProperty;
2425

@@ -29,101 +30,114 @@ public class SelectMetadataChange {
2930
// META-DATA mode
3031
/** Fields of which we want to change the meta data */
3132
// @Injection(name = "META_NAME", group = "METAS")
32-
@HopMetadataProperty(key = "name", injectionKey = "META_NAME", injectionGroupKey = "METAS")
33+
@HopMetadataProperty(
34+
key = "name",
35+
injectionKey = "META_NAME",
36+
injectionKeyDescription = "SelectValues.Injection.META_NAME")
3337
private String name;
3438

3539
/** Meta: new name of field */
3640
// @Injection(name = "META_RENAME", group = "METAS")
37-
@HopMetadataProperty(key = "rename", injectionKey = "META_RENAME", injectionGroupKey = "METAS")
41+
@HopMetadataProperty(
42+
key = "rename",
43+
injectionKey = "META_RENAME",
44+
injectionKeyDescription = "SelectValues.Injection.META_RENAME")
3845
private String rename;
3946

4047
/** Meta: new Value type for this field or TYPE_NONE if no change needed! */
41-
@HopMetadataProperty(key = "type", injectionKey = "META_TYPE", injectionGroupKey = "METAS")
48+
@HopMetadataProperty(
49+
key = "type",
50+
injectionKey = "META_TYPE",
51+
injectionKeyDescription = "SelectValues.Injection.META_TYPE")
4252
private String type;
4353

4454
/** Meta: new length of field */
45-
@HopMetadataProperty(key = "length", injectionKey = "META_LENGTH", injectionGroupKey = "METAS")
55+
@HopMetadataProperty(
56+
key = "length",
57+
injectionKey = "META_LENGTH",
58+
injectionKeyDescription = "SelectValues.Injection.META_LENGTH")
4659
private int length = -1;
4760

4861
/** Meta: new precision of field (for numbers) */
4962
@HopMetadataProperty(
5063
key = "precision",
5164
injectionKey = "META_PRECISION",
52-
injectionGroupKey = "METAS")
65+
injectionKeyDescription = "SelectValues.Injection.META_PRECISION")
5366
private int precision = -1;
5467

5568
/** Meta: the storage type, NORMAL or BINARY_STRING */
5669
@HopMetadataProperty(
5770
key = "storage_type",
5871
injectionKey = "META_STORAGE_TYPE",
59-
injectionGroupKey = "METAS")
72+
injectionKeyDescription = "SelectValues.Injection.META_STORAGE_TYPE")
6073
private String storageType;
6174

6275
/** The conversion metadata if any conversion needs to take place */
6376
@HopMetadataProperty(
6477
key = "conversion_mask",
6578
injectionKey = "META_CONVERSION_MASK",
66-
injectionGroupKey = "METAS")
79+
injectionKeyDescription = "SelectValues.Injection.META_CONVERSION_MASK")
6780
private String conversionMask;
6881

6982
/** Treat the date format as lenient */
7083
@HopMetadataProperty(
7184
key = "date_format_lenient",
7285
injectionKey = "META_DATE_FORMAT_LENIENT",
73-
injectionGroupKey = "METAS")
86+
injectionKeyDescription = "SelectValues.Injection.META_DATE_FORMAT_LENIENT")
7487
private boolean dateFormatLenient;
7588

7689
/** This is the locale to use for date parsing */
7790
@HopMetadataProperty(
7891
key = "date_format_locale",
7992
injectionKey = "META_DATE_FORMAT_LOCALE",
80-
injectionGroupKey = "METAS")
93+
injectionKeyDescription = "SelectValues.Injection.META_DATE_FORMAT_LOCALE")
8194
private String dateFormatLocale;
8295

8396
/** This is the time zone to use for date parsing */
8497
@HopMetadataProperty(
8598
key = "date_format_timezone",
8699
injectionKey = "META_DATE_FORMAT_TIMEZONE",
87-
injectionGroupKey = "METAS")
100+
injectionKeyDescription = "SelectValues.Injection.META_DATE_FORMAT_TIMEZONE")
88101
private String dateFormatTimeZone;
89102

90103
/** Treat string to number format as lenient */
91104
@HopMetadataProperty(
92105
key = "lenient_string_to_number",
93106
injectionKey = "META_LENIENT_STRING_TO_NUMBER",
94-
injectionGroupKey = "METAS")
107+
injectionKeyDescription = "SelectValues.Injection.META_LENIENT_STRING_TO_NUMBER")
95108
private boolean lenientStringToNumber;
96109

97110
/** The decimal symbol for number conversions */
98111
@HopMetadataProperty(
99112
key = "decimal_symbol",
100113
injectionKey = "META_DECIMAL",
101-
injectionGroupKey = "METAS")
114+
injectionKeyDescription = "SelectValues.Injection.META_DECIMAL")
102115
private String decimalSymbol;
103116

104117
/** The grouping symbol for number conversions */
105118
@HopMetadataProperty(
106119
key = "grouping_symbol",
107120
injectionKey = "META_GROUPING",
108-
injectionGroupKey = "METAS")
121+
injectionKeyDescription = "SelectValues.Injection.META_GROUPING")
109122
private String groupingSymbol;
110123

111124
/** The currency symbol for number conversions */
112125
@HopMetadataProperty(
113126
key = "currency_symbol",
114127
injectionKey = "META_CURRENCY",
115-
injectionGroupKey = "METAS")
128+
injectionKeyDescription = "SelectValues.Injection.META_CURRENCY")
116129
private String currencySymbol;
117130

118131
/** The encoding to use when decoding binary data to Strings */
119132
@HopMetadataProperty(
120133
key = "encoding",
121134
injectionKey = "META_ENCODING",
122-
injectionGroupKey = "METAS")
135+
injectionKeyDescription = "SelectValues.Injection.META_ENCODING")
123136
private String encoding;
124137

125138
public SelectMetadataChange() {
126139
storageType = "";
140+
type = ValueMetaFactory.getValueMetaName(IValueMeta.TYPE_NONE);
127141
}
128142

129143
public SelectMetadataChange(

plugins/transforms/selectvalues/src/main/java/org/apache/hop/pipeline/transforms/selectvalues/SelectOptions.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,30 @@ public SelectOptions() {
3333
meta = new ArrayList<>();
3434
}
3535

36-
@HopMetadataProperty(key = "field", injectionKey = "FIELD", injectionGroupKey = "FIELDS")
36+
@HopMetadataProperty(
37+
key = "field",
38+
injectionGroupKey = "FIELDS",
39+
injectionGroupDescription = "SelectValues.Injection.FIELDS")
3740
private List<SelectField> selectFields;
3841

39-
@HopMetadataProperty(key = "select_unspecified", injectionKey = "SELECT_UNSPECIFIED")
42+
@HopMetadataProperty(
43+
key = "select_unspecified",
44+
injectionKey = "SELECT_UNSPECIFIED",
45+
injectionKeyDescription = "SelectValues.Injection.SELECT_UNSPECIFIED")
4046
private boolean selectingAndSortingUnspecifiedFields;
4147

4248
// DE-SELECT mode
4349
/** Names of the fields to be removed! */
44-
@HopMetadataProperty(key = "remove", injectionKey = "REMOVE", injectionGroupKey = "REMOVES")
50+
@HopMetadataProperty(
51+
key = "remove",
52+
injectionGroupKey = "REMOVES",
53+
injectionGroupDescription = "SelectValues.Injection.REMOVES")
4554
private List<DeleteField> deleteName;
4655

4756
// META-DATA mode
48-
@HopMetadataProperty(key = "meta", injectionKey = "META", injectionGroupKey = "METAS")
57+
@HopMetadataProperty(
58+
key = "meta",
59+
injectionGroupKey = "METAS",
60+
injectionGroupDescription = "SelectValues.Injection.METAS")
4961
private List<SelectMetadataChange> meta;
5062
}

plugins/transforms/selectvalues/src/main/resources/org/apache/hop/pipeline/transforms/selectvalues/messages/messages_en_US.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ SelectValues.Injection.META_PRECISION=Precision
4343
SelectValues.Injection.META_RENAME=Rename to
4444
SelectValues.Injection.META_STORAGE_TYPE=Binary to Normal?
4545
SelectValues.Injection.META_TYPE=Type
46-
SelectValues.Injection.METAS=List of fields to change metadata for
46+
SelectValues.Injection.METAS=Fields to change metadata for
4747
SelectValues.Injection.REMOVE_NAME=Fieldname
48-
SelectValues.Injection.REMOVES=Removed fields
48+
SelectValues.Injection.REMOVES=Fields to remove
4949
SelectValues.Injection.SELECT_UNSPECIFIED=Include unspecified fields, ordered by name
5050
SelectValues.Log.CouldNotFindField=Couldn''t find field ''{0}'' in row!
5151
SelectValues.Log.FieldCouldNotSpecifiedMoreThanTwice=Field ''{0}'' is specified twice (or more) with the same name!

0 commit comments

Comments
 (0)