Skip to content

Commit

Permalink
this method should also check metadata with qualdrop_value
Browse files Browse the repository at this point in the history
  • Loading branch information
Micheleboychuk committed May 14, 2020
1 parent 7b7e7cd commit 3a19826
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions dspace-api/src/main/java/org/dspace/app/util/DCInputSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;

import org.dspace.core.Utils;
/**
* Class representing all DC inputs required for a submission, organized into pages
*
Expand Down Expand Up @@ -107,9 +108,20 @@ public boolean isFieldPresent(String fieldName) {
for (int i = 0; i < inputs.length; i++) {
for (int j = 0; j < inputs[i].length; j++) {
DCInput field = inputs[i][j];
String fullName = field.getFieldName();
if (fullName.equals(fieldName)) {
return true;
if (field.getInputType().equals("qualdrop_value")) {
List<String> pairs = field.getPairs();
for (int k = 0; k < pairs.size(); k += 2) {
String qualifier = pairs.get(k + 1);
String fullName = Utils.standardize(field.getSchema(), field.getElement(), qualifier, ".");
if (fullName.equals(fieldName)) {
return true;
}
}
} else {
String fullName = field.getFieldName();
if (fullName.equals(fieldName)) {
return true;
}
}
}
}
Expand Down

0 comments on commit 3a19826

Please sign in to comment.