}
public String createMetadata(Object nativeItem)
throws CannotDisseminateFormatException
{
Item item = ((HarvestedItemInfo) nativeItem).item;
StringBuffer metadata = new StringBuffer();
metadata
.append(
"<oai_dc:dc xmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\" ")
.append("xmlns:dc=\"http://purl.org/dc/elements/1.1/\" ")
.append(
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ")
.append(
"xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd\">");
for (String element : oaidcElement)
{
Set<String> itemMetadata = config.get(element);
if (itemMetadata != null && itemMetadata.size() > 0)
{
for (String mdString : itemMetadata)
{
String converterName = null;
IConverter converter = null;
Matcher converterMatcher = converterPattern.matcher(mdString);
if (converterMatcher.matches())
{
converterName = converterMatcher.group(1);
converter = (IConverter) PluginManager.getNamedPlugin(
IConverter.class, converterName);
if (converter == null)
{
log.warn(LogManager.getHeader(null,
"createMetadata",
"no converter plugin found with name "
+ converterName + " for metadata "
+ mdString));
}
}
DCValue[] dcValues;
if (converterName != null)
{
dcValues = item.getMetadata(mdString.replaceAll("\\("
+ converterName + "\\)", ""));
}
else
{
dcValues = item.getMetadata(mdString);
}
try
{
for (DCValue dcValue : dcValues)