cancel
Showing results for 
Search instead for 
Did you mean: 

Can click of tabs using alfTabContainer provide separate facets on the search screen

ranjeetsi
Star Contributor
Star Contributor

Hi ,

I am working on extension of search results from other repositories also apart from my native repository.

For that created tabbed pane using alfTabContainer . How can i have separate sets of facets on click of the tabs in the tabbed pane results.

Alfresco Content Services Certified Engineer (ACSCE)
1 ACCEPTED ANSWER

ddraper
World-Class Innovator
World-Class Innovator

Unfortunately what you're describing is going to be more difficult to accomplish (having facets shared by multiple search results)... as I explained in my previous answer the FacetFilter widget publishes a request to have it's facet applied to searches - and the AlfSearchList susbcribes to the published topic and includes the facet in the search request published to the SearchService.

It is quite straightforward to have multiple tabs that each contain their own AlfSearchList widget subscribing to the same search box (i.e. the user enters the search term once and each AlfSearchList updates to show the results for the location that it is configured to search in). However, it is not so straightforward to share different FacetFilters between each widget (because the filter results will be different for each search) - essentially each tab will result in a different search and therefore there will be different facet filter results published.

Basically logically what you're suggesting you want cannot work regardless of implementation. It would be possible to have multiple groups of facets (one group for each tab) that are shown outside of the tab container and only show the facets relevant to the currently selected tab. However, it would be much simpler to just keep the facets within the tab and there would be very little difference to the user.

Unfortunately at the moment although it is possible to change tabs through publication - there is no publication made when the selected tab changes when clicked. Therefore you're going to need to either raise an enhancement request on the AlfTabContainer widget or extend it and provide the feature yourself (you'd need to extend the _tabChanged function which is marked as private so extending it wouldn't be guaranteed future proof on upgrade).

I would definitely recommend that you keep your FacetFilter widgets contained with the same tab as each AlfSearchList - it will be much simpler to implement.

View answer in original post

4 REPLIES 4

ddraper
World-Class Innovator
World-Class Innovator

AlfTabContainer is an Aikau widget so you've actually raised this question in the wrong forum. This forum is for the Application Development Framework being built using Angular 2. In future you should raise your Aikau related questions in the ECM space!


However to answer your question...

The facets displayed in the standard search page are derived from the configuration set using the "Search Manager" page in Share... however, there is nothing to stop you creating a customization in which your hard-code the facet widgets that are displayed (and ignore the search configuration).

I think what you're saying you want (please correct if I've misinterpreted) is several tabs on the search page in which different facets are always displayed.

In the faceted-search.get.js file (the JavaScript controller that builds the model to render the search page) there is a section in which the facet filters are created, it looks a bit like this:

var facet = {

   id: "FCTSRCH_" + facet.filterID,

   name: facet.displayControl,

   config: {

      additionalCssClasses: "separated",

      label: msg.get(facet.displayName),

      facetQName: facet.facetQName,

      sortBy: facet.sortBy,

      maxFilters: facet.maxFilters,

      hitThreshold: facet.hitThreshold,

      minFilterValueLength: facet.minFilterValueLength,

      useHash: false,

      headingLevel: 3,

      blockIncludeFacetRequest: blockIncludeFacetRequest

   }

};

facets.push(facet);

The "name" attribute is variable because it is possible to configure different widgets for rendering facet filters - but out-of-the-box, the only one available is FacetFilters​. You should include an instance of this widget for each facet that you want to search on. The widget will publish a request to the AlfSearchList​ widget to indicate that the facet that it represents should be included in search requests. I would suggest adding break points into the Rhino debugger in Share to get an idea of the configuration expected.

Make sure to set a unique pubSubScope for each tab that you create to ensure that facet information isn't shared between tabs. I'd essentially recreate the default widgets for the page into each tab. Hopefully this should get you on your way, please reply if you need any more information.

@ Dave ,

Thanks for the reply. Actually my question is:

- In alfresco share, in normal/advanced search we get the search results in the main pane and facets on left side pane.

Actually i need to get the page with search results from different repositories in multiple tabs , but what i want is that on click of individual tab , the relevant facet for that results come on left side.For example I have search results for 4 other repositories in search results page and i put them in a tab using alfTabContainer.

Since we are using AlfTabContainer, is there any way that on click of any tab , the facet on left side change for that results.

As of now I am able to have the facets inside the individual tabs inside the tabbed pane using customised GlobalFacetFilters.js where we are getting all the facets for all four repositories respectively.

var facetsArray=[onefacets,twofacets,threefacetsfourfacets,fivefacets,sixfacets];

for(var j=0;j<pubScopedRepos.length;j++)

{

.

.

.

facet = {

        id: "FCTSRCH_" + facet.filterID,

        name: "alfresco/search/GlobalFacetFilters",

        config: {

           additionalCssClasses: "separated",

           label: msg.get(facet.displayName),

           pubSubScopeSmiley TongueubScopedRepos[j],

           facetQName: facet.facetQName,

           sortBy: facet.sortBy,

           maxFilters: facet.maxFilters,

           hitThreshold: facet.hitThreshold,

           minFilterValueLength: facet.minFilterValueLength,

           useHash: false,

           headingLevel: 3,

           blockIncludeFacetRequest: blockIncludeFacetRequest

        }

                };

         } 

  facetsArray[j].push(facet);

     

       }

Alfresco Content Services Certified Engineer (ACSCE)

ddraper
World-Class Innovator
World-Class Innovator

Unfortunately what you're describing is going to be more difficult to accomplish (having facets shared by multiple search results)... as I explained in my previous answer the FacetFilter widget publishes a request to have it's facet applied to searches - and the AlfSearchList susbcribes to the published topic and includes the facet in the search request published to the SearchService.

It is quite straightforward to have multiple tabs that each contain their own AlfSearchList widget subscribing to the same search box (i.e. the user enters the search term once and each AlfSearchList updates to show the results for the location that it is configured to search in). However, it is not so straightforward to share different FacetFilters between each widget (because the filter results will be different for each search) - essentially each tab will result in a different search and therefore there will be different facet filter results published.

Basically logically what you're suggesting you want cannot work regardless of implementation. It would be possible to have multiple groups of facets (one group for each tab) that are shown outside of the tab container and only show the facets relevant to the currently selected tab. However, it would be much simpler to just keep the facets within the tab and there would be very little difference to the user.

Unfortunately at the moment although it is possible to change tabs through publication - there is no publication made when the selected tab changes when clicked. Therefore you're going to need to either raise an enhancement request on the AlfTabContainer widget or extend it and provide the feature yourself (you'd need to extend the _tabChanged function which is marked as private so extending it wouldn't be guaranteed future proof on upgrade).

I would definitely recommend that you keep your FacetFilter widgets contained with the same tab as each AlfSearchList - it will be much simpler to implement.

Thanks Dave for helping out.

Alfresco Content Services Certified Engineer (ACSCE)