AnsweredAssumed Answered

Pass Content Types which are present in Alfresco Advanced Search Screen to Alfresco side

Question asked by riya.soni42 on May 4, 2017

Hi,

 

I want to pass all content types which currently we are getting in advsearch.get.js in "searchforms"  arrays object,

 

The code is given as below in advsearch.get.js,

 

// get the search forms from the config
   var formsElements = config.scoped["AdvancedSearch"]["advanced-search"].getChildren("forms");
   var searchForms = [];
   
   for (var x = 0, forms; x < formsElements.size(); x++)
   {
      forms = formsElements.get(x).childrenMap["form"];
      
      for (var i = 0, form, formId, label, desc; i < forms.size(); i++)
      {
         form = forms.get(i);
         
         // get optional attributes and resolve label/description text
         formId = form.attributes["id"];
         
         label = form.attributes["label"];
         if (label == null)
         {
            label = form.attributes["labelId"];
            if (label != null)
            {
               label = msg.get(label);
            }
         }
         
         desc = form.attributes["description"];
         if (desc == null)
         {
            desc = form.attributes["descriptionId"];
            if (desc != null)
            {
               desc = msg.get(desc);
            }
         }
         
         // create the model object to represent the form definition
         searchForms.push(
         {
            id: formId ? formId : "search",
            type: form.value,
            label: label ? label : form.value,
            description: desc ? desc : ""
         });
      }
   }

 

Now, I want to pass this searchforms object to alfresco (repo) side.

There are now particular webscript on share side which will return all content types, so please provide me the way or steps to pass this value to alfresco side and get that values in Java controller class on alfresco side.

Outcomes