0

I created a project with ant modulegen. b2b from b2c recipe, because hybris wiki says this.

But i could not get a proper result on backoffice / wcms / website

for that, mystore shows empty for

Name

and

Content Catalogs

I found that inpex that is not working on hac admin.

This is path

mystoreinitialdata/import/coredata/stores/mystore/site.impex

This is the error:

INSERT_UPDATE CMSSite;uid[unique=true];theme(code);channel(code);stores(uid);contentCatalogs(id);defaultCatalog(id);defaultLanguage(isoCode);siteMapConfig(&siteMapConfigId);urlPatterns;active;previewURL;startingPage(uid,catalogVersion(CatalogVersion.catalog(Catalog.id[default=mystoreContentCatalog]),CatalogVersion.version[default=Staged])[default=mystoreContentCatalog:Staged]);urlEncodingAttributes;defaultPromotionGroup(Identifier)[default=mystorePromoGrp] ,8796093187112,,,column 12: could not resolve item for homepage| column 12: cannot resolve value 'homepage' for attribute 'startingPage';mystore;blue;B2C;mystore;mystoreContentCatalog;mystoreProductCatalog;en;mystoreSiteMapConfig;(?i)^https?://[^/]+(/[^?])?\?(.\&)?(site=mystore)(|\&.)$,(?i)^https?://mystore.[^/]+(|/.|\?.)$,(?i)^https?://api.hybrisdev.com(:[\d]+)?/rest/.$,(?i)^https?://localhost(:[\d]+)?/rest/.*$;true;/?site=mystore;homepage;storefront,language;

error is for that line

