// Special Case: "(date)" in field name means render as date
boolean isDate = df.indexOf("(date)") > 0;
if (isDate)
df = df.replaceAll("\\(date\\)", "");
DCValue dcv[] = item.getMetadata(df);
if (dcv.length > 0)
{
String fieldLabel = labels.get(MSG_METADATA + df);
if (fieldLabel != null && fieldLabel.length()>0)
db.append(fieldLabel + ": ");
boolean first = true;
for (DCValue 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
DCValue authors[] = item.getMetadata(authorField);
if (authors.length > 0)
{
List<SyndPerson> creators = new ArrayList<SyndPerson>();
for (DCValue 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)
{
DCValue dcAuthors[] = item.getMetadata(dcCreatorField);
if (dcAuthors.length > 0)
{
List<String> creators = new ArrayList<String>();
for (DCValue author : dcAuthors)
creators.add(author.value);
dc.setCreators(creators);
}
}
if (dcDateField != null && !hasDate)
{
DCValue v[] = item.getMetadata(dcDateField);
if (v.length > 0)
dc.setDate((new DCDate(v[0].value)).toDate());
}
if (dcDescriptionField != null)
{
DCValue v[] = item.getMetadata(dcDescriptionField);
if (v.length > 0)
{
StringBuffer descs = new StringBuffer();
for (DCValue d : v)
{