[ACE-5554] Broken Get Sites REST API in 5.0 (cannot search by presets filter) Created: 10-Jul-14  Updated: 27-Feb-17  Resolved: 27-Jan-17

Status: Closed
Project: Alfresco One Platform
Component/s: REST API
Affects Version/s: 5.0
Fix Version/s: 5.2

Type: Bug Priority: Major
Reporter: Oksana Kurysheva (Inactive) Assignee: Closed Issues
Resolution: Fixed Votes: 0
Labels: CommunityPainPoints
Remaining Estimate: 0 minutes
Time Spent: 5 minutes
Original Estimate: 0 minutes

Issue Links:
Related
relates to ALF-5620 sitePreset filter in siteService.lis... Closed
is related to by REPO-353 Create Site (with specified preset) Done
is related to by REPO-417 Enhance Sites REST API Done

 Description   

org/alfresco/repository/site/sites.get API allows to get all sites using following filter parameters:

  • nameFilter;
  • sitePreset;
  • sizeString.

In 4.2 "sitePreset" filter works great, but it 5.0 it is broken.

The reason is that the filter has been removed from the findSites request in file http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/repository/site/sites.get.js

Request in 4.2:
siteService.getSites(nameFilter, sitePreset, sizeString != null ? parseInt(sizeString) : -1);

Request in 5.0:
siteService.findSites(nameFilter, sizeString != null ? parseInt(sizeString) : -1);

Is it possible to repair it in the future versions?



 Comments   
Comment by Kevin Roast [X] (Inactive) [ 01-Aug-14 ]

getSites() uses the DB and has performance issues - this is why the sites API was switched to use findSites() (SOLR based) in 5.0.

However, there are two findSites() methods in the SiteService - one of which does support the sitePreset parameter but is not exposed to the sites.get API - HOWEVER they have different implementations even though they have very similar method signatures - I think this is a mistake and they should use a single implementation that can support both nameFilter and sitePreset options. These methods are currently a mess and could really do with resolving- which would also fix this issue.

Comment by Richard Esplin [X] (Inactive) [ 13-Jul-15 ]

Gab, Gav, and Richard: This is a valid use case that should be met. We need to verify that the V1 API provides a replacement for getSites (that it provides proper parameters to meet this need), and if it does not, we should fix the V1 API.

Comment by Martin Bergljung [ 16-Nov-15 ]

The new Alfresco REST API for this: /alfresco/api/default/public/alfresco/versions/1/sites does not support any filters when searching for sites. Internally it calls siteService.listSites(null, sortProps, pagingRequest) passing in null for filter.
We should fix this.

The v0 Web Script based API is deprecated, so I would focus on the new API and not fix anything in v0.

Comment by Gavin Cornwell [ 11-Aug-16 ]

I've moved this one to ACE and linked it to a story for the Platform team to address as part of the REST API hardening effort.

Comment by Gavin Cornwell [ 27-Jan-17 ]

Fixed as part of the 5.2 REST API effort, see REPO-194.

Generated at Thu Jul 09 09:18:22 BST 2020 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.