Friday, 11 March 2016

Create Endeca Template and Cartridge with ATG CRS 11.2

Create Endeca Template and Cartridge with ATG CRS 11.2

                   Hi here I am going to explain how to create an Endeca Template and Cartridge in Oracle Commerce Reference Store 11.2 in a very simplified way and with minimum steps.
                   My Environment is as below..
·         JDK 1.8.0_60
·         JBOSS EAP 6.4.0
·         Oracle DB 11gR2XE.
·         Oracle Commerce 11.2 (ATG 11.2)
·         Oracle Guided Search with Experience Manager 11.2 (Endeca 11.2)
·         Oracle CRS 11.2 with Preview and Staging Environment.
·         Windows 7

Create a new Endeca template

By Default CRS 11.2 has two inbuilt templates.. Template is a placeholder for the Endeca Cartridges.
·         OneColumnPage
·         TwoColumnPage

Which you can find in your deployed .ear or in the Experience Manager as below screen shot


 

Now Lets Create a New Template as Pranjal’s Two-Column Page to be used in CRS..

Step 1: Go to you EAC Application Folder

For me its C:\Endeca\Apps\CRSStaging\config\import\templates



Step 2: Now lets create a new template from the Two-Column Page. You also can create an independent page.

Make a copy of the folder



               Step 3: Rename the folder
                

              Step 4: Edit the Template and the files inside the Locale folder       
            
                      




Changing the files inside locals : it just the description I changed



Step 5: Save your work and deploy the template in Endeca authoring and live,




Step 6: Check your template creation in Endeca Experience Manager
Login to Endeca Workbench http://localhost:8006 and you should see the new template



Step 7: Create the JSP in your codebase and compile you project and update the ear



You should create a folder under store.war/cartridges/



To build and deploy you can use cim (fom step 4) or the below steps..
Source : http://technoon.github.io/lessons/Endeca-Cartridge-ATG-CRS




Create a new Endeca Cartridge
Lets create a new Cartridge called StoeDetailWithMap. To create Endeca Cartridge you need to create.
·         A Cartridge Component
·         A Cartridge Handler Class
·         A Cartridge ContentItem Class
·         A Cartridge Folder
·         A Cartridge JSP
·         Mapping the Cartridge to NucleusAssemblerFactory.properties


Step 1: Create the Cartridge in Endeca App folder and deploy to Endeca application
Go to the template folder (C:\Endeca\Apps\CRSStaging\config\import\templates)
Make a copy of the StoreDetail folder and rename it as StoreDetailWithMap


Edit the template.xml and files inside locales folder (Similar to the template creation explained in above)



Save your work and deploy the template in Endeca authoring and live

   


Validate creation of the cartridge in workbench similar to the template creation
   

Step 2 : Now you need to create the Cartridge Component. Here I am going to refer the existing StoreDetails Cartridge as I made this POC as copy of it..
You can find the source and config files under
\CommerceReferenceStore\Store\Endeca\Assmbler folder..


Now we are going to refer the StoreDetail Cartridge existing code..
The existing Handler Component
 

 

You can refer the classes from the component
Note: In this POC we are going to refer the existing component. For creating a totally new component you can refer this blog.
http://technoon.github.io/lessons/Endeca-Cartridge-ATG-CRS
Step 3: Now we need to create the JSP in the same path where the existing store detail jsp exist
(store.war/catridges/)
 

You can create required customization in the JSP like modifying the structure etc.
 



Step 4: Link the file to NucleusAssemblerFactory.properties

  
Step 5:  Build your project like explained while template creation and deply template configuration from authoring to live using
C:\Endeca\Apps\CRSStaging\control\promote_contant.bat
Or you can do it through the workbench (EAC Admin Console)
Under script click start next to PromoteAuthoringToLive. It should run and complete
 


Once its done you can access and customize your new template and cartridge using Experience Manager
Like I added a left column to existing store detail page..
  

Result Page
      



1 comment:

  1. Hello! moore good this tutorial. Thank you :) hugs of brazil!

    ReplyDelete

  SyntaxError : (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape Solution:...