Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

85015: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      84136: Fix for ACE-1696    SOLR 4 - Support for name path - index only


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85330 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-09-20 10:18:43 +00:00
parent ec01efb150
commit b1478db657
2 changed files with 33 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -285,8 +286,25 @@ public class NodesMetaDataGet extends DeclarativeWebScript
}
this.ancestors = ancestors;
this.paths = paths;
// TODO: Convert name paths to required strings
this.namePaths = null; // TODO: use a JSON-friendly string
// convert name Paths to Strings
List<String> namePaths = new ArrayList<String>();
if(nodeMetaData.getNamePaths() != null)
{
for(Collection<String> namePath : nodeMetaData.getNamePaths())
{
JSONObject o = new JSONObject();
JSONArray array = new JSONArray();
for(String element : namePath)
{
array.put(solrSerializer.serializeValue(String.class, element));
}
o.put("namePath", array);
namePaths.add(o.toString(3));
}
}
this.namePaths = namePaths;
this.owner = nodeMetaData.getOwner();
this.childAssocs = nodeMetaData.getChildAssocs();
@@ -331,6 +349,10 @@ public class NodesMetaDataGet extends DeclarativeWebScript
{
return paths;
}
public List<String> getNamePaths()
{
return namePaths;
}
public QName getNodeType()
{
return nodeType;