/** * Ensure that the inputs reader has been initialized, this method may be * called multiple times with no ill-effect. */ private static void initializeInputsReader() throws DCInputsReaderException { if (INPUTS_READER == null) { INPUTS_READER = new DCInputsReader(); } }
private void init() { try { if (dci == null) { dci = new DCInputsReader(); } } catch (DCInputsReaderException e) { log.error("Failed reading DCInputs initialization: ", e); } }
private static synchronized void initPluginNames() { if (pluginNames == null) { try { if (dci == null) { dci = new DCInputsReader(); } } catch (DCInputsReaderException e) { log.error("Failed reading DCInputs initialization: ", e); } List<String> names = new ArrayList<String>(); Iterator pi = dci.getPairsNameIterator(); while (pi.hasNext()) { names.add((String) pi.next()); } pluginNames = names.toArray(new String[names.size()]); log.debug("Got plugin names = " + Arrays.deepToString(pluginNames)); } }
@Override public void init(Curator curator, String taskId) throws IOException { super.init(curator, taskId); try { reader = new DCInputsReader(); } catch (DCInputsReaderException dcrE) { throw new IOException(dcrE.getMessage(), dcrE); } }
protected DCInput getDCInput(String formName, String schema, String element, String qualifier) throws DCInputsReaderException { List<DCInputSet> dcinputsets = new DCInputsReader().getInputsBySubmissionName(formName); for (DCInputSet dcinputset : dcinputsets) { for (DCInput[] dcrow : dcinputset.getFields()) { for (DCInput dcinput : dcrow) { if (dcinput.getSchema().equals(schema) && dcinput.getElement().equals(element) && ((dcinput.getQualifier() != null && dcinput .getQualifier().equals(qualifier)) || (dcinput.getQualifier() == null && qualifier == null))) { return dcinput; } } } } return null; }
DCInputsReader inputsReader = new DCInputsReader();
public static List<String> differenceInSubmissionFields(Collection fromCollection, Collection toCollection) throws DCInputsReaderException { DCInputsReader reader = new DCInputsReader(); List<DCInputSet> from = reader.getInputsByCollectionHandle(fromCollection.getHandle()); List<DCInputSet> to = reader.getInputsByCollectionHandle(toCollection.getHandle()); Set<String> fromFieldName = new HashSet<>(); Set<String> toFieldName = new HashSet<>(); for (DCInputSet ff : from) { for (DCInput[] fdcrow : ff.getFields()) { for (DCInput fdc : fdcrow) { fromFieldName.add(fdc.getFieldName()); } } } for (DCInputSet tt : to) { for (DCInput[] tdcrow : tt.getFields()) { for (DCInput tdc : tdcrow) { toFieldName.add(tdc.getFieldName()); } } } return ListUtils.removeAll(fromFieldName, toFieldName); } }
try DCInputsReader inputsReader = new DCInputsReader(); request.setAttribute("submission.inputs", inputsReader.getInputs(c .getHandle()));
private void autoRegisterChoiceAuthorityFromInputReader() { try { DCInputsReader dcInputsReader = new DCInputsReader(); for (DCInputSet dcinputSet : dcInputsReader.getAllInputs(Integer.MAX_VALUE, 0)) { DCInput[][] dcinputs = dcinputSet.getFields();
private void autoRegisterAuthorityFromInputReader() { try { DCInputsReader dcInputsReader = new DCInputsReader(); for (DCInputSet dcinputSet : dcInputsReader.getAllInputs(Integer.MAX_VALUE, 0)) { DCInput[][] dcinputs = dcinputSet.getFields(); for (DCInput[] dcrows : dcinputs) { for (DCInput dcinput : dcrows) { if (StringUtils.isNotBlank(dcinput.getPairsType()) || StringUtils.isNotBlank(dcinput.getVocabulary())) { String authorityName = dcinput.getPairsType(); if (StringUtils.isBlank(authorityName)) { authorityName = dcinput.getVocabulary(); } if (!StringUtils.equals(dcinput.getInputType(), "qualdrop_value")) { String fieldKey = makeFieldKey(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier()); boolean req = ConfigurationManager .getBooleanProperty("authority.required." + fieldKey, false); controlled.put(fieldKey, true); isAuthorityRequired.put(fieldKey, req); } } } } } } catch (DCInputsReaderException e) { throw new IllegalStateException(e.getMessage(), e); } } }
DCInputsReader inputsReader = new DCInputsReader(); request.setAttribute("submission.inputs", inputsReader .getInputs(c.getHandle())); DCInputsReader inputsReader = new DCInputsReader(); request.setAttribute("submission.inputs", inputsReader .getInputs(c.getHandle())); DCInputsReader inputsReader = new DCInputsReader(); request.setAttribute("submission.inputs", inputsReader .getInputs(c.getHandle()));
DCInputsReader inputsReader = new DCInputsReader(formFileName);