mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Added system columns to web service results sets to provide association details where appropriate
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3552 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -111,7 +111,7 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
|||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService
|
Map<QName, Serializable> props = nodeService
|
||||||
.getProperties(childNodeRef);
|
.getProperties(childNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()];
|
NamedValue[] columns = new NamedValue[props.size()+1];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -119,6 +119,9 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
|||||||
col++;
|
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();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
@@ -97,7 +97,7 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
|||||||
// create columns for all the properties of the node
|
// create columns for all the properties of the node
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService.getProperties(childNodeRef);
|
Map<QName, Serializable> props = nodeService.getProperties(childNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()];
|
NamedValue[] columns = new NamedValue[props.size()+4];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -105,6 +105,15 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
|||||||
col++;
|
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();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
@@ -97,7 +97,7 @@ public class ParentsQuerySession extends AbstractQuerySession
|
|||||||
// create columns for all the properties of the node
|
// create columns for all the properties of the node
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService.getProperties(parentNodeRef);
|
Map<QName, Serializable> props = nodeService.getProperties(parentNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()];
|
NamedValue[] columns = new NamedValue[props.size()+4];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -105,6 +105,15 @@ public class ParentsQuerySession extends AbstractQuerySession
|
|||||||
col++;
|
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();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
@@ -30,6 +30,12 @@ import org.alfresco.service.namespace.NamespaceService;
|
|||||||
*/
|
*/
|
||||||
public interface QuerySession extends Serializable
|
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
|
* Retrieves the id this query session can be identified as
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user