public void reload() throws SubmissionConfigReaderException { collectionToSubmissionConfig = null; stepDefns = null; submitDefns = null; buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + SUBMIT_DEF_FILE_SUFFIX); }
Node nd = nl.item(i); if (nd.getNodeName().equals("name-map")) { String id = getAttribute(nd, "collection-handle"); String value = getAttribute(nd, "submission-name"); String content = getValue(nd); if (id == null) { throw new SAXException(
/** * Returns all the Item Submission process configs with pagination * * @param limit max number of SubmissionConfig to return * @param offset number of SubmissionConfig to skip in the return * @return the list of SubmissionConfig */ public List<SubmissionConfig> getAllSubmissionConfigs(Integer limit, Integer offset) { int idx = 0; int count = 0; List<SubmissionConfig> subConfigs = new LinkedList<SubmissionConfig>(); for (String key : submitDefns.keySet()) { if (offset == null || idx >= offset) { count++; subConfigs.add(getSubmissionConfigByName(key)); } idx++; if (count >= limit) { break; } } return subConfigs; }
SubmissionConfigReader subConfigReader = new SubmissionConfigReader(); SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c .getHandle(), false);
return; Node e = getElement(n); NodeList nl = e.getChildNodes(); int len = nl.getLength(); for (int i = 0; i < len; i++) { Node nd = nl.item(i); if ((nd == null) || isEmptyTextNode(nd)) { continue; processMap(nd); foundMap = true; } else if (tagName.equals("step-definitions")) { processStepDefinition(nd); foundStepDefs = true; } else if (tagName.equals("submission-definitions")) { processSubmissionDefinition(nd); foundSubmitDefs = true;
public List<DCInputSet> getInputsBySubmissionName(String name) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByName(name); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if (SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (SubmissionConfigReaderException e) { throw new DCInputsReaderException("No form designated as default", e); } }
/** * Returns the set of DC inputs used for a particular collection, or the * default set if no inputs defined for the collection * * @param collectionHandle collection's unique Handle * @return DC input set * @throws DCInputsReaderException if no default set defined * @throws ServletException */ public List<DCInputSet> getInputsByCollectionHandle(String collectionHandle) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if (SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (SubmissionConfigReaderException e) { throw new DCInputsReaderException("No form designated as default", e); } }
if (!isEmptyTextNode(nfld)) { String value = getValue(nfld); stepInfo.put(tagName, value); String stepID = getAttribute(nStep, "id"); if (StringUtils.isNotBlank(stepID)) { stepInfo.put("id", stepID); String mandatory = getAttribute(nStep, "mandatory"); if (StringUtils.isNotBlank(mandatory)) { stepInfo.put("mandatory", mandatory);
String stepID = getAttribute(nd, "id"); if (stepID == null) { throw new SAXException( Map<String, String> stepInfo = processStepChildNodes("step-definition", nd);
doNodes(doc); } catch (FactoryConfigurationError fe) { throw new SubmissionConfigReaderException(
+ "' not in cache. Reloading from scratch."); lastSubmissionConfig = new SubmissionConfig(StringUtils.equals(getDefaultSubmissionConfigName(), submitName), submitName, steps);
SubmissionConfigReader subConfigReader = new SubmissionConfigReader(); SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c.getHandle(), false);
String submitName = getAttribute(nd, "name"); if (submitName == null) { throw new SAXException( String stepID = getAttribute(nStep, "id"); stepInfo = processStepChildNodes( "submission-process", nStep);
/** * Load Submission Configuration from the * item-submission.xml configuration file * * @throws SubmissionConfigReaderException if servlet error */ public SubmissionConfigReader() throws SubmissionConfigReaderException { buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + SUBMIT_DEF_FILE_SUFFIX); }
/** * Returns the Item Submission process config used for a particular * collection, or the default if none is defined for the collection * * @param collectionHandle collection's unique Handle * @return the SubmissionConfig representing the item submission config * @throws SubmissionConfigReaderException if no default submission process configuration defined */ public SubmissionConfig getSubmissionConfigByCollection(String collectionHandle) { // get the name of the submission process config for this collection String submitName = collectionToSubmissionConfig .get(collectionHandle); if (submitName == null) { submitName = collectionToSubmissionConfig .get(DEFAULT_COLLECTION); } if (submitName == null) { throw new IllegalStateException( "No item submission process configuration designated as 'default' in 'submission-map' section of " + "'item-submission.xml'."); } return getSubmissionConfigByName(submitName); }