All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dspace.app.sherpa.submit.MetadataValueISSNExtractor Maven / Gradle / Ivy

There is a newer version: 8.0
Show newest version
/**
 * 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