Understanding Accelerators

So once you installed hybris, you think of having your own code base. At the same time, we see a lot of vanilla extensions, through which we can actually even see a working site, normally can be browsed at,

http://localhost:9001/yaccleratorStorefront/?site=hybris

So Cool na!!! We just installed and we have a working site.

But wait. That’s a sample. The literal meaning of accelerator, is to speed up. So hybris has given you a sample, so that can be used as a reference for your own custom store front. So any thing, that start with, yacclerator is a sample extension for reference only. We should not make changes to this, instead we should use our own code base generated via modulegen to achieve customization.

And then we will see our store front at

http://localhost:9001/actualStorefront/?site=actual

HTTP Status 500 – Cannot find CMSSite associated with current URL

This is the first error we see, when we set up Hybris and hit http://localhost:9001/

Hybris supports multi sites for a single code base, which can be accessed by passing a request parameter while accessing the site for first time. This parameter is set in browser session for subsequent requests.

http://localhost:9001/?site=hybris

When you pass the parameter site, with value same as your CMS site id, you are able to see the home page.

If you are using a single storefront, then you need to tell hybris specifically, by configuring the URL patterns for your site, so that hybris knows, what site you are looking for, when hit without a parameter. This can be dine in site.impex

$siteUid=hybris
UPDATE CMSSite;uid[unique=true];urlPatterns;defaultlanguage(isocode)
;hybris;”(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$;en