mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
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:
@@ -481,6 +481,9 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
//loop through all the metadata fields to put in the description
|
||||
StringTokenizer st = new StringTokenizer(descriptionFields, ",");
|
||||
|
||||
Description descrip = new Description();
|
||||
descrip.setValue("");
|
||||
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String field = st.nextToken().trim();
|
||||
@@ -493,29 +496,25 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
isDate = true;
|
||||
}
|
||||
|
||||
|
||||
//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);
|
||||
|
||||
if(values != null && values.length>0)
|
||||
{
|
||||
// We've found one, only take the first one if there
|
||||
// are more than one.
|
||||
String fieldValue = values[0].value;
|
||||
|
||||
for(DCValue value : values)
|
||||
{
|
||||
// We've found one, only take the first one if there
|
||||
// are more than one.
|
||||
String fieldValue = value.value;
|
||||
if(isDate)
|
||||
fieldValue = (new DCDate(fieldValue)).toString();
|
||||
|
||||
Description descrip = new Description();
|
||||
descrip.setValue(fieldValue);
|
||||
rssItem.setDescription(descrip);
|
||||
|
||||
// Once we've found one we can stop looking for more.
|
||||
break;
|
||||
|
||||
descrip.setValue(descrip.getValue() + fieldValue + "\n\n");
|
||||
}
|
||||
|
||||
}//end while
|
||||
}//end while
|
||||
|
||||
rssItem.setDescription(descrip);
|
||||
|
||||
|
||||
// set date field
|
||||
String dcDate = null;
|
||||
try
|
||||
|
Reference in New Issue
Block a user