if (idx == to && to < from) { addMetadata(context, dso, schema, element, qualifier, moved.getLanguage(), moved.getValue(), moved.getAuthority(), moved.getConfidence()); last = false; rr.getAuthority(), rr.getConfidence()); moved.getAuthority(), moved.getConfidence()); last = false; moved.getAuthority(), moved.getConfidence());
protected void copyMetadata(Context context, Item itemNew, Item nativeItem) throws SQLException { List<MetadataValue> md = itemService.getMetadata(nativeItem, Item.ANY, Item.ANY, Item.ANY, Item.ANY); for (MetadataValue aMd : md) { MetadataField metadataField = aMd.getMetadataField(); MetadataSchema metadataSchema = metadataField.getMetadataSchema(); String unqualifiedMetadataField = metadataSchema.getName() + "." + metadataField.getElement(); if (getIgnoredMetadataFields().contains(metadataField.toString('.')) || getIgnoredMetadataFields().contains(unqualifiedMetadataField + "." + Item.ANY)) { //Skip this metadata field continue; } itemService .addMetadata(context, itemNew, metadataField, aMd.getLanguage(), aMd.getValue(), aMd.getAuthority(), aMd.getConfidence()); } }
public MockMetadataValue(MetadataValue metadataValue) { MetadataField metadataField = metadataValue.getMetadataField(); MetadataSchema metadataSchema = metadataField.getMetadataSchema(); schema = metadataSchema.getName(); element = metadataField.getElement(); qualifier = metadataField.getQualifier(); language = metadataValue.getLanguage(); value = metadataValue.getValue(); authority = metadataValue.getAuthority(); confidence = metadataValue.getConfidence(); }
} else { dcvalues[i] = dcv.getValue() + csv.getAuthoritySeparator() + dcv.getAuthority(); dcvalues[i] += csv.getAuthoritySeparator() + (dcv.getConfidence() != -1 ? dcv .getConfidence() : Choices.CF_ACCEPTED);
@Override public void replaceMetadata(Context context, T dso, String schema, String element, String qualifier, String lang, String value, String authority, int confidence, int index) throws SQLException { List<MetadataValue> list = getMetadata(dso, schema, element, qualifier); clearMetadata(context, dso, schema, element, qualifier, Item.ANY); int idx = 0; for (MetadataValue rr : list) { if (idx == index) { addMetadata(context, dso, schema, element, qualifier, lang, value, authority, confidence); } else { addMetadata(context, dso, schema, element, qualifier, rr.getLanguage(), rr.getValue(), rr.getAuthority(), rr.getConfidence()); } idx++; } } }
identifier.getValue(), identifier.getAuthority(), identifier.getConfidence());
if (bi.isAuthorityIndex() && (values.get(x).getAuthority() == null || values.get(x) .getConfidence() < minConfidence)) { + values.get(x).getAuthority() + ", confidence=" + values.get(x).getConfidence() + " (BAD AUTHORITY)"); continue; .getConfidence() >= minConfidence)) { distFAuths.add(values.get(x).getAuthority());
@Override public void addAndShiftRightMetadata(Context context, T dso, String schema, String element, String qualifier, String lang, String value, String authority, int confidence, int index) throws SQLException { List<MetadataValue> list = getMetadata(dso, schema, element, qualifier); clearMetadata(context, dso, schema, element, qualifier, Item.ANY); int idx = 0; boolean last = true; for (MetadataValue rr : list) { if (idx == index) { addMetadata(context, dso, schema, element, qualifier, lang, value, authority, confidence); last = false; } addMetadata(context, dso, schema, element, qualifier, rr.getLanguage(), rr.getValue(), rr.getAuthority(), rr.getConfidence()); idx++; } if (last) { addMetadata(context, dso, schema, element, qualifier, lang, value, authority, confidence); } }
if (value.getAuthority() != null && !"".equals(value.getAuthority())) { mdValue += authoritySeparator + value.getAuthority() + authoritySeparator + (value .getConfidence() != -1 ? value.getConfidence() : Choices.CF_ACCEPTED);
if (val.getAuthority() != null) { valueElem.getField().add(createValue("authority", val.getAuthority())); if (val.getConfidence() != Choices.CF_NOVALUE) { valueElem.getField().add(createValue("confidence", val.getConfidence() + ""));
&& meta.getConfidence() >= minConfidence) { boolean ignoreAuthority = DSpaceServicesFactory
identifier.getValue(), identifier.getAuthority(), identifier.getConfidence());
/** * @param context The relevant DSpace Context. * @param bitstream the bitstream to be cloned * @return id of the clone bitstream. * A general class of exceptions produced by failed or interrupted I/O operations. * @throws SQLException An exception that provides information on a database access error or other errors. * @throws AuthorizeException Exception indicating the current user of the context does not have permission * to perform a particular action. */ @Override public Bitstream clone(Context context, Bitstream bitstream) throws SQLException, IOException, AuthorizeException { Bitstream clonedBitstream = bitstreamService.clone(context, bitstream); clonedBitstream.setStoreNumber(bitstream.getStoreNumber()); List<MetadataValue> metadataValues = bitstreamService .getMetadata(bitstream, Item.ANY, Item.ANY, Item.ANY, Item.ANY); for (MetadataValue metadataValue : metadataValues) { bitstreamService.addMetadata(context, clonedBitstream, metadataValue.getMetadataField(), metadataValue.getLanguage(), metadataValue.getValue(), metadataValue.getAuthority(), metadataValue.getConfidence()); } bitstreamService.update(context, clonedBitstream); return clonedBitstream; }
if (dc.getAuthority() != null) { doc.addField(key + ".authority", dc.getAuthority()); doc.addField(key + ".confidence", dc.getConfidence() + "");