on 09-07-2018 1:39 PM
My use case is like this:
We have catalogA and catalogB (both in readable catalogs for all usergroups).
If the user is member of userGroupA then after login the catalogA should be selected by default.
If the user is member of userGroupB then after login the catalogB should be selected by default.
So far, I found that the best way to do so is to override the method GenericInitAdvancedSearchController.createAdvancedSearchInitContext(NavigationNode navigationNode) wich takes a navigationNode in the arguments
My question is how can I define a new navigation node since the object is just passed by socket from the widget socketId = "nodeSelected", is there an initializer, a factory to generate one by catalog.
Thank you in advance.
The way I did it is by overriding the method initializeWithContext inside the FullTextSearchController, this method is called the first time a user logs in. That's when you can check the group of the logged user and add conditions to the solr query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
There is a Advanced Search Engine Generic Initializer
widget that allows adding any conditions you wish to the search. What I would do is:
introduce two Explorer Tree
configurations for different groups
extend explorerTreeSelectionProxy
multiplexer widget by introducing two virtual output sockets (let's call them catalogA
and catalogB
) and two settings (`catalogA_expression` and catalogB_expression
); those two settings should provide a SpEL expression that returns true if apropriate node was passed as #root
(i.e. #root.id EQ 'explorer-tree-nodes-catalogA'
if node representing catalogA
has id set to explorer-tree-nodes-catalogA
)
create new bean that implements com.hybris.backoffice.widgets.advancedsearch.AdvancedSearchInitializer
and add proper conditions depending on selected node
introduce new Advanced Search Engine Generic Initializer
widget that points to bean created in previous step
connect virtual sockets from explorerTreeSelectionProxy
with initializer and initializer with advanced search
This way you would have those nodes working as expected.
When it comes to have those nodes selected by default, you can do it by following widget meshup change:
Connect perspectiveSelected
socket of PerspectiveContainer
with Condition Evaluator
that would check if it is hmc2
Connect true
socket of this Condition Evaluator
with Property Extractor
that would create new instance of com.hybris.backoffice.navigation.TreeNodeSelector
Connect genericOutput
of this Property Extractor
with Explorer Tree
's nodeIdSelected
socket
The only problem with this solution is that it would select this node every time Administration Cockpit is opened.
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I don't really get what you want to achieve. My guess is:
Explorer tree on the left of Administration Cockpit
contains two additional nodes - each representing different catalog
When user logs in, depending on which group he belongs to, a particular node is selected
A selection is propagated to Advanced Search
and eventually to Collection Browser
which displays a list of Products assigned to selected catalog
Am I right? If so, then is user still able to change the catalog and freely manipulate with Advanced Search
conditions? What version of SAP CX are you using?
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello , thank you for taking your time to comprehend my issue.
I am using Hybris 6.7, and we want to implement this in a custom backoffice extension. The second point that you mentioned is the one that I want to implement, I can't figure a way to select a default node for a user after the login process.
Right now, no node is selected which retrieves all the products, I do not want that to happen.
I'll explain further in the next comment (due to the limited amount of characters).
I will simplify what I want to achieve with examples:
Imagine that we have two catalogs catalogA and catalogB (both readable catalogs for all usergroups).
If the user is member of userGroupA then after login only products from catalogA should be shown in the gridView/ListView (ie: catalogA Navigation Node should be selected ).
If the user is member of userGroupB then after login only products from catalogB should be shown in the gridView/ListView (ie: catalogB Navigation Node should be selected ).
After debugging the login process I found that when users login to product cockpit, all products are shown by default (Because Hybris creates a SolrSearchQuery to retrieve all products by default), so is there a way to intercept and change that query to add conditions to it.
Thank you in advance for any help you can provide. Cheers.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.