MBB
MBB

Reputation: 1

link between the cmssite and the frontend extension

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

Answers (2)

user3271463
user3271463

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:

  • The BaseStore for the storefront.
  • URL pattern regular expressions that enable the yacceleratorstorefront web application to decide which CMSSite and BaseStore to use to fulfill the request.
  • The content catalog for the WCMS content. Usually one content catalog serves just one CMSSite, but it is possible to reuse the content catalog for multiple CMSSites.
  • The product catalog, again the same catalog of products, categories, promotions reviews, and so on, could be used in multiple base stores or CMSSites. The optional classification catalog, it is helpful to have one classification catalog per product catalog if using more than one.
  • The theme, which selects the CSS and message bundles for the storefront.
  • The homepage for the storefront.
  • The corresponding system Java locale when a user selects a particular language, which is important for formatting currencies and numbers.
  • A flag to enable or disable the entire storefront.

Hope it helps.

Upvotes: 1

dj_frunza
dj_frunza

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

Related Questions