diff --git a/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java index b5447770cd..0d47599fb2 100644 --- a/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java +++ b/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java @@ -111,13 +111,16 @@ public class AssociatedQuerySession extends AbstractQuerySession // get the data for the row and build up the columns structure Map props = nodeService .getProperties(childNodeRef); - NamedValue[] columns = new NamedValue[props.size()]; + NamedValue[] columns = new NamedValue[props.size()+1]; int col = 0; for (QName propName : props.keySet()) { columns[col] = Utils.createNamedValue(dictionaryService, propName, props.get(propName)); col++; } + + // Now add the system columns containing the association details + columns[col] = new NamedValue(SYS_COL_ASSOC_TYPE, Boolean.FALSE, assoc.getTypeQName().toString(), null); ResultSetRow row = new ResultSetRow(); row.setRowIndex(x); diff --git a/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java index c8f8d54af7..3af9d8747e 100644 --- a/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java +++ b/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java @@ -97,7 +97,7 @@ public class ChildrenQuerySession extends AbstractQuerySession // create columns for all the properties of the node // get the data for the row and build up the columns structure Map props = nodeService.getProperties(childNodeRef); - NamedValue[] columns = new NamedValue[props.size()]; + NamedValue[] columns = new NamedValue[props.size()+4]; int col = 0; for (QName propName : props.keySet()) { @@ -105,6 +105,15 @@ public class ChildrenQuerySession extends AbstractQuerySession col++; } + // Now add the system columns containing the association details + columns[col] = new NamedValue(SYS_COL_ASSOC_TYPE, Boolean.FALSE, assoc.getTypeQName().toString(), null); + col++; + columns[col] = new NamedValue(SYS_COL_ASSOC_NAME, Boolean.FALSE, assoc.getQName().toString(), null); + col++; + columns[col] = new NamedValue(SYS_COL_IS_PRIMARY, Boolean.FALSE, Boolean.toString(assoc.isPrimary()), null); + col++; + columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null); + ResultSetRow row = new ResultSetRow(); row.setRowIndex(x); row.setNode(rowNode); diff --git a/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java index 61a29bb5c4..d27f7b8f10 100644 --- a/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java +++ b/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java @@ -97,7 +97,7 @@ public class ParentsQuerySession extends AbstractQuerySession // create columns for all the properties of the node // get the data for the row and build up the columns structure Map props = nodeService.getProperties(parentNodeRef); - NamedValue[] columns = new NamedValue[props.size()]; + NamedValue[] columns = new NamedValue[props.size()+4]; int col = 0; for (QName propName : props.keySet()) { @@ -105,6 +105,15 @@ public class ParentsQuerySession extends AbstractQuerySession col++; } + // Now add the system columns containing the association details + columns[col] = new NamedValue(SYS_COL_ASSOC_TYPE, Boolean.FALSE, assoc.getTypeQName().toString(), null); + col++; + columns[col] = new NamedValue(SYS_COL_ASSOC_NAME, Boolean.FALSE, assoc.getQName().toString(), null); + col++; + columns[col] = new NamedValue(SYS_COL_IS_PRIMARY, Boolean.FALSE, Boolean.toString(assoc.isPrimary()), null); + col++; + columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null); + ResultSetRow row = new ResultSetRow(); row.setRowIndex(x); row.setNode(rowNode); diff --git a/source/java/org/alfresco/repo/webservice/repository/QuerySession.java b/source/java/org/alfresco/repo/webservice/repository/QuerySession.java index 94d50b5d8b..679f7d031e 100644 --- a/source/java/org/alfresco/repo/webservice/repository/QuerySession.java +++ b/source/java/org/alfresco/repo/webservice/repository/QuerySession.java @@ -30,6 +30,12 @@ import org.alfresco.service.namespace.NamespaceService; */ public interface QuerySession extends Serializable { + /** System column namess */ + public static String SYS_COL_ASSOC_TYPE = "associationType"; + public static String SYS_COL_ASSOC_NAME = "associationName"; + public static String SYS_COL_IS_PRIMARY = "isPrimary"; + public static String SYS_COL_NTH_SIBLING = "nthSibling"; + /** * Retrieves the id this query session can be identified as *