Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

84922: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      83457: Refactoring the facetable properties.get response and some of the service API. Part of ACE-2639.
      This checkin changes the JSON structure slightly (array, not map), adds a displayName.
      The localised title and displayName are still in the server locale. I'll fix that to client locale next. Also need to add paging.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85239 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-09-20 09:11:04 +00:00
parent 8ea31336da
commit 22e9af3abc
2 changed files with 16 additions and 13 deletions

View File

@@ -1,15 +1,19 @@
<#escape x as jsonUtils.encodeJSONString(x)> <#escape x as jsonUtils.encodeJSONString(x)>
{ {
"properties" : { "data" : {
"properties" : [
<#list properties as property> <#list properties as property>
"${property.second.name.prefixString}" : { {
<#if property.first??> "name" : "${property.propertyDefinition.name.prefixString}",
"title" : "${property.first}", <#if property.localisedTitle??>
"title" : "${property.localisedTitle}",
</#if> </#if>
"dataType" : "${property.second.dataType.name.prefixString}", "displayName" : "${property.displayName}",
"modelQName" : "${property.second.model.name.prefixString}" "dataType" : "${property.propertyDefinition.dataType.name.prefixString}",
"modelQName" : "${property.propertyDefinition.model.name.prefixString}"
}<#if property_has_next>,</#if> }<#if property_has_next>,</#if>
</#list> </#list>
]
} }
} }
</#escape> </#escape>

View File

@@ -23,11 +23,10 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.alfresco.service.cmr.dictionary.PropertyDefinition; import org.alfresco.repo.search.impl.solr.facet.SolrFacetService.FacetablePropertyData;
import org.alfresco.service.namespace.NamespaceException; import org.alfresco.service.namespace.NamespaceException;
import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.webscripts.Cache; import org.springframework.extensions.webscripts.Cache;
@@ -73,7 +72,7 @@ public class FacetablePropertiesGet extends AbstractSolrFacetConfigAdminWebScrip
final Map<String, Object> model = new HashMap<>(); final Map<String, Object> model = new HashMap<>();
final Set<Pair<String, PropertyDefinition>> facetableProperties; final Set<FacetablePropertyData> facetableProperties;
if (contentClassQName == null) if (contentClassQName == null)
{ {
facetableProperties = facetService.getFacetableProperties(); facetableProperties = facetService.getFacetableProperties();