Updated data-mapper for ProjectEdit
This commit is contained in:
parent
8e2619a6d0
commit
0969af4f3d
|
@ -254,18 +254,18 @@ public class Geoportal_JSON_Mapper {
|
|||
LOG.debug("It is an Array");
|
||||
List dataArray = (List) theOBJFieldValue;
|
||||
//printList(dataArray);
|
||||
for (int j = 0; j < dataArray.size(); j++) {
|
||||
int dataSize = dataArray.size();
|
||||
for (int j = 0; j < dataSize; j++) {
|
||||
List<MetadataFieldWrapper> cloned = cloneList(Arrays.asList(metadataField));
|
||||
MetadataFieldWrapper mfw = cloned.get(0);
|
||||
|
||||
//Duplicating MetadataFieldWrapper for data list with isMultiSelection==false
|
||||
if(!mfw.isMultiSelection()) {
|
||||
mfw.setCurrentValues(dataArray.get(j)+"");
|
||||
// From the second repeated field settings
|
||||
// mandatory false and one instance
|
||||
// In case of array, from the first to second-last one, repeated field is set to 'false'
|
||||
// These properties are managed properly with the
|
||||
// first occurrence of the field
|
||||
if (j >= 1) {
|
||||
// last one field
|
||||
if (j < dataSize-1) {
|
||||
mfw.setMandatory(false);
|
||||
mfw.setMaxOccurs(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue