Tuesday, 2 May 2017

Creating CMS component as Addon

Creating CMS component as Addon .

Creating a new CMS component and controller with addon

1)  Create addon:

Run ‘ant extgen’ in platform folder.
Type/select ‘yaddon’ template
Provide required extension details.
Provide required package details.

2)  Add new addon extension in localextensions.xml of Config folder.

3)  Create new CMS component in *-items.xml.This is the place for data modeling.

        <itemtype code="xxxxxxComponent" autocreate="true" generate="true" extends="SimpleCMSComponent"
                     jaloclass="xxxxxxComponent">
                     <attributes>
                           <attribute type="xxxxl" qualifier="xxxx">
                                  <persistence type="property" />
                                  <modifiers optional="false" />
                                  <defaultvalue>
                                 
                                  </defaultvalue>                               
                           </attribute>
      
              </itemtype>
      

4)  Add entry in XXXXX-locales_en.properties

type.xxxxxxComponent.name = …… 

5)  As new component extends cms component , so set dependency in eclipse and extensioninfo.xml.
 name="cms2"/>
6)  Ant all and do system update.
Update with options ‘Update Running System’ and ‘Localized types’.

7)  Create JSP with name as new component type in small case(xxxxxxComponent).

8)  Create a controller and extend AbstractCMSAddOnComponentController.

a.  Add your logic by overriding fillModel().
b.  Add required notations
@Controller("xxxxxxComponentController")
@Scope("tenant")
@RequestMapping(value = ControllerConstants.Actions.Cms. xxxxxxComponent)

9)    Define controller :
set context:component-scan on *-web-spring.xml
<bean id=" xxxxxxComponentController " class="de.hybris.platform.addons.recentlyviewedproductsaddon.controllers. xxxxxxComponentController" scope="tenant">
</bean>
10)Building the AddOn
   ant addoninstall -Daddonnames="XXX(addon name)XX"  -DaddonStorefront.yacceleratorstorefront="XXXstorefront"

11) Run ant all

12)Add the new component to required section/template/.. of a page in HMC.

13)Now new component is available to use in the location as declared above. 

Sunday, 23 April 2017

Hybris installation 5.6 and above versions

SAP Hybris 5.6 and  above version  installation 



  1. Set JAVA_Home and Path variable 

    Extract the commerce suit 
    • We can see hybris-commerce-suite folder in it 
    •  In the hybris-commerce-suite- folder, we can see hybris and licenses folders 
    • In the hybris folder we can see bin folder and it has all default extensions(platform,ext-cockpit,ext-commerce,ext-data etc)


  1. Go to platform extension and open this path in the command prompt 


        • Execute the setantenv.bat file to set the ant home 
        • Install Recipe b2c_acc or b2b_acc as per requirement. 
        • Ex: Install.bat -r b2c_acc 
        • Wait till build successful 
        • log, temp and data folders are created. These are empty by default

  1. Initialize the Recipe(b2c_acc) 


    • Ex:install.bat -r b2c_acc initialize 
    • Wait till build successful 
    • Note: it takes more time please wait

  1. Start the server with hubrisserver.bat 


      • Wait till server started successfully 

  1.  Login to MCC and check all the URL’ user name as admin and password as nimda



Login to hmc with admin/nimda 

localhost:9001/hmc

Login to hac with admin/nimda

 localhost:9001/hac

Login to admincockpit with admin/nimda

 localhost:9001/admincockpit

Login to productcockpit with productmanager/1234 or  admin/nimda 

localhost:9001/productcockpit

Login to cmscockpit with cmsmanager/1234 or  admin/nimda 

localhost:9001/cmscockpit

Creating CMS component as Addon

Creating CMS component as Addon . Creating a new CMS component and controller with addon 1)    Create addon: Run ‘ant extgen’ ...