mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
[DS-1883] Un-deprecate DCValue and rename it.
It seems that the reason for deprecation was objection to the *name*, since it is not strictly for DC anymore.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
package org.dspace.app.bulkedit;
|
package org.dspace.app.bulkedit;
|
||||||
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -25,16 +25,16 @@ public class BulkEditChange
|
|||||||
private Item item;
|
private Item item;
|
||||||
|
|
||||||
/** The List of hashtables with the new elements */
|
/** The List of hashtables with the new elements */
|
||||||
private List<DCValue> adds;
|
private List<Metadatum> adds;
|
||||||
|
|
||||||
/** The List of hashtables with the removed elements */
|
/** The List of hashtables with the removed elements */
|
||||||
private List<DCValue> removes;
|
private List<Metadatum> removes;
|
||||||
|
|
||||||
/** The List of hashtables with the unchanged elements */
|
/** The List of hashtables with the unchanged elements */
|
||||||
private List<DCValue> constant;
|
private List<Metadatum> constant;
|
||||||
|
|
||||||
/** The List of the complete set of new values (constant + adds) */
|
/** The List of the complete set of new values (constant + adds) */
|
||||||
private List<DCValue> complete;
|
private List<Metadatum> complete;
|
||||||
|
|
||||||
/** The list of old collections the item used to be mapped to */
|
/** The list of old collections the item used to be mapped to */
|
||||||
private List<Collection> oldMappedCollections;
|
private List<Collection> oldMappedCollections;
|
||||||
@@ -77,10 +77,10 @@ public class BulkEditChange
|
|||||||
newOwningCollection = null;
|
newOwningCollection = null;
|
||||||
|
|
||||||
// Initialise the arrays
|
// Initialise the arrays
|
||||||
adds = new ArrayList<DCValue>();
|
adds = new ArrayList<Metadatum>();
|
||||||
removes = new ArrayList<DCValue>();
|
removes = new ArrayList<Metadatum>();
|
||||||
constant = new ArrayList<DCValue>();
|
constant = new ArrayList<Metadatum>();
|
||||||
complete = new ArrayList<DCValue>();
|
complete = new ArrayList<Metadatum>();
|
||||||
oldMappedCollections = new ArrayList<Collection>();
|
oldMappedCollections = new ArrayList<Collection>();
|
||||||
newMappedCollections = new ArrayList<Collection>();
|
newMappedCollections = new ArrayList<Collection>();
|
||||||
}
|
}
|
||||||
@@ -98,10 +98,10 @@ public class BulkEditChange
|
|||||||
empty = true;
|
empty = true;
|
||||||
|
|
||||||
// Initialise the arrays
|
// Initialise the arrays
|
||||||
adds = new ArrayList<DCValue>();
|
adds = new ArrayList<Metadatum>();
|
||||||
removes = new ArrayList<DCValue>();
|
removes = new ArrayList<Metadatum>();
|
||||||
constant = new ArrayList<DCValue>();
|
constant = new ArrayList<Metadatum>();
|
||||||
complete = new ArrayList<DCValue>();
|
complete = new ArrayList<Metadatum>();
|
||||||
oldMappedCollections = new ArrayList<Collection>();
|
oldMappedCollections = new ArrayList<Collection>();
|
||||||
newMappedCollections = new ArrayList<Collection>();
|
newMappedCollections = new ArrayList<Collection>();
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @param dcv The value to add
|
* @param dcv The value to add
|
||||||
*/
|
*/
|
||||||
public void registerAdd(DCValue dcv)
|
public void registerAdd(Metadatum dcv)
|
||||||
{
|
{
|
||||||
// Add the added value
|
// Add the added value
|
||||||
adds.add(dcv);
|
adds.add(dcv);
|
||||||
@@ -135,7 +135,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @param dcv The value to remove
|
* @param dcv The value to remove
|
||||||
*/
|
*/
|
||||||
public void registerRemove(DCValue dcv)
|
public void registerRemove(Metadatum dcv)
|
||||||
{
|
{
|
||||||
// Add the removed value
|
// Add the removed value
|
||||||
removes.add(dcv);
|
removes.add(dcv);
|
||||||
@@ -147,7 +147,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @param dcv The value to keep unchanged
|
* @param dcv The value to keep unchanged
|
||||||
*/
|
*/
|
||||||
public void registerConstant(DCValue dcv)
|
public void registerConstant(Metadatum dcv)
|
||||||
{
|
{
|
||||||
// Add the removed value
|
// Add the removed value
|
||||||
constant.add(dcv);
|
constant.add(dcv);
|
||||||
@@ -241,7 +241,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @return the list of elements and their values that have been added.
|
* @return the list of elements and their values that have been added.
|
||||||
*/
|
*/
|
||||||
public List<DCValue> getAdds()
|
public List<Metadatum> getAdds()
|
||||||
{
|
{
|
||||||
// Return the array
|
// Return the array
|
||||||
return adds;
|
return adds;
|
||||||
@@ -252,7 +252,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @return the list of elements and their values that have been removed.
|
* @return the list of elements and their values that have been removed.
|
||||||
*/
|
*/
|
||||||
public List<DCValue> getRemoves()
|
public List<Metadatum> getRemoves()
|
||||||
{
|
{
|
||||||
// Return the array
|
// Return the array
|
||||||
return removes;
|
return removes;
|
||||||
@@ -263,7 +263,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @return the list of unchanged values
|
* @return the list of unchanged values
|
||||||
*/
|
*/
|
||||||
public List<DCValue> getConstant()
|
public List<Metadatum> getConstant()
|
||||||
{
|
{
|
||||||
// Return the array
|
// Return the array
|
||||||
return constant;
|
return constant;
|
||||||
@@ -274,7 +274,7 @@ public class BulkEditChange
|
|||||||
*
|
*
|
||||||
* @return the list of all values
|
* @return the list of all values
|
||||||
*/
|
*/
|
||||||
public List<DCValue> getComplete()
|
public List<Metadatum> getComplete()
|
||||||
{
|
{
|
||||||
// Return the array
|
// Return the array
|
||||||
return complete;
|
return complete;
|
||||||
|
@@ -423,8 +423,8 @@ public class DSpaceCSV implements Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Populate it
|
// Populate it
|
||||||
DCValue md[] = i.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum md[] = i.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue value : md)
|
for (Metadatum value : md)
|
||||||
{
|
{
|
||||||
// Get the key (schema.element)
|
// Get the key (schema.element)
|
||||||
String key = value.schema + "." + value.element;
|
String key = value.schema + "." + value.element;
|
||||||
@@ -652,10 +652,10 @@ public class DSpaceCSV implements Serializable
|
|||||||
*
|
*
|
||||||
* The list can be configured via the key ignore-on-export in bulkedit.cfg
|
* The list can be configured via the key ignore-on-export in bulkedit.cfg
|
||||||
*
|
*
|
||||||
* @param md The DCValue to examine
|
* @param md The Metadatum to examine
|
||||||
* @return Whether or not it is OK to export this element
|
* @return Whether or not it is OK to export this element
|
||||||
*/
|
*/
|
||||||
private final boolean okToExport(DCValue md)
|
private final boolean okToExport(Metadatum md)
|
||||||
{
|
{
|
||||||
// Now compare with the list to ignore
|
// Now compare with the list to ignore
|
||||||
String key = md.schema + "." + md.element;
|
String key = md.schema + "." + md.element;
|
||||||
|
@@ -336,7 +336,7 @@ public class MetadataImport
|
|||||||
Item item = wsItem.getItem();
|
Item item = wsItem.getItem();
|
||||||
|
|
||||||
// Add the metadata to the item
|
// Add the metadata to the item
|
||||||
for (DCValue dcv : whatHasChanged.getAdds())
|
for (Metadatum dcv : whatHasChanged.getAdds())
|
||||||
{
|
{
|
||||||
item.addMetadata(dcv.schema,
|
item.addMetadata(dcv.schema,
|
||||||
dcv.element,
|
dcv.element,
|
||||||
@@ -473,11 +473,11 @@ public class MetadataImport
|
|||||||
",looking_for_element=" + element +
|
",looking_for_element=" + element +
|
||||||
",looking_for_qualifier=" + qualifier +
|
",looking_for_qualifier=" + qualifier +
|
||||||
",looking_for_language=" + language));
|
",looking_for_language=" + language));
|
||||||
DCValue[] current = item.getMetadata(schema, element, qualifier, language);
|
Metadatum[] current = item.getMetadata(schema, element, qualifier, language);
|
||||||
|
|
||||||
String[] dcvalues = new String[current.length];
|
String[] dcvalues = new String[current.length];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (DCValue dcv : current)
|
for (Metadatum dcv : current)
|
||||||
{
|
{
|
||||||
if (dcv.authority == null || !isAuthorityControlledField(md))
|
if (dcv.authority == null || !isAuthorityControlledField(md))
|
||||||
{
|
{
|
||||||
@@ -497,7 +497,7 @@ public class MetadataImport
|
|||||||
// Compare from current->csv
|
// Compare from current->csv
|
||||||
for (int v = 0; v < fromCSV.length; v++) {
|
for (int v = 0; v < fromCSV.length; v++) {
|
||||||
String value = fromCSV[v];
|
String value = fromCSV[v];
|
||||||
DCValue dcv = getDcValueFromCSV(language, schema, element, qualifier, value, fromAuthority);
|
Metadatum dcv = getDcValueFromCSV(language, schema, element, qualifier, value, fromAuthority);
|
||||||
if (fromAuthority!=null) {
|
if (fromAuthority!=null) {
|
||||||
value = dcv.value + DSpaceCSV.authoritySeparator + dcv.authority + DSpaceCSV.authoritySeparator + dcv.confidence;
|
value = dcv.value + DSpaceCSV.authoritySeparator + dcv.authority + DSpaceCSV.authoritySeparator + dcv.confidence;
|
||||||
fromCSV[v] = value;
|
fromCSV[v] = value;
|
||||||
@@ -515,7 +515,7 @@ public class MetadataImport
|
|||||||
for (String value : dcvalues)
|
for (String value : dcvalues)
|
||||||
{
|
{
|
||||||
// Look to see if it should be removed
|
// Look to see if it should be removed
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = schema;
|
dcv.schema = schema;
|
||||||
dcv.element = element;
|
dcv.element = element;
|
||||||
dcv.qualifier = qualifier;
|
dcv.qualifier = qualifier;
|
||||||
@@ -548,11 +548,11 @@ public class MetadataImport
|
|||||||
((changes.getAdds().size() > 0) || (changes.getRemoves().size() > 0)))
|
((changes.getAdds().size() > 0) || (changes.getRemoves().size() > 0)))
|
||||||
{
|
{
|
||||||
// Get the complete list of what values should now be in that element
|
// Get the complete list of what values should now be in that element
|
||||||
List<DCValue> list = changes.getComplete();
|
List<Metadatum> list = changes.getComplete();
|
||||||
List<String> values = new ArrayList<String>();
|
List<String> values = new ArrayList<String>();
|
||||||
List<String> authorities = new ArrayList<String>();
|
List<String> authorities = new ArrayList<String>();
|
||||||
List<Integer> confidences = new ArrayList<Integer>();
|
List<Integer> confidences = new ArrayList<Integer>();
|
||||||
for (DCValue value : list)
|
for (Metadatum value : list)
|
||||||
{
|
{
|
||||||
if ((qualifier == null) && (language == null))
|
if ((qualifier == null) && (language == null))
|
||||||
{
|
{
|
||||||
@@ -825,7 +825,7 @@ public class MetadataImport
|
|||||||
// Add all the values
|
// Add all the values
|
||||||
for (String value : fromCSV)
|
for (String value : fromCSV)
|
||||||
{
|
{
|
||||||
DCValue dcv = getDcValueFromCSV(language, schema, element, qualifier, value, fromAuthority);
|
Metadatum dcv = getDcValueFromCSV(language, schema, element, qualifier, value, fromAuthority);
|
||||||
if(fromAuthority!=null){
|
if(fromAuthority!=null){
|
||||||
value = dcv.value + DSpaceCSV.authoritySeparator + dcv.authority + DSpaceCSV.authoritySeparator + dcv.confidence;
|
value = dcv.value + DSpaceCSV.authoritySeparator + dcv.authority + DSpaceCSV.authoritySeparator + dcv.confidence;
|
||||||
}
|
}
|
||||||
@@ -849,9 +849,9 @@ public class MetadataImport
|
|||||||
return fromAuthority;
|
return fromAuthority;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DCValue getDcValueFromCSV(String language, String schema, String element, String qualifier, String value, AuthorityValue fromAuthority) {
|
private Metadatum getDcValueFromCSV(String language, String schema, String element, String qualifier, String value, AuthorityValue fromAuthority) {
|
||||||
// Look to see if it should be removed
|
// Look to see if it should be removed
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = schema;
|
dcv.schema = schema;
|
||||||
dcv.element = element;
|
dcv.element = element;
|
||||||
dcv.qualifier = qualifier;
|
dcv.qualifier = qualifier;
|
||||||
@@ -887,7 +887,7 @@ public class MetadataImport
|
|||||||
return dcv;
|
return dcv;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void simplyCopyValue(String value, DCValue dcv) {
|
private void simplyCopyValue(String value, Metadatum dcv) {
|
||||||
dcv.value = value;
|
dcv.value = value;
|
||||||
dcv.authority = null;
|
dcv.authority = null;
|
||||||
dcv.confidence = Choices.CF_UNSET;
|
dcv.confidence = Choices.CF_UNSET;
|
||||||
@@ -960,8 +960,8 @@ public class MetadataImport
|
|||||||
for (BulkEditChange change : changes)
|
for (BulkEditChange change : changes)
|
||||||
{
|
{
|
||||||
// Get the changes
|
// Get the changes
|
||||||
List<DCValue> adds = change.getAdds();
|
List<Metadatum> adds = change.getAdds();
|
||||||
List<DCValue> removes = change.getRemoves();
|
List<Metadatum> removes = change.getRemoves();
|
||||||
List<Collection> newCollections = change.getNewMappedCollections();
|
List<Collection> newCollections = change.getNewMappedCollections();
|
||||||
List<Collection> oldCollections = change.getOldMappedCollections();
|
List<Collection> oldCollections = change.getOldMappedCollections();
|
||||||
if ((adds.size() > 0) || (removes.size() > 0) ||
|
if ((adds.size() > 0) || (removes.size() > 0) ||
|
||||||
@@ -1099,7 +1099,7 @@ public class MetadataImport
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show additions
|
// Show additions
|
||||||
for (DCValue dcv : adds)
|
for (Metadatum dcv : adds)
|
||||||
{
|
{
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
if (dcv.qualifier != null)
|
if (dcv.qualifier != null)
|
||||||
@@ -1128,7 +1128,7 @@ public class MetadataImport
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show removals
|
// Show removals
|
||||||
for (DCValue dcv : removes)
|
for (Metadatum dcv : removes)
|
||||||
{
|
{
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
if (dcv.qualifier != null)
|
if (dcv.qualifier != null)
|
||||||
|
@@ -45,7 +45,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
@@ -403,8 +403,8 @@ public class ItemExport
|
|||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
Set<String> schemas = new HashSet<String>();
|
Set<String> schemas = new HashSet<String>();
|
||||||
DCValue[] dcValues = i.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] dcValues = i.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue dcValue : dcValues)
|
for (Metadatum dcValue : dcValues)
|
||||||
{
|
{
|
||||||
schemas.add(dcValue.schema);
|
schemas.add(dcValue.schema);
|
||||||
}
|
}
|
||||||
@@ -439,7 +439,7 @@ public class ItemExport
|
|||||||
BufferedOutputStream out = new BufferedOutputStream(
|
BufferedOutputStream out = new BufferedOutputStream(
|
||||||
new FileOutputStream(outFile));
|
new FileOutputStream(outFile));
|
||||||
|
|
||||||
DCValue[] dcorevalues = i.getMetadata(schema, Item.ANY, Item.ANY,
|
Metadatum[] dcorevalues = i.getMetadata(schema, Item.ANY, Item.ANY,
|
||||||
Item.ANY);
|
Item.ANY);
|
||||||
|
|
||||||
// XML preamble
|
// XML preamble
|
||||||
@@ -454,7 +454,7 @@ public class ItemExport
|
|||||||
String dateIssued = null;
|
String dateIssued = null;
|
||||||
String dateAccessioned = null;
|
String dateAccessioned = null;
|
||||||
|
|
||||||
for (DCValue dcv : dcorevalues)
|
for (Metadatum dcv : dcorevalues)
|
||||||
{
|
{
|
||||||
String qualifier = dcv.qualifier;
|
String qualifier = dcv.qualifier;
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.itemupdate;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
@@ -47,11 +47,11 @@ public class AddMetadataAction extends UpdateMetadataAction {
|
|||||||
{
|
{
|
||||||
// match against metadata for this field/value in repository
|
// match against metadata for this field/value in repository
|
||||||
// qualifier must be strictly matched, possibly null
|
// qualifier must be strictly matched, possibly null
|
||||||
DCValue[] ardcv = null;
|
Metadatum[] ardcv = null;
|
||||||
ardcv = item.getMetadata(dtom.schema, dtom.element, dtom.qualifier, Item.ANY);
|
ardcv = item.getMetadata(dtom.schema, dtom.element, dtom.qualifier, Item.ANY);
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (DCValue dcv : ardcv)
|
for (Metadatum dcv : ardcv)
|
||||||
{
|
{
|
||||||
if (dcv.value.equals(dtom.value))
|
if (dcv.value.equals(dtom.value))
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ public class AddMetadataAction extends UpdateMetadataAction {
|
|||||||
//ItemUpdate.pr("Undo metadata: " + dtom);
|
//ItemUpdate.pr("Undo metadata: " + dtom);
|
||||||
|
|
||||||
// add all as a replace record to be preceded by delete
|
// add all as a replace record to be preceded by delete
|
||||||
for (DCValue dcval : ardcv)
|
for (Metadatum dcval : ardcv)
|
||||||
{
|
{
|
||||||
itarch.addUndoMetadataField(DtoMetadata.create(dcval.schema, dcval.element,
|
itarch.addUndoMetadataField(DtoMetadata.create(dcval.schema, dcval.element,
|
||||||
dcval.qualifier, dcval.language, dcval.value));
|
dcval.qualifier, dcval.language, dcval.value));
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.itemupdate;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
@@ -38,10 +38,10 @@ public class DeleteMetadataAction extends UpdateMetadataAction {
|
|||||||
for (String f : targetFields)
|
for (String f : targetFields)
|
||||||
{
|
{
|
||||||
DtoMetadata dummy = DtoMetadata.create(f, Item.ANY, "");
|
DtoMetadata dummy = DtoMetadata.create(f, Item.ANY, "");
|
||||||
DCValue[] ardcv = item.getMetadataByMetadataString(f);
|
Metadatum[] ardcv = item.getMetadataByMetadataString(f);
|
||||||
|
|
||||||
ItemUpdate.pr("Metadata to be deleted: ");
|
ItemUpdate.pr("Metadata to be deleted: ");
|
||||||
for (DCValue dcv : ardcv)
|
for (Metadatum dcv : ardcv)
|
||||||
{
|
{
|
||||||
ItemUpdate.pr(" " + MetadataUtilities.getDCValueString(dcv));
|
ItemUpdate.pr(" " + MetadataUtilities.getDCValueString(dcv));
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ public class DeleteMetadataAction extends UpdateMetadataAction {
|
|||||||
{
|
{
|
||||||
if (!suppressUndo)
|
if (!suppressUndo)
|
||||||
{
|
{
|
||||||
for (DCValue dcv : ardcv)
|
for (Metadatum dcv : ardcv)
|
||||||
{
|
{
|
||||||
itarch.addUndoMetadataField(DtoMetadata.create(dcv.schema, dcv.element,
|
itarch.addUndoMetadataField(DtoMetadata.create(dcv.schema, dcv.element,
|
||||||
dcv.qualifier, dcv.language, dcv.value));
|
dcv.qualifier, dcv.language, dcv.value));
|
||||||
|
@@ -40,7 +40,7 @@ import org.w3c.dom.NodeList;
|
|||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -59,10 +59,10 @@ public class MetadataUtilities {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Working around Item API to delete a value-specific DCValue
|
* Working around Item API to delete a value-specific Metadatum
|
||||||
* For a given element/qualifier/lang:
|
For a given element/qualifier/lang:
|
||||||
* get all DCValues
|
get all DCValues
|
||||||
* clear (i.e. delete) all of these DCValues
|
clear (i.e. delete) all of these DCValues
|
||||||
* add them back, minus the one to actually delete
|
* add them back, minus the one to actually delete
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -74,7 +74,7 @@ public class MetadataUtilities {
|
|||||||
*/
|
*/
|
||||||
public static boolean deleteMetadataByValue(Item item, DtoMetadata dtom, boolean isLanguageStrict)
|
public static boolean deleteMetadataByValue(Item item, DtoMetadata dtom, boolean isLanguageStrict)
|
||||||
{
|
{
|
||||||
DCValue[] ar = null;
|
Metadatum[] ar = null;
|
||||||
|
|
||||||
if (isLanguageStrict)
|
if (isLanguageStrict)
|
||||||
{ // get all for given type
|
{ // get all for given type
|
||||||
@@ -89,7 +89,7 @@ public class MetadataUtilities {
|
|||||||
|
|
||||||
//build new set minus the one to delete
|
//build new set minus the one to delete
|
||||||
List<String> vals = new ArrayList<String>();
|
List<String> vals = new ArrayList<String>();
|
||||||
for (DCValue dcv : ar)
|
for (Metadatum dcv : ar)
|
||||||
{
|
{
|
||||||
if (dcv.value.equals(dtom.value))
|
if (dcv.value.equals(dtom.value))
|
||||||
{
|
{
|
||||||
@@ -130,7 +130,7 @@ public class MetadataUtilities {
|
|||||||
String textToAppend)
|
String textToAppend)
|
||||||
throws IllegalArgumentException
|
throws IllegalArgumentException
|
||||||
{
|
{
|
||||||
DCValue[] ar = null;
|
Metadatum[] ar = null;
|
||||||
|
|
||||||
// get all values for given element/qualifier
|
// get all values for given element/qualifier
|
||||||
if (isLanguageStrict) // get all for given element/qualifier
|
if (isLanguageStrict) // get all for given element/qualifier
|
||||||
@@ -472,12 +472,12 @@ public class MetadataUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get display of DCValue
|
* Get display of Metadatum
|
||||||
*
|
*
|
||||||
* @param dcv
|
* @param dcv
|
||||||
* @return string displaying elements of the DCValue
|
* @return string displaying elements of the Metadatum
|
||||||
*/
|
*/
|
||||||
public static String getDCValueString(DCValue dcv)
|
public static String getDCValueString(Metadatum dcv)
|
||||||
{
|
{
|
||||||
return "schema: " + dcv.schema + "; element: " + dcv.element + "; qualifier: " + dcv.qualifier +
|
return "schema: " + dcv.schema + "; element: " + dcv.element + "; qualifier: " + dcv.qualifier +
|
||||||
"; language: " + dcv.language + "; value: " + dcv.value;
|
"; language: " + dcv.language + "; value: " + dcv.value;
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.requestitem;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.I18nUtil;
|
import org.dspace.core.I18nUtil;
|
||||||
@@ -35,14 +35,14 @@ public class RequestItemMetadataStrategy extends RequestItemSubmitterStrategy {
|
|||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (emailMetadata != null)
|
if (emailMetadata != null)
|
||||||
{
|
{
|
||||||
DCValue[] vals = item.getMetadataByMetadataString(emailMetadata);
|
Metadatum[] vals = item.getMetadataByMetadataString(emailMetadata);
|
||||||
if (vals.length > 0)
|
if (vals.length > 0)
|
||||||
{
|
{
|
||||||
String email = vals[0].value;
|
String email = vals[0].value;
|
||||||
String fullname = null;
|
String fullname = null;
|
||||||
if (fullNameMatadata != null)
|
if (fullNameMatadata != null)
|
||||||
{
|
{
|
||||||
DCValue[] nameVals = item.getMetadataByMetadataString(fullNameMatadata);
|
Metadatum[] nameVals = item.getMetadataByMetadataString(fullNameMatadata);
|
||||||
if (nameVals.length > 0)
|
if (nameVals.length > 0)
|
||||||
{
|
{
|
||||||
fullname = nameVals[0].value;
|
fullname = nameVals[0].value;
|
||||||
|
@@ -16,7 +16,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
import org.dspace.content.DCPersonName;
|
import org.dspace.content.DCPersonName;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ public class SFXFileReader {
|
|||||||
}
|
}
|
||||||
if (finish == 4)
|
if (finish == 4)
|
||||||
{
|
{
|
||||||
DCValue[] dcvalue = item.getMetadata(schema, element, qualifier, Item.ANY);
|
Metadatum[] dcvalue = item.getMetadata(schema, element, qualifier, Item.ANY);
|
||||||
if (dcvalue.length > 0)
|
if (dcvalue.length > 0)
|
||||||
{
|
{
|
||||||
// Issued Date
|
// Issued Date
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.sherpa.submit;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ public class MetadataAuthorityISSNExtractor implements ISSNItemExtractor
|
|||||||
List<String> values = new ArrayList<String>();
|
List<String> values = new ArrayList<String>();
|
||||||
for (String metadata : metadataList)
|
for (String metadata : metadataList)
|
||||||
{
|
{
|
||||||
DCValue[] dcvalues = item.getMetadataByMetadataString(metadata);
|
Metadatum[] dcvalues = item.getMetadataByMetadataString(metadata);
|
||||||
for (DCValue dcvalue : dcvalues)
|
for (Metadatum dcvalue : dcvalues)
|
||||||
{
|
{
|
||||||
values.add(dcvalue.authority);
|
values.add(dcvalue.authority);
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.sherpa.submit;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ public class MetadataValueISSNExtractor implements ISSNItemExtractor
|
|||||||
List<String> values = new ArrayList<String>();
|
List<String> values = new ArrayList<String>();
|
||||||
for (String metadata : metadataList)
|
for (String metadata : metadataList)
|
||||||
{
|
{
|
||||||
DCValue[] dcvalues = item.getMetadataByMetadataString(metadata);
|
Metadatum[] dcvalues = item.getMetadataByMetadataString(metadata);
|
||||||
for (DCValue dcvalue : dcvalues)
|
for (Metadatum dcvalue : dcvalues)
|
||||||
{
|
{
|
||||||
values.add(dcvalue.value);
|
values.add(dcvalue.value);
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ import java.util.StringTokenizer;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -801,8 +801,8 @@ public class ReportGenerator
|
|||||||
// build the referece
|
// build the referece
|
||||||
// FIXME: here we have blurred the line between content and presentation
|
// FIXME: here we have blurred the line between content and presentation
|
||||||
// and it should probably be un-blurred
|
// and it should probably be un-blurred
|
||||||
DCValue[] title = item.getDC("title", null, Item.ANY);
|
Metadatum[] title = item.getDC("title", null, Item.ANY);
|
||||||
DCValue[] author = item.getDC("contributor", "author", Item.ANY);
|
Metadatum[] author = item.getDC("contributor", "author", Item.ANY);
|
||||||
|
|
||||||
StringBuffer authors = new StringBuffer();
|
StringBuffer authors = new StringBuffer();
|
||||||
if (author.length > 0)
|
if (author.length > 0)
|
||||||
|
@@ -268,7 +268,7 @@ public class GoogleMetadata
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue v = resolveMetadataField(config);
|
Metadatum v = resolveMetadataField(config);
|
||||||
|
|
||||||
if (null != v && (null != v.value) && !v.value.trim().equals(""))
|
if (null != v && (null != v.value) && !v.value.trim().equals(""))
|
||||||
{
|
{
|
||||||
@@ -289,10 +289,10 @@ public class GoogleMetadata
|
|||||||
* @param configFilter
|
* @param configFilter
|
||||||
* @return The first configured match of metadata field for the item.
|
* @return The first configured match of metadata field for the item.
|
||||||
*/
|
*/
|
||||||
private DCValue resolveMetadataField(String configFilter)
|
private Metadatum resolveMetadataField(String configFilter)
|
||||||
{
|
{
|
||||||
|
|
||||||
ArrayList<DCValue> fields = resolveMetadata(configFilter, SINGLE);
|
ArrayList<Metadatum> fields = resolveMetadata(configFilter, SINGLE);
|
||||||
if (null != fields && fields.size() > 0)
|
if (null != fields && fields.size() > 0)
|
||||||
{
|
{
|
||||||
return fields.get(0);
|
return fields.get(0);
|
||||||
@@ -308,10 +308,10 @@ public class GoogleMetadata
|
|||||||
* @return Aggregate of all matching metadata fields configured in the first
|
* @return Aggregate of all matching metadata fields configured in the first
|
||||||
* option field-set to return any number of filter matches.
|
* option field-set to return any number of filter matches.
|
||||||
*/
|
*/
|
||||||
private ArrayList<DCValue> resolveMetadataFields(String configFilter)
|
private ArrayList<Metadatum> resolveMetadataFields(String configFilter)
|
||||||
{
|
{
|
||||||
|
|
||||||
ArrayList<DCValue> fields = resolveMetadata(configFilter, MULTI);
|
ArrayList<Metadatum> fields = resolveMetadata(configFilter, MULTI);
|
||||||
if (null != fields && fields.size() > 0)
|
if (null != fields && fields.size() > 0)
|
||||||
{
|
{
|
||||||
return fields;
|
return fields;
|
||||||
@@ -326,7 +326,7 @@ public class GoogleMetadata
|
|||||||
* @param configValue
|
* @param configValue
|
||||||
* @return Array of configuration -> item-field matches
|
* @return Array of configuration -> item-field matches
|
||||||
*/
|
*/
|
||||||
private ArrayList<DCValue> resolveMetadata(String configFilter,
|
private ArrayList<Metadatum> resolveMetadata(String configFilter,
|
||||||
int returnType)
|
int returnType)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -367,8 +367,8 @@ public class GoogleMetadata
|
|||||||
|
|
||||||
int optionMatches = 0;
|
int optionMatches = 0;
|
||||||
String[] components;
|
String[] components;
|
||||||
DCValue[] values;
|
Metadatum[] values;
|
||||||
ArrayList<DCValue> resolvedFields = new ArrayList<DCValue>();
|
ArrayList<Metadatum> resolvedFields = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
for (String field : optionFields)
|
for (String field : optionFields)
|
||||||
{
|
{
|
||||||
@@ -379,7 +379,7 @@ public class GoogleMetadata
|
|||||||
|
|
||||||
if (values.length > 0)
|
if (values.length > 0)
|
||||||
{
|
{
|
||||||
for (DCValue v : values)
|
for (Metadatum v : values)
|
||||||
{
|
{
|
||||||
|
|
||||||
resolvedFields.add(v);
|
resolvedFields.add(v);
|
||||||
@@ -392,7 +392,7 @@ public class GoogleMetadata
|
|||||||
{
|
{
|
||||||
log
|
log
|
||||||
.debug("Resolved Field Value For This Item:");
|
.debug("Resolved Field Value For This Item:");
|
||||||
for (DCValue r : resolvedFields)
|
for (Metadatum r : resolvedFields)
|
||||||
{
|
{
|
||||||
log.debug("{" + r.value + "}");
|
log.debug("{" + r.value + "}");
|
||||||
}
|
}
|
||||||
@@ -411,7 +411,7 @@ public class GoogleMetadata
|
|||||||
if (log.isDebugEnabled())
|
if (log.isDebugEnabled())
|
||||||
{
|
{
|
||||||
log.debug("Resolved Field Values For This Item:");
|
log.debug("Resolved Field Values For This Item:");
|
||||||
for (DCValue v : resolvedFields)
|
for (Metadatum v : resolvedFields)
|
||||||
{
|
{
|
||||||
log.debug("{" + v.value + "}");
|
log.debug("{" + v.value + "}");
|
||||||
}
|
}
|
||||||
@@ -599,11 +599,11 @@ public class GoogleMetadata
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] allMD = item.getMetadata(components[0], components[1],
|
Metadatum[] allMD = item.getMetadata(components[0], components[1],
|
||||||
components[2], Item.ANY);
|
components[2], Item.ANY);
|
||||||
|
|
||||||
ArrayList<String> expandedDC = new ArrayList<String>();
|
ArrayList<String> expandedDC = new ArrayList<String>();
|
||||||
for (DCValue v : allMD)
|
for (Metadatum v : allMD)
|
||||||
{
|
{
|
||||||
|
|
||||||
// De-dup multiple occurrences of field names in item
|
// De-dup multiple occurrences of field names in item
|
||||||
@@ -628,13 +628,13 @@ public class GoogleMetadata
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct metadata field name out of DCValue components
|
* Construct metadata field name out of Metadatum components
|
||||||
*
|
*
|
||||||
* @param v
|
* @param v
|
||||||
* The DCValue to construct a name for.
|
* The Metadatum to construct a name for.
|
||||||
* @return The complete metadata field name.
|
* @return The complete metadata field name.
|
||||||
*/
|
*/
|
||||||
private String buildFieldName(DCValue v)
|
private String buildFieldName(Metadatum v)
|
||||||
{
|
{
|
||||||
|
|
||||||
StringBuilder name = new StringBuilder();
|
StringBuilder name = new StringBuilder();
|
||||||
@@ -1098,7 +1098,7 @@ public class GoogleMetadata
|
|||||||
{
|
{
|
||||||
|
|
||||||
String authorConfig = configuredFields.get(FIELD);
|
String authorConfig = configuredFields.get(FIELD);
|
||||||
ArrayList<DCValue> fields = resolveMetadataFields(authorConfig);
|
ArrayList<Metadatum> fields = resolveMetadataFields(authorConfig);
|
||||||
|
|
||||||
if (null != fields && !fields.isEmpty())
|
if (null != fields && !fields.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -1106,7 +1106,7 @@ public class GoogleMetadata
|
|||||||
StringBuilder fieldMetadata = new StringBuilder();
|
StringBuilder fieldMetadata = new StringBuilder();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (DCValue field : fields)
|
for (Metadatum field : fields)
|
||||||
{
|
{
|
||||||
fieldMetadata.append(field.value);
|
fieldMetadata.append(field.value);
|
||||||
if (count < fields.size() - 1)
|
if (count < fields.size() - 1)
|
||||||
@@ -1234,10 +1234,10 @@ public class GoogleMetadata
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check resolved/present metadata fields against configured values
|
// Check resolved/present metadata fields against configured values
|
||||||
ArrayList<DCValue> presentMD = resolveMetadataFields(sb.toString());
|
ArrayList<Metadatum> presentMD = resolveMetadataFields(sb.toString());
|
||||||
if (null != presentMD && presentMD.size() != 0)
|
if (null != presentMD && presentMD.size() != 0)
|
||||||
{
|
{
|
||||||
for (DCValue v : presentMD)
|
for (Metadatum v : presentMD)
|
||||||
{
|
{
|
||||||
String fieldName = buildFieldName(v);
|
String fieldName = buildFieldName(v);
|
||||||
if (mdPairs.containsKey(fieldName))
|
if (mdPairs.containsKey(fieldName))
|
||||||
|
@@ -23,7 +23,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -265,7 +265,7 @@ public class SyndicationFeed
|
|||||||
df = df.replaceAll("\\(date\\)", "");
|
df = df.replaceAll("\\(date\\)", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dcv[] = item.getMetadataByMetadataString(df);
|
Metadatum dcv[] = item.getMetadataByMetadataString(df);
|
||||||
if (dcv.length > 0)
|
if (dcv.length > 0)
|
||||||
{
|
{
|
||||||
String fieldLabel = labels.get(MSG_METADATA + df);
|
String fieldLabel = labels.get(MSG_METADATA + df);
|
||||||
@@ -274,7 +274,7 @@ public class SyndicationFeed
|
|||||||
db.append(fieldLabel).append(": ");
|
db.append(fieldLabel).append(": ");
|
||||||
}
|
}
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (DCValue v : dcv)
|
for (Metadatum v : dcv)
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
@@ -298,11 +298,11 @@ public class SyndicationFeed
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This gets the authors into an ATOM feed
|
// This gets the authors into an ATOM feed
|
||||||
DCValue authors[] = item.getMetadataByMetadataString(authorField);
|
Metadatum authors[] = item.getMetadataByMetadataString(authorField);
|
||||||
if (authors.length > 0)
|
if (authors.length > 0)
|
||||||
{
|
{
|
||||||
List<SyndPerson> creators = new ArrayList<SyndPerson>();
|
List<SyndPerson> creators = new ArrayList<SyndPerson>();
|
||||||
for (DCValue author : authors)
|
for (Metadatum author : authors)
|
||||||
{
|
{
|
||||||
SyndPerson sp = new SyndPersonImpl();
|
SyndPerson sp = new SyndPersonImpl();
|
||||||
sp.setName(author.value);
|
sp.setName(author.value);
|
||||||
@@ -318,11 +318,11 @@ public class SyndicationFeed
|
|||||||
DCModule dc = new DCModuleImpl();
|
DCModule dc = new DCModuleImpl();
|
||||||
if (dcCreatorField != null)
|
if (dcCreatorField != null)
|
||||||
{
|
{
|
||||||
DCValue dcAuthors[] = item.getMetadataByMetadataString(dcCreatorField);
|
Metadatum dcAuthors[] = item.getMetadataByMetadataString(dcCreatorField);
|
||||||
if (dcAuthors.length > 0)
|
if (dcAuthors.length > 0)
|
||||||
{
|
{
|
||||||
List<String> creators = new ArrayList<String>();
|
List<String> creators = new ArrayList<String>();
|
||||||
for (DCValue author : dcAuthors)
|
for (Metadatum author : dcAuthors)
|
||||||
{
|
{
|
||||||
creators.add(author.value);
|
creators.add(author.value);
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ public class SyndicationFeed
|
|||||||
}
|
}
|
||||||
if (dcDateField != null && !hasDate)
|
if (dcDateField != null && !hasDate)
|
||||||
{
|
{
|
||||||
DCValue v[] = item.getMetadataByMetadataString(dcDateField);
|
Metadatum v[] = item.getMetadataByMetadataString(dcDateField);
|
||||||
if (v.length > 0)
|
if (v.length > 0)
|
||||||
{
|
{
|
||||||
dc.setDate((new DCDate(v[0].value)).toDate());
|
dc.setDate((new DCDate(v[0].value)).toDate());
|
||||||
@@ -339,11 +339,11 @@ public class SyndicationFeed
|
|||||||
}
|
}
|
||||||
if (dcDescriptionField != null)
|
if (dcDescriptionField != null)
|
||||||
{
|
{
|
||||||
DCValue v[] = item.getMetadataByMetadataString(dcDescriptionField);
|
Metadatum v[] = item.getMetadataByMetadataString(dcDescriptionField);
|
||||||
if (v.length > 0)
|
if (v.length > 0)
|
||||||
{
|
{
|
||||||
StringBuffer descs = new StringBuffer();
|
StringBuffer descs = new StringBuffer();
|
||||||
for (DCValue d : v)
|
for (Metadatum d : v)
|
||||||
{
|
{
|
||||||
if (descs.length() > 0)
|
if (descs.length() > 0)
|
||||||
{
|
{
|
||||||
@@ -381,7 +381,7 @@ public class SyndicationFeed
|
|||||||
}
|
}
|
||||||
//Also try to add an external value from dc.identifier.other
|
//Also try to add an external value from dc.identifier.other
|
||||||
// We are assuming that if this is set, then it is a media file
|
// We are assuming that if this is set, then it is a media file
|
||||||
DCValue[] externalMedia = item.getMetadataByMetadataString(externalSourceField);
|
Metadatum[] externalMedia = item.getMetadataByMetadataString(externalSourceField);
|
||||||
if(externalMedia.length > 0)
|
if(externalMedia.length > 0)
|
||||||
{
|
{
|
||||||
for(int i = 0; i< externalMedia.length; i++)
|
for(int i = 0; i< externalMedia.length; i++)
|
||||||
@@ -567,7 +567,7 @@ public class SyndicationFeed
|
|||||||
// spoonful of syntactic sugar when we only need first value
|
// spoonful of syntactic sugar when we only need first value
|
||||||
private String getOneDC(Item item, String field)
|
private String getOneDC(Item item, String field)
|
||||||
{
|
{
|
||||||
DCValue dcv[] = item.getMetadataByMetadataString(field);
|
Metadatum dcv[] = item.getMetadataByMetadataString(field);
|
||||||
return (dcv.length > 0) ? dcv[0].value : null;
|
return (dcv.length > 0) ? dcv[0].value : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
import org.dspace.core.I18nUtil;
|
import org.dspace.core.I18nUtil;
|
||||||
@@ -366,7 +366,7 @@ public class Util {
|
|||||||
* @param item
|
* @param item
|
||||||
* The Dspace Item
|
* The Dspace Item
|
||||||
* @param values
|
* @param values
|
||||||
* A DCValue[] array of the specific "stored-value(s)"
|
* A Metadatum[] array of the specific "stored-value(s)"
|
||||||
* @param schema
|
* @param schema
|
||||||
* A String with the schema name of the metadata field
|
* A String with the schema name of the metadata field
|
||||||
* @param element
|
* @param element
|
||||||
@@ -377,7 +377,7 @@ public class Util {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public static List<String> getControlledVocabulariesDisplayValueLocalized(
|
public static List<String> getControlledVocabulariesDisplayValueLocalized(
|
||||||
Item item, DCValue[] values, String schema, String element,
|
Item item, Metadatum[] values, String schema, String element,
|
||||||
String qualifier, Locale locale) throws SQLException,
|
String qualifier, Locale locale) throws SQLException,
|
||||||
DCInputsReaderException
|
DCInputsReaderException
|
||||||
{
|
{
|
||||||
@@ -404,7 +404,7 @@ public class Util {
|
|||||||
|
|
||||||
DCInputSet inputSet = inputsReader.getInputs(col_handle);
|
DCInputSet inputSet = inputsReader.getInputs(col_handle);
|
||||||
|
|
||||||
// Replace the values of DCValue[] with the correct ones in case of
|
// Replace the values of Metadatum[] with the correct ones in case of
|
||||||
// controlled vocabularies
|
// controlled vocabularies
|
||||||
String currentField = schema + "." + element
|
String currentField = schema + "." + element
|
||||||
+ (qualifier == null ? "" : "." + qualifier);
|
+ (qualifier == null ? "" : "." + qualifier);
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -888,7 +888,7 @@ public class BrowseInfo
|
|||||||
sb.append("{{ NULL METADATA }}");
|
sb.append("{{ NULL METADATA }}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DCValue[] values = bi.getMetadata(md[0], md[1], md[2], Item.ANY);
|
Metadatum[] values = bi.getMetadata(md[0], md[1], md[2], Item.ANY);
|
||||||
StringBuffer value = new StringBuffer();
|
StringBuffer value = new StringBuffer();
|
||||||
if (values != null)
|
if (values != null)
|
||||||
{
|
{
|
||||||
|
@@ -41,7 +41,7 @@ public class BrowseItem extends DSpaceObject
|
|||||||
private static Logger log = Logger.getLogger(BrowseItem.class);
|
private static Logger log = Logger.getLogger(BrowseItem.class);
|
||||||
|
|
||||||
/** a List of all the metadata */
|
/** a List of all the metadata */
|
||||||
private List<DCValue> metadata = new ArrayList<DCValue>();
|
private List<Metadatum> metadata = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
/** database id of the item */
|
/** database id of the item */
|
||||||
private int id = -1;
|
private int id = -1;
|
||||||
@@ -84,7 +84,7 @@ public class BrowseItem extends DSpaceObject
|
|||||||
* @return array of matching values
|
* @return array of matching values
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
public DCValue[] getMetadata(String schema, String element, String qualifier, String lang) {
|
public Metadatum[] getMetadata(String schema, String element, String qualifier, String lang) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BrowseItemDAO dao = BrowseDAOFactory.getItemInstance(ourContext);
|
BrowseItemDAO dao = BrowseDAOFactory.getItemInstance(ourContext);
|
||||||
@@ -102,12 +102,12 @@ public class BrowseItem extends DSpaceObject
|
|||||||
|
|
||||||
if (!metadata.isEmpty())
|
if (!metadata.isEmpty())
|
||||||
{
|
{
|
||||||
List<DCValue> values = new ArrayList<DCValue>();
|
List<Metadatum> values = new ArrayList<Metadatum>();
|
||||||
Iterator<DCValue> i = metadata.iterator();
|
Iterator<Metadatum> i = metadata.iterator();
|
||||||
|
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
DCValue dcv = i.next();
|
Metadatum dcv = i.next();
|
||||||
|
|
||||||
if (match(schema, element, qualifier, lang, dcv))
|
if (match(schema, element, qualifier, lang, dcv))
|
||||||
{
|
{
|
||||||
@@ -117,7 +117,7 @@ public class BrowseItem extends DSpaceObject
|
|||||||
|
|
||||||
if (values.isEmpty())
|
if (values.isEmpty())
|
||||||
{
|
{
|
||||||
DCValue[] dcvs = new DCValue[0];
|
Metadatum[] dcvs = new Metadatum[0];
|
||||||
try {
|
try {
|
||||||
dcvs = dao.queryMetadata(id, schema, element, qualifier, lang);
|
dcvs = dao.queryMetadata(id, schema, element, qualifier, lang);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@@ -131,14 +131,14 @@ public class BrowseItem extends DSpaceObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// else, Create an array of matching values
|
// else, Create an array of matching values
|
||||||
DCValue[] valueArray = new DCValue[values.size()];
|
Metadatum[] valueArray = new Metadatum[values.size()];
|
||||||
valueArray = (DCValue[]) values.toArray(valueArray);
|
valueArray = (Metadatum[]) values.toArray(valueArray);
|
||||||
|
|
||||||
return valueArray;
|
return valueArray;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DCValue[] dcvs = new DCValue[0];
|
Metadatum[] dcvs = new Metadatum[0];
|
||||||
try {
|
try {
|
||||||
dcvs = dao.queryMetadata(id, schema, element, qualifier, lang);
|
dcvs = dao.queryMetadata(id, schema, element, qualifier, lang);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@@ -209,7 +209,7 @@ public class BrowseItem extends DSpaceObject
|
|||||||
* Utility method for pattern-matching metadata elements. This
|
* Utility method for pattern-matching metadata elements. This
|
||||||
* method will return <code>true</code> if the given schema,
|
* method will return <code>true</code> if the given schema,
|
||||||
* element, qualifier and language match the schema, element,
|
* element, qualifier and language match the schema, element,
|
||||||
* qualifier and language of the <code>DCValue</code> object passed
|
* qualifier and language of the <code>Metadatum</code> object passed
|
||||||
* in. Any or all of the element, qualifier and language passed
|
* in. Any or all of the element, qualifier and language passed
|
||||||
* in can be the <code>Item.ANY</code> wildcard.
|
* in can be the <code>Item.ANY</code> wildcard.
|
||||||
*
|
*
|
||||||
@@ -227,7 +227,7 @@ public class BrowseItem extends DSpaceObject
|
|||||||
* @return <code>true</code> if there is a match
|
* @return <code>true</code> if there is a match
|
||||||
*/
|
*/
|
||||||
private boolean match(String schema, String element, String qualifier,
|
private boolean match(String schema, String element, String qualifier,
|
||||||
String language, DCValue dcv)
|
String language, Metadatum dcv)
|
||||||
{
|
{
|
||||||
// We will attempt to disprove a match - if we can't we have a match
|
// We will attempt to disprove a match - if we can't we have a match
|
||||||
if (!element.equals(Item.ANY) && !element.equals(dcv.element))
|
if (!element.equals(Item.ANY) && !element.equals(dcv.element))
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.browse;
|
package org.dspace.browse;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
@@ -40,6 +40,6 @@ public interface BrowseItemDAO
|
|||||||
* @return matching metadata values.
|
* @return matching metadata values.
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
public DCValue[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
public Metadatum[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
||||||
throws SQLException;
|
throws SQLException;
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ import org.dspace.storage.rdbms.TableRowIterator;
|
|||||||
import org.dspace.storage.rdbms.DatabaseManager;
|
import org.dspace.storage.rdbms.DatabaseManager;
|
||||||
import org.dspace.storage.rdbms.TableRow;
|
import org.dspace.storage.rdbms.TableRow;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -95,10 +95,10 @@ public class BrowseItemDAOOracle implements BrowseItemDAO
|
|||||||
return items.toArray(bis);
|
return items.toArray(bis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DCValue[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
public Metadatum[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
List<DCValue> values = new ArrayList<DCValue>();
|
List<Metadatum> values = new ArrayList<Metadatum>();
|
||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -121,13 +121,13 @@ public class BrowseItemDAOOracle implements BrowseItemDAO
|
|||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
{
|
{
|
||||||
return new DCValue[0];
|
return new Metadatum[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
while (tri.hasNext())
|
while (tri.hasNext())
|
||||||
{
|
{
|
||||||
TableRow tr = tri.next();
|
TableRow tr = tri.next();
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = schema;
|
dcv.schema = schema;
|
||||||
dcv.element = tr.getStringColumn("element");
|
dcv.element = tr.getStringColumn("element");
|
||||||
dcv.qualifier = tr.getStringColumn("qualifier");
|
dcv.qualifier = tr.getStringColumn("qualifier");
|
||||||
@@ -146,7 +146,7 @@ public class BrowseItemDAOOracle implements BrowseItemDAO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] dcvs = new DCValue[values.size()];
|
Metadatum[] dcvs = new Metadatum[values.size()];
|
||||||
return values.toArray(dcvs);
|
return values.toArray(dcvs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ import org.dspace.storage.rdbms.TableRowIterator;
|
|||||||
import org.dspace.storage.rdbms.DatabaseManager;
|
import org.dspace.storage.rdbms.DatabaseManager;
|
||||||
import org.dspace.storage.rdbms.TableRow;
|
import org.dspace.storage.rdbms.TableRow;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -94,10 +94,10 @@ public class BrowseItemDAOPostgres implements BrowseItemDAO
|
|||||||
return items.toArray(bis);
|
return items.toArray(bis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DCValue[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
public Metadatum[] queryMetadata(int itemId, String schema, String element, String qualifier, String lang)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
List<DCValue> values = new ArrayList<DCValue>();
|
List<Metadatum> values = new ArrayList<Metadatum>();
|
||||||
TableRowIterator tri = null;
|
TableRowIterator tri = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -120,13 +120,13 @@ public class BrowseItemDAOPostgres implements BrowseItemDAO
|
|||||||
|
|
||||||
if (!tri.hasNext())
|
if (!tri.hasNext())
|
||||||
{
|
{
|
||||||
return new DCValue[0];
|
return new Metadatum[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
while (tri.hasNext())
|
while (tri.hasNext())
|
||||||
{
|
{
|
||||||
TableRow tr = tri.next();
|
TableRow tr = tri.next();
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = schema;
|
dcv.schema = schema;
|
||||||
dcv.element = tr.getStringColumn("element");
|
dcv.element = tr.getStringColumn("element");
|
||||||
dcv.qualifier = tr.getStringColumn("qualifier");
|
dcv.qualifier = tr.getStringColumn("qualifier");
|
||||||
@@ -145,7 +145,7 @@ public class BrowseItemDAOPostgres implements BrowseItemDAO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] dcvs = new DCValue[values.size()];
|
Metadatum[] dcvs = new Metadatum[values.size()];
|
||||||
return values.toArray(dcvs);
|
return values.toArray(dcvs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@ import org.apache.commons.cli.ParseException;
|
|||||||
import org.apache.commons.cli.PosixParser;
|
import org.apache.commons.cli.PosixParser;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.authority.ChoiceAuthorityManager;
|
import org.dspace.content.authority.ChoiceAuthorityManager;
|
||||||
import org.dspace.content.authority.MetadataAuthorityManager;
|
import org.dspace.content.authority.MetadataAuthorityManager;
|
||||||
@@ -409,7 +409,7 @@ public class IndexBrowse
|
|||||||
for (int mdIdx = 0; mdIdx < bis[i].getMetadataCount(); mdIdx++)
|
for (int mdIdx = 0; mdIdx < bis[i].getMetadataCount(); mdIdx++)
|
||||||
{
|
{
|
||||||
String[] md = bis[i].getMdBits(mdIdx);
|
String[] md = bis[i].getMdBits(mdIdx);
|
||||||
DCValue[] values = item.getMetadata(md[0], md[1], md[2], Item.ANY);
|
Metadatum[] values = item.getMetadata(md[0], md[1], md[2], Item.ANY);
|
||||||
|
|
||||||
// if we have values to index on, then do so
|
// if we have values to index on, then do so
|
||||||
if (values != null && values.length > 0)
|
if (values != null && values.length > 0)
|
||||||
@@ -417,7 +417,7 @@ public class IndexBrowse
|
|||||||
int minConfidence = MetadataAuthorityManager.getManager()
|
int minConfidence = MetadataAuthorityManager.getManager()
|
||||||
.getMinConfidence(values[0].schema, values[0].element, values[0].qualifier);
|
.getMinConfidence(values[0].schema, values[0].element, values[0].qualifier);
|
||||||
|
|
||||||
for (DCValue value : values)
|
for (Metadatum value : values)
|
||||||
{
|
{
|
||||||
// Ensure that there is a value to index before inserting it
|
// Ensure that there is a value to index before inserting it
|
||||||
if (StringUtils.isEmpty(value.value))
|
if (StringUtils.isEmpty(value.value))
|
||||||
@@ -537,18 +537,18 @@ public class IndexBrowse
|
|||||||
|
|
||||||
// If we've already used the metadata for this Item
|
// If we've already used the metadata for this Item
|
||||||
// it will be cached in the map
|
// it will be cached in the map
|
||||||
DCValue value = null;
|
Metadatum value = null;
|
||||||
|
|
||||||
if (itemMDMap != null)
|
if (itemMDMap != null)
|
||||||
{
|
{
|
||||||
value = (DCValue) itemMDMap.get(metadata);
|
value = (Metadatum) itemMDMap.get(metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We haven't used this metadata before, so grab it from the item
|
// We haven't used this metadata before, so grab it from the item
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
String[] somd = so.getMdBits();
|
String[] somd = so.getMdBits();
|
||||||
DCValue[] dcv = item.getMetadata(somd[0], somd[1], somd[2], Item.ANY);
|
Metadatum[] dcv = item.getMetadata(somd[0], somd[1], somd[2], Item.ANY);
|
||||||
|
|
||||||
if (dcv == null)
|
if (dcv == null)
|
||||||
{
|
{
|
||||||
@@ -1218,7 +1218,7 @@ public class IndexBrowse
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DCValue[] getMetadata(String schema, String element, String qualifier, String lang)
|
public Metadatum[] getMetadata(String schema, String element, String qualifier, String lang)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
if (item != null)
|
if (item != null)
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.Set;
|
|||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.authority.ChoiceAuthorityManager;
|
import org.dspace.content.authority.ChoiceAuthorityManager;
|
||||||
@@ -128,7 +128,7 @@ public class SolrBrowseCreateDAO implements BrowseCreateDAO,
|
|||||||
for (int mdIdx = 0; mdIdx < bi.getMetadataCount(); mdIdx++)
|
for (int mdIdx = 0; mdIdx < bi.getMetadataCount(); mdIdx++)
|
||||||
{
|
{
|
||||||
String[] md = bi.getMdBits(mdIdx);
|
String[] md = bi.getMdBits(mdIdx);
|
||||||
DCValue[] values = item.getMetadata(md[0], md[1],
|
Metadatum[] values = item.getMetadata(md[0], md[1],
|
||||||
md[2], Item.ANY);
|
md[2], Item.ANY);
|
||||||
|
|
||||||
// if we have values to index on, then do so
|
// if we have values to index on, then do so
|
||||||
@@ -330,7 +330,7 @@ public class SolrBrowseCreateDAO implements BrowseCreateDAO,
|
|||||||
{
|
{
|
||||||
for (SortOption so : SortOption.getSortOptions())
|
for (SortOption so : SortOption.getSortOptions())
|
||||||
{
|
{
|
||||||
DCValue[] dcvalue = item.getMetadataByMetadataString(so.getMetadata());
|
Metadatum[] dcvalue = item.getMetadataByMetadataString(so.getMetadata());
|
||||||
if (dcvalue != null && dcvalue.length > 0)
|
if (dcvalue != null && dcvalue.length > 0)
|
||||||
{
|
{
|
||||||
String nValue = OrderFormat
|
String nValue = OrderFormat
|
||||||
|
@@ -94,7 +94,7 @@ public abstract class DSpaceObject
|
|||||||
// Work out the place numbers for the in memory DC
|
// Work out the place numbers for the in memory DC
|
||||||
for (int dcIdx = 0; dcIdx < getMetadata().size(); dcIdx++)
|
for (int dcIdx = 0; dcIdx < getMetadata().size(); dcIdx++)
|
||||||
{
|
{
|
||||||
DCValue dcv = getMetadata().get(dcIdx);
|
Metadatum dcv = getMetadata().get(dcIdx);
|
||||||
|
|
||||||
// Work out the place number for ordering
|
// Work out the place number for ordering
|
||||||
int current = 0;
|
int current = 0;
|
||||||
@@ -143,7 +143,7 @@ public abstract class DSpaceObject
|
|||||||
if (!storedDC[dcIdx])
|
if (!storedDC[dcIdx])
|
||||||
{
|
{
|
||||||
boolean matched = true;
|
boolean matched = true;
|
||||||
DCValue dcv = getMetadata().get(dcIdx);
|
Metadatum dcv = getMetadata().get(dcIdx);
|
||||||
|
|
||||||
// Check the metadata field is the same
|
// Check the metadata field is the same
|
||||||
if (matched && dcFields[dcIdx].getFieldID() != tr.getIntColumn("metadata_field_id"))
|
if (matched && dcFields[dcIdx].getFieldID() != tr.getIntColumn("metadata_field_id"))
|
||||||
@@ -241,9 +241,9 @@ public abstract class DSpaceObject
|
|||||||
// Only write values that are not already in the db
|
// Only write values that are not already in the db
|
||||||
if (!storedDC[dcIdx])
|
if (!storedDC[dcIdx])
|
||||||
{
|
{
|
||||||
DCValue dcv = getMetadata().get(dcIdx);
|
Metadatum dcv = getMetadata().get(dcIdx);
|
||||||
|
|
||||||
// Write DCValue
|
// Write Metadatum
|
||||||
MetadataValue metadata = new MetadataValue();
|
MetadataValue metadata = new MetadataValue();
|
||||||
metadata.setResourceId(getID());
|
metadata.setResourceId(getID());
|
||||||
metadata.setResourceTypeId(getType());
|
metadata.setResourceTypeId(getType());
|
||||||
@@ -526,7 +526,7 @@ public abstract class DSpaceObject
|
|||||||
* @return Dublin Core fields that match the parameters
|
* @return Dublin Core fields that match the parameters
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public DCValue[] getDC(String element, String qualifier, String lang)
|
public Metadatum[] getDC(String element, String qualifier, String lang)
|
||||||
{
|
{
|
||||||
return getMetadata(MetadataSchema.DC_SCHEMA, element, qualifier, lang);
|
return getMetadata(MetadataSchema.DC_SCHEMA, element, qualifier, lang);
|
||||||
}
|
}
|
||||||
@@ -577,17 +577,17 @@ public abstract class DSpaceObject
|
|||||||
* no country code are returned.
|
* no country code are returned.
|
||||||
* @return metadata fields that match the parameters
|
* @return metadata fields that match the parameters
|
||||||
*/
|
*/
|
||||||
public DCValue[] getMetadata(String schema, String element, String qualifier,
|
public Metadatum[] getMetadata(String schema, String element, String qualifier,
|
||||||
String lang)
|
String lang)
|
||||||
{
|
{
|
||||||
// Build up list of matching values
|
// Build up list of matching values
|
||||||
List<DCValue> values = new ArrayList<DCValue>();
|
List<Metadatum> values = new ArrayList<Metadatum>();
|
||||||
for (DCValue dcv : getMetadata())
|
for (Metadatum dcv : getMetadata())
|
||||||
{
|
{
|
||||||
if (match(schema, element, qualifier, lang, dcv))
|
if (match(schema, element, qualifier, lang, dcv))
|
||||||
{
|
{
|
||||||
// We will return a copy of the object in case it is altered
|
// We will return a copy of the object in case it is altered
|
||||||
DCValue copy = new DCValue();
|
Metadatum copy = new Metadatum();
|
||||||
copy.element = dcv.element;
|
copy.element = dcv.element;
|
||||||
copy.qualifier = dcv.qualifier;
|
copy.qualifier = dcv.qualifier;
|
||||||
copy.value = dcv.value;
|
copy.value = dcv.value;
|
||||||
@@ -600,8 +600,8 @@ public abstract class DSpaceObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create an array of matching values
|
// Create an array of matching values
|
||||||
DCValue[] valueArray = new DCValue[values.size()];
|
Metadatum[] valueArray = new Metadatum[values.size()];
|
||||||
valueArray = (DCValue[]) values.toArray(valueArray);
|
valueArray = (Metadatum[]) values.toArray(valueArray);
|
||||||
|
|
||||||
return valueArray;
|
return valueArray;
|
||||||
}
|
}
|
||||||
@@ -614,7 +614,7 @@ public abstract class DSpaceObject
|
|||||||
* The metadata string of the form
|
* The metadata string of the form
|
||||||
* <schema prefix>.<element>[.<qualifier>|.*]
|
* <schema prefix>.<element>[.<qualifier>|.*]
|
||||||
*/
|
*/
|
||||||
public DCValue[] getMetadataByMetadataString(String mdString)
|
public Metadatum[] getMetadataByMetadataString(String mdString)
|
||||||
{
|
{
|
||||||
StringTokenizer dcf = new StringTokenizer(mdString, ".");
|
StringTokenizer dcf = new StringTokenizer(mdString, ".");
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ public abstract class DSpaceObject
|
|||||||
String element = tokens[1];
|
String element = tokens[1];
|
||||||
String qualifier = tokens[2];
|
String qualifier = tokens[2];
|
||||||
|
|
||||||
DCValue[] values;
|
Metadatum[] values;
|
||||||
if ("*".equals(qualifier))
|
if ("*".equals(qualifier))
|
||||||
{
|
{
|
||||||
values = getMetadata(schema, element, Item.ANY, Item.ANY);
|
values = getMetadata(schema, element, Item.ANY, Item.ANY);
|
||||||
@@ -650,7 +650,7 @@ public abstract class DSpaceObject
|
|||||||
* Retrieve first metadata field value
|
* Retrieve first metadata field value
|
||||||
*/
|
*/
|
||||||
protected String getMetadataFirstValue(String schema, String element, String qualifier, String language){
|
protected String getMetadataFirstValue(String schema, String element, String qualifier, String language){
|
||||||
DCValue[] dcvalues = getMetadata(schema, element, qualifier, Item.ANY);
|
Metadatum[] dcvalues = getMetadata(schema, element, qualifier, Item.ANY);
|
||||||
if(dcvalues.length>0){
|
if(dcvalues.length>0){
|
||||||
return dcvalues[0].value;
|
return dcvalues[0].value;
|
||||||
}
|
}
|
||||||
@@ -669,7 +669,7 @@ public abstract class DSpaceObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<DCValue> getMetadata()
|
protected List<Metadatum> getMetadata()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -680,7 +680,7 @@ public abstract class DSpaceObject
|
|||||||
log.error("Loading item - cannot load metadata");
|
log.error("Loading item - cannot load metadata");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayList<DCValue>();
|
return new ArrayList<Metadatum>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -695,7 +695,7 @@ public abstract class DSpaceObject
|
|||||||
* if the requested metadata field doesn't exist
|
* if the requested metadata field doesn't exist
|
||||||
*/
|
*/
|
||||||
public String getMetadata(String value){
|
public String getMetadata(String value){
|
||||||
DCValue[] dcvalues = getMetadataByMetadataString(value);
|
Metadatum[] dcvalues = getMetadataByMetadataString(value);
|
||||||
|
|
||||||
if(dcvalues.length>0) {
|
if(dcvalues.length>0) {
|
||||||
return dcvalues[0].value;
|
return dcvalues[0].value;
|
||||||
@@ -906,7 +906,7 @@ public abstract class DSpaceObject
|
|||||||
public void addMetadata(String schema, String element, String qualifier, String lang,
|
public void addMetadata(String schema, String element, String qualifier, String lang,
|
||||||
String[] values, String authorities[], int confidences[])
|
String[] values, String authorities[], int confidences[])
|
||||||
{
|
{
|
||||||
List<DCValue> dublinCore = getMetadata();
|
List<Metadatum> dublinCore = getMetadata();
|
||||||
MetadataAuthorityManager mam = MetadataAuthorityManager.getManager();
|
MetadataAuthorityManager mam = MetadataAuthorityManager.getManager();
|
||||||
boolean authorityControlled = mam.isAuthorityControlled(schema, element, qualifier);
|
boolean authorityControlled = mam.isAuthorityControlled(schema, element, qualifier);
|
||||||
boolean authorityRequired = mam.isAuthorityRequired(schema, element, qualifier);
|
boolean authorityRequired = mam.isAuthorityRequired(schema, element, qualifier);
|
||||||
@@ -916,7 +916,7 @@ public abstract class DSpaceObject
|
|||||||
// until update() is called.
|
// until update() is called.
|
||||||
for (int i = 0; i < values.length; i++)
|
for (int i = 0; i < values.length; i++)
|
||||||
{
|
{
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = schema;
|
dcv.schema = schema;
|
||||||
dcv.element = element;
|
dcv.element = element;
|
||||||
dcv.qualifier = qualifier;
|
dcv.qualifier = qualifier;
|
||||||
@@ -1097,8 +1097,8 @@ public abstract class DSpaceObject
|
|||||||
String lang)
|
String lang)
|
||||||
{
|
{
|
||||||
// We will build a list of values NOT matching the values to clear
|
// We will build a list of values NOT matching the values to clear
|
||||||
List<DCValue> values = new ArrayList<DCValue>();
|
List<Metadatum> values = new ArrayList<Metadatum>();
|
||||||
for (DCValue dcv : getMetadata())
|
for (Metadatum dcv : getMetadata())
|
||||||
{
|
{
|
||||||
if (!match(schema, element, qualifier, lang, dcv))
|
if (!match(schema, element, qualifier, lang, dcv))
|
||||||
{
|
{
|
||||||
@@ -1115,7 +1115,7 @@ public abstract class DSpaceObject
|
|||||||
* Utility method for pattern-matching metadata elements. This
|
* Utility method for pattern-matching metadata elements. This
|
||||||
* method will return <code>true</code> if the given schema,
|
* method will return <code>true</code> if the given schema,
|
||||||
* element, qualifier and language match the schema, element,
|
* element, qualifier and language match the schema, element,
|
||||||
* qualifier and language of the <code>DCValue</code> object passed
|
* qualifier and language of the <code>Metadatum</code> object passed
|
||||||
* in. Any or all of the element, qualifier and language passed
|
* in. Any or all of the element, qualifier and language passed
|
||||||
* in can be the <code>Item.ANY</code> wildcard.
|
* in can be the <code>Item.ANY</code> wildcard.
|
||||||
*
|
*
|
||||||
@@ -1133,7 +1133,7 @@ public abstract class DSpaceObject
|
|||||||
* @return <code>true</code> if there is a match
|
* @return <code>true</code> if there is a match
|
||||||
*/
|
*/
|
||||||
private boolean match(String schema, String element, String qualifier,
|
private boolean match(String schema, String element, String qualifier,
|
||||||
String language, DCValue dcv)
|
String language, Metadatum dcv)
|
||||||
{
|
{
|
||||||
// We will attempt to disprove a match - if we can't we have a match
|
// We will attempt to disprove a match - if we can't we have a match
|
||||||
if (!element.equals(Item.ANY) && !element.equals(dcv.element))
|
if (!element.equals(Item.ANY) && !element.equals(dcv.element))
|
||||||
@@ -1192,7 +1192,7 @@ public abstract class DSpaceObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected transient MetadataField[] allMetadataFields = null;
|
protected transient MetadataField[] allMetadataFields = null;
|
||||||
protected MetadataField getMetadataField(DCValue dcv) throws SQLException, AuthorizeException
|
protected MetadataField getMetadataField(Metadatum dcv) throws SQLException, AuthorizeException
|
||||||
{
|
{
|
||||||
if (allMetadataFields == null)
|
if (allMetadataFields == null)
|
||||||
{
|
{
|
||||||
@@ -1216,7 +1216,7 @@ public abstract class DSpaceObject
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMetadataSchemaID(DCValue dcv) throws SQLException
|
private int getMetadataSchemaID(Metadatum dcv) throws SQLException
|
||||||
{
|
{
|
||||||
int schemaID;
|
int schemaID;
|
||||||
MetadataSchema schema = MetadataSchema.find(ourContext,dcv.schema);
|
MetadataSchema schema = MetadataSchema.find(ourContext,dcv.schema);
|
||||||
@@ -1245,7 +1245,7 @@ public abstract class DSpaceObject
|
|||||||
getType());
|
getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMetadata(List<DCValue> metadata)
|
private void setMetadata(List<Metadatum> metadata)
|
||||||
{
|
{
|
||||||
metadataCache.set(metadata);
|
metadataCache.set(metadata);
|
||||||
modifiedMetadata = true;
|
modifiedMetadata = true;
|
||||||
@@ -1253,13 +1253,13 @@ public abstract class DSpaceObject
|
|||||||
|
|
||||||
class MetadataCache
|
class MetadataCache
|
||||||
{
|
{
|
||||||
List<DCValue> metadata = null;
|
List<Metadatum> metadata = null;
|
||||||
|
|
||||||
List<DCValue> get(Context c, int resourceId, int resourceTypeId, Logger log) throws SQLException
|
List<Metadatum> get(Context c, int resourceId, int resourceTypeId, Logger log) throws SQLException
|
||||||
{
|
{
|
||||||
if (metadata == null)
|
if (metadata == null)
|
||||||
{
|
{
|
||||||
metadata = new ArrayList<DCValue>();
|
metadata = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
// Get Dublin Core metadata
|
// Get Dublin Core metadata
|
||||||
TableRowIterator tri = retrieveMetadata(resourceId, resourceTypeId);
|
TableRowIterator tri = retrieveMetadata(resourceId, resourceTypeId);
|
||||||
@@ -1289,8 +1289,8 @@ public abstract class DSpaceObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Make a DCValue object
|
// Make a Metadatum object
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.element = field.getElement();
|
dcv.element = field.getElement();
|
||||||
dcv.qualifier = field.getQualifier();
|
dcv.qualifier = field.getQualifier();
|
||||||
dcv.value = resultRow.getStringColumn("text_value");
|
dcv.value = resultRow.getStringColumn("text_value");
|
||||||
@@ -1320,7 +1320,7 @@ public abstract class DSpaceObject
|
|||||||
return metadata;
|
return metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(List<DCValue> m)
|
void set(List<Metadatum> m)
|
||||||
{
|
{
|
||||||
metadata = m;
|
metadata = m;
|
||||||
}
|
}
|
||||||
|
@@ -117,7 +117,7 @@ public class InstallItem
|
|||||||
DCDate now = DCDate.getCurrent();
|
DCDate now = DCDate.getCurrent();
|
||||||
|
|
||||||
// If the item doesn't have a date.accessioned, set it to today
|
// If the item doesn't have a date.accessioned, set it to today
|
||||||
DCValue[] dateAccessioned = item.getDC("date", "accessioned", Item.ANY);
|
Metadatum[] dateAccessioned = item.getDC("date", "accessioned", Item.ANY);
|
||||||
if (dateAccessioned.length == 0)
|
if (dateAccessioned.length == 0)
|
||||||
{
|
{
|
||||||
item.addDC("date", "accessioned", null, now.toString());
|
item.addDC("date", "accessioned", null, now.toString());
|
||||||
@@ -127,9 +127,9 @@ public class InstallItem
|
|||||||
// In the below loop, we temporarily clear all issued dates and re-add, one-by-one,
|
// In the below loop, we temporarily clear all issued dates and re-add, one-by-one,
|
||||||
// replacing "today" with today's date.
|
// replacing "today" with today's date.
|
||||||
// NOTE: As of DSpace 4.0, DSpace no longer sets an issue date by default
|
// NOTE: As of DSpace 4.0, DSpace no longer sets an issue date by default
|
||||||
DCValue[] currentDateIssued = item.getDC("date", "issued", Item.ANY);
|
Metadatum[] currentDateIssued = item.getDC("date", "issued", Item.ANY);
|
||||||
item.clearDC("date", "issued", Item.ANY);
|
item.clearDC("date", "issued", Item.ANY);
|
||||||
for (DCValue dcv : currentDateIssued)
|
for (Metadatum dcv : currentDateIssued)
|
||||||
{
|
{
|
||||||
if(dcv.value!=null && dcv.value.equalsIgnoreCase("today"))
|
if(dcv.value!=null && dcv.value.equalsIgnoreCase("today"))
|
||||||
{
|
{
|
||||||
@@ -170,9 +170,9 @@ public class InstallItem
|
|||||||
// In the below loop, we temporarily clear all issued dates and re-add, one-by-one,
|
// In the below loop, we temporarily clear all issued dates and re-add, one-by-one,
|
||||||
// replacing "today" with today's date.
|
// replacing "today" with today's date.
|
||||||
// NOTE: As of DSpace 4.0, DSpace no longer sets an issue date by default
|
// NOTE: As of DSpace 4.0, DSpace no longer sets an issue date by default
|
||||||
DCValue[] currentDateIssued = item.getDC("date", "issued", Item.ANY);
|
Metadatum[] currentDateIssued = item.getDC("date", "issued", Item.ANY);
|
||||||
item.clearDC("date", "issued", Item.ANY);
|
item.clearDC("date", "issued", Item.ANY);
|
||||||
for (DCValue dcv : currentDateIssued)
|
for (Metadatum dcv : currentDateIssued)
|
||||||
{
|
{
|
||||||
if(dcv.value!=null && dcv.value.equalsIgnoreCase("today"))
|
if(dcv.value!=null && dcv.value.equalsIgnoreCase("today"))
|
||||||
{
|
{
|
||||||
|
@@ -21,9 +21,9 @@ import org.dspace.sort.OrderFormat;
|
|||||||
* Compare two Items by their DCValues.
|
* Compare two Items by their DCValues.
|
||||||
*
|
*
|
||||||
* The DCValues to be compared are specified by the element, qualifier and
|
* The DCValues to be compared are specified by the element, qualifier and
|
||||||
* language parameters to the constructor. If the Item has more than one
|
language parameters to the constructor. If the Item has more than one
|
||||||
* matching DCValue, then the max parameter to the constructor specifies whether
|
matching Metadatum, then the max parameter to the constructor specifies whether
|
||||||
* the maximum or minimum lexicographic value will be used.
|
the maximum or minimum lexicographic value will be used.
|
||||||
*
|
*
|
||||||
* @author Peter Breton
|
* @author Peter Breton
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
@@ -52,9 +52,9 @@ public class ItemComparator implements Comparator, Serializable
|
|||||||
* @param language
|
* @param language
|
||||||
* The language for the DCValues
|
* The language for the DCValues
|
||||||
* @param max
|
* @param max
|
||||||
* If true, and there is more than one DCValue for element,
|
* If true, and there is more than one Metadatum for element,
|
||||||
* qualifier and language, then use the maximum value
|
qualifier and language, then use the maximum value
|
||||||
* lexicographically; otherwise use the minimum value.
|
lexicographically; otherwise use the minimum value.
|
||||||
*/
|
*/
|
||||||
public ItemComparator(String element, String qualifier, String language,
|
public ItemComparator(String element, String qualifier, String language,
|
||||||
boolean max)
|
boolean max)
|
||||||
@@ -176,7 +176,7 @@ public class ItemComparator implements Comparator, Serializable
|
|||||||
private String getValue(Item item)
|
private String getValue(Item item)
|
||||||
{
|
{
|
||||||
// The overall array and each element are guaranteed non-null
|
// The overall array and each element are guaranteed non-null
|
||||||
DCValue[] dcvalues = item.getDC(element, qualifier, language);
|
Metadatum[] dcvalues = item.getDC(element, qualifier, language);
|
||||||
|
|
||||||
if (dcvalues.length == 0)
|
if (dcvalues.length == 0)
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ public class ItemComparator implements Comparator, Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We want to sort using Strings, but also keep track of
|
// We want to sort using Strings, but also keep track of
|
||||||
// which DCValue the value came from.
|
// which Metadatum the value came from.
|
||||||
Map<String, Integer> values = new HashMap<String, Integer>();
|
Map<String, Integer> values = new HashMap<String, Integer>();
|
||||||
|
|
||||||
for (int i = 0; i < dcvalues.length; i++)
|
for (int i = 0; i < dcvalues.length; i++)
|
||||||
@@ -217,9 +217,9 @@ public class ItemComparator implements Comparator, Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalize the title of a DCValue.
|
* Normalize the title of a Metadatum.
|
||||||
*/
|
*/
|
||||||
private String normalizeTitle(DCValue value)
|
private String normalizeTitle(Metadatum value)
|
||||||
{
|
{
|
||||||
if (!"title".equals(element))
|
if (!"title".equals(element))
|
||||||
{
|
{
|
||||||
|
@@ -10,44 +10,45 @@ package org.dspace.content;
|
|||||||
import org.dspace.content.authority.Choices;
|
import org.dspace.content.authority.Choices;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple data structure-like class representing a Dublin Core value. It has an
|
* Simple data structure-like class representing a flat metadata value. It has a
|
||||||
* element, qualifier, value and language.
|
* schema, element, qualifier, value, language and authority.
|
||||||
*
|
*
|
||||||
* @author Robert Tansley
|
* @author Robert Tansley
|
||||||
* @author Martin Hald
|
* @author Martin Hald
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public class Metadatum
|
||||||
public class DCValue
|
|
||||||
{
|
{
|
||||||
/** The DC element */
|
/** The element name. */
|
||||||
public String element;
|
public String element;
|
||||||
|
|
||||||
/** The DC qualifier, or <code>null</code> if unqualified */
|
/** The name's qualifier, or <code>null</code> if unqualified. */
|
||||||
public String qualifier;
|
public String qualifier;
|
||||||
|
|
||||||
/** The value of the field */
|
/** The value of the field. */
|
||||||
public String value;
|
public String value;
|
||||||
|
|
||||||
/** The language of the field, may be <code>null</code> */
|
/** The language of the field, may be <code>null</code>. */
|
||||||
public String language;
|
public String language;
|
||||||
|
|
||||||
/** The schema name of the metadata element */
|
/** The schema name of the metadata element. */
|
||||||
public String schema;
|
public String schema;
|
||||||
|
|
||||||
/** Authority control key */
|
/** Authority control key. */
|
||||||
public String authority = null;
|
public String authority = null;
|
||||||
|
|
||||||
/** Authority control confidence */
|
/** Authority control confidence. */
|
||||||
public int confidence = Choices.CF_UNSET;
|
public int confidence = Choices.CF_UNSET;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the field in dot notation. i.e. schema.element.qualifier, as in dc.date.issued
|
* Get the name of the field in dot notation: schema.element.qualifier,
|
||||||
* @return
|
* as in {@code dc.date.issued}.
|
||||||
|
*
|
||||||
|
* @return stringified name of this field.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public DCValue copy() {
|
public Metadatum copy() {
|
||||||
DCValue copy = new DCValue();
|
Metadatum copy = new Metadatum();
|
||||||
copy.value = this.value;
|
copy.value = this.value;
|
||||||
copy.authority = this.authority;
|
copy.authority = this.authority;
|
||||||
copy.confidence = this.confidence;
|
copy.confidence = this.confidence;
|
||||||
@@ -62,7 +63,7 @@ public class DCValue
|
|||||||
return schema + "." + element + (qualifier==null?"":("." + qualifier));
|
return schema + "." + element + (qualifier==null?"":("." + qualifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSameFieldAs(DCValue dcValue) {
|
public boolean hasSameFieldAs(Metadatum dcValue) {
|
||||||
if (dcValue == this) {
|
if (dcValue == this) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -87,7 +88,7 @@ public class DCValue
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dcValue = (DCValue) o;
|
Metadatum dcValue = (Metadatum) o;
|
||||||
|
|
||||||
if (confidence != dcValue.confidence) {
|
if (confidence != dcValue.confidence) {
|
||||||
return false;
|
return false;
|
@@ -240,7 +240,7 @@ public class WorkspaceItem implements InProgressSubmission
|
|||||||
|
|
||||||
if (template && (templateItem != null))
|
if (template && (templateItem != null))
|
||||||
{
|
{
|
||||||
DCValue[] md = templateItem.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] md = templateItem.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
for (int n = 0; n < md.length; n++)
|
for (int n = 0; n < md.length; n++)
|
||||||
{
|
{
|
||||||
|
@@ -16,7 +16,7 @@ import java.sql.SQLException;
|
|||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.BitstreamFormat;
|
import org.dspace.content.BitstreamFormat;
|
||||||
@@ -185,7 +185,7 @@ public class AIPTechMDCrosswalk
|
|||||||
throws CrosswalkException, IOException, SQLException,
|
throws CrosswalkException, IOException, SQLException,
|
||||||
AuthorizeException
|
AuthorizeException
|
||||||
{
|
{
|
||||||
List<DCValue> dc = new ArrayList<DCValue>();
|
List<Metadatum> dc = new ArrayList<Metadatum>();
|
||||||
if (dso.getType() == Constants.ITEM)
|
if (dso.getType() == Constants.ITEM)
|
||||||
{
|
{
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
@@ -295,13 +295,13 @@ public class AIPTechMDCrosswalk
|
|||||||
dc.add(makeDC("identifier", "uri", site.getURL()));
|
dc.add(makeDC("identifier", "uri", site.getURL()));
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue result[] = (DCValue[])dc.toArray(new DCValue[dc.size()]);
|
Metadatum result[] = (Metadatum[])dc.toArray(new Metadatum[dc.size()]);
|
||||||
return XSLTDisseminationCrosswalk.createDIM(dso, result);
|
return XSLTDisseminationCrosswalk.createDIM(dso, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DCValue makeDC(String element, String qualifier, String value)
|
private static Metadatum makeDC(String element, String qualifier, String value)
|
||||||
{
|
{
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = "dc";
|
dcv.schema = "dc";
|
||||||
dcv.language = null;
|
dcv.language = null;
|
||||||
dcv.element = element;
|
dcv.element = element;
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
@@ -61,7 +61,7 @@ public class DIMDisseminationCrosswalk
|
|||||||
}
|
}
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
|
|
||||||
DCValue[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
Element dim = new Element("dim", DIM_NS);
|
Element dim = new Element("dim", DIM_NS);
|
||||||
for (int i = 0; i < dc.length; i++)
|
for (int i = 0; i < dc.length; i++)
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,7 @@ import java.util.Properties;
|
|||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
@@ -328,7 +328,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
private List<Element> disseminateListInternal(DSpaceObject dso, boolean addSchema)
|
private List<Element> disseminateListInternal(DSpaceObject dso, boolean addSchema)
|
||||||
throws CrosswalkException, IOException, SQLException, AuthorizeException
|
throws CrosswalkException, IOException, SQLException, AuthorizeException
|
||||||
{
|
{
|
||||||
DCValue[] dcvs = null;
|
Metadatum[] dcvs = null;
|
||||||
if (dso.getType() == Constants.ITEM)
|
if (dso.getType() == Constants.ITEM)
|
||||||
{
|
{
|
||||||
dcvs = item2Metadata((Item) dso);
|
dcvs = item2Metadata((Item) dso);
|
||||||
@@ -446,9 +446,9 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
* @param site
|
* @param site
|
||||||
* The site to derive metadata from
|
* The site to derive metadata from
|
||||||
*/
|
*/
|
||||||
protected DCValue[] site2Metadata(Site site)
|
protected Metadatum[] site2Metadata(Site site)
|
||||||
{
|
{
|
||||||
List<DCValue> metadata = new ArrayList<DCValue>();
|
List<Metadatum> metadata = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
String identifier_uri = "http://hdl.handle.net/"
|
String identifier_uri = "http://hdl.handle.net/"
|
||||||
+ site.getHandle();
|
+ site.getHandle();
|
||||||
@@ -471,7 +471,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
metadata.add(createDCValue("title", null, title));
|
metadata.add(createDCValue("title", null, title));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DCValue[]) metadata.toArray(new DCValue[metadata.size()]);
|
return (Metadatum[]) metadata.toArray(new Metadatum[metadata.size()]);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Generate a list of metadata elements for the given DSpace
|
* Generate a list of metadata elements for the given DSpace
|
||||||
@@ -480,9 +480,9 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
* @param community
|
* @param community
|
||||||
* The community to derive metadata from
|
* The community to derive metadata from
|
||||||
*/
|
*/
|
||||||
protected DCValue[] community2Metadata(Community community)
|
protected Metadatum[] community2Metadata(Community community)
|
||||||
{
|
{
|
||||||
List<DCValue> metadata = new ArrayList<DCValue>();
|
List<Metadatum> metadata = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
String description = community.getMetadata("introductory_text");
|
String description = community.getMetadata("introductory_text");
|
||||||
String description_abstract = community
|
String description_abstract = community
|
||||||
@@ -523,7 +523,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
metadata.add(createDCValue("title", null, title));
|
metadata.add(createDCValue("title", null, title));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DCValue[]) metadata.toArray(new DCValue[metadata.size()]);
|
return (Metadatum[]) metadata.toArray(new Metadatum[metadata.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -533,9 +533,9 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
* @param collection
|
* @param collection
|
||||||
* The collection to derive metadata from
|
* The collection to derive metadata from
|
||||||
*/
|
*/
|
||||||
protected DCValue[] collection2Metadata(Collection collection)
|
protected Metadatum[] collection2Metadata(Collection collection)
|
||||||
{
|
{
|
||||||
List<DCValue> metadata = new ArrayList<DCValue>();
|
List<Metadatum> metadata = new ArrayList<Metadatum>();
|
||||||
|
|
||||||
String description = collection.getMetadata("introductory_text");
|
String description = collection.getMetadata("introductory_text");
|
||||||
String description_abstract = collection
|
String description_abstract = collection
|
||||||
@@ -588,7 +588,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
metadata.add(createDCValue("title", null, title));
|
metadata.add(createDCValue("title", null, title));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DCValue[]) metadata.toArray(new DCValue[metadata.size()]);
|
return (Metadatum[]) metadata.toArray(new Metadatum[metadata.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -597,16 +597,16 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
* @param item
|
* @param item
|
||||||
* The item to derive metadata from
|
* The item to derive metadata from
|
||||||
*/
|
*/
|
||||||
protected DCValue[] item2Metadata(Item item)
|
protected Metadatum[] item2Metadata(Item item)
|
||||||
{
|
{
|
||||||
DCValue[] dcvs = item.getMetadata(Item.ANY, Item.ANY, Item.ANY,
|
Metadatum[] dcvs = item.getMetadata(Item.ANY, Item.ANY, Item.ANY,
|
||||||
Item.ANY);
|
Item.ANY);
|
||||||
|
|
||||||
return dcvs;
|
return dcvs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DCValue createDCValue(String element, String qualifier, String value) {
|
private Metadatum createDCValue(String element, String qualifier, String value) {
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = "dc";
|
dcv.schema = "dc";
|
||||||
dcv.element = element;
|
dcv.element = element;
|
||||||
dcv.qualifier = qualifier;
|
dcv.qualifier = qualifier;
|
||||||
|
@@ -20,7 +20,7 @@ import org.apache.commons.lang.ArrayUtils;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
@@ -116,8 +116,8 @@ public class OREDisseminationCrosswalk
|
|||||||
aggregation.addContent(atomId);
|
aggregation.addContent(atomId);
|
||||||
|
|
||||||
Element aggLink;
|
Element aggLink;
|
||||||
DCValue[] uris = item.getMetadata(MetadataSchema.DC_SCHEMA,"identifier","uri",Item.ANY);
|
Metadatum[] uris = item.getMetadata(MetadataSchema.DC_SCHEMA,"identifier","uri",Item.ANY);
|
||||||
for (DCValue uri : uris) {
|
for (Metadatum uri : uris) {
|
||||||
aggLink = new Element("link",ATOM_NS);
|
aggLink = new Element("link",ATOM_NS);
|
||||||
aggLink.setAttribute("rel", "alternate");
|
aggLink.setAttribute("rel", "alternate");
|
||||||
aggLink.setAttribute("href", uri.value);
|
aggLink.setAttribute("href", uri.value);
|
||||||
@@ -153,7 +153,7 @@ public class OREDisseminationCrosswalk
|
|||||||
|
|
||||||
// Information about the aggregation (item) itself
|
// Information about the aggregation (item) itself
|
||||||
Element aggTitle = new Element("title",ATOM_NS);
|
Element aggTitle = new Element("title",ATOM_NS);
|
||||||
DCValue[] titles = item.getMetadata(MetadataSchema.DC_SCHEMA, "title", null, Item.ANY);
|
Metadatum[] titles = item.getMetadata(MetadataSchema.DC_SCHEMA, "title", null, Item.ANY);
|
||||||
if (titles != null && titles.length>0)
|
if (titles != null && titles.length>0)
|
||||||
{
|
{
|
||||||
aggTitle.addContent(titles[0].value);
|
aggTitle.addContent(titles[0].value);
|
||||||
@@ -166,8 +166,8 @@ public class OREDisseminationCrosswalk
|
|||||||
|
|
||||||
Element aggAuthor;
|
Element aggAuthor;
|
||||||
Element aggAuthorName;
|
Element aggAuthorName;
|
||||||
DCValue[] authors = item.getMetadata(MetadataSchema.DC_SCHEMA,"contributor","author",Item.ANY);
|
Metadatum[] authors = item.getMetadata(MetadataSchema.DC_SCHEMA,"contributor","author",Item.ANY);
|
||||||
for (DCValue author : authors) {
|
for (Metadatum author : authors) {
|
||||||
aggAuthor = new Element("author",ATOM_NS);
|
aggAuthor = new Element("author",ATOM_NS);
|
||||||
aggAuthorName = new Element("name",ATOM_NS);
|
aggAuthorName = new Element("name",ATOM_NS);
|
||||||
aggAuthorName.addContent(author.value);
|
aggAuthorName.addContent(author.value);
|
||||||
|
@@ -22,7 +22,7 @@ import java.util.Properties;
|
|||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
@@ -98,7 +98,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
|||||||
// map of qdc to JDOM Element
|
// map of qdc to JDOM Element
|
||||||
private Map<String, Element> qdc2element = new HashMap<String, Element>();
|
private Map<String, Element> qdc2element = new HashMap<String, Element>();
|
||||||
|
|
||||||
// map of JDOM Element to qdc DCValue
|
// map of JDOM Element to qdc Metadatum
|
||||||
private Map<String, String> element2qdc = new HashMap<String, String>();
|
private Map<String, String> element2qdc = new HashMap<String, String>();
|
||||||
|
|
||||||
// the XML namespaces from config file for this name.
|
// the XML namespaces from config file for this name.
|
||||||
@@ -352,7 +352,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
|||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
init();
|
init();
|
||||||
|
|
||||||
DCValue[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
List<Element> result = new ArrayList<Element>(dc.length);
|
List<Element> result = new ArrayList<Element>(dc.length);
|
||||||
for (int i = 0; i < dc.length; i++)
|
for (int i = 0; i < dc.length; i++)
|
||||||
{
|
{
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
@@ -91,7 +91,7 @@ public class SimpleDCDisseminationCrosswalk extends SelfNamedPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
DCValue[] allDC = item.getDC(Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] allDC = item.getDC(Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
List<Element> dcl = new ArrayList<Element>(allDC.length);
|
List<Element> dcl = new ArrayList<Element>(allDC.length);
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ package org.dspace.content.crosswalk;
|
|||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -174,7 +174,7 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
|
|||||||
Item item = (Item) dso;
|
Item item = (Item) dso;
|
||||||
String handle = item.getHandle();
|
String handle = item.getHandle();
|
||||||
List<Element> metas = new ArrayList<Element>();
|
List<Element> metas = new ArrayList<Element>();
|
||||||
DCValue[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
// Add in schema URLs e.g. <link rel="schema.DC" href="...." />
|
// Add in schema URLs e.g. <link rel="schema.DC" href="...." />
|
||||||
Iterator<String> schemaIterator = schemaURLs.keySet().iterator();
|
Iterator<String> schemaIterator = schemaURLs.keySet().iterator();
|
||||||
@@ -190,7 +190,7 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
|
|||||||
|
|
||||||
for (int i = 0; i < values.length; i++)
|
for (int i = 0; i < values.length; i++)
|
||||||
{
|
{
|
||||||
DCValue v = values[i];
|
Metadatum v = values[i];
|
||||||
|
|
||||||
// Work out the key for the Maps that will tell us which metadata
|
// Work out the key for the Maps that will tell us which metadata
|
||||||
// name + scheme to use
|
// name + scheme to use
|
||||||
|
@@ -20,7 +20,7 @@ import java.util.List;
|
|||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
@@ -296,7 +296,7 @@ public class XSLTDisseminationCrosswalk
|
|||||||
*
|
*
|
||||||
* @param dso The dspace object to build a representation of.
|
* @param dso The dspace object to build a representation of.
|
||||||
*/
|
*/
|
||||||
public static Element createDIM(DSpaceObject dso, DCValue[] dcvs)
|
public static Element createDIM(DSpaceObject dso, Metadatum[] dcvs)
|
||||||
{
|
{
|
||||||
Element dim = new Element("dim", DIM_NS);
|
Element dim = new Element("dim", DIM_NS);
|
||||||
String type = Constants.typeText[dso.getType()];
|
String type = Constants.typeText[dso.getType()];
|
||||||
@@ -304,7 +304,7 @@ public class XSLTDisseminationCrosswalk
|
|||||||
|
|
||||||
for (int i = 0; i < dcvs.length; i++)
|
for (int i = 0; i < dcvs.length; i++)
|
||||||
{
|
{
|
||||||
DCValue dcv = dcvs[i];
|
Metadatum dcv = dcvs[i];
|
||||||
Element field =
|
Element field =
|
||||||
createField(dcv.schema, dcv.element, dcv.qualifier,
|
createField(dcv.schema, dcv.element, dcv.qualifier,
|
||||||
dcv.language, dcv.value, dcv.authority, dcv.confidence);
|
dcv.language, dcv.value, dcv.authority, dcv.confidence);
|
||||||
|
@@ -16,7 +16,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
@@ -326,10 +326,10 @@ public class DSpaceAIPIngester
|
|||||||
throws PackageValidationException, AuthorizeException, IOException, SQLException
|
throws PackageValidationException, AuthorizeException, IOException, SQLException
|
||||||
{
|
{
|
||||||
// Get all metadata fields/values currently added to this Item
|
// Get all metadata fields/values currently added to this Item
|
||||||
DCValue allMD[] = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum allMD[] = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
// For each field, we'll check if it exists. If not, we'll create it.
|
// For each field, we'll check if it exists. If not, we'll create it.
|
||||||
for(DCValue md : allMD)
|
for(Metadatum md : allMD)
|
||||||
{
|
{
|
||||||
MetadataSchema mdSchema = null;
|
MetadataSchema mdSchema = null;
|
||||||
MetadataField mdField = null;
|
MetadataField mdField = null;
|
||||||
|
@@ -26,7 +26,7 @@ import org.dspace.content.BitstreamFormat;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.FormatIdentifier;
|
import org.dspace.content.FormatIdentifier;
|
||||||
import org.dspace.content.InstallItem;
|
import org.dspace.content.InstallItem;
|
||||||
@@ -129,7 +129,7 @@ public class PackageUtils
|
|||||||
public static void checkItemMetadata(Item item)
|
public static void checkItemMetadata(Item item)
|
||||||
throws PackageValidationException
|
throws PackageValidationException
|
||||||
{
|
{
|
||||||
DCValue t[] = item.getDC( "title", null, Item.ANY);
|
Metadatum t[] = item.getDC( "title", null, Item.ANY);
|
||||||
if (t == null || t.length == 0)
|
if (t == null || t.length == 0)
|
||||||
{
|
{
|
||||||
throw new PackageValidationException("Item cannot be created without the required \"title\" DC metadata.");
|
throw new PackageValidationException("Item cannot be created without the required \"title\" DC metadata.");
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.content.service;
|
package org.dspace.content.service;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.dao.ItemDAO;
|
import org.dspace.content.dao.ItemDAO;
|
||||||
import org.dspace.content.dao.ItemDAOFactory;
|
import org.dspace.content.dao.ItemDAOFactory;
|
||||||
@@ -53,7 +53,7 @@ public class ItemService
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getFirstMetadataValue(Item item, String metadataKey) {
|
public static String getFirstMetadataValue(Item item, String metadataKey) {
|
||||||
DCValue[] dcValue = item.getMetadataByMetadataString(metadataKey);
|
Metadatum[] dcValue = item.getMetadataByMetadataString(metadataKey);
|
||||||
if(dcValue.length > 0) {
|
if(dcValue.length > 0) {
|
||||||
return dcValue[0].value;
|
return dcValue[0].value;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
package org.dspace.ctask.general;
|
package org.dspace.ctask.general;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -89,7 +89,7 @@ public abstract class AbstractTranslator extends AbstractCurationTask
|
|||||||
String handle = item.getHandle();
|
String handle = item.getHandle();
|
||||||
log.debug("Translating metadata for " + handle);
|
log.debug("Translating metadata for " + handle);
|
||||||
|
|
||||||
DCValue[] authLangs = item.getMetadataByMetadataString(authLangField);
|
Metadatum[] authLangs = item.getMetadataByMetadataString(authLangField);
|
||||||
if(authLangs.length > 0)
|
if(authLangs.length > 0)
|
||||||
{
|
{
|
||||||
/* Assume the first... multiple
|
/* Assume the first... multiple
|
||||||
@@ -107,11 +107,11 @@ public abstract class AbstractTranslator extends AbstractCurationTask
|
|||||||
boolean translated = false;
|
boolean translated = false;
|
||||||
field = field.trim();
|
field = field.trim();
|
||||||
String[] fieldSegments = field.split("\\.");
|
String[] fieldSegments = field.split("\\.");
|
||||||
DCValue[] fieldMetadata = null;
|
Metadatum[] fieldMetadata = null;
|
||||||
|
|
||||||
if(fieldSegments.length > 2) {
|
if(fieldSegments.length > 2) {
|
||||||
// First, check to see if we've already got this in the target language
|
// First, check to see if we've already got this in the target language
|
||||||
DCValue[] checkMetadata = item.getMetadata(fieldSegments[0], fieldSegments[1], fieldSegments[2], lang);
|
Metadatum[] checkMetadata = item.getMetadata(fieldSegments[0], fieldSegments[1], fieldSegments[2], lang);
|
||||||
if(checkMetadata.length > 0)
|
if(checkMetadata.length > 0)
|
||||||
{
|
{
|
||||||
// We've already translated this, move along
|
// We've already translated this, move along
|
||||||
@@ -126,7 +126,7 @@ public abstract class AbstractTranslator extends AbstractCurationTask
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// First, check to see if we've already got this in the target language
|
// First, check to see if we've already got this in the target language
|
||||||
DCValue[] checkMetadata = item.getMetadata(fieldSegments[0], fieldSegments[1], null, lang);
|
Metadatum[] checkMetadata = item.getMetadata(fieldSegments[0], fieldSegments[1], null, lang);
|
||||||
if(checkMetadata.length > 0)
|
if(checkMetadata.length > 0)
|
||||||
{
|
{
|
||||||
// We've already translated this, move along
|
// We've already translated this, move along
|
||||||
@@ -143,7 +143,7 @@ public abstract class AbstractTranslator extends AbstractCurationTask
|
|||||||
|
|
||||||
if(!translated && fieldMetadata.length > 0)
|
if(!translated && fieldMetadata.length > 0)
|
||||||
{
|
{
|
||||||
for(DCValue metadataValue : fieldMetadata) {
|
for(Metadatum metadataValue : fieldMetadata) {
|
||||||
String value = metadataValue.value;
|
String value = metadataValue.value;
|
||||||
String translatedText = translateText(authLang, lang, value);
|
String translatedText = translateText(authLang, lang, value);
|
||||||
if(translatedText != null && !"".equals(translatedText))
|
if(translatedText != null && !"".equals(translatedText))
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
package org.dspace.ctask.general;
|
package org.dspace.ctask.general;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.curate.AbstractCurationTask;
|
import org.dspace.curate.AbstractCurationTask;
|
||||||
@@ -101,9 +101,9 @@ public class BasicLinkChecker extends AbstractCurationTask
|
|||||||
protected List<String> getURLs(Item item)
|
protected List<String> getURLs(Item item)
|
||||||
{
|
{
|
||||||
// Get URIs from anyschema.anyelement.uri.*
|
// Get URIs from anyschema.anyelement.uri.*
|
||||||
DCValue[] urls = item.getMetadata(Item.ANY, Item.ANY, "uri", Item.ANY);
|
Metadatum[] urls = item.getMetadata(Item.ANY, Item.ANY, "uri", Item.ANY);
|
||||||
ArrayList<String> theURLs = new ArrayList<String>();
|
ArrayList<String> theURLs = new ArrayList<String>();
|
||||||
for (DCValue url : urls)
|
for (Metadatum url : urls)
|
||||||
{
|
{
|
||||||
theURLs.add(url.value);
|
theURLs.add(url.value);
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.ctask.general;
|
package org.dspace.ctask.general;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -26,9 +26,9 @@ public class MetadataValueLinkChecker extends BasicLinkChecker {
|
|||||||
protected List<String> getURLs(Item item)
|
protected List<String> getURLs(Item item)
|
||||||
{
|
{
|
||||||
// Get all metadata elements that start with http:// or https://
|
// Get all metadata elements that start with http:// or https://
|
||||||
DCValue[] urls = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] urls = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
ArrayList<String> theURLs = new ArrayList<String>();
|
ArrayList<String> theURLs = new ArrayList<String>();
|
||||||
for (DCValue url : urls)
|
for (Metadatum url : urls)
|
||||||
{
|
{
|
||||||
if ((url.value.startsWith("http://")) || (url.value.startsWith("https://")))
|
if ((url.value.startsWith("http://")) || (url.value.startsWith("https://")))
|
||||||
{
|
{
|
||||||
|
@@ -45,7 +45,7 @@ import org.w3c.dom.NodeList;
|
|||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -228,7 +228,7 @@ public class MetadataWebService extends AbstractCurationTask implements Namespac
|
|||||||
String itemId = item.getHandle();
|
String itemId = item.getHandle();
|
||||||
if (itemId == null) {
|
if (itemId == null) {
|
||||||
// we are still in workflow - no handle assigned - try title
|
// we are still in workflow - no handle assigned - try title
|
||||||
DCValue[] titleDc = item.getMetadata("dc", "title", null, Item.ANY);
|
Metadatum[] titleDc = item.getMetadata("dc", "title", null, Item.ANY);
|
||||||
String title = (titleDc.length > 0) ? titleDc[0].value : "untitled - dbId: " + item.getID();
|
String title = (titleDc.length > 0) ? titleDc[0].value : "untitled - dbId: " + item.getID();
|
||||||
itemId = "Workflow item: " + title;
|
itemId = "Workflow item: " + title;
|
||||||
} else {
|
} else {
|
||||||
@@ -236,7 +236,7 @@ public class MetadataWebService extends AbstractCurationTask implements Namespac
|
|||||||
}
|
}
|
||||||
resultSb.append(itemId);
|
resultSb.append(itemId);
|
||||||
// Only proceed if item has a value for service template parameter
|
// Only proceed if item has a value for service template parameter
|
||||||
DCValue[] dcVals = item.getMetadataByMetadataString(lookupField);
|
Metadatum[] dcVals = item.getMetadataByMetadataString(lookupField);
|
||||||
if (dcVals.length > 0 && dcVals[0].value.length() > 0) {
|
if (dcVals.length > 0 && dcVals[0].value.length() > 0) {
|
||||||
String value = transform(dcVals[0].value, lookupTransform);
|
String value = transform(dcVals[0].value, lookupTransform);
|
||||||
status = callService(value, item, resultSb);
|
status = callService(value, item, resultSb);
|
||||||
@@ -319,7 +319,7 @@ public class MetadataWebService extends AbstractCurationTask implements Namespac
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (DCValue dcVal : item.getMetadata(info.schema, info.element, info.qualifier, Item.ANY)) {
|
for (Metadatum dcVal : item.getMetadata(info.schema, info.element, info.qualifier, Item.ANY)) {
|
||||||
values.add(dcVal.value);
|
values.add(dcVal.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ import org.dspace.app.util.DCInput;
|
|||||||
import org.dspace.app.util.DCInputSet;
|
import org.dspace.app.util.DCInputSet;
|
||||||
import org.dspace.app.util.DCInputsReader;
|
import org.dspace.app.util.DCInputsReader;
|
||||||
import org.dspace.app.util.DCInputsReaderException;
|
import org.dspace.app.util.DCInputsReaderException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
@@ -81,7 +81,7 @@ public class RequiredMetadata extends AbstractCurationTask
|
|||||||
sb.append("Item: ").append(handle);
|
sb.append("Item: ").append(handle);
|
||||||
for (String req : getReqList(item.getOwningCollection().getHandle()))
|
for (String req : getReqList(item.getOwningCollection().getHandle()))
|
||||||
{
|
{
|
||||||
DCValue[] vals = item.getMetadataByMetadataString(req);
|
Metadatum[] vals = item.getMetadataByMetadataString(req);
|
||||||
if (vals.length == 0)
|
if (vals.length == 0)
|
||||||
{
|
{
|
||||||
sb.append(" missing required field: ").append(req);
|
sb.append(" missing required field: ").append(req);
|
||||||
|
@@ -65,7 +65,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
@@ -971,8 +971,8 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] mydc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] mydc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue meta : mydc)
|
for (Metadatum meta : mydc)
|
||||||
{
|
{
|
||||||
String field = meta.schema + "." + meta.element;
|
String field = meta.schema + "." + meta.element;
|
||||||
String unqualifiedField = field;
|
String unqualifiedField = field;
|
||||||
@@ -1325,7 +1325,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
DCValue[] values = item.getMetadataByMetadataString("dc.relation.ispartof");
|
Metadatum[] values = item.getMetadataByMetadataString("dc.relation.ispartof");
|
||||||
|
|
||||||
if(values != null && values.length > 0 && values[0] != null && values[0].value != null)
|
if(values != null && values.length > 0 && values[0] != null && values[0].value != null)
|
||||||
{
|
{
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
package org.dspace.discovery;
|
package org.dspace.discovery;
|
||||||
|
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -25,8 +25,8 @@ public class SolrServiceSpellIndexingPlugin implements SolrServiceIndexPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void additionalIndex(Context context, DSpaceObject dso, SolrInputDocument document) {
|
public void additionalIndex(Context context, DSpaceObject dso, SolrInputDocument document) {
|
||||||
if(dso instanceof Item){
|
if(dso instanceof Item){
|
||||||
DCValue[] dcValues = ((Item) dso).getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] dcValues = ((Item) dso).getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue dcValue : dcValues) {
|
for (Metadatum dcValue : dcValues) {
|
||||||
document.addField("a_spell", dcValue.value);
|
document.addField("a_spell", dcValue.value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -128,7 +128,7 @@ public class EmbargoManager
|
|||||||
throws SQLException, AuthorizeException, IOException
|
throws SQLException, AuthorizeException, IOException
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
DCValue terms[] = item.getMetadata(terms_schema, terms_element,
|
Metadatum terms[] = item.getMetadata(terms_schema, terms_element,
|
||||||
terms_qualifier, Item.ANY);
|
terms_qualifier, Item.ANY);
|
||||||
|
|
||||||
DCDate result = null;
|
DCDate result = null;
|
||||||
@@ -338,7 +338,7 @@ public class EmbargoManager
|
|||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
boolean status = false;
|
boolean status = false;
|
||||||
DCValue lift[] = item.getMetadata(lift_schema, lift_element, lift_qualifier, Item.ANY);
|
Metadatum lift[] = item.getMetadata(lift_schema, lift_element, lift_qualifier, Item.ANY);
|
||||||
|
|
||||||
if (lift.length > 0)
|
if (lift.length > 0)
|
||||||
{
|
{
|
||||||
@@ -448,7 +448,7 @@ public class EmbargoManager
|
|||||||
// it was never under embargo, or the lift date has passed.
|
// it was never under embargo, or the lift date has passed.
|
||||||
private static DCDate recoverEmbargoDate(Item item) {
|
private static DCDate recoverEmbargoDate(Item item) {
|
||||||
DCDate liftDate = null;
|
DCDate liftDate = null;
|
||||||
DCValue lift[] = item.getMetadata(lift_schema, lift_element, lift_qualifier, Item.ANY);
|
Metadatum lift[] = item.getMetadata(lift_schema, lift_element, lift_qualifier, Item.ANY);
|
||||||
if (lift.length > 0)
|
if (lift.length > 0)
|
||||||
{
|
{
|
||||||
liftDate = new DCDate(lift[0].value);
|
liftDate = new DCDate(lift[0].value);
|
||||||
|
@@ -32,7 +32,7 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Site;
|
import org.dspace.content.Site;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -464,7 +464,7 @@ public class Subscribe
|
|||||||
HarvestedItemInfo hii = (HarvestedItemInfo) itemInfos
|
HarvestedItemInfo hii = (HarvestedItemInfo) itemInfos
|
||||||
.get(j);
|
.get(j);
|
||||||
|
|
||||||
DCValue[] titles = hii.item.getDC("title", null, Item.ANY);
|
Metadatum[] titles = hii.item.getDC("title", null, Item.ANY);
|
||||||
emailText.append(" ").append(labels.getString("org.dspace.eperson.Subscribe.title")).append(" ");
|
emailText.append(" ").append(labels.getString("org.dspace.eperson.Subscribe.title")).append(" ");
|
||||||
|
|
||||||
if (titles.length > 0)
|
if (titles.length > 0)
|
||||||
@@ -476,7 +476,7 @@ public class Subscribe
|
|||||||
emailText.append(labels.getString("org.dspace.eperson.Subscribe.untitled"));
|
emailText.append(labels.getString("org.dspace.eperson.Subscribe.untitled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] authors = hii.item.getDC("contributor", Item.ANY,
|
Metadatum[] authors = hii.item.getDC("contributor", Item.ANY,
|
||||||
Item.ANY);
|
Item.ANY);
|
||||||
|
|
||||||
if (authors.length > 0)
|
if (authors.length > 0)
|
||||||
@@ -621,12 +621,12 @@ public class Subscribe
|
|||||||
// has the item modified today?
|
// has the item modified today?
|
||||||
if (lastUpdateStr.equals(today))
|
if (lastUpdateStr.equals(today))
|
||||||
{
|
{
|
||||||
DCValue[] dateAccArr = infoObject.item.getMetadata("dc",
|
Metadatum[] dateAccArr = infoObject.item.getMetadata("dc",
|
||||||
"date", "accessioned", Item.ANY);
|
"date", "accessioned", Item.ANY);
|
||||||
// we need only the item archived yesterday
|
// we need only the item archived yesterday
|
||||||
if (dateAccArr != null && dateAccArr.length > 0)
|
if (dateAccArr != null && dateAccArr.length > 0)
|
||||||
{
|
{
|
||||||
for (DCValue date : dateAccArr)
|
for (Metadatum date : dateAccArr)
|
||||||
{
|
{
|
||||||
if (date != null && date.value != null)
|
if (date != null && date.value != null)
|
||||||
{
|
{
|
||||||
@@ -678,11 +678,11 @@ public class Subscribe
|
|||||||
|
|
||||||
for (HarvestedItemInfo infoObject : completeList)
|
for (HarvestedItemInfo infoObject : completeList)
|
||||||
{
|
{
|
||||||
DCValue[] dateAccArr = infoObject.item.getMetadata("dc", "date", "accessioned", Item.ANY);
|
Metadatum[] dateAccArr = infoObject.item.getMetadata("dc", "date", "accessioned", Item.ANY);
|
||||||
|
|
||||||
if (dateAccArr != null && dateAccArr.length > 0)
|
if (dateAccArr != null && dateAccArr.length > 0)
|
||||||
{
|
{
|
||||||
for(DCValue date : dateAccArr)
|
for(Metadatum date : dateAccArr)
|
||||||
{
|
{
|
||||||
if(date != null && date.value != null)
|
if(date != null && date.value != null)
|
||||||
{
|
{
|
||||||
|
@@ -38,7 +38,7 @@ import org.dspace.content.BitstreamFormat;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.FormatIdentifier;
|
import org.dspace.content.FormatIdentifier;
|
||||||
import org.dspace.content.InstallItem;
|
import org.dspace.content.InstallItem;
|
||||||
@@ -615,14 +615,14 @@ public class OAIHarvester {
|
|||||||
rejectedHandlePrefixString = "123456789";
|
rejectedHandlePrefixString = "123456789";
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] values = item.getMetadata("dc", "identifier", Item.ANY, Item.ANY);
|
Metadatum[] values = item.getMetadata("dc", "identifier", Item.ANY, Item.ANY);
|
||||||
|
|
||||||
if (values.length > 0 && !acceptedHandleServersString.equals(""))
|
if (values.length > 0 && !acceptedHandleServersString.equals(""))
|
||||||
{
|
{
|
||||||
String[] acceptedHandleServers = acceptedHandleServersString.split(",");
|
String[] acceptedHandleServers = acceptedHandleServersString.split(",");
|
||||||
String[] rejectedHandlePrefixes = rejectedHandlePrefixString.split(",");
|
String[] rejectedHandlePrefixes = rejectedHandlePrefixString.split(",");
|
||||||
|
|
||||||
for (DCValue value : values)
|
for (Metadatum value : values)
|
||||||
{
|
{
|
||||||
// 0 1 2 3 4
|
// 0 1 2 3 4
|
||||||
// http://hdl.handle.net/1234/12
|
// http://hdl.handle.net/1234/12
|
||||||
@@ -672,8 +672,8 @@ public class OAIHarvester {
|
|||||||
|
|
||||||
List<String> clearList = new ArrayList<String>();
|
List<String> clearList = new ArrayList<String>();
|
||||||
|
|
||||||
DCValue[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue value : values)
|
for (Metadatum value : values)
|
||||||
{
|
{
|
||||||
// Verify that the schema exists
|
// Verify that the schema exists
|
||||||
MetadataSchema mdSchema = MetadataSchema.find(ourContext, value.schema);
|
MetadataSchema mdSchema = MetadataSchema.find(ourContext, value.schema);
|
||||||
|
@@ -13,7 +13,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.FormatIdentifier;
|
import org.dspace.content.FormatIdentifier;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
@@ -848,8 +848,8 @@ public class DOIIdentifierProvider
|
|||||||
}
|
}
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
Metadatum[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.startsWith(DOI.RESOLVER + "/10."))
|
if (id.value.startsWith(DOI.RESOLVER + "/10."))
|
||||||
{
|
{
|
||||||
@@ -911,10 +911,10 @@ public class DOIIdentifierProvider
|
|||||||
}
|
}
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
Metadatum[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||||
List<String> remainder = new ArrayList<String>();
|
List<String> remainder = new ArrayList<String>();
|
||||||
|
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (!id.value.equals(DOI.DOIToExternalForm(doi)))
|
if (!id.value.equals(DOI.DOIToExternalForm(doi)))
|
||||||
{
|
{
|
||||||
|
@@ -18,7 +18,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
@@ -130,8 +130,8 @@ public class EZIDIdentifierProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
DCValue[] identifiers = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
Metadatum[] identifiers = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||||
for (DCValue identifier : identifiers)
|
for (Metadatum identifier : identifiers)
|
||||||
{
|
{
|
||||||
if ((null != identifier.value) && (identifier.value.startsWith(DOI_SCHEME)))
|
if ((null != identifier.value) && (identifier.value.startsWith(DOI_SCHEME)))
|
||||||
{
|
{
|
||||||
@@ -367,8 +367,8 @@ public class EZIDIdentifierProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item item = (Item)object;
|
Item item = (Item)object;
|
||||||
DCValue found = null;
|
Metadatum found = null;
|
||||||
for (DCValue candidate : item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null))
|
for (Metadatum candidate : item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null))
|
||||||
{
|
{
|
||||||
if (candidate.value.startsWith(DOI_SCHEME))
|
if (candidate.value.startsWith(DOI_SCHEME))
|
||||||
{
|
{
|
||||||
@@ -402,10 +402,10 @@ public class EZIDIdentifierProvider
|
|||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
|
|
||||||
// delete from EZID
|
// delete from EZID
|
||||||
DCValue[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
Metadatum[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||||
List<String> remainder = new ArrayList<String>();
|
List<String> remainder = new ArrayList<String>();
|
||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (!id.value.startsWith(DOI_SCHEME))
|
if (!id.value.startsWith(DOI_SCHEME))
|
||||||
{
|
{
|
||||||
@@ -472,10 +472,10 @@ public class EZIDIdentifierProvider
|
|||||||
|
|
||||||
Item item = (Item)dso;
|
Item item = (Item)dso;
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
Metadatum[] metadata = item.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||||
List<String> remainder = new ArrayList<String>();
|
List<String> remainder = new ArrayList<String>();
|
||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (!id.value.equals(idToDOI(identifier)))
|
if (!id.value.equals(idToDOI(identifier)))
|
||||||
{
|
{
|
||||||
@@ -629,10 +629,10 @@ public class EZIDIdentifierProvider
|
|||||||
|
|
||||||
for (Entry<String, String> datum : crosswalk.entrySet())
|
for (Entry<String, String> datum : crosswalk.entrySet())
|
||||||
{
|
{
|
||||||
DCValue[] values = item.getMetadataByMetadataString(datum.getValue());
|
Metadatum[] values = item.getMetadataByMetadataString(datum.getValue());
|
||||||
if (null != values)
|
if (null != values)
|
||||||
{
|
{
|
||||||
for (DCValue value : values)
|
for (Metadatum value : values)
|
||||||
{
|
{
|
||||||
String key = datum.getKey();
|
String key = datum.getKey();
|
||||||
String mappedValue;
|
String mappedValue;
|
||||||
|
@@ -432,8 +432,8 @@ public class HandleIdentifierProvider extends IdentifierProvider {
|
|||||||
// Add handle as identifier.uri DC value.
|
// Add handle as identifier.uri DC value.
|
||||||
// First check that identifier doesn't already exist.
|
// First check that identifier doesn't already exist.
|
||||||
boolean identifierExists = false;
|
boolean identifierExists = false;
|
||||||
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
Metadatum[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
||||||
for (DCValue identifier : identifiers)
|
for (Metadatum identifier : identifiers)
|
||||||
{
|
{
|
||||||
if (handleref.equals(identifier.value))
|
if (handleref.equals(identifier.value))
|
||||||
{
|
{
|
||||||
|
@@ -633,8 +633,8 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
|
|||||||
// Add handle as identifier.uri DC value.
|
// Add handle as identifier.uri DC value.
|
||||||
// First check that identifier doesn't already exist.
|
// First check that identifier doesn't already exist.
|
||||||
boolean identifierExists = false;
|
boolean identifierExists = false;
|
||||||
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
Metadatum[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
||||||
for (DCValue identifier : identifiers)
|
for (Metadatum identifier : identifiers)
|
||||||
{
|
{
|
||||||
if (handleref.equals(identifier.value))
|
if (handleref.equals(identifier.value))
|
||||||
{
|
{
|
||||||
|
@@ -26,7 +26,7 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.BitstreamFormat;
|
import org.dspace.content.BitstreamFormat;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -490,8 +490,8 @@ public class CreativeCommons
|
|||||||
*/
|
*/
|
||||||
public String ccItemValue(Item item)
|
public String ccItemValue(Item item)
|
||||||
{
|
{
|
||||||
DCValue[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
Metadatum[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
||||||
for (DCValue dcvalue : dcvalues)
|
for (Metadatum dcvalue : dcvalues)
|
||||||
{
|
{
|
||||||
if ((dcvalue.value).indexOf(ccShib) != -1)
|
if ((dcvalue.value).indexOf(ccShib) != -1)
|
||||||
{
|
{
|
||||||
@@ -516,8 +516,8 @@ public class CreativeCommons
|
|||||||
CCLookup ccLookup = new CCLookup();
|
CCLookup ccLookup = new CCLookup();
|
||||||
ccLookup.issue(key);
|
ccLookup.issue(key);
|
||||||
String matchValue = ccLookup.getLicenseName();
|
String matchValue = ccLookup.getLicenseName();
|
||||||
DCValue[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
Metadatum[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
||||||
for (DCValue dcvalue : dcvalues)
|
for (Metadatum dcvalue : dcvalues)
|
||||||
{
|
{
|
||||||
if (dcvalue.value.equals(matchValue))
|
if (dcvalue.value.equals(matchValue))
|
||||||
{
|
{
|
||||||
@@ -538,9 +538,9 @@ public class CreativeCommons
|
|||||||
{
|
{
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
DCValue[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
Metadatum[] dcvalues = item.getMetadata(params[0], params[1], params[2], params[3]);
|
||||||
ArrayList<String> arrayList = new ArrayList<String>();
|
ArrayList<String> arrayList = new ArrayList<String>();
|
||||||
for (DCValue dcvalue : dcvalues)
|
for (Metadatum dcvalue : dcvalues)
|
||||||
{
|
{
|
||||||
if (! dcvalue.value.equals(value))
|
if (! dcvalue.value.equals(value))
|
||||||
{
|
{
|
||||||
|
@@ -28,9 +28,9 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.MetadataExposure;
|
import org.dspace.app.util.MetadataExposure;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.rdf.RDFUtil;
|
import org.dspace.rdf.RDFUtil;
|
||||||
@@ -134,8 +134,8 @@ public class MetadataConverterPlugin implements ConverterPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item item = (Item) dso;
|
Item item = (Item) dso;
|
||||||
DCValue[] metadata_values = item.getDC(Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] metadata_values = item.getDC(Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue value : metadata_values)
|
for (Metadatum value : metadata_values)
|
||||||
{
|
{
|
||||||
String fieldname = value.schema + "." + value.element;
|
String fieldname = value.schema + "." + value.element;
|
||||||
if (value.qualifier != null)
|
if (value.qualifier != null)
|
||||||
|
@@ -55,7 +55,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
@@ -1080,7 +1080,7 @@ public class DSIndexer
|
|||||||
int j;
|
int j;
|
||||||
if (indexConfigArr.length > 0)
|
if (indexConfigArr.length > 0)
|
||||||
{
|
{
|
||||||
DCValue[] mydc;
|
Metadatum[] mydc;
|
||||||
|
|
||||||
for (int i = 0; i < indexConfigArr.length; i++)
|
for (int i = 0; i < indexConfigArr.length; i++)
|
||||||
{
|
{
|
||||||
@@ -1246,7 +1246,7 @@ public class DSIndexer
|
|||||||
for (SortOption so : SortOption.getSortOptions())
|
for (SortOption so : SortOption.getSortOptions())
|
||||||
{
|
{
|
||||||
String[] somd = so.getMdBits();
|
String[] somd = so.getMdBits();
|
||||||
DCValue[] dcv = item.getMetadata(somd[0], somd[1], somd[2], Item.ANY);
|
Metadatum[] dcv = item.getMetadata(somd[0], somd[1], somd[2], Item.ANY);
|
||||||
if (dcv.length > 0)
|
if (dcv.length > 0)
|
||||||
{
|
{
|
||||||
String value = OrderFormat.makeSortString(dcv[0].value, dcv[0].language, so.getType());
|
String value = OrderFormat.makeSortString(dcv[0].value, dcv[0].language, so.getType());
|
||||||
|
@@ -493,7 +493,7 @@ public class StatisticsDataVisits extends StatisticsData
|
|||||||
case Constants.ITEM:
|
case Constants.ITEM:
|
||||||
Item item = (Item) dso;
|
Item item = (Item) dso;
|
||||||
String name = "untitled";
|
String name = "untitled";
|
||||||
DCValue[] vals = item.getMetadata("dc", "title", null, Item.ANY);
|
Metadatum[] vals = item.getMetadata("dc", "title", null, Item.ANY);
|
||||||
if(vals != null && 0 < vals.length)
|
if(vals != null && 0 < vals.length)
|
||||||
{
|
{
|
||||||
name = vals[0].value;
|
name = vals[0].value;
|
||||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -50,7 +50,7 @@ public class SubmissionLookupUtils
|
|||||||
{
|
{
|
||||||
LookupProvidersCheck check = new LookupProvidersCheck();
|
LookupProvidersCheck check = new LookupProvidersCheck();
|
||||||
MetadataSchema[] schemas = MetadataSchema.findAll(context);
|
MetadataSchema[] schemas = MetadataSchema.findAll(context);
|
||||||
DCValue[] values = item.getMetadata(dcSchema, dcElement,
|
Metadatum[] values = item.getMetadata(dcSchema, dcElement,
|
||||||
dcQualifier, Item.ANY);
|
dcQualifier, Item.ANY);
|
||||||
|
|
||||||
for (MetadataSchema schema : schemas)
|
for (MetadataSchema schema : schemas)
|
||||||
@@ -59,7 +59,7 @@ public class SubmissionLookupUtils
|
|||||||
if (schema.getNamespace().startsWith(
|
if (schema.getNamespace().startsWith(
|
||||||
SubmissionLookupService.SL_NAMESPACE_PREFIX))
|
SubmissionLookupService.SL_NAMESPACE_PREFIX))
|
||||||
{
|
{
|
||||||
DCValue[] slCache = item.getMetadata(schema.getName(),
|
Metadatum[] slCache = item.getMetadata(schema.getName(),
|
||||||
dcElement, dcQualifier, Item.ANY);
|
dcElement, dcQualifier, Item.ANY);
|
||||||
if (slCache.length == 0)
|
if (slCache.length == 0)
|
||||||
continue;
|
continue;
|
||||||
@@ -72,8 +72,8 @@ public class SubmissionLookupUtils
|
|||||||
{
|
{
|
||||||
for (int idx = 0; idx < values.length; idx++)
|
for (int idx = 0; idx < values.length; idx++)
|
||||||
{
|
{
|
||||||
DCValue v = values[idx];
|
Metadatum v = values[idx];
|
||||||
DCValue sl = slCache[idx];
|
Metadatum sl = slCache[idx];
|
||||||
// FIXME gestire authority e possibilita' multiple:
|
// FIXME gestire authority e possibilita' multiple:
|
||||||
// match non sicuri, affiliation, etc.
|
// match non sicuri, affiliation, etc.
|
||||||
if (!v.value.equals(sl.value))
|
if (!v.value.equals(sl.value))
|
||||||
|
@@ -19,7 +19,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.app.util.SubmissionInfo;
|
import org.dspace.app.util.SubmissionInfo;
|
||||||
import org.dspace.app.util.Util;
|
import org.dspace.app.util.Util;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
@@ -29,7 +29,7 @@ import org.dspace.content.Collection;
|
|||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCPersonName;
|
import org.dspace.content.DCPersonName;
|
||||||
import org.dspace.content.DCSeriesNumber;
|
import org.dspace.content.DCSeriesNumber;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
import org.dspace.content.authority.MetadataAuthorityManager;
|
import org.dspace.content.authority.MetadataAuthorityManager;
|
||||||
@@ -324,7 +324,7 @@ public class DescribeStep extends AbstractProcessingStep
|
|||||||
{
|
{
|
||||||
qualifier = Item.ANY;
|
qualifier = Item.ANY;
|
||||||
}
|
}
|
||||||
DCValue[] values = item.getMetadata(inputs[i].getSchema(),
|
Metadatum[] values = item.getMetadata(inputs[i].getSchema(),
|
||||||
inputs[i].getElement(), qualifier, Item.ANY);
|
inputs[i].getElement(), qualifier, Item.ANY);
|
||||||
|
|
||||||
if ((inputs[i].isRequired() && values.length == 0) &&
|
if ((inputs[i].isRequired() && values.length == 0) &&
|
||||||
|
@@ -19,7 +19,7 @@ import org.dspace.app.util.Util;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.WorkspaceItem;
|
import org.dspace.content.WorkspaceItem;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -155,7 +155,7 @@ public class InitialQuestionsStep extends AbstractProcessingStep
|
|||||||
// shouldn't need to check if submission is null, but just in case!
|
// shouldn't need to check if submission is null, but just in case!
|
||||||
if (!multipleTitles)
|
if (!multipleTitles)
|
||||||
{
|
{
|
||||||
DCValue[] altTitles = subInfo.getSubmissionItem().getItem()
|
Metadatum[] altTitles = subInfo.getSubmissionItem().getItem()
|
||||||
.getDC("title", "alternative", Item.ANY);
|
.getDC("title", "alternative", Item.ANY);
|
||||||
|
|
||||||
willRemoveTitles = altTitles.length > 0;
|
willRemoveTitles = altTitles.length > 0;
|
||||||
@@ -163,11 +163,11 @@ public class InitialQuestionsStep extends AbstractProcessingStep
|
|||||||
|
|
||||||
if (!publishedBefore)
|
if (!publishedBefore)
|
||||||
{
|
{
|
||||||
DCValue[] dateIssued = subInfo.getSubmissionItem().getItem()
|
Metadatum[] dateIssued = subInfo.getSubmissionItem().getItem()
|
||||||
.getDC("date", "issued", Item.ANY);
|
.getDC("date", "issued", Item.ANY);
|
||||||
DCValue[] citation = subInfo.getSubmissionItem().getItem()
|
Metadatum[] citation = subInfo.getSubmissionItem().getItem()
|
||||||
.getDC("identifier", "citation", Item.ANY);
|
.getDC("identifier", "citation", Item.ANY);
|
||||||
DCValue[] publisher = subInfo.getSubmissionItem().getItem()
|
Metadatum[] publisher = subInfo.getSubmissionItem().getItem()
|
||||||
.getDC("publisher", null, Item.ANY);
|
.getDC("publisher", null, Item.ANY);
|
||||||
|
|
||||||
willRemoveDate = (dateIssued.length > 0)
|
willRemoveDate = (dateIssued.length > 0)
|
||||||
@@ -219,7 +219,7 @@ public class InitialQuestionsStep extends AbstractProcessingStep
|
|||||||
// (This logic is necessary since the date field is hidden on DescribeStep when publishedBefore==false)
|
// (This logic is necessary since the date field is hidden on DescribeStep when publishedBefore==false)
|
||||||
if(!publishedBefore)
|
if(!publishedBefore)
|
||||||
{
|
{
|
||||||
DCValue[] dateIssued = subInfo.getSubmissionItem().getItem()
|
Metadatum[] dateIssued = subInfo.getSubmissionItem().getItem()
|
||||||
.getDC("date", "issued", Item.ANY);
|
.getDC("date", "issued", Item.ANY);
|
||||||
if(dateIssued.length==0)
|
if(dateIssued.length==0)
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@ import org.apache.commons.cli.Options;
|
|||||||
import org.apache.commons.cli.PosixParser;
|
import org.apache.commons.cli.PosixParser;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.jdom.Document;
|
import org.jdom.Document;
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
import org.jdom.output.Format;
|
import org.jdom.output.Format;
|
||||||
@@ -90,7 +90,7 @@ public class PubMedToImport {
|
|||||||
|
|
||||||
private static class PubMedHandler extends DefaultHandler {
|
private static class PubMedHandler extends DefaultHandler {
|
||||||
private static int recordCount = 1;
|
private static int recordCount = 1;
|
||||||
private static List<DCValue> dcValues;
|
private static List<Metadatum> dcValues;
|
||||||
|
|
||||||
private static StringBuilder value;
|
private static StringBuilder value;
|
||||||
private static StringBuilder lastName;
|
private static StringBuilder lastName;
|
||||||
@@ -102,10 +102,10 @@ public class PubMedToImport {
|
|||||||
|
|
||||||
private static void addDCValue(String element, String qualifier, String value) {
|
private static void addDCValue(String element, String qualifier, String value) {
|
||||||
if (dcValues == null) {
|
if (dcValues == null) {
|
||||||
dcValues = new ArrayList<DCValue>();
|
dcValues = new ArrayList<Metadatum>();
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue thisValue = new DCValue();
|
Metadatum thisValue = new Metadatum();
|
||||||
thisValue.schema = "dc";
|
thisValue.schema = "dc";
|
||||||
thisValue.element = element;
|
thisValue.element = element;
|
||||||
thisValue.qualifier = qualifier;
|
thisValue.qualifier = qualifier;
|
||||||
@@ -203,7 +203,7 @@ public class PubMedToImport {
|
|||||||
|
|
||||||
doc.setRootElement(root);
|
doc.setRootElement(root);
|
||||||
|
|
||||||
for (DCValue dcValue : dcValues)
|
for (Metadatum dcValue : dcValues)
|
||||||
{
|
{
|
||||||
Element dcNode = new Element("dcvalue");
|
Element dcNode = new Element("dcvalue");
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@ public abstract class AbstractVersionProvider {
|
|||||||
private Set<String> ignoredMetadataFields;
|
private Set<String> ignoredMetadataFields;
|
||||||
|
|
||||||
protected void copyMetadata(Item itemNew, Item nativeItem){
|
protected void copyMetadata(Item itemNew, Item nativeItem){
|
||||||
DCValue[] md = nativeItem.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] md = nativeItem.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue aMd : md) {
|
for (Metadatum aMd : md) {
|
||||||
String unqualifiedMetadataField = aMd.schema + "." + aMd.element;
|
String unqualifiedMetadataField = aMd.schema + "." + aMd.element;
|
||||||
String qualifiedMetadataField = unqualifiedMetadataField + (aMd.qualifier == null ? "" : "." + aMd.qualifier);
|
String qualifiedMetadataField = unqualifiedMetadataField + (aMd.qualifier == null ? "" : "." + aMd.qualifier);
|
||||||
if(getIgnoredMetadataFields().contains(qualifiedMetadataField) ||
|
if(getIgnoredMetadataFields().contains(qualifiedMetadataField) ||
|
||||||
|
@@ -9,7 +9,7 @@ package org.dspace.versioning;
|
|||||||
|
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.springframework.beans.factory.annotation.Required;
|
import org.springframework.beans.factory.annotation.Required;
|
||||||
@@ -46,7 +46,7 @@ public class VersioningServiceImpl implements VersioningService{
|
|||||||
vh=versionHistoryDAO.create(c);
|
vh=versionHistoryDAO.create(c);
|
||||||
|
|
||||||
// get dc:date.accessioned to be set as first version date...
|
// get dc:date.accessioned to be set as first version date...
|
||||||
DCValue[] values = item.getMetadata("dc", "date", "accessioned", Item.ANY);
|
Metadatum[] values = item.getMetadata("dc", "date", "accessioned", Item.ANY);
|
||||||
Date versionDate = new Date();
|
Date versionDate = new Date();
|
||||||
if(values!=null && values.length > 0){
|
if(values!=null && values.length > 0){
|
||||||
String date = values[0].value;
|
String date = values[0].value;
|
||||||
|
@@ -25,7 +25,7 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.InstallItem;
|
import org.dspace.content.InstallItem;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.WorkspaceItem;
|
import org.dspace.content.WorkspaceItem;
|
||||||
@@ -748,7 +748,7 @@ public class WorkflowManager
|
|||||||
String handle = HandleManager.findHandle(c, i);
|
String handle = HandleManager.findHandle(c, i);
|
||||||
|
|
||||||
// Get title
|
// Get title
|
||||||
DCValue[] titles = i.getDC("title", null, Item.ANY);
|
Metadatum[] titles = i.getDC("title", null, Item.ANY);
|
||||||
String title = "";
|
String title = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -1083,7 +1083,7 @@ public class WorkflowManager
|
|||||||
public static String getItemTitle(WorkflowItem wi) throws SQLException
|
public static String getItemTitle(WorkflowItem wi) throws SQLException
|
||||||
{
|
{
|
||||||
Item myitem = wi.getItem();
|
Item myitem = wi.getItem();
|
||||||
DCValue[] titles = myitem.getDC("title", null, Item.ANY);
|
Metadatum[] titles = myitem.getDC("title", null, Item.ANY);
|
||||||
|
|
||||||
// only return the first element, or "Untitled"
|
// only return the first element, or "Untitled"
|
||||||
if (titles.length > 0)
|
if (titles.length > 0)
|
||||||
|
@@ -402,7 +402,7 @@ public class XmlWorkflowManager {
|
|||||||
String handle = HandleManager.findHandle(c, i);
|
String handle = HandleManager.findHandle(c, i);
|
||||||
|
|
||||||
// Get title
|
// Get title
|
||||||
DCValue[] titles = i.getMetadata(MetadataSchema.DC_SCHEMA, "title", null, Item.ANY);
|
Metadatum[] titles = i.getMetadata(MetadataSchema.DC_SCHEMA, "title", null, Item.ANY);
|
||||||
String title = "";
|
String title = "";
|
||||||
try {
|
try {
|
||||||
title = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled");
|
title = I18nUtil.getMessage("org.dspace.workflow.WorkflowManager.untitled");
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
package org.dspace.xmlworkflow.state.actions.processingaction;
|
package org.dspace.xmlworkflow.state.actions.processingaction;
|
||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -47,10 +47,10 @@ public class ScoreEvaluationAction extends ProcessingAction{
|
|||||||
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException {
|
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException {
|
||||||
boolean hasPassed = false;
|
boolean hasPassed = false;
|
||||||
//Retrieve all our scores from the metadata & add em up
|
//Retrieve all our scores from the metadata & add em up
|
||||||
DCValue[] scores = wfi.getItem().getMetadata(WorkflowRequirementsManager.WORKFLOW_SCHEMA, "score", null, Item.ANY);
|
Metadatum[] scores = wfi.getItem().getMetadata(WorkflowRequirementsManager.WORKFLOW_SCHEMA, "score", null, Item.ANY);
|
||||||
if(0 < scores.length){
|
if(0 < scores.length){
|
||||||
int totalScoreCount = 0;
|
int totalScoreCount = 0;
|
||||||
for (DCValue score : scores) {
|
for (Metadatum score : scores) {
|
||||||
totalScoreCount += Integer.parseInt(score.value);
|
totalScoreCount += Integer.parseInt(score.value);
|
||||||
}
|
}
|
||||||
int scoreMean = totalScoreCount / scores.length;
|
int scoreMean = totalScoreCount / scores.length;
|
||||||
|
@@ -132,9 +132,9 @@ public class InstallItemTest extends AbstractUnitTest
|
|||||||
assertThat("testRestoreItem 0", result, equalTo(is.getItem()));
|
assertThat("testRestoreItem 0", result, equalTo(is.getItem()));
|
||||||
|
|
||||||
//Make sure that restore did NOT insert a new provenance message with today's date
|
//Make sure that restore did NOT insert a new provenance message with today's date
|
||||||
DCValue[] provMsgValues = result.getMetadata("dc", "description", "provenance", Item.ANY);
|
Metadatum[] provMsgValues = result.getMetadata("dc", "description", "provenance", Item.ANY);
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for(DCValue val : provMsgValues)
|
for(Metadatum val : provMsgValues)
|
||||||
{
|
{
|
||||||
assertFalse("testRestoreItem " + i, val.value.startsWith(provDescriptionBegins));
|
assertFalse("testRestoreItem " + i, val.value.startsWith(provDescriptionBegins));
|
||||||
i++;
|
i++;
|
||||||
@@ -202,7 +202,7 @@ public class InstallItemTest extends AbstractUnitTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
//Make sure the string "today" was replaced with today's date
|
//Make sure the string "today" was replaced with today's date
|
||||||
DCValue[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
Metadatum[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
||||||
|
|
||||||
assertThat("testInstallItem_todayAsIssuedDate 0", issuedDates[0].value, equalTo(date));
|
assertThat("testInstallItem_todayAsIssuedDate 0", issuedDates[0].value, equalTo(date));
|
||||||
assertThat("testInstallItem_todayAsIssuedDate 1", issuedDates[1].value, equalTo("2011-01-01"));
|
assertThat("testInstallItem_todayAsIssuedDate 1", issuedDates[1].value, equalTo("2011-01-01"));
|
||||||
@@ -224,7 +224,7 @@ public class InstallItemTest extends AbstractUnitTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
//Make sure dc.date.issued is NOT set
|
//Make sure dc.date.issued is NOT set
|
||||||
DCValue[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
Metadatum[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
||||||
assertThat("testInstallItem_nullIssuedDate 0", issuedDates.length, equalTo(0));
|
assertThat("testInstallItem_nullIssuedDate 0", issuedDates.length, equalTo(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public class InstallItemTest extends AbstractUnitTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
//Make sure the string "today" was replaced with today's date
|
//Make sure the string "today" was replaced with today's date
|
||||||
DCValue[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
Metadatum[] issuedDates = result.getMetadata("dc", "date", "issued", Item.ANY);
|
||||||
|
|
||||||
assertThat("testRestoreItem_todayAsIssuedDate 0", issuedDates[0].value, equalTo(date));
|
assertThat("testRestoreItem_todayAsIssuedDate 0", issuedDates[0].value, equalTo(date));
|
||||||
assertThat("testRestoreItem_todayAsIssuedDate 1", issuedDates[1].value, equalTo("2011-01-01"));
|
assertThat("testRestoreItem_todayAsIssuedDate 1", issuedDates[1].value, equalTo("2011-01-01"));
|
||||||
|
@@ -272,7 +272,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String element = "contributor";
|
String element = "contributor";
|
||||||
String qualifier = "author";
|
String qualifier = "author";
|
||||||
String lang = Item.ANY;
|
String lang = Item.ANY;
|
||||||
DCValue[] dc = it.getDC(element, qualifier, lang);
|
Metadatum[] dc = it.getDC(element, qualifier, lang);
|
||||||
assertThat("testGetDC 0",dc,notNullValue());
|
assertThat("testGetDC 0",dc,notNullValue());
|
||||||
assertTrue("testGetDC 1",dc.length == 0);
|
assertTrue("testGetDC 1",dc.length == 0);
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String element = "contributor";
|
String element = "contributor";
|
||||||
String qualifier = "author";
|
String qualifier = "author";
|
||||||
String lang = Item.ANY;
|
String lang = Item.ANY;
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testGetMetadata_4args 0",dc,notNullValue());
|
assertThat("testGetMetadata_4args 0",dc,notNullValue());
|
||||||
assertTrue("testGetMetadata_4args 1",dc.length == 0);
|
assertTrue("testGetMetadata_4args 1",dc.length == 0);
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
public void testGetMetadata_String()
|
public void testGetMetadata_String()
|
||||||
{
|
{
|
||||||
String mdString = "dc.contributor.author";
|
String mdString = "dc.contributor.author";
|
||||||
DCValue[] dc = it.getMetadataByMetadataString(mdString);
|
Metadatum[] dc = it.getMetadataByMetadataString(mdString);
|
||||||
assertThat("testGetMetadata_String 0",dc,notNullValue());
|
assertThat("testGetMetadata_String 0",dc,notNullValue());
|
||||||
assertTrue("testGetMetadata_String 1",dc.length == 0);
|
assertTrue("testGetMetadata_String 1",dc.length == 0);
|
||||||
|
|
||||||
@@ -327,7 +327,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
it.addMetadata("test", "type", null, null, testType);
|
it.addMetadata("test", "type", null, null, testType);
|
||||||
|
|
||||||
// Check that only one is returned when we ask for all dc.type values
|
// Check that only one is returned when we ask for all dc.type values
|
||||||
DCValue[] values = it.getMetadata("dc", "type", null, null);
|
Metadatum[] values = it.getMetadata("dc", "type", null, null);
|
||||||
assertTrue("Return results", values.length == 1);
|
assertTrue("Return results", values.length == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String[] values = {"value0","value1"};
|
String[] values = {"value0","value1"};
|
||||||
it.addDC(element, qualifier, lang, values);
|
it.addDC(element, qualifier, lang, values);
|
||||||
|
|
||||||
DCValue[] dc = it.getDC(element, qualifier, lang);
|
Metadatum[] dc = it.getDC(element, qualifier, lang);
|
||||||
assertThat("testAddDC_4args_1 0",dc,notNullValue());
|
assertThat("testAddDC_4args_1 0",dc,notNullValue());
|
||||||
assertTrue("testAddDC_4args_1 1",dc.length == 2);
|
assertTrue("testAddDC_4args_1 1",dc.length == 2);
|
||||||
assertThat("testAddDC_4args_1 2",dc[0].element,equalTo(element));
|
assertThat("testAddDC_4args_1 2",dc[0].element,equalTo(element));
|
||||||
@@ -368,7 +368,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String value = "value";
|
String value = "value";
|
||||||
it.addDC(element, qualifier, lang, value);
|
it.addDC(element, qualifier, lang, value);
|
||||||
|
|
||||||
DCValue[] dc = it.getDC(element, qualifier, lang);
|
Metadatum[] dc = it.getDC(element, qualifier, lang);
|
||||||
assertThat("testAddDC_4args_2 0",dc,notNullValue());
|
assertThat("testAddDC_4args_2 0",dc,notNullValue());
|
||||||
assertTrue("testAddDC_4args_2 1",dc.length == 1);
|
assertTrue("testAddDC_4args_2 1",dc.length == 1);
|
||||||
assertThat("testAddDC_4args_2 2",dc[0].element,equalTo(element));
|
assertThat("testAddDC_4args_2 2",dc[0].element,equalTo(element));
|
||||||
@@ -390,7 +390,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String[] values = {"value0","value1"};
|
String[] values = {"value0","value1"};
|
||||||
it.addMetadata(schema, element, qualifier, lang, values);
|
it.addMetadata(schema, element, qualifier, lang, values);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_5args_1 0",dc,notNullValue());
|
assertThat("testAddMetadata_5args_1 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_5args_1 1",dc.length == 2);
|
assertTrue("testAddMetadata_5args_1 1",dc.length == 2);
|
||||||
assertThat("testAddMetadata_5args_1 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_5args_1 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -423,7 +423,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
int[] confidences = {0,0};
|
int[] confidences = {0,0};
|
||||||
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_7args_1 0",dc,notNullValue());
|
assertThat("testAddMetadata_7args_1 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_7args_1 1",dc.length == 2);
|
assertTrue("testAddMetadata_7args_1 1",dc.length == 2);
|
||||||
assertThat("testAddMetadata_7args_1 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_7args_1 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -459,7 +459,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
int[] confidences = {0,0};
|
int[] confidences = {0,0};
|
||||||
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_7args_1 0",dc,notNullValue());
|
assertThat("testAddMetadata_7args_1 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_7args_1 1",dc.length == 2);
|
assertTrue("testAddMetadata_7args_1 1",dc.length == 2);
|
||||||
assertThat("testAddMetadata_7args_1 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_7args_1 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -491,7 +491,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
String[] values = {"value0","value1"};
|
String[] values = {"value0","value1"};
|
||||||
it.addMetadata(schema, element, qualifier, lang, values);
|
it.addMetadata(schema, element, qualifier, lang, values);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_5args_2 0",dc,notNullValue());
|
assertThat("testAddMetadata_5args_2 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_5args_2 1",dc.length == 2);
|
assertTrue("testAddMetadata_5args_2 1",dc.length == 2);
|
||||||
assertThat("testAddMetadata_5args_2 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_5args_2 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -524,7 +524,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
int confidences = 0;
|
int confidences = 0;
|
||||||
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_7args_2 0",dc,notNullValue());
|
assertThat("testAddMetadata_7args_2 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_7args_2 1",dc.length == 1);
|
assertTrue("testAddMetadata_7args_2 1",dc.length == 1);
|
||||||
assertThat("testAddMetadata_7args_2 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_7args_2 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -553,7 +553,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
int confidences = 0;
|
int confidences = 0;
|
||||||
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
it.addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testAddMetadata_7args_2 0",dc,notNullValue());
|
assertThat("testAddMetadata_7args_2 0",dc,notNullValue());
|
||||||
assertTrue("testAddMetadata_7args_2 1",dc.length == 1);
|
assertTrue("testAddMetadata_7args_2 1",dc.length == 1);
|
||||||
assertThat("testAddMetadata_7args_2 2",dc[0].schema,equalTo(schema));
|
assertThat("testAddMetadata_7args_2 2",dc[0].schema,equalTo(schema));
|
||||||
@@ -579,7 +579,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
|
|
||||||
it.clearDC(element, qualifier, lang);
|
it.clearDC(element, qualifier, lang);
|
||||||
|
|
||||||
DCValue[] dc = it.getDC(element, qualifier, lang);
|
Metadatum[] dc = it.getDC(element, qualifier, lang);
|
||||||
assertThat("testClearDC 0",dc,notNullValue());
|
assertThat("testClearDC 0",dc,notNullValue());
|
||||||
assertTrue("testClearDC 1",dc.length == 0);
|
assertTrue("testClearDC 1",dc.length == 0);
|
||||||
}
|
}
|
||||||
@@ -599,7 +599,7 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
|
|
||||||
it.clearMetadata(schema, element, qualifier, lang);
|
it.clearMetadata(schema, element, qualifier, lang);
|
||||||
|
|
||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
Metadatum[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testClearMetadata 0",dc,notNullValue());
|
assertThat("testClearMetadata 0",dc,notNullValue());
|
||||||
assertTrue("testClearMetadata 1",dc.length == 0);
|
assertTrue("testClearMetadata 1",dc.length == 0);
|
||||||
}
|
}
|
||||||
|
@@ -13,20 +13,20 @@ import static org.junit.Assert.*;
|
|||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DCValue is a deprecated class with no methods (just a Data Object). This
|
* Metadatum is a deprecated class with no methods (just a Data Object). This
|
||||||
* class does no real testing, is just here for the sake of coberture completeness
|
* class does no real testing, is just here for the sake of coberture completeness
|
||||||
* and in case the class is refactored and requires some extra testing.
|
* and in case the class is refactored and requires some extra testing.
|
||||||
* @author pvillega
|
* @author pvillega
|
||||||
*/
|
*/
|
||||||
public class DCValueTest extends AbstractUnitTest
|
public class MetadatumTest extends AbstractUnitTest
|
||||||
{
|
{
|
||||||
/** log4j category */
|
/** log4j category */
|
||||||
private final static Logger log = Logger.getLogger(DCValueTest.class);
|
private final static Logger log = Logger.getLogger(MetadatumTest.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object to use in the tests
|
* Object to use in the tests
|
||||||
*/
|
*/
|
||||||
private DCValue dcval;
|
private Metadatum dcval;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +41,7 @@ public class DCValueTest extends AbstractUnitTest
|
|||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
dcval = new DCValue();
|
dcval = new Metadatum();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@@ -125,8 +125,8 @@ public class DOIIdentifierProviderTest
|
|||||||
|
|
||||||
private static void dumpMetadata(Item eyetem)
|
private static void dumpMetadata(Item eyetem)
|
||||||
{
|
{
|
||||||
DCValue[] metadata = eyetem.getMetadata("dc", Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] metadata = eyetem.getMetadata("dc", Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue metadatum : metadata)
|
for (Metadatum metadatum : metadata)
|
||||||
System.out.printf("Metadata: %s.%s.%s(%s) = %s\n",
|
System.out.printf("Metadata: %s.%s.%s(%s) = %s\n",
|
||||||
metadatum.schema,
|
metadatum.schema,
|
||||||
metadatum.element,
|
metadatum.element,
|
||||||
@@ -161,14 +161,14 @@ public class DOIIdentifierProviderTest
|
|||||||
String sql = "DELETE FROM Doi WHERE resource_type_id = ? AND resource_id = ?";
|
String sql = "DELETE FROM Doi WHERE resource_type_id = ? AND resource_id = ?";
|
||||||
DatabaseManager.updateQuery(context, sql, item.getType(), item.getID());
|
DatabaseManager.updateQuery(context, sql, item.getType(), item.getID());
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(
|
Metadatum[] metadata = item.getMetadata(
|
||||||
DOIIdentifierProvider.MD_SCHEMA,
|
DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
List<String> remainder = new ArrayList<String>();
|
List<String> remainder = new ArrayList<String>();
|
||||||
|
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (!id.value.startsWith(DOI.RESOLVER))
|
if (!id.value.startsWith(DOI.RESOLVER))
|
||||||
{
|
{
|
||||||
@@ -310,12 +310,12 @@ public class DOIIdentifierProviderTest
|
|||||||
provider.saveDOIToObject(context, item, doi);
|
provider.saveDOIToObject(context, item, doi);
|
||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
Metadatum[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi)))
|
||||||
{
|
{
|
||||||
@@ -365,12 +365,12 @@ public class DOIIdentifierProviderTest
|
|||||||
provider.removeDOIFromObject(context, item, doi);
|
provider.removeDOIFromObject(context, item, doi);
|
||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
DCValue[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
Metadatum[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
boolean foundDOI = false;
|
boolean foundDOI = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi)))
|
||||||
{
|
{
|
||||||
@@ -461,13 +461,13 @@ public class DOIIdentifierProviderTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
// assure that the right one was removed
|
// assure that the right one was removed
|
||||||
DCValue[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
Metadatum[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
boolean foundDOI1 = false;
|
boolean foundDOI1 = false;
|
||||||
boolean foundDOI2 = false;
|
boolean foundDOI2 = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
||||||
{
|
{
|
||||||
@@ -494,7 +494,7 @@ public class DOIIdentifierProviderTest
|
|||||||
null);
|
null);
|
||||||
foundDOI1 = false;
|
foundDOI1 = false;
|
||||||
foundDOI2 = false;
|
foundDOI2 = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
||||||
{
|
{
|
||||||
@@ -643,13 +643,13 @@ public class DOIIdentifierProviderTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
// assure that the right one was removed
|
// assure that the right one was removed
|
||||||
DCValue[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
Metadatum[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
boolean foundDOI1 = false;
|
boolean foundDOI1 = false;
|
||||||
boolean foundDOI2 = false;
|
boolean foundDOI2 = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
||||||
{
|
{
|
||||||
@@ -690,13 +690,13 @@ public class DOIIdentifierProviderTest
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
// assure that the right one was removed
|
// assure that the right one was removed
|
||||||
DCValue[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
Metadatum[] metadata = item.getMetadata(DOIIdentifierProvider.MD_SCHEMA,
|
||||||
DOIIdentifierProvider.DOI_ELEMENT,
|
DOIIdentifierProvider.DOI_ELEMENT,
|
||||||
DOIIdentifierProvider.DOI_QUALIFIER,
|
DOIIdentifierProvider.DOI_QUALIFIER,
|
||||||
null);
|
null);
|
||||||
boolean foundDOI1 = false;
|
boolean foundDOI1 = false;
|
||||||
boolean foundDOI2 = false;
|
boolean foundDOI2 = false;
|
||||||
for (DCValue id : metadata)
|
for (Metadatum id : metadata)
|
||||||
{
|
{
|
||||||
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
if (id.value.equals(DOI.DOIToExternalForm(doi1)))
|
||||||
{
|
{
|
||||||
|
@@ -49,8 +49,8 @@ public class EZIDIdentifierProviderTest
|
|||||||
|
|
||||||
private static void dumpMetadata(Item eyetem)
|
private static void dumpMetadata(Item eyetem)
|
||||||
{
|
{
|
||||||
DCValue[] metadata = eyetem.getMetadata("dc", Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] metadata = eyetem.getMetadata("dc", Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue metadatum : metadata)
|
for (Metadatum metadatum : metadata)
|
||||||
System.out.printf("Metadata: %s.%s.%s(%s) = %s\n",
|
System.out.printf("Metadata: %s.%s.%s(%s) = %s\n",
|
||||||
metadatum.schema,
|
metadatum.schema,
|
||||||
metadatum.element,
|
metadatum.element,
|
||||||
|
@@ -16,7 +16,7 @@ import org.dspace.app.webui.util.UIUtil;
|
|||||||
import org.dspace.browse.*;
|
import org.dspace.browse.*;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Thumbnail;
|
import org.dspace.content.Thumbnail;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -457,7 +457,7 @@ public class BrowseListTag extends TagSupport
|
|||||||
String qualifier = tokens[2];
|
String qualifier = tokens[2];
|
||||||
|
|
||||||
// first get hold of the relevant metadata for this column
|
// first get hold of the relevant metadata for this column
|
||||||
DCValue[] metadataArray;
|
Metadatum[] metadataArray;
|
||||||
if (qualifier.equals("*"))
|
if (qualifier.equals("*"))
|
||||||
{
|
{
|
||||||
metadataArray = items[i].getMetadata(schema, element, Item.ANY, Item.ANY);
|
metadataArray = items[i].getMetadata(schema, element, Item.ANY, Item.ANY);
|
||||||
@@ -474,7 +474,7 @@ public class BrowseListTag extends TagSupport
|
|||||||
// save on a null check which would make the code untidy
|
// save on a null check which would make the code untidy
|
||||||
if (metadataArray == null)
|
if (metadataArray == null)
|
||||||
{
|
{
|
||||||
metadataArray = new DCValue[0];
|
metadataArray = new Metadatum[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// now prepare the content of the table division
|
// now prepare the content of the table division
|
||||||
|
@@ -20,7 +20,7 @@ import org.dspace.browse.CrossLinks;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Thumbnail;
|
import org.dspace.content.Thumbnail;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -422,7 +422,7 @@ public class ItemListTag extends TagSupport
|
|||||||
String qualifier = tokens[2];
|
String qualifier = tokens[2];
|
||||||
|
|
||||||
// first get hold of the relevant metadata for this column
|
// first get hold of the relevant metadata for this column
|
||||||
DCValue[] metadataArray;
|
Metadatum[] metadataArray;
|
||||||
if (qualifier.equals("*"))
|
if (qualifier.equals("*"))
|
||||||
{
|
{
|
||||||
metadataArray = items[i].getMetadata(schema, element, Item.ANY, Item.ANY);
|
metadataArray = items[i].getMetadata(schema, element, Item.ANY, Item.ANY);
|
||||||
@@ -439,7 +439,7 @@ public class ItemListTag extends TagSupport
|
|||||||
// save on a null check which would make the code untidy
|
// save on a null check which would make the code untidy
|
||||||
if (metadataArray == null)
|
if (metadataArray == null)
|
||||||
{
|
{
|
||||||
metadataArray = new DCValue[0];
|
metadataArray = new Metadatum[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// now prepare the content of the table division
|
// now prepare the content of the table division
|
||||||
|
@@ -11,7 +11,7 @@ import org.dspace.app.webui.util.UIUtil;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -98,7 +98,7 @@ public class ItemPreviewTag extends TagSupport
|
|||||||
String s = ConfigurationManager.getProperty("webui.preview.dc");
|
String s = ConfigurationManager.getProperty("webui.preview.dc");
|
||||||
if (s != null)
|
if (s != null)
|
||||||
{
|
{
|
||||||
DCValue[] dcValue;
|
Metadatum[] dcValue;
|
||||||
|
|
||||||
int i = s.indexOf('.');
|
int i = s.indexOf('.');
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.authority.MetadataAuthorityManager;
|
import org.dspace.content.authority.MetadataAuthorityManager;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -463,7 +463,7 @@ public class ItemTag extends TagSupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Still need to fix for metadata language?
|
// FIXME: Still need to fix for metadata language?
|
||||||
DCValue[] values = item.getMetadata(schema, element, qualifier, Item.ANY);
|
Metadatum[] values = item.getMetadata(schema, element, qualifier, Item.ANY);
|
||||||
|
|
||||||
if (values.length > 0)
|
if (values.length > 0)
|
||||||
{
|
{
|
||||||
@@ -647,7 +647,7 @@ public class ItemTag extends TagSupport
|
|||||||
Context context = UIUtil.obtainContext(request);
|
Context context = UIUtil.obtainContext(request);
|
||||||
|
|
||||||
// Get all the metadata
|
// Get all the metadata
|
||||||
DCValue[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
out.println("<div class=\"panel panel-info\"><div class=\"panel-heading\">"
|
out.println("<div class=\"panel panel-info\"><div class=\"panel-heading\">"
|
||||||
+ LocaleSupport.getLocalizedMessage(pageContext,
|
+ LocaleSupport.getLocalizedMessage(pageContext,
|
||||||
|
@@ -17,7 +17,7 @@ import org.dspace.app.webui.util.UIUtil;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.*;
|
import org.dspace.core.*;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
@@ -149,7 +149,7 @@ public class RequestItemServlet extends DSpaceServlet
|
|||||||
{
|
{
|
||||||
JSPManager.showInvalidIDError(request, response, handle, -1);
|
JSPManager.showInvalidIDError(request, response, handle, -1);
|
||||||
}
|
}
|
||||||
DCValue[] titleDC = item.getDC("title", null, Item.ANY);
|
Metadatum[] titleDC = item.getDC("title", null, Item.ANY);
|
||||||
if (titleDC != null || titleDC.length > 0)
|
if (titleDC != null || titleDC.length > 0)
|
||||||
{
|
{
|
||||||
title = titleDC[0].value;
|
title = titleDC[0].value;
|
||||||
@@ -290,7 +290,7 @@ public class RequestItemServlet extends DSpaceServlet
|
|||||||
String title = "";
|
String title = "";
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
DCValue[] titleDC = item.getDC("title", null, Item.ANY);
|
Metadatum[] titleDC = item.getDC("title", null, Item.ANY);
|
||||||
if (titleDC != null || titleDC.length > 0)
|
if (titleDC != null || titleDC.length > 0)
|
||||||
title = titleDC[0].value;
|
title = titleDC[0].value;
|
||||||
}
|
}
|
||||||
@@ -327,7 +327,7 @@ public class RequestItemServlet extends DSpaceServlet
|
|||||||
if (requestItem != null && (yes || no)) {
|
if (requestItem != null && (yes || no)) {
|
||||||
Item item = Item.find(context, requestItem.getIntColumn("item_id"));
|
Item item = Item.find(context, requestItem.getIntColumn("item_id"));
|
||||||
|
|
||||||
DCValue[] titleDC = item.getDC("title", null, Item.ANY);
|
Metadatum[] titleDC = item.getDC("title", null, Item.ANY);
|
||||||
String title = titleDC.length > 0 ? titleDC[0].value : I18nUtil
|
String title = titleDC.length > 0 ? titleDC[0].value : I18nUtil
|
||||||
.getMessage("jsp.general.untitled", context);
|
.getMessage("jsp.general.untitled", context);
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ import org.dspace.eperson.EPerson;
|
|||||||
import org.dspace.handle.HandleManager;
|
import org.dspace.handle.HandleManager;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +86,7 @@ public class SuggestServlet extends DSpaceServlet
|
|||||||
Item item = (Item) HandleManager.resolveToObject(context, handle);
|
Item item = (Item) HandleManager.resolveToObject(context, handle);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
DCValue[] titleDC = item.getDC("title", null, Item.ANY);
|
Metadatum[] titleDC = item.getDC("title", null, Item.ANY);
|
||||||
if (titleDC != null && titleDC.length > 0)
|
if (titleDC != null && titleDC.length > 0)
|
||||||
{
|
{
|
||||||
title = titleDC[0].value;
|
title = titleDC[0].value;
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.webui.util;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class MetadataStyleSelection extends AKeyBasedStyleSelection
|
|||||||
public String getStyleForItem(Item item) throws SQLException
|
public String getStyleForItem(Item item) throws SQLException
|
||||||
{
|
{
|
||||||
String metadata = ConfigurationManager.getProperty("webui.itemdisplay.metadata-style");
|
String metadata = ConfigurationManager.getProperty("webui.itemdisplay.metadata-style");
|
||||||
DCValue[] value = item.getMetadataByMetadataString(metadata);
|
Metadatum[] value = item.getMetadataByMetadataString(metadata);
|
||||||
String styleName = "default";
|
String styleName = "default";
|
||||||
if (value.length > 0)
|
if (value.length > 0)
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.InProgressSubmission;
|
import org.dspace.content.InProgressSubmission;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
@@ -330,7 +330,7 @@ public class VersionUtil
|
|||||||
String[] result = null;
|
String[] result = null;
|
||||||
String itemHandle = version.getItem().getHandle();
|
String itemHandle = version.getItem().getHandle();
|
||||||
|
|
||||||
DCValue[] identifiers = version.getItem().getMetadata(
|
Metadatum[] identifiers = version.getItem().getMetadata(
|
||||||
MetadataSchema.DC_SCHEMA, "identifier", null, Item.ANY);
|
MetadataSchema.DC_SCHEMA, "identifier", null, Item.ANY);
|
||||||
String itemIdentifier = null;
|
String itemIdentifier = null;
|
||||||
if (identifiers != null && identifiers.length > 0)
|
if (identifiers != null && identifiers.length > 0)
|
||||||
|
@@ -25,7 +25,7 @@ import org.dspace.authorize.AuthorizeManager;
|
|||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.crosswalk.CrosswalkException;
|
import org.dspace.content.crosswalk.CrosswalkException;
|
||||||
import org.dspace.content.packager.PackageDisseminator;
|
import org.dspace.content.packager.PackageDisseminator;
|
||||||
@@ -303,7 +303,7 @@ class DAVItem extends DAVDSpaceObject
|
|||||||
else if (elementsEqualIsh(property, displaynameProperty))
|
else if (elementsEqualIsh(property, displaynameProperty))
|
||||||
{
|
{
|
||||||
// displayname - title or handle.
|
// displayname - title or handle.
|
||||||
DCValue titleDc[] = this.item.getDC("title", Item.ANY, Item.ANY);
|
Metadatum titleDc[] = this.item.getDC("title", Item.ANY, Item.ANY);
|
||||||
value = titleDc.length > 0 ? titleDc[0].value : this.item.getHandle();
|
value = titleDc.length > 0 ? titleDc[0].value : this.item.getHandle();
|
||||||
}
|
}
|
||||||
else if (elementsEqualIsh(property, handleProperty))
|
else if (elementsEqualIsh(property, handleProperty))
|
||||||
|
@@ -253,9 +253,9 @@ public class XOAI {
|
|||||||
doc.addField("item.communities",
|
doc.addField("item.communities",
|
||||||
"com_" + com.getHandle().replace("/", "_"));
|
"com_" + com.getHandle().replace("/", "_"));
|
||||||
|
|
||||||
DCValue[] allData = item.getMetadata(Item.ANY, Item.ANY, Item.ANY,
|
Metadatum[] allData = item.getMetadata(Item.ANY, Item.ANY, Item.ANY,
|
||||||
Item.ANY);
|
Item.ANY);
|
||||||
for (DCValue dc : allData) {
|
for (Metadatum dc : allData) {
|
||||||
String key = "metadata." + dc.schema + "." + dc.element;
|
String key = "metadata." + dc.schema + "." + dc.element;
|
||||||
if (dc.qualifier != null) {
|
if (dc.qualifier != null) {
|
||||||
key += "." + dc.qualifier;
|
key += "." + dc.qualifier;
|
||||||
|
@@ -15,7 +15,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.authority.Choices;
|
import org.dspace.content.authority.Choices;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -69,8 +69,8 @@ public class ItemUtils
|
|||||||
|
|
||||||
// read all metadata into Metadata Object
|
// read all metadata into Metadata Object
|
||||||
metadata = new Metadata();
|
metadata = new Metadata();
|
||||||
DCValue[] vals = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] vals = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
for (DCValue val : vals)
|
for (Metadatum val : vals)
|
||||||
{
|
{
|
||||||
Element valueElem = null;
|
Element valueElem = null;
|
||||||
Element schema = getElement(metadata.getElement(), val.schema);
|
Element schema = getElement(metadata.getElement(), val.schema);
|
||||||
|
@@ -37,8 +37,8 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.BitstreamFormat;
|
import org.dspace.content.BitstreamFormat;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.eperson.Group;
|
import org.dspace.eperson.Group;
|
||||||
import org.dspace.rest.common.Bitstream;
|
import org.dspace.rest.common.Bitstream;
|
||||||
import org.dspace.rest.common.Item;
|
import org.dspace.rest.common.Item;
|
||||||
@@ -771,10 +771,10 @@ public class ItemsResource extends Resource
|
|||||||
|
|
||||||
log.trace("Deleting metadata.");
|
log.trace("Deleting metadata.");
|
||||||
// TODO Rewrite without deprecated object. Leave there only generated metadata.
|
// TODO Rewrite without deprecated object. Leave there only generated metadata.
|
||||||
DCValue[] value = dspaceItem.getMetadata("dc", "date", "accessioned", org.dspace.content.Item.ANY);
|
Metadatum[] value = dspaceItem.getMetadata("dc", "date", "accessioned", org.dspace.content.Item.ANY);
|
||||||
DCValue[] value2 = dspaceItem.getMetadata("dc", "date", "available", org.dspace.content.Item.ANY);
|
Metadatum[] value2 = dspaceItem.getMetadata("dc", "date", "available", org.dspace.content.Item.ANY);
|
||||||
DCValue[] value3 = dspaceItem.getMetadata("dc", "identifier", "uri", org.dspace.content.Item.ANY);
|
Metadatum[] value3 = dspaceItem.getMetadata("dc", "identifier", "uri", org.dspace.content.Item.ANY);
|
||||||
DCValue[] value4 = dspaceItem.getMetadata("dc", "description", "provenance", org.dspace.content.Item.ANY);
|
Metadatum[] value4 = dspaceItem.getMetadata("dc", "description", "provenance", org.dspace.content.Item.ANY);
|
||||||
|
|
||||||
dspaceItem.clearMetadata(org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY,
|
dspaceItem.clearMetadata(org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY,
|
||||||
org.dspace.content.Item.ANY);
|
org.dspace.content.Item.ANY);
|
||||||
|
@@ -11,7 +11,7 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.app.util.MetadataExposure;
|
import org.dspace.app.util.MetadataExposure;
|
||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
import javax.ws.rs.WebApplicationException;
|
import javax.ws.rs.WebApplicationException;
|
||||||
@@ -60,10 +60,11 @@ public class Item extends DSpaceObject {
|
|||||||
|
|
||||||
if(expandFields.contains("metadata") || expandFields.contains("all")) {
|
if(expandFields.contains("metadata") || expandFields.contains("all")) {
|
||||||
metadata = new ArrayList<MetadataEntry>();
|
metadata = new ArrayList<MetadataEntry>();
|
||||||
DCValue[] dcvs = item.getMetadata(org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY);
|
Metadatum[] dcvs = item.getMetadata(org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY, org.dspace.content.Item.ANY);
|
||||||
for (DCValue dcv : dcvs) {
|
for (Metadatum dcv : dcvs) {
|
||||||
if (!MetadataExposure.isHidden(context, dcv.schema, dcv.element, dcv.qualifier))
|
if (!MetadataExposure.isHidden(context, dcv.schema, dcv.element, dcv.qualifier)) {
|
||||||
metadata.add(new MetadataEntry(dcv.getField(), dcv.value, dcv.language));
|
metadata.add(new MetadataEntry(dcv.getField(), dcv.value, dcv.language));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.addExpand("metadata");
|
this.addExpand("metadata");
|
||||||
|
@@ -54,7 +54,7 @@ public class ItemCollectionGenerator extends ATOMCollectionGenerator
|
|||||||
|
|
||||||
// the item title is the sword collection title, or "untitled" otherwise
|
// the item title is the sword collection title, or "untitled" otherwise
|
||||||
String title = "Untitled";
|
String title = "Untitled";
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.title");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.title");
|
||||||
if (dcv.length > 0)
|
if (dcv.length > 0)
|
||||||
{
|
{
|
||||||
title = dcv[0].value;
|
title = dcv[0].value;
|
||||||
@@ -67,7 +67,7 @@ public class ItemCollectionGenerator extends ATOMCollectionGenerator
|
|||||||
|
|
||||||
// abstract is the short description of the item, if it exists
|
// abstract is the short description of the item, if it exists
|
||||||
String dcAbstract = "";
|
String dcAbstract = "";
|
||||||
DCValue[] dcva = item.getMetadataByMetadataString("dc.description.abstract");
|
Metadatum[] dcva = item.getMetadataByMetadataString("dc.description.abstract");
|
||||||
if (dcva.length > 0)
|
if (dcva.length > 0)
|
||||||
{
|
{
|
||||||
dcAbstract = dcva[0].value;
|
dcAbstract = dcva[0].value;
|
||||||
|
@@ -11,7 +11,7 @@ import org.dspace.content.Bitstream;
|
|||||||
import org.dspace.content.BitstreamFormat;
|
import org.dspace.content.BitstreamFormat;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.handle.HandleManager;
|
import org.dspace.handle.HandleManager;
|
||||||
import org.purl.sword.atom.Content;
|
import org.purl.sword.atom.Content;
|
||||||
@@ -47,7 +47,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
*/
|
*/
|
||||||
protected void addCategories()
|
protected void addCategories()
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.subject.*");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.subject.*");
|
||||||
if (dcv != null)
|
if (dcv != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dcv.length; i++)
|
for (int i = 0; i < dcv.length; i++)
|
||||||
@@ -233,7 +233,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
*/
|
*/
|
||||||
protected void addPublishDate()
|
protected void addPublishDate()
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.date.issued");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.date.issued");
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
entry.setPublished(dcv[0].value);
|
entry.setPublished(dcv[0].value);
|
||||||
@@ -298,7 +298,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
*/
|
*/
|
||||||
protected void addSummary()
|
protected void addSummary()
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.description.abstract");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.description.abstract");
|
||||||
if (dcv != null)
|
if (dcv != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dcv.length; i++)
|
for (int i = 0; i < dcv.length; i++)
|
||||||
@@ -317,7 +317,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
*/
|
*/
|
||||||
protected void addTitle()
|
protected void addTitle()
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.title");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.title");
|
||||||
if (dcv != null)
|
if (dcv != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dcv.length; i++)
|
for (int i = 0; i < dcv.length; i++)
|
||||||
@@ -337,7 +337,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
protected void addLastUpdatedDate()
|
protected void addLastUpdatedDate()
|
||||||
{
|
{
|
||||||
String config = ConfigurationManager.getProperty("sword-server", "updated.field");
|
String config = ConfigurationManager.getProperty("sword-server", "updated.field");
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString(config);
|
Metadatum[] dcv = item.getMetadataByMetadataString(config);
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
DCDate dcd = new DCDate(dcv[0].value);
|
DCDate dcd = new DCDate(dcv[0].value);
|
||||||
|
@@ -15,7 +15,7 @@ import org.apache.log4j.Logger;
|
|||||||
|
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.packager.PackageIngester;
|
import org.dspace.content.packager.PackageIngester;
|
||||||
@@ -179,7 +179,7 @@ public class SWORDMETSIngester implements SWORDIngester
|
|||||||
throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.updated.field");
|
throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.updated.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.configToDC(field, null);
|
Metadatum dc = this.configToDC(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
DCDate date = new DCDate(new Date());
|
DCDate date = new DCDate(new Date());
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
||||||
@@ -212,7 +212,7 @@ public class SWORDMETSIngester implements SWORDIngester
|
|||||||
throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.slug.field");
|
throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.slug.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.configToDC(field, null);
|
Metadatum dc = this.configToDC(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
||||||
|
|
||||||
@@ -221,19 +221,19 @@ public class SWORDMETSIngester implements SWORDIngester
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* utility method to turn given metadata fields of the form
|
* utility method to turn given metadata fields of the form
|
||||||
* schema.element.qualifier into DCValue objects which can be
|
schema.element.qualifier into Metadatum objects which can be
|
||||||
* used to access metadata in items.
|
used to access metadata in items.
|
||||||
*
|
*
|
||||||
* The def parameter should be null, * or "" depending on how
|
* The def parameter should be null, * or "" depending on how
|
||||||
* you intend to use the DCValue object
|
you intend to use the Metadatum object
|
||||||
*
|
*
|
||||||
* @param config
|
* @param config
|
||||||
* @param def
|
* @param def
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private DCValue configToDC(String config, String def)
|
private Metadatum configToDC(String config, String def)
|
||||||
{
|
{
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = def;
|
dcv.schema = def;
|
||||||
dcv.element= def;
|
dcv.element= def;
|
||||||
dcv.qualifier = def;
|
dcv.qualifier = def;
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
package org.dspace.sword2;
|
package org.dspace.sword2;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
|
|
||||||
@@ -61,9 +61,9 @@ public class AbstractSimpleDC
|
|||||||
this.loadMetadataMaps();
|
this.loadMetadataMaps();
|
||||||
|
|
||||||
SimpleDCMetadata md = new SimpleDCMetadata();
|
SimpleDCMetadata md = new SimpleDCMetadata();
|
||||||
DCValue[] all = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] all = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
|
|
||||||
for (DCValue dcv : all)
|
for (Metadatum dcv : all)
|
||||||
{
|
{
|
||||||
String valueMatch = dcv.schema + "." + dcv.element;
|
String valueMatch = dcv.schema + "." + dcv.element;
|
||||||
if (dcv.qualifier != null)
|
if (dcv.qualifier != null)
|
||||||
|
@@ -13,7 +13,7 @@ import org.dspace.content.BitstreamFormat;
|
|||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -104,7 +104,7 @@ public abstract class AbstractSwordContentIngester implements SwordContentIngest
|
|||||||
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
|
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.configToDC(field, null);
|
Metadatum dc = this.configToDC(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
DCDate date = new DCDate(new Date());
|
DCDate date = new DCDate(new Date());
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
||||||
@@ -137,7 +137,7 @@ public abstract class AbstractSwordContentIngester implements SwordContentIngest
|
|||||||
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");
|
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.configToDC(field, null);
|
Metadatum dc = this.configToDC(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
||||||
|
|
||||||
@@ -146,18 +146,18 @@ public abstract class AbstractSwordContentIngester implements SwordContentIngest
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method to turn given metadata fields of the form
|
* Utility method to turn given metadata fields of the form
|
||||||
* schema.element.qualifier into DCValue objects which can be
|
schema.element.qualifier into Metadatum objects which can be
|
||||||
* used to access metadata in items.
|
used to access metadata in items.
|
||||||
*
|
*
|
||||||
* The def parameter should be null, * or "" depending on how
|
* The def parameter should be null, * or "" depending on how
|
||||||
* you intend to use the DCValue object.
|
you intend to use the Metadatum object.
|
||||||
*
|
*
|
||||||
* @param config
|
* @param config
|
||||||
* @param def
|
* @param def
|
||||||
*/
|
*/
|
||||||
protected DCValue configToDC(String config, String def)
|
protected Metadatum configToDC(String config, String def)
|
||||||
{
|
{
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
dcv.schema = def;
|
dcv.schema = def;
|
||||||
dcv.element= def;
|
dcv.element= def;
|
||||||
dcv.qualifier = def;
|
dcv.qualifier = def;
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.sword2;
|
package org.dspace.sword2;
|
||||||
|
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -43,14 +43,14 @@ public class AtomStatementDisseminator extends GenericStatementDisseminator impl
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] dcvs = item.getMetadataByMetadataString(field);
|
Metadatum[] dcvs = item.getMetadataByMetadataString(field);
|
||||||
if (dcvs == null || dcvs.length == 0)
|
if (dcvs == null || dcvs.length == 0)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder md = new StringBuilder();
|
StringBuilder md = new StringBuilder();
|
||||||
for (DCValue dcv : dcvs)
|
for (Metadatum dcv : dcvs)
|
||||||
{
|
{
|
||||||
if (md.length() > 0)
|
if (md.length() > 0)
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@ import org.apache.abdera.i18n.iri.IRI;
|
|||||||
import org.apache.abdera.model.Entry;
|
import org.apache.abdera.model.Entry;
|
||||||
import org.apache.abdera.model.Feed;
|
import org.apache.abdera.model.Feed;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
import org.dspace.content.WorkspaceItem;
|
import org.dspace.content.WorkspaceItem;
|
||||||
@@ -180,14 +180,14 @@ public class CollectionListManagerDSpace extends DSpaceSwordAPI implements Colle
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue[] dcvs = item.getMetadataByMetadataString(field);
|
Metadatum[] dcvs = item.getMetadataByMetadataString(field);
|
||||||
if (dcvs == null)
|
if (dcvs == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder md = new StringBuilder();
|
StringBuilder md = new StringBuilder();
|
||||||
for (DCValue dcv : dcvs)
|
for (Metadatum dcv : dcvs)
|
||||||
{
|
{
|
||||||
if (md.length() > 0)
|
if (md.length() > 0)
|
||||||
{
|
{
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.sword2;
|
|||||||
import org.apache.abdera.i18n.iri.IRI;
|
import org.apache.abdera.i18n.iri.IRI;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -222,7 +222,7 @@ public class ReceiptGenerator
|
|||||||
*/
|
*/
|
||||||
protected void addCategories(DepositResult result, DepositReceipt receipt)
|
protected void addCategories(DepositResult result, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
DCValue[] dcv = result.getItem().getMetadataByMetadataString("dc.subject.*");
|
Metadatum[] dcv = result.getItem().getMetadataByMetadataString("dc.subject.*");
|
||||||
if (dcv != null)
|
if (dcv != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dcv.length; i++)
|
for (int i = 0; i < dcv.length; i++)
|
||||||
@@ -234,7 +234,7 @@ public class ReceiptGenerator
|
|||||||
|
|
||||||
protected void addCategories(Item item, DepositReceipt receipt)
|
protected void addCategories(Item item, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.subject.*");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.subject.*");
|
||||||
if (dcv != null)
|
if (dcv != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dcv.length; i++)
|
for (int i = 0; i < dcv.length; i++)
|
||||||
@@ -250,7 +250,7 @@ public class ReceiptGenerator
|
|||||||
*/
|
*/
|
||||||
protected void addPublishDate(DepositResult result, DepositReceipt receipt)
|
protected void addPublishDate(DepositResult result, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
DCValue[] dcv = result.getItem().getMetadataByMetadataString("dc.date.issued");
|
Metadatum[] dcv = result.getItem().getMetadataByMetadataString("dc.date.issued");
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -269,7 +269,7 @@ public class ReceiptGenerator
|
|||||||
|
|
||||||
protected void addPublishDate(Item item, DepositReceipt receipt)
|
protected void addPublishDate(Item item, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString("dc.date.issued");
|
Metadatum[] dcv = item.getMetadataByMetadataString("dc.date.issued");
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -293,7 +293,7 @@ public class ReceiptGenerator
|
|||||||
protected void addLastUpdatedDate(DepositResult result, DepositReceipt receipt)
|
protected void addLastUpdatedDate(DepositResult result, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
|
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
|
||||||
DCValue[] dcv = result.getItem().getMetadataByMetadataString(config);
|
Metadatum[] dcv = result.getItem().getMetadataByMetadataString(config);
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -313,7 +313,7 @@ public class ReceiptGenerator
|
|||||||
protected void addLastUpdatedDate(Item item, DepositReceipt receipt)
|
protected void addLastUpdatedDate(Item item, DepositReceipt receipt)
|
||||||
{
|
{
|
||||||
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
|
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
|
||||||
DCValue[] dcv = item.getMetadataByMetadataString(config);
|
Metadatum[] dcv = item.getMetadataByMetadataString(config);
|
||||||
if (dcv != null && dcv.length == 1)
|
if (dcv != null && dcv.length == 1)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@@ -10,7 +10,7 @@ package org.dspace.sword2;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCDate;
|
import org.dspace.content.DCDate;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.WorkspaceItem;
|
import org.dspace.content.WorkspaceItem;
|
||||||
@@ -115,12 +115,12 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
String[] parts = raw.split(",");
|
String[] parts = raw.split(",");
|
||||||
for (String part : parts)
|
for (String part : parts)
|
||||||
{
|
{
|
||||||
DCValue dcv = this.makeDCValue(part.trim(), null);
|
Metadatum dcv = this.makeDCValue(part.trim(), null);
|
||||||
item.clearMetadata(dcv.schema, dcv.element, dcv.qualifier, Item.ANY);
|
item.clearMetadata(dcv.schema, dcv.element, dcv.qualifier, Item.ANY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUniqueMetadata(DCValue dcv, Item item)
|
private void addUniqueMetadata(Metadatum dcv, Item item)
|
||||||
{
|
{
|
||||||
String qual = dcv.qualifier;
|
String qual = dcv.qualifier;
|
||||||
if (dcv.qualifier == null)
|
if (dcv.qualifier == null)
|
||||||
@@ -133,8 +133,8 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
{
|
{
|
||||||
lang = Item.ANY;
|
lang = Item.ANY;
|
||||||
}
|
}
|
||||||
DCValue[] existing = item.getMetadata(dcv.schema, dcv.element, qual, lang);
|
Metadatum[] existing = item.getMetadata(dcv.schema, dcv.element, qual, lang);
|
||||||
for (DCValue dcValue : existing)
|
for (Metadatum dcValue : existing)
|
||||||
{
|
{
|
||||||
// FIXME: probably we want to be slightly more careful about qualifiers and languages
|
// FIXME: probably we want to be slightly more careful about qualifiers and languages
|
||||||
//
|
//
|
||||||
@@ -163,7 +163,7 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
String titleField = this.dcMap.get("title");
|
String titleField = this.dcMap.get("title");
|
||||||
if (titleField != null)
|
if (titleField != null)
|
||||||
{
|
{
|
||||||
DCValue dcv = this.makeDCValue(titleField, title);
|
Metadatum dcv = this.makeDCValue(titleField, title);
|
||||||
this.addUniqueMetadata(dcv, item);
|
this.addUniqueMetadata(dcv, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
String abstractField = this.dcMap.get("abstract");
|
String abstractField = this.dcMap.get("abstract");
|
||||||
if (abstractField != null)
|
if (abstractField != null)
|
||||||
{
|
{
|
||||||
DCValue dcv = this.makeDCValue(abstractField, summary);
|
Metadatum dcv = this.makeDCValue(abstractField, summary);
|
||||||
this.addUniqueMetadata(dcv, item);
|
this.addUniqueMetadata(dcv, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,7 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now add all the metadata terms
|
// now add all the metadata terms
|
||||||
DCValue dcv = this.makeDCValue(dsTerm, null);
|
Metadatum dcv = this.makeDCValue(dsTerm, null);
|
||||||
for (String value : dc.get(term))
|
for (String value : dc.get(term))
|
||||||
{
|
{
|
||||||
dcv.value = value;
|
dcv.value = value;
|
||||||
@@ -262,10 +262,10 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DCValue makeDCValue(String field, String value)
|
public Metadatum makeDCValue(String field, String value)
|
||||||
throws DSpaceSwordException
|
throws DSpaceSwordException
|
||||||
{
|
{
|
||||||
DCValue dcv = new DCValue();
|
Metadatum dcv = new Metadatum();
|
||||||
String[] bits = field.split("\\.");
|
String[] bits = field.split("\\.");
|
||||||
if (bits.length < 2 || bits.length > 3)
|
if (bits.length < 2 || bits.length > 3)
|
||||||
{
|
{
|
||||||
@@ -298,7 +298,7 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
|
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.makeDCValue(field, null);
|
Metadatum dc = this.makeDCValue(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
DCDate date = new DCDate(new Date());
|
DCDate date = new DCDate(new Date());
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());
|
||||||
@@ -331,7 +331,7 @@ public class SimpleDCEntryIngester extends AbstractSimpleDC implements SwordEntr
|
|||||||
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");
|
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");
|
||||||
}
|
}
|
||||||
|
|
||||||
DCValue dc = this.makeDCValue(field, null);
|
Metadatum dc = this.makeDCValue(field, null);
|
||||||
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
|
||||||
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ import org.dspace.app.xmlui.wing.element.List;
|
|||||||
import org.dspace.app.xmlui.wing.element.PageMeta;
|
import org.dspace.app.xmlui.wing.element.PageMeta;
|
||||||
import org.dspace.app.xmlui.wing.element.Row;
|
import org.dspace.app.xmlui.wing.element.Row;
|
||||||
import org.dspace.app.xmlui.wing.element.Table;
|
import org.dspace.app.xmlui.wing.element.Table;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class ConfirmItemForm extends AbstractDSpaceTransformer {
|
|||||||
// Get our parameters and state
|
// Get our parameters and state
|
||||||
int itemID = parameters.getParameterAsInteger("itemID",-1);
|
int itemID = parameters.getParameterAsInteger("itemID",-1);
|
||||||
Item item = Item.find(context, itemID);
|
Item item = Item.find(context, itemID);
|
||||||
final DCValue[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
final Metadatum[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
Arrays.sort(values, new DCValueComparator());
|
Arrays.sort(values, new DCValueComparator());
|
||||||
|
|
||||||
String confirm = parameters.getParameter("confirm",null);
|
String confirm = parameters.getParameter("confirm",null);
|
||||||
@@ -109,7 +109,7 @@ public class ConfirmItemForm extends AbstractDSpaceTransformer {
|
|||||||
header.addCell().addContent(T_column1);
|
header.addCell().addContent(T_column1);
|
||||||
header.addCell().addContent(T_column2);
|
header.addCell().addContent(T_column2);
|
||||||
header.addCell().addContent(T_column3);
|
header.addCell().addContent(T_column3);
|
||||||
for(final DCValue value:values){
|
for(final Metadatum value:values){
|
||||||
final String dcValue = value.schema + ". " + value.element + (value.qualifier==null?"":(". " + value.qualifier));
|
final String dcValue = value.schema + ". " + value.element + (value.qualifier==null?"":(". " + value.qualifier));
|
||||||
final Row row = table.addRow();
|
final Row row = table.addRow();
|
||||||
row.addCell().addContent(dcValue);
|
row.addCell().addContent(dcValue);
|
||||||
@@ -153,8 +153,8 @@ public class ConfirmItemForm extends AbstractDSpaceTransformer {
|
|||||||
*/
|
*/
|
||||||
static class DCValueComparator implements Comparator, Serializable {
|
static class DCValueComparator implements Comparator, Serializable {
|
||||||
public int compare(Object arg0, Object arg1) {
|
public int compare(Object arg0, Object arg1) {
|
||||||
final DCValue o1 = (DCValue)arg0;
|
final Metadatum o1 = (Metadatum)arg0;
|
||||||
final DCValue o2 = (DCValue)arg1;
|
final Metadatum o2 = (Metadatum)arg1;
|
||||||
final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
|
final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
|
||||||
final String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
|
final String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
|
||||||
return s1.compareTo(s2);
|
return s1.compareTo(s2);
|
||||||
|
@@ -34,7 +34,7 @@ import org.dspace.app.xmlui.wing.element.Text;
|
|||||||
import org.dspace.app.xmlui.wing.element.TextArea;
|
import org.dspace.app.xmlui.wing.element.TextArea;
|
||||||
import org.dspace.app.xmlui.wing.element.Value;
|
import org.dspace.app.xmlui.wing.element.Value;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
import org.dspace.content.MetadataSchema;
|
import org.dspace.content.MetadataSchema;
|
||||||
@@ -114,7 +114,7 @@ public class EditItemMetadataForm extends AbstractDSpaceTransformer {
|
|||||||
// Get our parameters and state
|
// Get our parameters and state
|
||||||
int itemID = parameters.getParameterAsInteger("itemID",-1);
|
int itemID = parameters.getParameterAsInteger("itemID",-1);
|
||||||
Item item = Item.find(context, itemID);
|
Item item = Item.find(context, itemID);
|
||||||
DCValue[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
Metadatum[] values = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
|
||||||
Arrays.sort(values, new DCValueComparator());
|
Arrays.sort(values, new DCValueComparator());
|
||||||
String baseURL = contextPath+"/admin/item?administrative-continue="+knot.getId();
|
String baseURL = contextPath+"/admin/item?administrative-continue="+knot.getId();
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ public class EditItemMetadataForm extends AbstractDSpaceTransformer {
|
|||||||
header.addCell().addContent(T_column4);
|
header.addCell().addContent(T_column4);
|
||||||
|
|
||||||
ChoiceAuthorityManager cmgr = ChoiceAuthorityManager.getManager();
|
ChoiceAuthorityManager cmgr = ChoiceAuthorityManager.getManager();
|
||||||
for(DCValue value : values)
|
for(Metadatum value : values)
|
||||||
{
|
{
|
||||||
String name = value.schema + "_" + value.element;
|
String name = value.schema + "_" + value.element;
|
||||||
if (value.qualifier != null)
|
if (value.qualifier != null)
|
||||||
@@ -312,8 +312,8 @@ public class EditItemMetadataForm extends AbstractDSpaceTransformer {
|
|||||||
*/
|
*/
|
||||||
static class DCValueComparator implements Comparator, Serializable {
|
static class DCValueComparator implements Comparator, Serializable {
|
||||||
public int compare(Object arg0, Object arg1) {
|
public int compare(Object arg0, Object arg1) {
|
||||||
final DCValue o1 = (DCValue)arg0;
|
final Metadatum o1 = (Metadatum)arg0;
|
||||||
final DCValue o2 = (DCValue)arg1;
|
final Metadatum o2 = (Metadatum)arg1;
|
||||||
final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
|
final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
|
||||||
final String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
|
final String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
|
||||||
return s1.compareTo(s2);
|
return s1.compareTo(s2);
|
||||||
|
@@ -24,7 +24,7 @@ import org.dspace.app.xmlui.wing.element.Row;
|
|||||||
import org.dspace.app.xmlui.wing.element.Table;
|
import org.dspace.app.xmlui.wing.element.Table;
|
||||||
import org.dspace.authorize.AuthorizeManager;
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.ItemIterator;
|
import org.dspace.content.ItemIterator;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
@@ -107,14 +107,14 @@ public class BrowseItemForm extends AbstractDSpaceTransformer {
|
|||||||
Collection owningCollection = item.getOwningCollection();
|
Collection owningCollection = item.getOwningCollection();
|
||||||
String owning = owningCollection.getMetadata("name");
|
String owning = owningCollection.getMetadata("name");
|
||||||
String author = "unknown";
|
String author = "unknown";
|
||||||
DCValue[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
|
Metadatum[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
|
||||||
if (dcAuthors != null && dcAuthors.length >= 1)
|
if (dcAuthors != null && dcAuthors.length >= 1)
|
||||||
{
|
{
|
||||||
author = dcAuthors[0].value;
|
author = dcAuthors[0].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = "untitled";
|
String title = "untitled";
|
||||||
DCValue[] dcTitles = item.getDC("title",null,Item.ANY);
|
Metadatum[] dcTitles = item.getDC("title",null,Item.ANY);
|
||||||
if (dcTitles != null && dcTitles.length >= 1)
|
if (dcTitles != null && dcTitles.length >= 1)
|
||||||
{
|
{
|
||||||
title = dcTitles[0].value;
|
title = dcTitles[0].value;
|
||||||
|
@@ -23,7 +23,7 @@ import org.dspace.app.xmlui.wing.element.Para;
|
|||||||
import org.dspace.app.xmlui.wing.element.Row;
|
import org.dspace.app.xmlui.wing.element.Row;
|
||||||
import org.dspace.app.xmlui.wing.element.Table;
|
import org.dspace.app.xmlui.wing.element.Table;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -108,13 +108,13 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
|||||||
if (owningCollection != null)
|
if (owningCollection != null)
|
||||||
owning = owningCollection.getMetadata("name");
|
owning = owningCollection.getMetadata("name");
|
||||||
String author = "unknown";
|
String author = "unknown";
|
||||||
DCValue[] dcCreators = item.getDC("creator",Item.ANY,Item.ANY);
|
Metadatum[] dcCreators = item.getDC("creator",Item.ANY,Item.ANY);
|
||||||
if (dcCreators != null && dcCreators.length >= 1)
|
if (dcCreators != null && dcCreators.length >= 1)
|
||||||
{
|
{
|
||||||
author = dcCreators[0].value;
|
author = dcCreators[0].value;
|
||||||
} else {
|
} else {
|
||||||
// Do a fallback look for contributors
|
// Do a fallback look for contributors
|
||||||
DCValue[] dcContributors = item.getDC("contributor",Item.ANY,Item.ANY);
|
Metadatum[] dcContributors = item.getDC("contributor",Item.ANY,Item.ANY);
|
||||||
if (dcContributors != null && dcContributors.length >= 1)
|
if (dcContributors != null && dcContributors.length >= 1)
|
||||||
{
|
{
|
||||||
author = dcContributors[0].value;
|
author = dcContributors[0].value;
|
||||||
@@ -122,7 +122,7 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String title = "untitled";
|
String title = "untitled";
|
||||||
DCValue[] dcTitles = item.getDC("title",null,Item.ANY);
|
Metadatum[] dcTitles = item.getDC("title",null,Item.ANY);
|
||||||
if (dcTitles != null && dcTitles.length >= 1)
|
if (dcTitles != null && dcTitles.length >= 1)
|
||||||
{
|
{
|
||||||
title = dcTitles[0].value;
|
title = dcTitles[0].value;
|
||||||
|
@@ -27,7 +27,7 @@ import org.dspace.app.xmlui.wing.element.Row;
|
|||||||
import org.dspace.app.xmlui.wing.element.Cell;
|
import org.dspace.app.xmlui.wing.element.Cell;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import org.dspace.app.bulkedit.BulkEditChange;
|
import org.dspace.app.bulkedit.BulkEditChange;
|
||||||
@@ -106,8 +106,8 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer {
|
|||||||
for (BulkEditChange change : changes)
|
for (BulkEditChange change : changes)
|
||||||
{
|
{
|
||||||
// Get the changes
|
// Get the changes
|
||||||
List<DCValue> adds = change.getAdds();
|
List<Metadatum> adds = change.getAdds();
|
||||||
List<DCValue> removes = change.getRemoves();
|
List<Metadatum> removes = change.getRemoves();
|
||||||
List<Collection> newCollections = change.getNewMappedCollections();
|
List<Collection> newCollections = change.getNewMappedCollections();
|
||||||
List<Collection> oldCollections = change.getOldMappedCollections();
|
List<Collection> oldCollections = change.getOldMappedCollections();
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show additions
|
// Show additions
|
||||||
for (DCValue dcv : adds)
|
for (Metadatum dcv : adds)
|
||||||
{
|
{
|
||||||
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
|
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
@@ -227,7 +227,7 @@ public class MetadataImportConfirm extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show removals
|
// Show removals
|
||||||
for (DCValue dcv : removes)
|
for (Metadatum dcv : removes)
|
||||||
{
|
{
|
||||||
Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
|
Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
|
@@ -27,7 +27,7 @@ import org.dspace.app.xmlui.wing.element.Row;
|
|||||||
import org.dspace.app.xmlui.wing.element.Cell;
|
import org.dspace.app.xmlui.wing.element.Cell;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import org.dspace.app.bulkedit.BulkEditChange;
|
import org.dspace.app.bulkedit.BulkEditChange;
|
||||||
@@ -103,8 +103,8 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer {
|
|||||||
for (BulkEditChange change : changes)
|
for (BulkEditChange change : changes)
|
||||||
{
|
{
|
||||||
// Get the changes
|
// Get the changes
|
||||||
List<DCValue> adds = change.getAdds();
|
List<Metadatum> adds = change.getAdds();
|
||||||
List<DCValue> removes = change.getRemoves();
|
List<Metadatum> removes = change.getRemoves();
|
||||||
List<Collection> newCollections = change.getNewMappedCollections();
|
List<Collection> newCollections = change.getNewMappedCollections();
|
||||||
List<Collection> oldCollections = change.getOldMappedCollections();
|
List<Collection> oldCollections = change.getOldMappedCollections();
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show additions
|
// Show additions
|
||||||
for (DCValue dcv : adds)
|
for (Metadatum dcv : adds)
|
||||||
{
|
{
|
||||||
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
|
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
@@ -224,7 +224,7 @@ public class MetadataImportUpload extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show removals
|
// Show removals
|
||||||
for (DCValue dcv : removes)
|
for (Metadatum dcv : removes)
|
||||||
{
|
{
|
||||||
Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
|
Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
|
||||||
String md = dcv.schema + "." + dcv.element;
|
String md = dcv.schema + "." + dcv.element;
|
||||||
|
@@ -31,7 +31,7 @@ import org.dspace.app.xmlui.wing.element.Radio;
|
|||||||
import org.dspace.app.xmlui.wing.element.Text;
|
import org.dspace.app.xmlui.wing.element.Text;
|
||||||
import org.dspace.app.xmlui.wing.element.TextArea;
|
import org.dspace.app.xmlui.wing.element.TextArea;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.DCValue;
|
import org.dspace.content.Metadatum;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user