Steps to create webstore or online website using Hybris e-commerce multi-channel suite

If you are very new to Hybris e-commerce then follow below steps to create a own webstore or online website
1. Download any version of Hybris suite like Hybris 4.8
2. After download go to CMD and go to Installed directory
  like c:/hybris/bin/plateform
 
3. set ant
Hybris provides a full fledge running webstore through accelarator extension so we only need to create accelarator type own extension
and we can customized this accordingly our requirements
so for that we need to type
ant modulegen command
after hit enter it will create six extension in our custom folder
Now you can customized it accordingly
ownWebstorecockpits
ownWebstorecore
ownWebstorefacades
ownWebstoreinitialdata
ownWebstorestorefront
ownWebstoretest
in above extension all UI related file and controller will in ownWebstorestorefront
and your default webstore url will
http://localhost:9001/ownWebstorestorefront?site=electronic

How can implement Ehcache in Hybris multi-channel ecommerce suite ? step to implement Ehcache in Hybris

Hybris is provide caching in spilit of content called region and we can configure and add object in each region cache
In Hybris core-cache.xml is heart of caching configuration in Hybris
Suppose we need to implement a another cache region then you need to add below code in core extension spring xml file
<alias alias="cacheRegionsList" name="defaultScenarioCacheRegionList" />
  <bean name="ownProductCacheRegion" class="de.hybris.platform.regioncache.region.impl.EHCacheRegion">
     <constructor-arg name="name" value="ownCacheRegion" />
     <constructor-arg name="maxEntries" value="50000" />
     <constructor-arg name="evictionPolicy" value="LFU" />
     <property name="handledTypes">
         <array>
             <value>1</value>
         </array>
     </property>
  </bean>
 
  <bean id="defaultScenarioCacheRegionList" class="java.util.ArrayList">
                    <constructor-arg>
                        <list>
                             <ref bean="typesystemCacheRegion"/>
                            <ref bean="entityCacheRegion"/>
                            <ref bean="queryCacheRegion"/>
                             <ref bean="ownProductCacheRegion"/>
                        </list>
                    </constructor-arg>
   </bean>
  
  
  
   After add above code you need to access caching by using DefaultCacheController for we need to add below code to access them
  
   @Autowired
 CacheController controller;




 final Collection<CacheRegion> regions = controller.getRegions();
  for (final CacheRegion region : regions)
  {
   if (region.toString().equals("goodyearCacheRegion"))
   {
   
    final Collection<CacheKey> cacheKey = region.getAllKeys();
    for (final CacheKey cach : cacheKey)
    {
     System.out.println(" Cache Region name  " + region.getName() + " Cache key  " + cach.toString());
    
    }
    final CacheStatistics stats = region.getCacheRegionStatistics();
    stats.getHitCount();
    //    (...)
   }
  }

Hybris 4.8 multi-channel suites setup | step –by-step to setup Hybris ecommerce

Follow below steps to setup hybris ecommerce multi-channel suite
1.       First unzip the hybris muti-channel suite
2.       After unzip open the cmd command promp and go the Hybrisfolder > bin> plateform
3.       First need to setup ant so type command  
Ø  D:\HybrisMC\hybris\hybris\bin\platform>setantenv.bat
4.       Now build your hybris by typing command
Ø  D:\HybrisMC\hybris\hybris\bin\platform>ant build all
5.       After successfully build there will create config folder in your installed hybris directory where it contain to important file local.properties and localextensions.xml file
6.       Now start your hybris server by typing command
Ø  D:\HybrisMC\hybris\hybris\bin\platform>hybrisserver.bat

Now you can check your hybris admin console by URL in internet explorer
http://localhost:9001/admin

How can craete a extension of type Ycommercewebservices ? Ycommercewebservices is not showing in ant extegen command

Basically i want to create a extension of type Ycommercewebservices  but when i giving ant extgen command Ycommercewebservices
extension type is not showing

For that i need to required modify ant extgen command for that follow below steps

1.       Go to Platform extension > extgen


2.       Open project.properties file and add below line for Ycommercewebservices 

extgen.template.list=yempty,springmvcstore,flexstore,storetemplate,ycockpit,fulfilmentprocess,soapspring,jmssample, Ycommercewebservices 

extgen.template.path.jmssample=${HYBRIS_BIN_DIR}/ext-template/ Ycommercewebservices 

Now again try it will work

Explain Model in Hybris multi-channel suite ? Define Model in Hybris ?

Model are the way to represents item in Hybris ie. each of item is represented by in Model Class. So Model class is just like POJO class
which contain all item attributes
For every item type after build Hybris framework that create class with suffix Model and configuration file i.e. for product type item model class
will create with name ProductModel

Suppose you have define below item type in items.xml
<itemtype
  generate="true"
  code="ContactRequest"
  jaloclass="de.hybris.springmvcdemo.jalo.ContactRequest"
  extends="GenericItem"
  autocreate="true"
  >
    <attributes>
      <attribute qualifier="message" type="java.lang.String">
        <persistence type="property"/>
      </attribute>
    </attributes>
</itemtype>

Then generated model class will be

package de.hybris.springmvcdemo.model;

import de.hybris.platform.core.model.ItemModel;

/**
 * Generated Model class for type ContactRequest first defined at extension {literal}springmvcdemo{literal}
 */
@SuppressWarnings("all")
public class ContactRequestModel extends ItemModel
{
    /** <i>Generated type code constant.</i>*/
    public final static String _TYPECODE = "ContactRequest";
   
    /**
         * <i>Generated constant</i> - Attribute key of <code>ContactRequest.message</code> attribute defined
         * at extension <code>springmvcdemo</code>.
         */
    public static final String MESSAGE = "message";
   
   
    /** <i>Generated variable</i> - Variable of <code>ContactRequest.message</code> attribute defined
         * at extension <code>springmvcdemo</code>.
         */
    private String _message;
   
   
    /**
     * <i>Generated constructor</i> - for all mandatory attributes.
     * @deprecated Since 4.1.1 Please use the default constructor without parameters
     */
    @Deprecated
    public ContactRequestModel()
    {
        super();

    }
   
    /**
     * <i>Generated constructor</i> - for all mandatory and initial attributes.
     * @deprecated Since 4.1.1 Please use the default constructor without parameters
     * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code>
     */
    @Deprecated
    public ContactRequestModel(final ItemModel _owner)
    {
        super(
            _owner
        );

    }
   
   
    /**
     * <i>Generated method</i> - Getter of the <code>ContactRequest.message</code> attribute defined
         * at extension <code>springmvcdemo</core>.
     * @return the message
     */
    public String getMessage()
    {
        if( !isAttributeLoaded(MESSAGE))
        {
          this._message = getAttributeProvider() == null ? null : (String) getAttributeProvider().getAttribute(MESSAGE);
          getValueHistory().loadOriginalValue(MESSAGE, this._message);
        }
        throwLoadingError(MESSAGE);
        return this._message;
    }
   
    /**
     * <i>Generated method</i> - Setter of <code>ContactRequest.message</code> attribute defined
         * at extension <code>springmvcdemo</code>.
     *
     * @param value the message
     */
    public void setMessage(final String value)
    {
        this._message = value;
        markDirty(MESSAGE);
    }
   
}