Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a search Action in Alfresco

I am using Alfresco Enterprise 6.2. Similar to the live search, I am creating a search Action for folders that I have in document library.

I have updated the custom-actions.js as follows:

onActionSearch: function dla_onActionSearch(record){
        window.open(Alfresco.constants.PAGECONTEXT +'dp/ws/faceted-search?', "_self");       
}

I have also added folder scope in faceted-search.get.js as below. I have hardcoded the value folder1 just to test if it works:

  scopeOptions.push({
  id: "FCTSRCH_SET_FOLDER_SCOPE",
  name: "alfresco/menus/AlfCheckableMenuItem",
  config: {
    label: "folder",
    value: "folder1",
    group: "SEARCHLIST_SCOPE",
    publishTopic: "ALF_SEARCHLIST_SCOPE_SELECTION",
    checked: false,
    hashName: "scope",
    publishPayload: {
     label: "folder",
     value: "folder1"
    }
  }
});

However it dos not consider the folder scope when performing the search. Instead, it consider 'folder1' as a site. How can I correctly perform a search within folder scope?

like image 827
SkyBlue Avatar asked May 22 '20 08:05

SkyBlue


People also ask

How do you search in Alfresco?

You can use the search box on the toolbar to search for files, sites, and people. Type your search into the search box, and a list of matching files, sites, and people will be shown as you type. If you're in a site you can click Search all content or Search in [sitename] to search all sites or just the site you're in.


1 Answers

Please check below widget,It is considering scope as a siteId always.

https://dev.alfresco.com/resource/docs/aikau-jsdoc/AlfSearchList.js_.html

like image 112
Sanjay Avatar answered Oct 07 '22 01:10

Sanjay