2

How can a workflow initiator assign a task to user by selecting particular site in alfresco?currently it lists all users registered in alfresco ECM, i want it to list the current site users or a provision to select site first and search user therein.

Is there any configuration needs to done or please tell me the files to work on.

Thanks in advance

Faiz
  • 31
  • 3

1 Answers1

1

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.

  • Thank you very much Sir, im able to do modifications in people-finder.js in share but not in people.java because im bit confused, since i found someone implemented the same by overriding pickerchilder.js in alfresco repo. below is the link for the same. https://github.com/douglascrp/alfresco-colleagues-picker-form-control if i have to modify people.java then how safely i can implement (override existing people.java) – Faiz May 10 '18 at 05:52
  • I have a custom picker and under findUsers method i'm passing siteid to get site object like this var site = siteService.getSite(searchSiteTerm); and getting members of site using var members = site.listMembers(null, null, 0, true); But im not getting users list of other sites which im not registered with. im getting error as "Cannot call method "listMembers" of null" im getting all users of particular site only if im registered with that site. Can anyone help me getting users of particular site with being registered with that site?? – Faiz May 20 '18 at 12:28