git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31373 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2011-10-20 09:01:22 +00:00
parent 11bf15cfd2
commit dd65d93435

View File

@@ -461,6 +461,26 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
return nodeIds; return nodeIds;
} }
protected Map<QName, Serializable> getProperties(Long nodeId)
{
Map<QName, Serializable> props = null;
// 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));
}
}
return props;
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@@ -518,25 +538,13 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
if(includeProperties) if(includeProperties)
{ {
// ALF-10641 props = getProperties(nodeId);
// 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 else
{ {
nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap()); nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap());
} }
if(includeAspects) if(includeAspects)
{ {
@@ -546,6 +554,10 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
if(includePaths) if(includePaths)
{ {
if(props == null)
{
props = getProperties(nodeId);
}
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props); Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
List<Path> directPaths = nodeDAO.getPaths(pair, false); List<Path> directPaths = nodeDAO.getPaths(pair, false);