How to use tabs OOTB in hybris on mine custom tabs? - components

I want to create my custom tabs in hybris. I saw OOTB example for product details page. There has TabsSlot and for cmsComponents(&componentRef) use TabPanelContainer which contains 3 jsps with JspIncludeComponents. In my way I want to have in my custom page templete MyTabs for Slot and inside it I have again 3 jsps, but when load the page the content inside body is ok, but in head looks bad.
There don't has css classes , why is that and how can I make it?
The situaton is, I have 3 tabs for example, 2 of them I don't want to be editable in smartedit ( to be jspincludecomponent ) , but for other 1 I want to be custom component and will be editable from smatedit.
In cms-content.impex I created this.
INSERT_UPDATE JspIncludeComponent; $contentCV[unique = true]; uid[unique = true]; name ; page ; actions(uid, $contentCV); &componentRef
; ; Contact ; Contact ; contact.jsp ; ; Contact
; ; MySupportTickets ; My Support Tickets ; mySupportTickets.jsp ; ; MySupportTickets
; ; Faq ; Faq ; faqTab.jsp ; ; Faq
INSERT_UPDATE ContentSlot; $contentCV[unique = true]; uid[unique = true] ; name ; active; cmsComponents(&componentRef)
; ; Tabs ; Body Content Slot for Support and FAQ ; true ; FAQTabsContainer
INSERT_UPDATE ContentSlotForPage; $contentCV[unique = true]; uid[unique = true] ; position[unique = true]; page(uid, $contentCV)[unique = true][default = 'supportAndFAQPage']; contentSlot(uid, $contentCV)[unique = true]
; ; BodyContent-support-and-faq ; Tabs ; ; Tabs
INSERT_UPDATE CMSTabParagraphContainer; $contentCV[unique = true]; uid[unique = true]; name ; visible; simpleCMSComponents(uid, $contentCV); &componentRef
; ; FAQTabsContainer ; Tab container ; true ; Contact,MySupportTickets,Faq ; FAQTabsContainer
also I have one page which will use these jspincludecomponents inside it as <cms:PageSlot position="Tabs"/>
In jsps I use for head tabs <tabshead>....</tabshead> and for body <tabsbody>...</tabsbody> . The body looks ok with the html but header tabs looks bad. I don't know what is the reason

Related

Roles restricting access to import Hot folder throuh impex backoffice hybris

I need an impex that will prohibit the import of data into the hot folder for users of a specific group.
In other i need those buttons to be muted.
image
Appreciate your inputs.
I've tried something like this, but i'm not sure what to write in a gap.
`
$START_USERRIGHTS; ; ; ; ; ; ; ; ;
Type ; UID ; MemberOfGroups ; Password ; Target ; read ; change ; create ;
remove ; change_perm
Role ; ReadGroup ;
;;;; HotFolderMediabatch ;+;-;-;-;
$END_USERRIGHTS`

No read access for Product in backoffice with new usergroup

