AnsweredAssumed Answered

Aikau: How to call a repo webscript from an aikau widget

Question asked by francesco.fornasari on Feb 15, 2018
Latest reply on Feb 20, 2018 by francesco.fornasari

##Dear All,

I need to add a new button on Share Search result page that allow users to export search metadata results as Excel file.

 

So, I made the repo webscript to make the Excel outputstream based on user search data (i.e: terms, query, etc..) and I'm looking to bind to the Share Aikau Search Result page.

 

I added to Share search page a new button linke this:

 

var searchResultsMenuBar  = widgetUtils.findObject(model.jsonModel, "id", "SEARCH_RESULTS_MENU_BAR");
searchResultsMenuBar.config.widgets.push({
    id: "EXPORT_BUTTON_SEARCH",
    name: "alfresco/buttons/AlfButton",
    config: {        
      additionalCssClasses:"call-to-action",
label : "export.search.result"
   }
})

Now how can we add the repo webscript call? Pheraps adding something like this:
        publishPayloadType: 'PROCESS',
        useHash: true,
        hashDataMapping: {
            searchTerm: "widgetsContent.0.config.searchTerm",
            siteId: "widgetsContent.0.config.siteId",
            searchSort: "widgetsContent.0.config.searchSort"
        },
        publishPayload: {

        }
Could you suggest me any sample to do this?

Thank you.

Outcomes