mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
77150: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 73977: ACE-1802 "MT / Cloud Restrict namespace URI of dynamic models." ACE-955 "Custom Content Models in Cloud" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,8 @@ import org.alfresco.repo.solr.NodeMetaData;
|
|||||||
import org.alfresco.repo.solr.NodeMetaDataParameters;
|
import org.alfresco.repo.solr.NodeMetaDataParameters;
|
||||||
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
||||||
import org.alfresco.repo.solr.SOLRTrackingComponent.NodeMetaDataQueryCallback;
|
import org.alfresco.repo.solr.SOLRTrackingComponent.NodeMetaDataQueryCallback;
|
||||||
|
import org.alfresco.repo.tenant.TenantUtil;
|
||||||
|
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.Path;
|
import org.alfresco.service.cmr.repository.Path;
|
||||||
@@ -252,7 +254,8 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
private Set<String> ancestors;
|
private Set<String> ancestors;
|
||||||
private String tenantDomain;
|
private String tenantDomain;
|
||||||
|
|
||||||
public FreemarkerNodeMetaData(SOLRSerializer solrSerializer, NodeMetaData nodeMetaData) throws IOException, JSONException
|
public FreemarkerNodeMetaData(final SOLRSerializer solrSerializer, final NodeMetaData nodeMetaData)
|
||||||
|
throws IOException, JSONException
|
||||||
{
|
{
|
||||||
setNodeId(nodeMetaData.getNodeId());
|
setNodeId(nodeMetaData.getNodeId());
|
||||||
setTenantDomain(nodeMetaData.getTenantDomain());
|
setTenantDomain(nodeMetaData.getTenantDomain());
|
||||||
@@ -287,15 +290,25 @@ public class NodesMetaDataGet extends DeclarativeWebScript
|
|||||||
setParentAssocs(nodeMetaData.getParentAssocs());
|
setParentAssocs(nodeMetaData.getParentAssocs());
|
||||||
setParentAssocsCrc(nodeMetaData.getParentAssocsCrc());
|
setParentAssocsCrc(nodeMetaData.getParentAssocsCrc());
|
||||||
setAspects(nodeMetaData.getAspects());
|
setAspects(nodeMetaData.getAspects());
|
||||||
Map<QName, Serializable> props = nodeMetaData.getProperties();
|
final Map<QName, Serializable> props = nodeMetaData.getProperties();
|
||||||
if(props != null)
|
if(props != null)
|
||||||
{
|
{
|
||||||
Map<String, PropertyValue> properties = (props != null ? new HashMap<String, PropertyValue>(props.size()) : null);
|
final Map<String, PropertyValue> properties = (props != null ? new HashMap<String, PropertyValue>(props.size()) : null);
|
||||||
for(QName propName : props.keySet())
|
for(final QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
Serializable value = props.get(propName);
|
// need to run this in tenant context because types may be in a tenant-specific
|
||||||
properties.put(solrSerializer.serializeValue(String.class, propName),
|
// dictionary registry
|
||||||
solrSerializer.serialize(propName, value));
|
TenantUtil.runAsTenant(new TenantRunAsWork<Void>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Void doWork() throws Exception
|
||||||
|
{
|
||||||
|
Serializable value = props.get(propName);
|
||||||
|
properties.put(solrSerializer.serializeValue(String.class, propName),
|
||||||
|
solrSerializer.serialize(propName, value));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, tenantDomain);
|
||||||
}
|
}
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user