#23544 Integrated with the fieldId
This commit is contained in:
parent
0710f44269
commit
fc23e553f7
|
@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
- [#23188] Overloaded the method getProfilesInTheScope(forName)
|
- [#23188] Overloaded the method getProfilesInTheScope(forName)
|
||||||
- [#22890] Including the set/get currentValue for Update facility
|
- [#22890] Including the set/get currentValue for Update facility
|
||||||
- [#23188] Advanced the MultipleDilaogUpload with a more complex object
|
- [#23188] Advanced the MultipleDilaogUpload with a more complex object
|
||||||
|
- [#23544] Integrated with the fieldId added to gCube Metadata Profile
|
||||||
|
|
||||||
## [v1.0.1-SNAPSHOT] - 2020-10-08
|
## [v1.0.1-SNAPSHOT] - 2020-10-08
|
||||||
|
|
||||||
|
|
|
@ -921,8 +921,16 @@ public class MetaDataFieldSkeleton extends Composite {
|
||||||
*/
|
*/
|
||||||
public String getFieldNameQualified() {
|
public String getFieldNameQualified() {
|
||||||
|
|
||||||
if (field.getFieldNameFromCategory() != null)
|
//see https://support.d4science.org/issues/23544
|
||||||
|
if (field.getFieldId() != null) {
|
||||||
|
return field.getFieldId();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Using the getFieldNameFromCategory if the category is present in the model as cateogory:fieldName
|
||||||
|
if (field.getFieldNameFromCategory() != null && field.getFieldNameFromCategory().compareTo(field.getFieldName())!=0) {
|
||||||
return field.getFieldNameFromCategory();
|
return field.getFieldNameFromCategory();
|
||||||
|
}
|
||||||
|
|
||||||
return field.getFieldName();
|
return field.getFieldName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,6 +298,7 @@ public class MetadataDiscovery {
|
||||||
wrapperObj.setType(DataTypeWrapper.String);
|
wrapperObj.setType(DataTypeWrapper.String);
|
||||||
}
|
}
|
||||||
wrapperObj.setDefaultValue(metadataField.getDefaultValue());
|
wrapperObj.setDefaultValue(metadataField.getDefaultValue());
|
||||||
|
wrapperObj.setFieldId(metadataField.getFieldId());
|
||||||
wrapperObj.setFieldName(metadataField.getFieldName());
|
wrapperObj.setFieldName(metadataField.getFieldName());
|
||||||
wrapperObj.setMandatory(metadataField.getMandatory());
|
wrapperObj.setMandatory(metadataField.getMandatory());
|
||||||
wrapperObj.setNote(metadataField.getNote());
|
wrapperObj.setNote(metadataField.getNote());
|
||||||
|
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||||
public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8476731365884466698L;
|
private static final long serialVersionUID = -8476731365884466698L;
|
||||||
|
private String fieldId;
|
||||||
private String fieldName;
|
private String fieldName;
|
||||||
private String fieldNameFromCategory;
|
private String fieldNameFromCategory;
|
||||||
private Boolean mandatory = false;
|
private Boolean mandatory = false;
|
||||||
|
@ -40,6 +41,8 @@ public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
||||||
/**
|
/**
|
||||||
* Instantiates a new metadata field wrapper.
|
* Instantiates a new metadata field wrapper.
|
||||||
*
|
*
|
||||||
|
* @param fieldId the field id (optional) if present is used instead of
|
||||||
|
* fieldName as result
|
||||||
* @param fieldName the field name
|
* @param fieldName the field name
|
||||||
* @param mandatory the mandatory
|
* @param mandatory the mandatory
|
||||||
* @param type the type
|
* @param type the type
|
||||||
|
@ -49,9 +52,10 @@ public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
||||||
* @param validator the validator
|
* @param validator the validator
|
||||||
* @param category the category
|
* @param category the category
|
||||||
*/
|
*/
|
||||||
public MetadataFieldWrapper(String fieldName, Boolean mandatory, DataTypeWrapper type, String defaultValue,
|
public MetadataFieldWrapper(String fieldId, String fieldName, Boolean mandatory, DataTypeWrapper type,
|
||||||
String note, List<String> vocabulary, String validator, CategoryWrapper category) {
|
String defaultValue, String note, List<String> vocabulary, String validator, CategoryWrapper category) {
|
||||||
super();
|
super();
|
||||||
|
this.fieldId = fieldId;
|
||||||
this.fieldName = fieldName;
|
this.fieldName = fieldName;
|
||||||
this.mandatory = mandatory;
|
this.mandatory = mandatory;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -80,6 +84,24 @@ public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
||||||
this.maxOccurs = maxOccurs;
|
this.maxOccurs = maxOccurs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the field id.
|
||||||
|
*
|
||||||
|
* @return the field id
|
||||||
|
*/
|
||||||
|
public String getFieldId() {
|
||||||
|
return fieldId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the field id.
|
||||||
|
*
|
||||||
|
* @param fieldId the new field id
|
||||||
|
*/
|
||||||
|
public void setFieldId(String fieldId) {
|
||||||
|
this.fieldId = fieldId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the field name.
|
* Gets the field name.
|
||||||
*
|
*
|
||||||
|
@ -327,29 +349,43 @@ public class MetadataFieldWrapper implements UpdatableField, Serializable {
|
||||||
return currentValue;
|
return currentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* To string.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#toString()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MetadataFieldWrapper [" + (fieldName != null ? "serviceFieldName=" + fieldName + ", " : "")
|
StringBuilder builder = new StringBuilder();
|
||||||
+ (fieldNameFromCategory != null ? "fieldNameFromCategory=" + fieldNameFromCategory + ", " : "")
|
builder.append("MetadataFieldWrapper [fieldId=");
|
||||||
+ (mandatory != null ? "mandatory=" + mandatory + ", " : "")
|
builder.append(fieldId);
|
||||||
+ (maxOccurs != null ? "maxOccurs=" + maxOccurs + ", " : "")
|
builder.append(", fieldName=");
|
||||||
+ (type != null ? "type=" + type + ", " : "")
|
builder.append(fieldName);
|
||||||
+ (defaultValue != null ? "defaultValue=" + defaultValue + ", " : "")
|
builder.append(", fieldNameFromCategory=");
|
||||||
+ (note != null ? "note=" + note + ", " : "")
|
builder.append(fieldNameFromCategory);
|
||||||
+ (vocabulary != null ? "vocabulary=" + vocabulary + ", " : "") + "multiSelection=" + multiSelection
|
builder.append(", mandatory=");
|
||||||
+ ", " + (validator != null ? "validator=" + validator + ", " : "")
|
builder.append(mandatory);
|
||||||
+ (ownerCategory != null ? "ownerCategory=" + ownerCategory.getId() + ", " : "")
|
builder.append(", type=");
|
||||||
+ (asGroup != null ? "asGroup=" + asGroup + ", " : "") + (asTag != null ? "asTag=" + asTag : "") + "]";
|
builder.append(type);
|
||||||
|
builder.append(", defaultValue=");
|
||||||
|
builder.append(defaultValue);
|
||||||
|
builder.append(", note=");
|
||||||
|
builder.append(note);
|
||||||
|
builder.append(", vocabulary=");
|
||||||
|
builder.append(vocabulary);
|
||||||
|
builder.append(", multiSelection=");
|
||||||
|
builder.append(multiSelection);
|
||||||
|
builder.append(", validator=");
|
||||||
|
builder.append(validator);
|
||||||
|
builder.append(", ownerCategory=");
|
||||||
|
builder.append(ownerCategory);
|
||||||
|
builder.append(", asGroup=");
|
||||||
|
builder.append(asGroup);
|
||||||
|
builder.append(", asTag=");
|
||||||
|
builder.append(asTag);
|
||||||
|
builder.append(", maxOccurs=");
|
||||||
|
builder.append(maxOccurs);
|
||||||
|
builder.append(", currentValue=");
|
||||||
|
builder.append(currentValue);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue