cancel
Showing results for 
Search instead for 
Did you mean: 

Faceted Search Results Page - How to include Custom actions in the 'Actions' menu for a row

rmahajan
Champ in-the-making
Champ in-the-making
Hello,

In the faceted search results page when you click on the “Actions” menu for a row, it asynchronously gets the list of allowed actions. It looks like there is a filter defined in AlfSearchResult.js that restricts the allowed actions to actions currently supported by the Aikau action service.

We would like to include custom actions in this list of allowed actions. What is the recommended approach to include custom actions under the "Actions" menu for each row in the faceted search result list?

I have gone through the faceted-search.get.js, AlfSearchResult.js, Action.js, _ActionsMixin.js, XhrActions.js, _XhrActionsMixin.js and ActionService.js files but it is not clear to me what's the best way to include custom actions under the "Actions" menu. Do we need to override some of these standard files?

Our custom actions work on document-details and documentlibrary pages but they are not included under the Actions menu in the faceted search results page.

Thanks for your help.

Raju
10 REPLIES 10

ddraper
World-Class Innovator
World-Class Innovator
We're in the process of improving both the support for existing Document Library actions within Aikau as well as improving the way in which custom actions can be mixed with a selection of the default actions. Unfortunately at the present time we're still a long way from completing this effort. Your best bet at the moment would be to specify pure custom actions (using the "customActions" attribute (defined in the _ActionsMixin module) and then duplicate the existing action modules that you want to support.

Alternatively you could look to extend the XhrActions widget with your own version and then augment the actions with the additional items you wish to provide.

In both these cases you would need to extend or replace the AlfSearchView to include your custom module (e.g. you could extend AlfSearchView and override the "widgets" array to either be your own view (created entirely as a JSON model) or reference an extension to the AlfSearchResult.

The reason we have a specific AlfSearchResult widget (rather than a model of layout and renderer widgets) is because this provides a performance improvement in rendering. However, the faceted search page will still work with any view constructed using the techniques described in the Aikau Tutorial that you can find on GitHub (e.g. https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Contents.md)

Regards,
Dave

pl_componize
Champ in-the-making
Champ in-the-making
Hello can I have an update on this, do we have a standard way to configure this now in one of the release?

ddraper
World-Class Innovator
World-Class Innovator
It's now possible to mix-and-match "legacy" Document Library actions (i.e. those that are defined in the share-documentlibrary-config.xml file), pure custom menu items that can be configured to perform actions and pure Aikau actions (of which there a currently limited set). An example of this can be seen in the Aikau unit test page here: https://github.com/Alfresco/Aikau/blob/d5b54c8d2b33bb7bfff804d59c56ac209aeb9a1b/aikau/src/test/resou...

The key configuration attribute is "mergeActions" (see http://dev.alfresco.com/resource/docs/aikau-jsdoc/_ActionsMixin.html).

Hi Dave,

how can i disable or invisible action button from search result in alfresco advance search?

do i need to override createActionsRenderer function and set as onlyShowOnHover:false ?

regards

janaka

ddraper
World-Class Innovator
World-Class Innovator

janaka _​ Could you try to avoid cross posting questions on multiple threads ... you've asked this here and I've provided an answer.

anooj_agarwal
Champ in-the-making
Champ in-the-making
Hi Dave,

Do we have a process of rendering actions on search results page based on user site role. For example I need to remove delete-action for a set of people with a role say "custom-role". I have gone through the following set of files AlfSearchResult.js. Action.js, _ActionsMixin.js, XhrActions.js, _XhrActionsMixin.js and ActionService.js. I found that  when I remove a action it gets removed for the users. I want to restrict to only a set of users. As I am a Newbie to Aikau Please suggest what needs to be followed.


Thanks & Regards,
Anooj Agarwal.

parashiftaustra
Confirmed Champ
Confirmed Champ
I've created a blog about adding custom actions to faceted search here:

https://www.parashift.com.au/2016/06/28/adding-custom-action-shares-faceted-search/

Let me know if you have any further questions.

ddraper
World-Class Innovator
World-Class Innovator

That's a great blog post ... my only observation would be that you may want to consider creating the action subscriber as a service rather than a widget.

gaurav_sharma
Champ in-the-making
Champ in-the-making

I tried with "merge-actions" approach and added “Edit Properties” action in faceted page.
widgets: [
{
id: “FCTSRCH_SEARCH_RESULT”,
name: “alfresco/search/AlfSearchResult”,
config: {
enableContextMenu: false,
showSelector: true,
mergeActions : true,
additionalDocumentAndFolderActions : [“document-edit-properties”]
}
}
]

And I am able to see "Edit Properties" action.But only three metadata fields are being displayed once we click on Edit Properties action at faceted page(Name,Title,description).Also, I have configured share-config-custom.xml for edit metadata pop up form and I can see the custom properties when I go through document library –> "edit properties" action pop up.

But at search results page, only Name,Title,Description are being displayed.Kindly help.I am using Enterprise 5.1.1.
Also, Why edit properties action is not available out of the box at faceted page?