mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-9856: RSOLR 046: Index track and build from SOLR: ALF-9857 Track changes to PATH and optimised support for getting AUX doc only data
- path tracking complete git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29758 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -45,47 +45,53 @@
|
|||||||
|
|
||||||
<#macro nodeMetaDataJSON nodeMetaData filter>
|
<#macro nodeMetaDataJSON nodeMetaData filter>
|
||||||
{
|
{
|
||||||
"id": ${nodeMetaData.nodeId?c},
|
"id": ${nodeMetaData.nodeId?c}
|
||||||
"nodeRef": <#if filter.includeNodeRef??>"${nodeMetaData.nodeRef.toString()}",</#if>
|
<#if filter.includeNodeRef??><#if nodeMetaData.nodeRef??>, "nodeRef": "${nodeMetaData.nodeRef.toString()}"</#if></#if>
|
||||||
"type": <#if filter.includeType??><@qNameJSON qName=nodeMetaData.nodeType/>,</#if>
|
<#if filter.includeType??><#if nodeMetaData.nodeType??>, "type": <@qNameJSON qName=nodeMetaData.nodeType/></#if></#if>
|
||||||
"aclId": <#if filter.includeAclId??><#if nodeMetaData.aclId??>${nodeMetaData.aclId?c}<#else>null</#if>,</#if>
|
<#if filter.includeAclId??><#if nodeMetaData.aclId??>, "aclId": ${nodeMetaData.aclId?c}</#if></#if>
|
||||||
<#if filter.includeProperties??>
|
<#if filter.includeProperties??>
|
||||||
"properties": {
|
<#if nodeMetaData.properties??>
|
||||||
|
, "properties": {
|
||||||
<#list nodeMetaData.properties?keys as propName>
|
<#list nodeMetaData.properties?keys as propName>
|
||||||
"${propName}": ${nodeMetaData.properties[propName]}<#if propName_has_next>,</#if>
|
"${propName}": ${nodeMetaData.properties[propName]}<#if propName_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
},
|
}
|
||||||
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
<#if filter.includeAspects??>
|
<#if filter.includeAspects??>
|
||||||
"aspects": [
|
<#if nodeMetaData.aspects??>
|
||||||
|
, "aspects": [
|
||||||
<#list nodeMetaData.aspects as aspectQName>
|
<#list nodeMetaData.aspects as aspectQName>
|
||||||
<@nodeAspectJSON aspectQName=aspectQName indent=""/><#if aspectQName_has_next>,</#if>
|
<@nodeAspectJSON aspectQName=aspectQName indent=""/><#if aspectQName_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
],
|
]
|
||||||
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
<#if filter.includePaths??>
|
<#if filter.includePaths??>
|
||||||
"paths": [
|
<#if nodeMetaData.paths??>
|
||||||
|
, "paths": [
|
||||||
<#list nodeMetaData.paths as path>
|
<#list nodeMetaData.paths as path>
|
||||||
${path}<#if path_has_next>,</#if>
|
${path}<#if path_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
],
|
]
|
||||||
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
<#if filter.includeParentAssociations??>
|
<#if filter.includeParentAssociations??>
|
||||||
<#if nodeMetaData.parentAssocs??>
|
<#if nodeMetaData.parentAssocs??>
|
||||||
<#if (nodeMetaData.parentAssocs?size > 0)>
|
<#if (nodeMetaData.parentAssocs?size > 0)>
|
||||||
"parentAssocs": [
|
, "parentAssocs": [
|
||||||
<#list nodeMetaData.parentAssocs as pa>
|
<#list nodeMetaData.parentAssocs as pa>
|
||||||
"${pa}"<#if pa_has_next>,</#if>
|
"${pa}"<#if pa_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
],
|
]
|
||||||
"parentAssocsCrc": <#if nodeMetaData.parentAssocsCrc??>${nodeMetaData.parentAssocsCrc?c}<#else>null</#if>,
|
,"parentAssocsCrc": <#if nodeMetaData.parentAssocsCrc??>${nodeMetaData.parentAssocsCrc?c}<#else>null</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
<#if filter.includeChildAssociations??>
|
<#if filter.includeChildAssociations??>
|
||||||
<#if nodeMetaData.childAssocs??>
|
<#if nodeMetaData.childAssocs??>
|
||||||
<#if (nodeMetaData.childAssocs?size > 0)>
|
<#if (nodeMetaData.childAssocs?size > 0)>
|
||||||
"childAssocs": [
|
, "childAssocs": [
|
||||||
<#list nodeMetaData.childAssocs as ca>
|
<#list nodeMetaData.childAssocs as ca>
|
||||||
"${ca}"<#if ca_has_next>,</#if>
|
"${ca}"<#if ca_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
@@ -93,6 +99,22 @@
|
|||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
|
<#if filter.includeChildIds??>
|
||||||
|
<#if nodeMetaData.childIds??>
|
||||||
|
<#if (nodeMetaData.childIds?size > 0)>
|
||||||
|
, "childIds": [
|
||||||
|
<#list nodeMetaData.childIds as ci>
|
||||||
|
${ci?c}<#if ci_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
]
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<#if filter.includeOwner??>
|
||||||
|
<#if nodeMetaData.owner??>
|
||||||
|
, "owner": "${nodeMetaData.owner}"
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
@@ -156,7 +156,11 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
}
|
}
|
||||||
if(o.has("includeParentAssociations"))
|
if(o.has("includeParentAssociations"))
|
||||||
{
|
{
|
||||||
filter.setIncludeParentAssociations(o.getBoolean("includeParentAssociations"));
|
filter.setIncludeParentAssociations(o.getBoolean("includeChildIds"));
|
||||||
|
}
|
||||||
|
if(o.has("includeChildIds"))
|
||||||
|
{
|
||||||
|
filter.setIncludeChildIds(o.getBoolean("includeChildIds"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final ArrayList<FreemarkerNodeMetaData> nodesMetaData =
|
final ArrayList<FreemarkerNodeMetaData> nodesMetaData =
|
||||||
@@ -235,6 +239,8 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
private List<ChildAssociationRef> childAssocs;
|
private List<ChildAssociationRef> childAssocs;
|
||||||
private List<ChildAssociationRef> parentAssocs;
|
private List<ChildAssociationRef> parentAssocs;
|
||||||
private Long parentAssocsCrc;
|
private Long parentAssocsCrc;
|
||||||
|
private List<Long> childIds;
|
||||||
|
private String owner;
|
||||||
|
|
||||||
public FreemarkerNodeMetaData(SOLRSerializer solrSerializer, NodeMetaData nodeMetaData) throws IOException, JSONException
|
public FreemarkerNodeMetaData(SOLRSerializer solrSerializer, NodeMetaData nodeMetaData) throws IOException, JSONException
|
||||||
{
|
{
|
||||||
@@ -255,10 +261,13 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
setPaths(paths);
|
setPaths(paths);
|
||||||
|
|
||||||
setChildAssocs(nodeMetaData.getChildAssocs());
|
setChildAssocs(nodeMetaData.getChildAssocs());
|
||||||
|
setChildIds(nodeMetaData.getChildIds());
|
||||||
setParentAssocs(nodeMetaData.getParentAssocs());
|
setParentAssocs(nodeMetaData.getParentAssocs());
|
||||||
setParentAssocsCrc(nodeMetaData.getParentAssocsCrc());
|
setParentAssocsCrc(nodeMetaData.getParentAssocsCrc());
|
||||||
setAspects(nodeMetaData.getAspects());
|
setAspects(nodeMetaData.getAspects());
|
||||||
Map<QName, Serializable> props = nodeMetaData.getProperties();
|
Map<QName, Serializable> props = nodeMetaData.getProperties();
|
||||||
|
if(props != null)
|
||||||
|
{
|
||||||
Map<String, PropertyValue> properties = (props != null ? new HashMap<String, PropertyValue>(props.size()) : null);
|
Map<String, PropertyValue> properties = (props != null ? new HashMap<String, PropertyValue>(props.size()) : null);
|
||||||
for(QName propName : props.keySet())
|
for(QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -268,6 +277,8 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
}
|
}
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
setOwner(nodeMetaData.getOwner());
|
||||||
|
}
|
||||||
|
|
||||||
public NodeRef getNodeRef()
|
public NodeRef getNodeRef()
|
||||||
{
|
{
|
||||||
@@ -349,6 +360,27 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
{
|
{
|
||||||
this.parentAssocsCrc = parentAssocsCrc;
|
this.parentAssocsCrc = parentAssocsCrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Long> getChildIds()
|
||||||
|
{
|
||||||
|
return childIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildIds(List<Long> childIds)
|
||||||
|
{
|
||||||
|
this.childIds = childIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwner()
|
||||||
|
{
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwner(String owner)
|
||||||
|
{
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user