3

The problem

Here is the answer about extending default authority.ftl in alfresco. But when pickerchildren.get.js is invoked it has null instead of argsFilterString. Also code sources pickerchildren.get.js differes from sources in the answer.

About degugging

I have aready modified authority.ftl to output expression ${field.control.params.filterString} into html, so this paramer is not null and works as expected.

What I really can not understand is pickerchildren.get.js, the line argsFilterString = args['filterString'] always return null. Also there is no special parameters in args variable.

So how to pass new controll-param to alfresco picker when alfresco version is 5?

Community
  • 1
  • 1
Cherry
  • 31,309
  • 66
  • 224
  • 364
  • 1
    What exactly you wanted to do with the extra param ? pickerchildren.get.js is different could be because of Alfresco versions. – Muralidharan Deenathayalan Oct 28 '16 at 03:35
  • I want a filter users by group, see [previous question](http://stackoverflow.com/questions/34856540/alfresco-limiting-authority-ftl-to-a-group-of-users/34872521#34872521). – Cherry Oct 28 '16 at 04:08

1 Answers1

1

Although the date of asking this question is more than 3 years ago, if I faced this issue nowadays too, maybe my solution will help anyway.

There is one more step missing, while implementing this group control.

You have to find in file /share/components/object-finder/object-finder.js function _generatePickerChildrenUrlParams: function ObjectRenderer__generatePickerChildrenUrlParams(searchTerm) and add into generated URL value of parameter filterString:

 _generatePickerChildrenUrlParams: function ObjectRenderer__generatePickerChildrenUrlParams(searchTerm)
  {
     var params = "?selectableType=" + this.options.itemType + "&searchTerm=" + encodeURIComponent(searchTerm) + "&size=";
     if (this.options.createNewItemUri !== "")
     {
        params += this.options.maxSearchResults;
     }
     else
     {
        params += this.options.maxChildResults;
     }

     //if filterString control-param has been provided in share-config.xml file
     if ( this.options.filterString ) {
        params += "&filterString="+ this.options.filterString;
     }
     
     .
     .
     .
     .
     return params;
  }

It is just one more condition controlling if this parameter is provided in your custom share config.

Lu Cka
  • 43
  • 6