if (isDate)
{
df = df.replaceAll("\\(date\\)", "");
}
Metadatum dcv[] = item.getMetadataByMetadataString(df);
if (dcv.length > 0)
{
String fieldLabel = labels.get(MSG_METADATA + df);
if (fieldLabel != null && fieldLabel.length()>0)
{
db.append(fieldLabel).append(": ");
}
boolean first = true;
for (Metadatum v : dcv)
{
if (first)
{
first = false;
}
else
{
db.append("; ");
}
db.append(isDate ? new DCDate(v.value).toString() : v.value);
}
db.append("\n");
}
}
if (db.length() > 0)
{
SyndContent desc = new SyndContentImpl();
desc.setType("text/plain");
desc.setValue(db.toString());
entry.setDescription(desc);
}
// This gets the authors into an ATOM feed
Metadatum authors[] = item.getMetadataByMetadataString(authorField);
if (authors.length > 0)
{
List<SyndPerson> creators = new ArrayList<SyndPerson>();
for (Metadatum author : authors)
{
SyndPerson sp = new SyndPersonImpl();
sp.setName(author.value);
creators.add(sp);
}
entry.setAuthors(creators);
}
// only add DC module if any DC fields are configured
if (dcCreatorField != null || dcDateField != null ||
dcDescriptionField != null)
{
DCModule dc = new DCModuleImpl();
if (dcCreatorField != null)
{
Metadatum dcAuthors[] = item.getMetadataByMetadataString(dcCreatorField);
if (dcAuthors.length > 0)
{
List<String> creators = new ArrayList<String>();
for (Metadatum author : dcAuthors)
{
creators.add(author.value);
}
dc.setCreators(creators);
}
}
if (dcDateField != null && !hasDate)
{
Metadatum v[] = item.getMetadataByMetadataString(dcDateField);
if (v.length > 0)
{
dc.setDate((new DCDate(v[0].value)).toDate());
}
}
if (dcDescriptionField != null)
{
Metadatum v[] = item.getMetadataByMetadataString(dcDescriptionField);
if (v.length > 0)
{
StringBuffer descs = new StringBuffer();
for (Metadatum d : v)
{