mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
63328: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 63150: Merged DEV to V4.2-BUG-FIX (4.2.2) 61233 : MNT-10548 : Public API returns invalid JSON if a tag or category has been applied to object - Replace List of NodeRefs with List of String elements in DirectProperty 63129 : MNT-10548 : Public API returns invalid JSON if a tag or category has been applied to object - Fix related test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,10 +19,12 @@
|
||||
package org.alfresco.opencmis.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.opencmis.CMISConnector;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
@@ -59,7 +61,24 @@ public class DirectProperty extends AbstractProperty
|
||||
|
||||
if (nodeInfo.getNodeRef() != null)
|
||||
{
|
||||
return getServiceRegistry().getNodeService().getProperty(nodeInfo.getNodeRef(), alfrescoName);
|
||||
/* MNT-10548 fix */
|
||||
Serializable result = getServiceRegistry().getNodeService().getProperty(nodeInfo.getNodeRef(), alfrescoName);
|
||||
|
||||
if (result instanceof List)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> resultList = (List<Object>)result;
|
||||
for (int index = 0; index < resultList.size(); index++)
|
||||
{
|
||||
Object element = resultList.get(index);
|
||||
if (element instanceof NodeRef)
|
||||
{
|
||||
resultList.set(index, element.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
else if (nodeInfo.getAssociationRef() != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user