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; }
public void addRioxxVersionSection(List upload, Item item) throws WingException { String version = item.getMetadata("rioxxterms.version"); if (StringUtils.isNotBlank(version) && !"NA".equals(version)) { try { DCInputsReader a = new DCInputsReader(); java.util.List<String> pairs = a.getPairs("rioxxterms_version"); int humanReadable = pairs.indexOf(version) - 1; version = pairs.get(humanReadable); } catch (DCInputsReaderException e) { log.error(e.getMessage(), e); } upload .addItem("upload-rioxx-version-warning", "upload-rioxx-version-warning") .addContent(T_rioxx_version.parameterize(version)); } }
/** * Show the page which displays all the Initial Questions to the user * * @param context current DSpace context * @param request the request object * @param response the response object * @param subInfo the SubmissionInfo object */ private void showInitialQuestions( Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo) throws SQLException, ServletException, IOException { // determine collection Collection c = subInfo.getSubmissionItem().getCollection(); try { // read configurable submissions forms data DCInputsReader inputsReader = new DCInputsReader(); // load the proper submission inputs to be used by the JSP request.setAttribute("submission.inputs", inputsReader.getInputs(c.getHandle())); } catch (DCInputsReaderException e) { throw new ServletException(e); } // forward to initial questions JSP JSPStepManager.showJSP(request, response, subInfo, INITIAL_QUESTIONS_JSP); }