Reputation: 1
i am trying to create a new accelerator. i ve created a new extension via extgen (yb2Baccelerator) after that i created a new cmssite in hmc. what is the link between the cmssite ( hmc > wcms > websites) and the frontend extension ? thanks for help
Upvotes: 0
Views: 343
Reputation: 11
Well, the sort answer is: url pattern defined in the CMSSite.
Here is an example of CMSSite creation:
INSERT_UPDATE CMSSite ; uid[unique=true] ; theme(code) ; channel(code) ; stores(uid) ; contentCatalogs(id) ; defaultCatalog(id) ; defaultLanguage(isoCode) ; urlPatterns ; active ; previewURL ; startingPage(uid,$contentCV) ; urlEncodingAttributes ;
; $siteUid ; blue ; B2B ; $storeUid ; $contentCatalog ; $productCatalog ; $defaultLanguage ; (?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$,(?i)^https?://api\.hybrisdev\.com(:[\d]+)?/rest/.*$,(?i)^https?://localhost(:[\d]+)?/rest/.*$ ; true ; $storefrontContextRoot/?site=$siteUid ; homepage ; storefront,language
Long answer from https://help.sap.com/viewer/4c33bf189ab9409e84e589295c36d96e/1905/en-US/8aefea0586691014b55edcb21295e112.html:
CMSSite A CMS site configuration options include:
Hope it helps.
Upvotes: 1
Reputation: 1593
Your newly created storefront extension should contain the CMSSiteFilter java class. This filter is responsible for setting on the Hybris Session a CMSSite, Catalogs, etc...
The CMSSite which will be set on the session will be decided based on the request URL(i.e the URL you put in the browser when trying to access your extension).
By default, you can access a website using a query param containing the site id as depicted below:
https://localhost:9002/?site=id_of_the_website&clear=true
In case your storefront has a different webroot than please see below example which can be used for accessing the B2C OOTB(out of the box) apparel store :
https://localhost:9002/yacceleratorstorefront/?site=apparel-uk&clear=true
Upvotes: 0