org.dspace.app.sherpa.submit.MetadataValueISSNExtractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dspace-api Show documentation
Show all versions of dspace-api Show documentation
DSpace core data model and service APIs.
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.sherpa.submit;
import java.util.ArrayList;
import java.util.List;
import org.dspace.content.Item;
import org.dspace.content.MetadataValue;
import org.dspace.content.service.ItemService;
import org.dspace.core.Context;
import org.springframework.beans.factory.annotation.Autowired;
public class MetadataValueISSNExtractor implements ISSNItemExtractor {
@Autowired(required = true)
public ItemService itemService;
private List metadataList;
public void setMetadataList(List metadataList) {
this.metadataList = metadataList;
}
@Override
public List getISSNs(Context context, Item item) {
List values = new ArrayList();
for (String metadata : metadataList) {
List dcvalues = itemService.getMetadataByMetadataString(item, metadata);
for (MetadataValue dcvalue : dcvalues) {
values.add(dcvalue.getValue());
}
}
return values;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy