Merge branch 'develop' of https://github.com/vivo-project/Vitro into develop

This commit is contained in:
brianjlowe 2013-10-16 16:17:31 -04:00
commit 63d9466674

View file

@ -6,6 +6,7 @@ import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputDocument;
@ -124,10 +125,15 @@ public class ContextNodeFields implements DocumentModifier{
String name = iter.next(); String name = iter.next();
RDFNode node = row.get( name ); RDFNode node = row.get( name );
if( node != null ){ if( node != null ){
if(addSpace) { String value = (node.isLiteral()) ?
text.append(" ").append( node.toString() ); node.asLiteral().getString():
} else { node.toString();
text.append(node.toString()); if (StringUtils.isNotBlank(value)) {
if(addSpace) {
text.append(" ").append( value );
} else {
text.append(value);
}
} }
}else{ }else{
log.debug(name + " is null"); log.debug(name + " is null");