>     # CMS Site
>     INSERT_UPDATE CMSSite;uid[unique=true];theme(code);channel(code);stores(uid);contentCatalogs(id);defaultCatalog(id);defaultLanguage(isoCode);siteMapConfig(&siteMapConfigId);urlPatterns;active;previewURL;startingPage(uid,$contentCV);urlEncodingAttributes;defaultPromotionGroup(Identifier)[default=$promoGrp]
>     ;$siteUid;blue;B2C;$storeUid;$contentCatalog;$productCatalog;$defaultLanguage;$storeUidSiteMapConfig;(?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

I followed the recipe wiki and

https://wiki.hybris.com/pages/viewpage.action?pageId=294094425

that wiki. What am i doing wrong?

    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;defaultPromotionGroup(Identifier)[default=PromoGrp];# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference;# invalid item expression '# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference' - unexpected expression at 45
,,,,unknown attributes [ContentPage.$contentCV] - cannot resolve item reference, invalid item expression '# unknown attributes [ContentPage.$contentCV] - cannot resolve item reference' - unexpected expression at 45;$siteUid;lambda;B2B;$storeUid;$contentCatalog;$productCatalog;$defaultLanguage;(?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$;true;$storefrontContextRoot/?site=$siteUid;homepage;storefront,language,currency
user9708984
  • 141
  • 3
  • 15
  • 1
    The error is caused by the lack of a **ContentPage** instance named 'homepage' in the mentioned content catalogue. Make sure you create the content page as well before creating the CMSSite or use another existing content page – dj_frunza May 30 '18 at 09:19
  • When i go to backoffice/wcms, i see that Content Catalogs part is selected with mystore.startpage was empty, i slected appareluk homepage but still can not import and i got error when i go to localhost:9002 : ` May 30, 2018 3:29:29 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is de.hybris.platform.cms2.exceptions.CMSItemNotFoundExh root cause de.hybris.platform.cms2.exceptions.CMSItemNotFoundException: No page with id [homepage] found` – user9708984 May 30 '18 at 12:29

3 Answers3

1

Add this to your impex before importing CMS Site

INSERT_UPDATE SiteMapPage;&siteMapPage;code(code)[unique=true];frequency(code)[unique=true];priority[unique=true];active[default=true]
;Homepage;Homepage;daily;1.0;;
Joe Sebin
  • 452
  • 4
  • 24
  • it already has this `INSERT_UPDATE SiteMapPage;&siteMapPage;code(code)[unique=true];frequency(code)[unique=true];priority[unique=true];active[default=true] ;Homepage;Homepage;daily;1.0;; ;Product;Product;weekly;0.6;; ;CategoryLanding;CategoryLanding;daily;0.9;; ;Category;Category;daily;0.8;; ;Store;Store;weekly;0.6;; ;Content;Content;monthly;0.4;; ;Custom;Custom;daily;1.0;; `and importing it gives no problem – user9708984 May 30 '18 at 09:47
  • 1
    did you perform 'ant all' and updatesystem after successful import? – Joe Sebin May 30 '18 at 09:51
  • No because i already initialized and this was iniatialized in site.impex. After that i copied all impexes to import page to see which gives error and error is for site.impex `could not resolve item for homepage`. I did not try other impexes yet. – user9708984 May 30 '18 at 09:54
  • 1
    what is your hybris version? – Joe Sebin May 30 '18 at 10:47
  • i used that HYBRISCOMM6700P_0-80003492.ZIP – user9708984 May 30 '18 at 12:27
  • The basic problem you are facing here is due to the document you are following and the latest version of hybris you are using.the document is for 5+ versions and yours is 6.7. just have a look at the CoreDataImportService before initialization.the order in which impex files are imported set up there only.the chances of skipping some impex's which have dependency with the import failed(in your case) impex could be the problem here. – Joe Sebin May 30 '18 at 12:53
  • Actually i followed that mostly https://help.hybris.com/6.7.0/hcd/8acc8a5a86691014a20781b3f738213e.html After that finshed, i tried everything to make my store up, when i go to localhost:9002, ishould be able to see my store. So i also used that 5.7 version tutorial. I did not touch 'CoreDataImportService' . for example there is `store-responsive.impex` which is not in powertools but in electronics. but i want b2b – user9708984 May 30 '18 at 13:04
  • If you follow all 14 steps correctly in help.hybris.com/6.7.0/hcd/8acc8a5a86691014a20781b3f738213e.html it should work.make sure you are using this link for store and you have added this in hosts file.https://powertools.local:9002/trainingstorefront/powertools/en/USD. – Joe Sebin May 30 '18 at 13:26
  • I dont want to use powertools. this link works. I want to go to mystore store when i go to localhost. Should i copy all powertools files and rename them to mystore? – user9708984 May 30 '18 at 13:39
1

I think some Impex might have failed during your system initialization. So what I would suggest.

  • Since you have set up the custom extension with your store data, remove all OOTB stores(powertools, apparel-us etc.) from your localextension.xml file
  • Initialize your system. Look for the error log in the console, note down all Impex which fail to load
  • Correct those Impex and run it through hac Impex-Import
  • Once setup correctly your store correctly, you can follow this to access your site as root
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
  • I cant look on initialize be cause it takes at least 40 minutes on that old computer. Because of that,a fter initialize finishes, i copy all impexes to hac admin to see if all of them are succesful. In the question, that was not succesful. and i could not correct it. That is default impex which have come from ant module – user9708984 May 30 '18 at 12:37
  • As I said, make sure you have set up your custom extension correctly with all OOTB impex with your store data – HybrisHelp May 30 '18 at 12:44
  • But ant modulegen already created everything. should i copy impexes from powertools which is under `powertoolsi/resources/import/coredata` and rename? – user9708984 May 30 '18 at 13:01
  • It just create the template impex, if you want to have same OOTB site setup then you have to copy those. like WCMS components, pages, core data etc – HybrisHelp May 31 '18 at 05:37
  • From powertools? @HybrisFreelance – user9708984 May 31 '18 at 08:59
  • yeah if you are trying to setup b2b site – HybrisHelp May 31 '18 at 12:00
-1

You're using a version 6.7 of Hybris but you're following the wiki for the version 5.7. Follow this link. Here instead you can find the trails.

sharkbait
  • 2,980
  • 16
  • 51
  • 89