You have to customize both alfresco-share and alfresco repo side to achieve this and you've to start the workflow from site context means from the document library.
Here are the steps.
Alfresco-share
people-finder-extended.js (_buildSearchParams method).
Pass the current site name in the filter.
return "filter=" + encodeURIComponent(searchTerm) + "&maxResults=" + this.options.maxSearchResults+"&siteId="+<YOUR_CURRENT_SITE_NAME>;
Alfresco Repo
You need to extend the people.java to limit the search.
Methods to be modified.
- getPeople(String,int)
- getPeople(String,int,String,boolean)
Add extra siteId param to filter.
public Scriptable getPeople(String filter, int maxResults, String siteId)
{
return getPeople(filter, maxResults, null, true, siteId);
}
public Scriptable getPeople(String filter, int maxResults, String sortBy, boolean sortAsc, String siteId) { ... }
Hope this helps you.
Please let me know, if you're not clear.