1
votes

I want to create a new page in SAP Hybris. After going through some articles I found that I have to follow some steps like writing impex commands, creating jsp file with proper tags & all, now my question is where should I write these impex commands to make it run successfully? If I run these on HAC(Hybris Admin Console), these runs successfully without any error, but I don't see any resultant page that should have been created. If I hit the link;

https://electronics.local:9002/trainingstorefront/electronics/giftPageTemplate

It is throwing 404 error.

My complete impex script goes like:-

$contentCatalog=electronicsContentCatalog
$contentCatalogName=Electronics Content Catalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online]
$productCatalog=electronicsProductCatalog
$productCatalogName=Electronics Product Catalog
$productCV=catalogVersion(catalog(id[default=$productCatalog]),version[default='Online'])[unique=true,default=$productCatalog:Online]
$picture=media(code, $contentCV);
$image=image(code, $contentCV);
$media=media(code, $contentCV);
$page=page(uid, $contentCV);
$contentPage=contentPage(uid, $contentCV);
$product=product(code, $productCV)
$category=category(code, $productCV)
$siteResource=jar:de.hybris.platform.electronicsstore.constants.ElectronicsstoreConstants&/electronicsstore/import/sampledata/contentCatalogs/$contentCatalog
$productResource=jar:de.hybris.platform.electronicsstore.constants.ElectronicsstoreConstants&/electronicsstore/import/sampledata/productCatalogs/$productCatalog
$jarResourceCms=jar:de.hybris.platform.electronicsstore.constants.ElectronicsstoreConstants&/electronicsstore/import/sampledata/cockpits/cmscockpit


INSERT_UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];name;frontendTemplateName;restrictedPageTypes(code);active[default=true]
                          ;;giftPageTemplate  ;Gift Wrapping Template   ;layout/giftPageTemplate ;;


INSERT_UPDATE ContentSlotName;name[unique=true];template(uid,$contentCV)[unique=true][default='giftPageTemplate'];validComponentTypes(code)
                             ;HeaderArea;;
                             ;NavBarArea;;
                             ;ASectionArea;;



INSERT_UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];name;active
                         ;;HeaderAreaSlot;Header Area Content Slot;true
                         ;;NavBarAreaSlot;NavBar Area Content Slot;true
                         ;;ASectionAreaSlot;A Section Area Content Slot;true

INSERT_UPDATE ContentSlotForTemplate;$contentCV[unique=true];uid[unique=true];position[unique=true];pageTemplate(uid,$contentCV)[unique=true][default='giftPageTemplate'];contentSlot(uid,$contentCV)[unique=true];allowOverwrite[default=true]
                                    ;;HeaderArea-giftPageTemplate;HeaderArea;;HeaderAreaSlot;true
                                    ;;NavBarArea-giftPageTemplate;NavBarArea;;NavBarAreaSlot;true
                                    ;;ASectionArea-giftPageTemplate;ASectionArea;;ASectionAreaSlot;true


INSERT_UPDATE ContentPage;$contentCV[unique=true];uid[unique=true];label;title[lang=en];name;masterTemplate(uid, $contentCV);defaultPage[default='true'];approvalStatus(code)[default='approved']
                         ;;giftCustomPage;giftPageTemplate;Gift Wrapping Page;Gift Wrapping custom page;giftPageTemplate;;;
1
You have to define a GET method to retrieve the content page.user1234SI.

1 Answers

0
votes

If you are using 2005 and I guess you do, you should be aware of a bug in the DefaultPageController. It is responsible to render each content page. However it does not dispatch any more in the standard accelerator. (Sadly I have not the related ticket ready in hand (I am on vacation :D. If you search for "DefaultPageController" in answers.sap.com, you should find the ticket.)

Add @RequestMapping("/**) to the DefaultPageController and see if it works then. SAP is also fixing the issue with AspectJ. Dont know if it is already in 2005.3