Showing posts with label e-commerce suite. Show all posts
Showing posts with label e-commerce suite. Show all posts

Step to create PageTemplate and Page in Hybris 4.8 e-commerce suite | Hybris 4.8 Tutorial



Steps to create a PageTemplate and page [All below examples are related to Home Page].

(1)    Create  PageTemplate which will have uid , restrictedPageTypes defines for which type of pages the template can be used.[ For ex: LandingPage2Template]
(2)    Create ContentSlotName associated to the pre-defined templates and declare validComponentTypes (what type of components can be associated to this section.).
[For ex:  SiteLogo, HeaderLinks, MiniCart, NavigationBar, Section1, Section2A, Section2B, Section2C, Section3, Section4, Section5, Footer].

(3)    Create ContentSlotForTemplate. Basically this is used for common area in all pages for ex: header ,footer [For ex: SiteLogo-LandingPage2, HomepageLink-LandingPage2, NavigationBar-LandingPage2, MiniCart-LandingPage2, Footer-LandingPage2, HeaderLinks-LandingPage2]

(4)    Create Page which will have association to the PageTemplate. [Ex:homepage]

(5)    Create ContentSlot. Depedending on the requirement these ContentSlots can be associated to the ContentSlotForTemplate or contentSlotForPage. Associate the required components to these contentslots.
(6)    [For ex: Content Slot NavigationBarSlot is associated to ContentSlotForTemplate NavigationBar-LandingPage2 and ContentSlot Section4Slot-KmCAHomepage is associated to ContentSlotForpage Section4-KmCAHomepage ].

ContentSlotName


 
                 PageTemplate àContentSlotForTemplateàContentSlot àCMSComponent

               Content/Category Page à ContentSlotForPage à ContentSlot à  CMSComponent

(7)    Create ContentSlotForPage and associate it to contentSlot [for ex: Section4Slot-kmCAHomepage].

Explain Multi-Tenant System in Hybris e-commerce suite ? How Multi-Tenant is differ from Hybris cluster.

Multi-Tenants means individual set of data across one database .Hybris  e-commerce suite provide to run one single codebase over multiple set of data . following below point need to remember related to hybris interview point of view

1.       It provide isolation between set of data (tenant)

2.       Provide individual time zone and locale setting.

Hybris multi-Tenant is completely differ from Hybris clustering as below

A hybris Cluster is a concept different from multi-tenant hybris Commerce Suites. A hybris Cluster is a number of individual, separate hybris Commerce Suites sharing one single set of data, whereas a multi-tenant hybris Commerce Suite is one single hybris Commerce Suite using individual sets of data.

How To create Cron Job in Hybris e-commerce suite | Interview Question on Hybris 4.8 e-commerce suite

Below given step by step to create hybris cron job

1. create a class MyFirstCronJob as below

/**
*
 */
package se.hm.core.cronjob;

import de.hybris.platform.cronjob.enums.CronJobResult;
import de.hybris.platform.cronjob.enums.CronJobStatus;
import de.hybris.platform.cronjob.model.CronJobModel;
import de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable;
import de.hybris.platform.servicelayer.cronjob.PerformResult;


/**
* @author
 *
 */
public class TestCronJob extends AbstractJobPerformable
{

                /*
                * (non-Javadoc)
                *
                 * @see
                * de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable#perform(de.hybris.platform.cronjob.model.CronJobModel
                * )
                */
                private String exportDir;

                /**
                * @return the exportDir
                */
                public String getExportDir()
                {
                                return exportDir;
                }

                /**
                * @param exportDir
                *           the exportDir to set
                */
                public void setExportDir(final String exportDir)
                {
                                this.exportDir = exportDir;
                }



                @Override
                public PerformResult perform(final CronJobModel arg0)
                {
                                System.out.printlnTestCronJob Job Started");


                                System.out.printlnTestCronJob Job Finished");
                                return new PerformResult(CronJobResult.SUCCESS, CronJobStatus.FINISHED);
                }

}


2. After create  KumudJob.java register this cron job in xml as below

<bean id="myFirstCrobJob" class="se.hm.core.cronjob.TestCronJob" scope="tenant"
                                  parent="abstractJobPerformable">
                                  <property name="exportDir" ref="exportDataBaseDirectory"/>
                </bean>

3. Now Run UPDATE Hybris

4. After UPDATE your created Cron job  KumudJob  will show in list of cronjob in Hmc where you can schedule .