Correct issues in feed generation where description value is overwritten and only the first instance of a field is included in the description.

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@2938 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2008-05-18 18:25:28 +00:00
parent 58f35ee427
commit 60d3e6ce59

View File

@@ -481,6 +481,9 @@ public class DSpaceFeedGenerator extends AbstractGenerator
//loop through all the metadata fields to put in the description //loop through all the metadata fields to put in the description
StringTokenizer st = new StringTokenizer(descriptionFields, ","); StringTokenizer st = new StringTokenizer(descriptionFields, ",");
Description descrip = new Description();
descrip.setValue("");
while (st.hasMoreTokens()) while (st.hasMoreTokens())
{ {
String field = st.nextToken().trim(); String field = st.nextToken().trim();
@@ -493,29 +496,25 @@ public class DSpaceFeedGenerator extends AbstractGenerator
isDate = true; isDate = true;
} }
//print out this field, along with its value(s) //print out this field, along with its value(s)
//FIXME: replace with this line once dspace 1.4.1 is released:
//DCValue[] values = dspaceItem.getMetadata(field);
DCValue[] values = getMetadata(dspaceItem,field); DCValue[] values = getMetadata(dspaceItem,field);
if(values != null && values.length>0) for(DCValue value : values)
{ {
// We've found one, only take the first one if there // We've found one, only take the first one if there
// are more than one. // are more than one.
String fieldValue = values[0].value; String fieldValue = value.value;
if(isDate) if(isDate)
fieldValue = (new DCDate(fieldValue)).toString(); fieldValue = (new DCDate(fieldValue)).toString();
Description descrip = new Description(); descrip.setValue(descrip.getValue() + fieldValue + "\n\n");
descrip.setValue(fieldValue);
rssItem.setDescription(descrip);
// Once we've found one we can stop looking for more.
break;
} }
}//end while }//end while
rssItem.setDescription(descrip);
// set date field // set date field
String dcDate = null; String dcDate = null;
try try