I created a new usergroup but i'm trying to view the product node and i dont have permisions for read and write that.
I tried to add permissions using this but is not working.
$START_USERRIGHTS; ; ; ; ; ; ; ; ;
Type ; UID ; MemberOfGroups ; Password ; Target ; read ; change ; create ; remove ; change_perm
UserGroup ; xxxxxxxxxxxRole ; ; ; ; ; ; ; ;
; ; ; ; Category ; + ; + ; + ; + ;
; ; ; ; Product ; + ; + ; + ; + ;
; ; ; ; BaseStore ; + ; + ; + ; + ;
; ; ; ; CronJob ; + ; + ; + ; + ;
; ; ; ; Job ; + ; + ; + ; + ;
$END_USERRIGHTS; ; ; ; ;
Simple UserGroup is not respected by backoffice ,to support this create new backoffice role.
A BackofficeRole is an extension of UserGroup that is meant to be used for restricting access in Backoffice (i.e. UI configuration context defines an dimension called principal which actually work exactly on BackofficeRoles). It also introduces an attribute called authorities which extends restriction possibilities (i.e. widget access may be restricted only to specified authorities) - user may use only one role at the moment, but different roles may have same authorities.
You cannot use simple UserGroup then - it will not be respected by Backoffice.
Below you may find examples of restriction capabilities:
<context type="Product" component="myComponent" principal="user1">
...
</context>
<context type="Product" component="myComponent" principal="backofficeRole1">
...
</context>
<widget id="someWidget" widgetDefinitionId="com.hybris.someWidget"
access="backofficeRole1" />
<widget id="someWidget" widgetDefinitionId="com.hybris.someWidget"
access="authority1" />
The new usergroup newUserGroup should be given a read access (or even a write access if required) to the productCatalogVersion in which the members of that group will be able to view (read) the products details of that catalog version (Staged or Online, etc ..)
Here is an example of impex to give newUserGroup read access and write access to XYZ_ProductCatalog
INSERT_UPDATE CatalogVersion; catalog(id)[unique = true]; version[unique = true]; readPrincipals(uid)[mode = append]; writePrincipals(uid)[mode = append]
; XYZ_ProductCatalog ; Staged ; newUserGroupUID ; newUserGroupUID
; XYZ_ProductCatalog ; Online ; newUserGroupUID ; newUserGroupUID
You may modify the above impex to suit your use case.

how to configure OOTB "inStockFlag" and "reviewAvgRating" index property as facets

Please help to achieve this. I added these two properties from non facets index property to facet index property in solr.implex file. Run the full indexer ,
added customer review for some of the products and approved the status as well in spite of that these two properties are not showing as facets in storefront.
Please guide me step by step how can I achieve this. I have already wasted 2.5 days to achieve the same.
I am using hybris 6.4
First, run the below Impex form the HAC. Don't forget to change apparel-ukProductType with your Indexed type.
$solrIndexedType=apparel-ukProductType
# Facet properties
INSERT_UPDATE SolrIndexedProperty ; solrIndexedType(identifier)[unique=true] ; name[unique=true] ; type(code) ; sortableType(code) ; currency[default=false] ; localized[default=false] ; multiValue[default=false] ; useForSpellchecking[default=false] ; useForAutocomplete[default=false] ; fieldValueProvider ; valueProviderParameters[map-delimiter=|] ; ftsPhraseQuery[default=false] ; ftsPhraseQueryBoost ; ftsQuery[default=false] ; ftsQueryBoost ; ftsFuzzyQuery[default=false] ; ftsFuzzyQueryBoost ; ftsWildcardQuery[default=false] ; ftsWildcardQueryType(code)[default=POSTFIX] ; ftsWildcardQueryBoost ; ftsWildcardQueryMinTermLength ; facetType(code) ; facetSort(code) ; priority ; visible ; facet[default=true]
; $solrIndexedType ; reviewAvgRating ; double ; ; ; TRUE ; ; ; ; productReviewAverageRatingValueProvider ; ; ; ; ; ; ; ; ; ; ; ; MultiSelectOr ; Custom ; 10000 ; true ;
; $solrIndexedType ; inStockFlag ; boolean ; ; ; ; ; ; ; productInStockFlagValueProvider ; ; ; ; ; ; ; ; ; ; ; ; MultiSelectOr ; Custom ; 10000 ; true ;
You can do the same changes from backoffice/hmc.
Go to System > Facet Search > Indexed Type > select your type from list > Find the inStockFlag under Properties filed > scroll to end (right) to edit inStockFlag properties > In popup go to facet setting tab > Mark Facet to true and edit other fields.
Lastly, run the full indexer.

Hybris faceted search

