cancel
Showing results for 
Search instead for 
Did you mean: 

alfresco share

rutaveejshah
Champ in-the-making
Champ in-the-making
In alfresco share i want to know which webscript is used for seaching the user when we have to provide the  permission to the user in alfresco repositry.If any body have any idea please provide the solution as early as possible.

Thank you in Advance.
3 REPLIES 3

avyaznikov
Champ in-the-making
Champ in-the-making
When you search people/groups at manage-permissions page share presentation webscript is used <blockquote>share/service/components/people-finder/authority-query?authorityType=all&maxResults=100&filter=adm</blockquote>. This webscript uses /api/groups and /api/people repository webscripts.
See <blockquote>/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/people-finder/authority-query.get.js</blockquote> for details.
You can easily find ajax webscript requests using browser debugger. In Chrome press F12 and go to Network -> XHR tab.

Thank you for your reply.
I want to customize that.I want that user can also search by their jobtitle and location.
You have any idea where the user query is written.Or where should i make change so that user can be search by jobtitle and location?
Please Reply if you know this.
Thank you in advance.

Hi,

Arkadiy gave the right hint. You have to look at the /api/people repository webscript. In the javascript controller you can extend the search query. Have a look at the code snippet.


<blockcode>
        …..
   var termArray = filter.split(' ');
   var searchStringExtended = "TYPE:\"cmSmiley Tongueerson\" ";
   for ( var i = 0; i < termArray.length; i++) {
      var term = termArray;

       searchStringExtended += "AND (cm:mobile:*" + term
            + "* OR cm:companypostcode:*" + term + "* OR cm:email:*" + term
            + "* OR cm:companyfax:*" + term + "* OR cm:companyaddress3:*"
            + term + "* OR cm:middleName:*" + term
            + "* OR cm:companytelephone:*" + term + "* OR cm:skype:*"
            + term + "* OR cmSmiley Surprisedrganization:*" + term + "* OR cm:jobtitle:*"
            + term + "* OR cm:companyaddress2:*" + term
            + "* OR cm:lastName:*" + term + "* OR cm:telephone:*" + term
            + "* OR cm:instantmsg:*" + term + "* OR cmSmiley Tongueersondescription:*"
            + term + "* OR cm:companyemail:*" + term + "* OR cm:userName:*"
            + term + "* OR cm:companyaddress1:*" + term
            + "* OR cm:googleusername:*" + term + "* OR cm:firstName:*"
            + term + "*) ";

   }

   while (searchStringExtended.indexOf("**") !== -1) {
      searchStringExtended = searchStringExtended.replace(/\*\*/g, "*");
   }

   if (maxResults != null) {
      var paging = {
         maxItems : parseInt(maxResults),
         skipCount : 0
      };
   } else {
      var paging = {
         skipCount : 0
      };
   }

   var def = {
      query : searchStringExtended,
      language : "fts-alfresco",
      page : paging
   };
         …..
</blockcode>