Reversed out revisions 14366, 14361 and 14356

- Just prior to this, created dev branch DEV/ANDY_HEAD_ROLLBACKS
 - Andy: Switch to this branch on your local copy if you have changes to any of the files modified here


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14374 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-05-20 10:32:23 +00:00
parent 2558c285d2
commit 7de9315818

View File

@@ -141,11 +141,24 @@ public class SearchQuery extends AbstractQuery<ResultSet>
}
ResultSetRowNode rowNode = createResultSetRowNode(nodeRef, nodeService);
NamedValue[] columns = new NamedValue[1];
// get the data for the row and build up the columns structure
Map<Path, Serializable> values = searchRow.getValues();
NamedValue[] columns = new NamedValue[values.size() + 1];
int col = 0;
for (Path path : values.keySet())
{
// Get the attribute QName from the result path
String attributeName = path.last().toString();
if (attributeName.startsWith("@") == true)
{
attributeName = attributeName.substring(1);
}
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(attributeName), values.get(path));
col++;
}
// add one extra column for the node's path
columns[0] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(nodeRef).toString());
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(nodeRef).toString());
ResultSetRow row = new org.alfresco.repo.webservice.types.ResultSetRow();
row.setColumns(columns);