private List<String> getReqList(String handle) throws DCInputsReaderException { List<String> reqList = reqMap.get(handle); if (reqList == null) { reqList = reqMap.get("default"); } if (reqList == null) { reqList = new ArrayList<String>(); DCInputSet inputs = reader.getInputs(handle); for (int i = 0; i < inputs.getNumberPages(); i++) { for (DCInput input : inputs.getPageRows(i, true, true)) { if (input.isRequired()) { StringBuilder sb = new StringBuilder(); sb.append(input.getSchema()).append("."); sb.append(input.getElement()).append("."); String qual = input.getQualifier(); if (qual == null) { qual = ""; } sb.append(qual); reqList.add(sb.toString()); } } } reqMap.put(inputs.getFormName(), reqList); } return reqList; }
/** * Return the HTML / DRI field name for the given input. * * @param input * @return field name as a String (e.g. dc_contributor_editor) */ public static String getFieldName(DCInput input) { String dcSchema = input.getSchema(); String dcElement = input.getElement(); String dcQualifier = input.getQualifier(); if (dcQualifier != null && !dcQualifier.equals(Item.ANY)) { return dcSchema + "_" + dcElement + '_' + dcQualifier; } else { return dcSchema + "_" + dcElement; } }