I have a requirement whereby I have to implement a faceted search,where a user is taken through some questions and suggested a list of products on Hybris.Any approach to help me get started?
Solr supports facet search on its own. Hybris leverages this via the solr configuration. You can manage this through the impex file. There are a lot of fields on SolrIndexedProperty, but I think these are the ones required to control facet search - facet=true, facetType, and facetSort.
INSERT_UPDATE SolrIndexedProperty ; ... facet[default = true] ; facetType(code) ; facetSort(code) ; ...
; ... ; MultiSelectOr ; Alpha ; ...
Here's the full impex statement, in case I missed something.
INSERT_UPDATE SolrIndexedProperty ; solrIndexedType(identifier)[unique = true] ; name[unique = true] ; type(code) ; isAlpha[default = false] ; isNumeric[default = false] ; isAlphaNumeric[default = false] ; sortableType(code) ; currency[default = false] ; localized[default = false] ; multiValue[default = false] ; facet[default = true] ; facetType(code) ; facetSort(code) ; priority ; visible ; useForSpellchecking[default = false] ; useForAutocomplete[default = false] ; fieldValueProvider ; valueProviderParameter ; facetDisplayNameProvider ; customFacetSortProvider ; topValuesProvider ; rangeSets(name) ; displayName ; includeInResponse [default=true]
; yourProductType ; colorFacet ; string ; true ; ; ; ; ; ; ; ; MultiSelectOr ; Alpha ; 7500 ; true ; ; ; colorValueProvider ; ; ; facetNameSortProviderAscending ; defaultTopValuesProvider ; ; "Color" ;false

Hybris Readonly UserGroup

I need to set up a user group which should have access to everything like the admingroup but with readonly rightsg. I know that there is a way to set the access rights for single types, but is there any method which sets the readonly right to all? Also I need to know if there is a type which allows login rights to specific cockpits. The problem is that some users are allowed to access to productcockpit but not into cmscockpit.
Please see the script below, this script enables read only rights for the product cockpit. Please change the same for other cockpits
# -----------------------------------------------------------------------
#
# Import Access Rights for Product Cockpit
#
$defaultPassword=1234
INSERT_UPDATE UserGroup;UID[unique=true];groups(uid)[mode=append]
;myproductmanagergroup;cockpitgroup,employeegroup
INSERT_UPDATE Employee;UID[unique=true];password[default=$defaultPassword];description;name;groups(uid);sessionLanguage(isocode);sessionCurrency(isocode)
;myproductmanager;;Product manager;My Product Manager; myproductmanagergroup;en;ZAR
UPDATE CatalogVersion;catalog(id)[unique=true];version[unique=true];writePrincipals(uid);
;apparelProductCatalog;Online;myproductmanagergroup,myproductmanager;
;apparelProductCatalog;Staged;myproductmanagergroup,myproductmanager;
$START_USERRIGHTS;;;;;;;;;
Type;UID;MemberOfGroups;Password;Target;read;change;create;remove;change_perm
UserGroup;myproductmanagergroup;cockpitgroup;;;;;;;
# Access Rights for Products & Catalog;;;;;;;;;
;;;;Product;+;-;-;-;-;
$END_USERRIGHTS;;;;;
#Vikrant I was looking for a way to set readonly on every single Item so that this group can't change anything. My final solution is to set readonly right to the Target Item like this:
$START_USERRIGHTS; ; ; ; ; ; ; ; ;
Type ; UID ; MemberOfGroups ; Password ; Target ; read ; change ; create ; remove ; change_perm
UserGroup ; readonlygroup ; ; ; ; ; ; ; ;
; ; ; ; Item ; + ; - ; - ; -
; ; ; ; ProductReference ; + ; - ; - ; -
$END_USERRIGHTS; ; ; ; ;
I had the same issue, the solution is to create user group, then give it user rights for Item - this will apply for all types. And update catalogs with readPrincipals.
INSERT_UPDATE UserGroup; UID[unique = true] ; locname[lang = en] ; description ; backOfficeLoginDisabled[default = false]
; backofficereadonlygroup ; "Backoffice Read Only Group" ; "User has read only access to the Backoffice" ;
$START_USERRIGHTS;;;;;;;;;
Type;UID;MemberOfGroups;Password;Target;read;change;create;remove;change_perm
UserGroup;backofficereadonlygroup;;;;;;;;
;;;;Item;+;-;-;-;-;
$END_USERRIGHTS;;;;;
UPDATE CatalogVersion;catalog(id)[unique=true];version[unique=true];readPrincipals(uid);
;Default;Online;backofficereadonlygroup;
;Default;Staged;backofficereadonlygroup;

Resources