Fix for ALF-10641 SOLR tracking fails for residual properties when there is no model that defines the prefix for the URI

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31085 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2011-10-10 13:41:06 +00:00
parent 052d824a9e
commit 6d41e3f0bd
2 changed files with 123 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -513,9 +514,25 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
if(includeProperties)
{
props = nodeDAO.getNodeProperties(nodeId);
// ALF-10641
// Residual properties are un-indexed -> break serlialisation
Map<QName, Serializable> sourceProps = nodeDAO.getNodeProperties(nodeId);
props = new HashMap<QName, Serializable>((int)(sourceProps.size() * 1.3));
for(QName propertyQName : sourceProps.keySet())
{
PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
if(propDef != null)
{
props.put(propertyQName, sourceProps.get(propertyQName));
}
}
nodeMetaData.setProperties(props);
}
nodeMetaData.setProperties(props);
else
{
nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap());
}
if(includeAspects)
{