Showing posts with label Endeca Assembler. Show all posts
Showing posts with label Endeca Assembler. Show all posts

Saturday, 7 July 2018

Enabling SEO in Endeca

Hi All,

I wanted to discuss SEO in Endeca, as we all know the Search Engine Optimization plays an important role in any E-commerce Site. The Url we are navigating should be simpler and user-friendly so it will get more rank in the search engines. This is the main concept behind it, In Endeca as we all know it works only on the guided Navigation we have to apply the filter, these filters are nothing but the dimensions, it is evident that the Url is getting increased like anything with this long Ids. Endeca has SEO mechanism where we can hide/encrypt these dimensionIds for better viewing and simple Urls.

There are two ways you can achieve this .

1. Spring injection.
2. Defineing in the class and property file.

I am going to discuss about the first approach. That is implementing using injecting the Spring.

You can follow the below steps to achieve it. you can also refer the CRS for implementation, we are also going to take this as the base for our implementation.

1. Copy all the Jars from the folder \CommerceReferenceStore\Store\Storefront\j2ee-apps\Storefront\store.war\WEB-INF\lib

2. Next steps are to create the following files.

endeca-seo-url-config.xml

you can find this file from CommerceReferenceStore\Store\Storefront\j2ee-apps\Storefront\store.war\WEB-INF

spring-context.xml

you can find this file from CommerceReferenceStore\Store\Storefront\j2ee-apps\Storefront\store.war\WEB-INF

3.Create a reference for these files from the web.xml as like below.

 <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring-context.xml</param-value>
  </context-param>

  Once you define the context here then by default spring injection is happened through here.

4. Congratulations SEO is enabled. Now you have to define the navigation state to use this SEO URL with the property

urlFormatter=/atg/spring/FromSpring/seoUrlFormatter

5. Restart the servers Now you will start seeing the SEO URLs for all of the navigation state.

6.Whats there in endeca-seo-url-config. SeoUrlFormatter is the class where you can write a logic to parse input required, this will get called for each handler defined .parsePathInfo can be utilised for the parsing it, by the way, we write to read the request parameters.

7. Hence Extend the class SeoUrlFormatter and create your custom logic, and override the method

8. Adding descriptors.

you have define the following formatter for the dimension which you need to enable the SEO. you really have the control overSEO from here.

appendAncestors=will append the ancestors.
appendDescriptor=will append the descriptors.
appendRoot=will append the root.

you can also define the separator here.

<bean id="categoryFormatter"
        class="com.endeca.soleng.urlformatter.seo.SeoDimLocationFormatter">

    <property name="key">
      <value>product.category</value>
    </property>

    <property name="appendRoot">
      <value>false</value>
    </property>

    <property name="appendAncestors">
      <value>true</value>
    </property>

    <property name="appendDescriptor">
      <value>true</value>
    </property>

    <property name="separator">
      <value>-</value>
    </property>

    <property name="rootStringFormatter">

      <bean class="com.endeca.soleng.urlformatter.seo.StringFormatterChain">
        <property name="stringFormatters">
          <list>
            <!-- replace 'product.category' with 'Category' -->
            <bean class="com.endeca.soleng.urlformatter.seo.RegexStringFormatter">
              <property name="pattern">
                <value>product.category</value>
              </property>

              <property name="replacement">
                <value>Category</value>
              </property>

              <property name="replaceAll">
                <value>false</value>
              </property>
            </bean>

            <!-- Execute the default string formatter chain -->
            <ref bean="defaultStringFormatterChain"/>
          </list>
        </property>
      </bean>
    </property>

    <property name="dimValStringFormatter">
      <ref bean="defaultStringFormatterChain"/>
    </property>

  </bean>

9. These are the steps for the SEO Happy Learning !!!!

Wednesday, 13 June 2018

Configuring GroupingApplicationRoutingStrategy

The GroupingApplicationRoutingStrategy allows more flexible groupings of sites than
SiteApplicationRoutingStrategy does. For example, with GroupingApplicationRoutingStrategy,
you can have three sites handled by one EAC application and two other sites handled by a second EAC application. If a site has multiple languages, all records for the site are directed to the site’s EAC application, regardless of the language.

Mapping of applications to sites is done through the applicationGroupingMap property of the
GroupingApplicationRoutingStrategy component. This property is a Map where each key is the name
of an EAC application and the corresponding value is a list of the site IDs of the sites to be routed to that
application. 

Naviate to /atg/endeca/ApplicationConfiguration

set 

applicationRoutingStrategy=\
  /atg/endeca/configuration/GroupingApplicationRoutingStrategy

 To ensure that separate records are created for each EAC application, you need to add
the MultipleSiteVariantProducer to the variantProducers property of each
EndecaIndexingOutputConfig component. For example:

variantProducers+=/atg/search/repository/MultipleSiteVariantProducer

 Also, mention the siteIDsToIndex property with all the sites required to index in output config. please consider this as an important step, if you are not doing this your indexing will always be a failure.

 Set the routingObjectAdapter property of the /atg/endeca/index/IndexingApplicationConfiguration component to specify the ContextRoutingObjectAdapter component to use:

routingObjectAdapter=\
 /atg/endeca/index/configuration/GroupingContextRoutingObjectAdapter

Set the routingObjectAdapter property of the /atg/endeca/assembler/AssemblerApplicationConfiguration component to specify the RequestRoutingObjectAdapter component to use:

routingObjectAdapter=\
 /atg/endeca/index/configuration/GroupingRequestRoutingObjectAdapter

eg: ApplicationConfiguration

workbenchHostName=localhost

# Our Workbench Port
workbenchPort=8006

applicationRoutingStrategy=\
  /atg/endeca/configuration/GroupingApplicationRoutingStrategy

defaultLanguageForApplications=

applicationKeyToMdexHostAndPort=\
ClothSiteAPP=localhost:15000,\
ApprealSiteApp=localhost:16000

keyToApplicationName^=/Constants.null

where ClothSiteAPP & ApprealSiteApp are EAC apps of the site. 


eg: GroupingApplicationRoutingStrategy

applicationGroupingMap=\
 ClothSiteAPP=ClothSite|shoeSiteCanada,\
 ApprealSiteApp=ApprealSite|clothesSiteUK|clothesSiteCanada

 It is necessary to mention two groups here otherwise you won't the response back from the assembler.

 For these group of sites, these apps will be used.

eg:IndexingApplicationConfiguration

CASHostName=localhost
CASPort=8500
EACHostName=localhost
EACPort=8888
routingObjectAdapter=\
  /atg/endeca/index/configuration/GroupingContextRoutingObjectAdapter
cxfLogLevelOverride^=/Constants.null


eg: AssemblerApplicationConfiguration

routingObjectAdapter=\
  /atg/endeca/assembler/configuration/GroupingRequestRoutingObjectAdapter

useFileStoreFactory=true


applicationKeyToStoreFactory=\
ClothSiteAPP=/atg/endeca/assembler/cartridge/manager/ClothSiteFileStoreFactory,\
ApprealSiteApp=/atg/endeca/assembler/cartridge/manager/ApprealSiteFileStoreFactory


Here you cannot use the default file store Factory, you have to use the filestore factory for separate instances.

Create a component 

eg :ClothSiteFileStoreFactory with the below data

$class=atg.endeca.assembler.content.ExtendedFileStoreFactory
configurationPath=\
C:\\Endeca\\Apps\\ClothSite
appName=ClothSiteApp

Last you mention about the 

eg:EndecaAdministrationService

/atg/endeca/assembler/admin/EndecaAdministrationService

$class=atg.endeca.assembler.MultiAppAdministrationService
storeFactory^=/Constants.NULL

Set this property to handle the multiple Applications.

Happy Learning !!!! 

Configuring SiteApplicationRoutingStrategy

Use the SiteApplicationRoutingStrategy if you have a separate EAC application for each site (with all languages in a given site being handled by that site’s EAC application), or if you have a separate EAC application for each combination of site and language. Make sure you are creating a separate app for the site.

Naviate to /atg/endeca/ApplicationConfiguration

set 
applicationRoutingStrategy=\
 /atg/endeca/configuration/SiteApplicationRoutingStrategy

 In addition, to ensure that separate records are created for each site, you need to add the UniqueSiteVariantProducer to the variantProducers property of each EndecaIndexingOutputConfig component. For example ProductCatalogOutputConfig,MediaOutputConfig,ArticleOutputConfig.

 variantProducers+=/atg/search/repository/UniqueSiteVariantProducer

 Also, mention the siteIDsToIndex property with all the sites required to index in output config. please consider this as an important step, if you are not doing this your indexing will always be a failure.

 Set the routingObjectAdapter property of the/atg/endeca/index/IndexingApplicationConfiguration component to specify the ContextRoutingObjectAdapter component to use:

routingObjectAdapter=\
 /atg/endeca/index/configuration/SiteContextRoutingObjectAdapter

Set the routingObjectAdapter property of the /atg/endeca/assembler/AssemblerApplicationConfiguration component to specify the RequestRoutingObjectAdapter component to use:

routingObjectAdapter=\
 /atg/endeca/index/configuration/SiteRequestRoutingObjectAdapter

eg: ApplicationConfiguration

workbenchHostName=localhost

# Our Workbench Port
workbenchPort=8006

applicationRoutingStrategy=\
 /atg/endeca/configuration/SiteApplicationRoutingStrategy

defaultLanguageForApplications=

keyToApplicationName=\
 ClothSite=ClothSiteAPP,\
 ApprealSite=ApprealSiteApp

applicationKeyToMdexHostAndPort=\
ClothSite=localhost:15000,\
ApprealSite=localhost:16000

where ClothSite & ApprealSite are sitesIds of the application

eg: SiteApplicationRoutingStrategy

eg:filterByLocale=true
applicationNameFormatString={0}{1}

eg:IndexingApplicationConfiguration

CASHostName=localhost
CASPort=8500
EACHostName=localhost
EACPort=8888
routingObjectAdapter=\
 /atg/endeca/index/configuration/SiteContextRoutingObjectAdapter
cxfLogLevelOverride^=/Constants.null


eg: AssemblerApplicationConfiguration

routingObjectAdapter=\
 /atg/endeca/index/configuration/SiteRequestRoutingObjectAdapter

useFileStoreFactory=true

applicationKeyToStoreFactory=\
ClothSite=/atg/endeca/assembler/cartridge/manager/ClothSiteFileStoreFactory,\
ApprealSite=/atg/endeca/assembler/cartridge/manager/ApprealSiteFileStoreFactory


Here you cannot use the defaultFileStore Factory, you have to use the filestore factory for separate instances.

Create a component 

eg: ClothSiteFileStoreFactory with the below data

$class=atg.endeca.assembler.content.ExtendedFileStoreFactory
configurationPath=\
C:\\Endeca\\Apps\\ClothSite
appName=ClothSiteApp


Last you mention about the 

eg:EndecaAdministrationService

/atg/endeca/assembler/admin/EndecaAdministrationService

$class=atg.endeca.assembler.MultiAppAdministrationService
storeFactory^=/Constants.NULL

Set this property to handle the multiple Applications.

Happy Learning !!!! 

Configuring Single ApplicationRoutingStrategy

This ApplicationRoutingStrategy by default available and you need to follow below steps for configuration

Naviate to /atg/endeca/ApplicationConfiguration

Set applicationRoutingStrategy property to null. This property is null by default, so you can leave it unset or set it to null explicitly. If applicationRoutingStrategy is null, an instance of the SingleApplicationRoutingStrategy class is created automatically.

Similarly, set the /atg/endeca/index/IndexingApplicationConfiguration .routingObjectAdapter and /atg/endeca/assembler/AssemblerApplicationConfiguration.routingObjectAdapter properties to null to automatically create instances of the SingleContextRoutingObjectAdapter and SingleRequestRoutingObjectAdapter
classes.

Additional configuration differs depending on whether you have a single EAC application for all languages or a separate EAC application for each language.

eg: ApplicationConfiguration
baseApplicationName=ATG
defaultApplicationName=ATG
# Our Workbench Host
workbenchHostName=localhost

# Our Workbench Port
workbenchPort=8006

If your application Name is ATG configure like above in ApplicationConfiguration. 

If you have different locales configure like these, Set this property if you have different locales otherwise set this property to Null.

defaultLanguageForApplications=fr

if this is set along with locale then during indexing the Application looks for the EAC application as ATGfr,ATGen etc.

eg:IndexingApplicationConfiguration 

CASHostName=localhost
CASPort=8500
EACHostName=localhost
EACPort=8888

eg:AssemblerApplicationConfiguration

defaultMdexHostName=localhost
defaultMdexPort=15000


Happy Learning !!!!

RoutingStrategy in Endeca

Hi guys, Sorry for taking more time to get back on 2018. I was busy with my regular works and did not find time in sharing the experience with you all. I was preparing this good contents for you these days, I am sure you are going to like all my upcoming topics, which is very interesting and concept wise more weight for you as an Endeca developer.

Why do want to go for routing?

The answer is simple !!!! my requirement of the application will not be the same at all the time. Sometimes my application works as a multisite, single site, group of sites. When we go with the default way Endeca provides for the application, it will be very hard to achieve it hence Endeca provides the way by which you can simplify the tasks. 

I used to term it as simplification, but the actual definition as per the document goes by this way "Routing is the process of directing records for indexing to specific EAC applications and their corresponding MDEX instances, and ensuring that queries (for example, search terms or dimension selections) are directed to the correct EAC applications as well." Remeber this you have to define the only by this way.

So we understand the routing and let's see what are the different types of routing supported by The platform Guided Search 11.3(Endeca)

There are three types RoutingStrategy

1. Single ApplicationRoutingStrategy

This is the default routing statergy the endeca comes with, It was recommended to use this statergy when we have no site based application, single mdex data and only one EAC application. Locale and language does not make difference. Configuring the  ApplicationRoutingStrategy check here .

2. SiteApplicationRoutingStrategy

This startergy can be used when we have the site based applications, for example, I have multisite application, different EAC applications for the sites, differnt mdex's and different data then we can go for this approach (with all languages in a given site being handled by that site’s EAC application), or if you have a separate EAC application for each combination of site and language. Configuring the SiteApplicationRoutingStrategy check here .

3. GroupingApplicationRoutingStrategy

This statergy can be used when we have the Single EAC applications for the group of sites, it is more flexible than the SiteApplicationRoutingStrategy regardless of the language. Configuring the GroupingApplicationRoutingStrategy check here .

Happy Learning Stay Tuned for featured posts !!!

Friday, 20 October 2017

About Editors in Endeca

Hi All,
   
   Happy Diwali !!!

Most of us when working on the XM Part of Endeca, dont explore much on the editors part since we are going with the OOTB editors , there was no necessary as well to learn about this OOTB editors .

So today in this post am going to explain some basics about this editors. What are  editors ? Editors are nothing but medium with the help of which we configure the data that flows from the xm. 

So What are the Default Editors are available ? There were many editors are available out of which some are very important for the basic operations are Boost and Burry, Choice,Link,Media,String etc.

So If you want to overwrite the existing Editors , you have follow some default steps that is being overridden .We can see this topic as future posts from developing via SDK.

Now how to change their configurations ? What are configurations , its nothing but the Values supporting the Functioning of this editors. What are the Inputs , what are its Configuration Files , this can be helpful in the many context of customization .How to Achieve this , follow the below steps .

1) Export the Existing Editors using   

runcommand.bat IFCR exportContent editors D:\backup\editors 

After the Editors whatever value you provide will be the Place where it gets exported .

2)After the Export Edit the Configs with the Custom Values which you need it .

3)Import the editors using 

runcommand.bat IFCR importContent editors D:\backup\editors 

Once the Importing is done those editors with the new Configs are avaliable .

So Extending and Creating the new Cartridges will be seen in the Future Posts !!!


Happy UnderStanding !!!!!


Tuesday, 5 September 2017

Logging in Endeca Assembler

Hi All,
        Most of Us will be very keen about Debugging the Code via Logging , this is Because this Prints the line it need .

So here is a solution for you and how to implement in Endeca. By Default Endeca OOTB code has very limited set of Logging . If you want to enable logging , most of the Class does not extend the Generic Service so no logging !! Dont Worry, Blindly Follow the Below Steps , you can enable logging for your Application .

I would Recommend of using the Same logging all the Places , because when you enable in one Component all the Corresponding components will print it from Starting of the Request and When Request is Becoming Death.

you can use the below snippet wherever it is required .

VariableArgumentApplicationLogging mLogger = AssemblerTools.getApplicationLogging();

usauge will be as follows mLogger.isLoggingDebug()

apart from this you will get all the loggings .


Happy Logging !!!!

Monday, 7 August 2017

Exception Handling in Endeca

Hi All,
  I am Going to Share Some Basics note about Exception Handling in Endeca . We will be having Many Scenarios that has to be handled, so that the Users will not lead to seeing the Error or the Exceptions. I am sharing my Experience it varies from the Implementation Perspective from developers to developers .

When we are implementing the Assembler Approach there are only two types of Exceptions will be land in to and we have to handle everything within it.

Exception
Description
AssemblerException
This Exception states that the exception occurred during the process or creating the Assembler Request. Eg ene Query,Host Exception
CartridgeHandlerException
This Exception Occurs while calling the single Cartridge handler, usually exceptions like NPE,Range Exceptions .

Well, we have Seen These Two Exceptions and next step is to how to bring these Exceptions in to our applications. When the endeca contentItems are rendered from the JSP then it is with the Developer, who renders it and no need to worry about this status. Where else we are going with the Rest or the JAX-RS Approach which requires these Scenarios to be handled before Sending the Status to the Service.

When you see the Architecture, there is no way we can handled the Exception Thrown. So what we have to do? Customize the Invoke Assembler or Assembler Tools only for the Exceptions? Not required.

So here is what you have to do, When the Assembler Exception Happens or the Cartridge Handler Exceptions Happens you are able to see the @error Param on the Content Item, when you go in to this param , you could able to see the type of exception. You can write a wrapper on top of the Calling type method for example in the Actor Chains, if it is going to be the Rest MVC architecture and Nucleus Resource Class in case of the JAX-RS Implementation, take the ContentItem that InvokeAssmbler Returns send it the Method and Parse it, weather it is network, Invalid key, NPE, Range, MDEX Down, Class Cast Exception and handle it appropriately based on the Type of Exception Status and Error Codes.. If the Content Item is null then blindly throw it as 500 Status .

I have handled in the above way Instead of throwing the Generic Exceptions, and it is working as Excepted. Hope you have understood the Easiest Way of handling the types of Exceptions in Endeca.

If you have any other Reference of handling it can Suggest Below.

Happy Learning !!!!!


Monday, 20 March 2017

Multiple-MDEX Content Configurations

Many of the Endeca Applications are done with Single MDEX environment, whereas the Applications having the Multiple Languages, it will be challenging to achieve the Indexing and Assembler Configuration. So We Can See what are the Changes have to be done, so that it can handle the Multiple MDEX environments.

Step:1

Create one EAC application per language (for example,  If you are having three Languages then Create the app for each Language ATGen, ATGes, and ATGde).

Modify the /atg/endeca/ApplicationConfiguration component of your server configuration. Set the defaultLanguageForApplications to null, and set the keyToApplicationName property to create a mapping of application keys to application names is configured for the Different Languages . For example:

defaultLanguageForApplications^=/Constants.null
keyToApplicationName=\
en=ATGen,\
de=ATGde,\
es=ATGes

Modify the /atg/endeca/assembler/AssemblerApplicationConfiguration component of your server configuration to set the applicationKeyToMdexHostAndPort property to create a mapping of application keys to hostname/port combinations. For example:

applicationKeyToMdexHostAndPort=\
en=localhost:15000,\
de=localhost:16000,\
es=localhost:17000

Step:2

For each EAC application, create a properties file for the corresponding FileStoreFactory component. Set the $class property to atg.endeca.assembler.content.ExtendedFileStoreFactory:

$class=atg.endeca.assembler.content.ExtendedFileStoreFactory

Set the configurationPath property of each FileStoreFactory component to the file-system pathname of the directory to retrieve promoted content from. For example, the configurationPath property for the FileStoreFactory component associated with an EAC application named ATGde might be:

configurationPath=\
ToolsAndFrameworks/11.0.0/server/workspace/state/repository/ATGde

Step:3

Modify the /atg/endeca/assembler/AssemblerApplicationConfiguration component in the local server configuration. Set the useFileStoreFactory property to true to automatically set a reference to the corresponding FileStoreFactory on the application’s WorkbenchContentSource:
useFileStoreFactory=true

Step:4

Set the applicationKeyToStoreFactory property of the AssemblerApplicationConfiguration component to map application keys to the FileStoreFactory components you created. For example:

applicationKeyToStoreFactory=\
en=/atg/endeca/assembler/cartridge/manager/FileStoreFactory_en,\
es=/atg/endeca/assembler/cartridge/manager/FileStoreFactory_es,\
de=/atg/endeca/assembler/cartridge/manager/FileStoreFactory_de

Step:5

Modify the /atg/endeca/assembler/admin/EndecaAdministrationService component in the local server configuration. Set the $class property to atg.endeca.assembler.MultiAppAdministrationService:
$class=atg.endeca.assembler.MultiAppAdministrationService
The MultiAppAdministrationService class is able to handle updates to multiple store factory instances.


For Multiple Application Indexing We can See in the Separate Post .

Saturday, 18 February 2017

Navigation State in Endeca

The Term Navigation State Can be Defined as the Current State of the Search, by which we can Filter or Sort the Results, the Navigation state is considered to be the Way Endeca identifies the Request and Process it accordingly.

The Componet /atg/endeca/assembler/cartridge/manage/NavigationStateBuilder is Responsible for Defining the Navigation  State.

This Component is of class ExtendedNavigationStateBuilder extends UrlNavigationStateBuilder.We Can See What are the Advatages of Class and How to Define it.

This class has the Method parseNavigationState which is being Called whe the Scope comes to the Navigation State, This method in turn calls Correspondig Navigation StatProcessors .For More Details on the Navigation State Processors You can Watch out My posts

http://searchendeca.blogspot.in/2016/10/usersegments-in-endeca.html

This Method Inturn Calls the parseRangeFilters which takes the Values that we defined as Range Filters.

This Method also inturn Calls the parseRecordFilters which holds the Value We Defined as RecordFilters.

For More Details about Record Filters You Ca Watch Out My Blogs Regarding the Record Filters

http://searchendeca.blogspot.in/2017/02/record-filters-in-endeca.html

If your Logic Needs to play wit this RecordFilter,RangeFilters You Can Play with this Class. 

Friday, 17 February 2017

Record Filters in Endeca

The Term Record Filter Can be Defined as Filtering the Records based on Some Property Value, this Type of Filters Can be added once if we know the Value that can Filtered from the List of Records , endeca Provides the Powerful Way by Which we can Achieve this functionality.

Step:1

Make the corresponding property as Record Filterable.

For More Information how to make property as Record Filterable You can Watch my following posts .

http://searchendeca.blogspot.com/2016/09/about-indexconfigcmdbat.html This posts has the Procedure to make the property as the RecordFilterable.


Step:2

Create a component of class that extends RecordFilterBuilderImpl and Override the buildRecordFilter method , the Return Value should be the Filterable Value.


Step:3

After you create a particular component you have to register the Same in the Navigation State by assaing to  recordFilterBuilders property in the NavigationStateBuilder component in the Path /atg/endeca/assembler/cartridge/manager this Filter Class will be called and set in the Navigation State During the Request.



For Reference you can Refer LocationTypeFilterBuilder From CRS.


Monday, 5 December 2016

Querying for Dynamic Field Names in Endeca.

Hi all, have you wonder how can we query for the multiple fieldnames in endeca? . This is also as simple as querying for the fieldnames as others, but the Dynamic fields should be initiazed properly before sending it to Endeca.

We can see how to initialize and set it in the Query for Endeca below.

How to Set FieldNames in Endeca.

pCartridgeConfig.setFieldNames(fieldNames);

Where pCartridgeConfig is the ResultsListConfig Component. Which holds the Value for the Cartridges Setting and Configurations.


fieldNames is the List that will be used for the Defining the List of Fields.


How to Set Dynaic FieldNames in endeca

List<String> fieldNames = new ArrayList<String>(getFieldNames());
pCartridgeConfig.setFieldNames(fieldNames);

In Case of the Dynamic fieldNames, we have to first initialize it and then set it in the pCartidgeConfig.The Reason being that the Setting the Property Value in the Request or Prototype Component we have to initiaze and set it . As given in the actual ATG Document.

Sunday, 13 November 2016

Registering Cartridges

Any time a cartridge handler has a name that does not match its cartridge type exactly, it must be registered in 
the /atg/endeca/assembler/NucleusAssemblerFactory.handlerMapping property. For example, The CategoryHeaderBanner component is registered in the NucleusAssemblerFactory.handlerMapping property as the handler for cartridges with an ID of HeaderBanner-ATGCategory. The following mappings cartridge type and handler are defined in Commerce Reference Store.


When the cartridge name and the handler name , both matches then you don’t need to register here.


handlerMapping+=\
  ContentSlot-Main=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  ContentSlot-Header=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  ContentSlot-Secondary=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  PageSlot=/atg/endeca/assembler/cartridge/handler/ContentSlot,\
  PromotionalContent-ATGSlot=\
     /atg/endeca/assembler/cartridge/handler/PromotionalContentSlot,\
  PromotionalContent-ATGTargeter=\
     /atg/endeca/assembler/cartridge/handler/PromotionalContentTargeter,\
  ProductSpotlight-ATGSlot=\
     /atg/endeca/assembler/cartridge/handler/ProductSpotlightSlot,\
  ProductSpotlight-ATGTargeter=\
     /atg/endeca/assembler/cartridge/handler/ProductSpotlightTargeter,\
  HeaderBanner-ATGCategory=\
     /atg/endeca/assembler/cartridge/handler/CategoryHeaderBanner,\
  DimensionSearchAutoSuggestItem=\
     /atg/endeca/assembler/cartridge/handler/DimensionSearchResults,\
  ProductSpotlight-ATGCategoryRelatedProducts=\
     /atg/endeca/assembler/cartridge/handler/CategoryRelatedProducts,\
  ProductSpotlight-ATGCategoryRecommendations=\
     /atg/endeca/assembler/cartridge/handler/CategoryRecommendations,\
  HorizontalRecordSpotlight=\
     /atg/endeca/assembler/cartridge/handler/RecordSpotlight,\
  ProductList-ATGCategoryChildren=\
     /atg/endeca/assembler/cartridge/handler/ProductListCategoryChildren

Note: The PriceSlider cartridge handler has the same name as the PriceSlider cartridge, so it does not need to be registered in the handlerMappingproperty.
  

Default Cartridges in Endeca

Cartridge can be defined as the components, that serve specific purpose in the pages or it may be defined as the dynamic content that was loaded in to the Content item.
Cartridges can be defined by both custom and reuse the OOTB one. Oracle commerce guided search provides the  easiest way , so that we can extend the OOTB one  and customize based upon our project need.


What are the Default Methods of the Cartridge handlers?

There may be some default methods available in the handlers , that should be taken in to account while extending it.

public void preprocess

This method is the First method to be called when the scope comes to the Handler from the nucleus assembler factory. It can also be defined as the method where we set the query to be returned from the endeca,  pCartridgeConfig is the handler config which is used for this purpose.Setting up the Rollup key, adding the dynamic filters will also be done in this method.

public <HandlerType> process

This is the Method used for the processing of the results, creating mdex query and firing it and getting the ENEResults, from the results we can able to fetch the Required . We can also manipulate the Results based on the specific condition. This method where the returntype will be return type of the Handler.


Hence the above two method are considered to be the default method to be considered when extending the handlers.

What are the Default Cartridges avalaible in Endeca OOTB

RefinementMenu
HorizontalRecordSpotlight
ResultsList
SearchBox

Other Existing Endeca Cartridges

The DAF.Endeca.Assembler module includes configuration, in the /atg/endeca/assembler/cartridge/handler/ Nucleus folder, for additional existing Oracle Endeca cartridge handlers from the com.endeca.infront.cartridge package. The table below provides a list of these cartridge handlers (note that some of these cartridges handlers are used by Commerce Reference Store and some are not):

Nucleus Component
Cartridge Handler Class
Breadcrumbs
BreadcrumbsHandler
ContentInclude
ContentIncludeHandler
ContentSlot
ContentSlotHandler
DimensionSearchResults
DimensionSearchResultsHandler
NavigationCartridgeHandler
NavigationCartridgeHandler
NavigationContainer
NavigationContainerHandler
RecordBasedNavigationCartridgehandler
RecordBasedNavigationCartridgeHandler
RecordDetail
RecordDetailsHandler
RecordSpotlight
RecordSpotlightHandler
RefinementMenu
RefinementMenuHandler
SearchAdjustments
SearchAdjustmentsHandler


We can also see about the individual handlers in the upcoming tutorials.

Friday, 28 October 2016

UserSegments in Endeca

If you want display content only to the specified set of people, then you need to have the User segment configure in the Xm .

You can add the usersegment by the following ways.











Once you added the usersegment then you should progrmatically add by the following way.

Step:1
create a class implements NavigationStateProcessor

Step:2
Override the method process.
@Override
public void process(final NavigationState pArg0) {

//custom business logic

getUserState().addUserSegments(“men”);

}
In the Component file define the following things

userstate =/atg/endeca/assembler/cartridge/manager/user/LiveUserState

We have to write a custom logic when the Usersegment can be applied on the particular condition.

Register this component in /atg/endeca/assembler/cartridge/manager/NavigationStateBuilder

in the property navigationStateProcessors

Sunday, 16 October 2016

Sorting in Endeca

In Endeca Assembler 11.1 all are defined as the components, even the Sorting’s are also defined as the Component . We can see the tutorials how to write the sorting component, and how to inject it.


Create a Custom component, in the Follwing path /com/endeca/infront/cartridge/model/sort

$class=com.infront.cartridge.model.SortOptionsRatingsConfig
$scope=request

label=By Rating


create a class that extends SortOptionConfig

import com.endeca.infront.cartridge.model.SortOptionConfig;

public class SortOptionsRatingsConfig extends SortOptionConfig {

public String RATING_HIGH=”Rating|1”;
    
     public SortOptionsRatingsConfig() {
           super();
     }

     public SortOptionsRatingsConfig(String pLabel) {
           mLabel = pLabel;
     }

     private String mLabel;

     public String getLabel() {
           return mLabel;
     }

     public void setLabel(String pLabel) {
           mLabel = pLabel;
     }

     public String getValue() {

// if the Soring value is Dynamically Dependent then we can write the Business logic for generating Sort Dynamically.

           return RATING_HIGH;
     }

}




Go to ResultsList Component  

atg\endeca\assembler\cartridge\handler\ResultsList.properties

and Register the Component in the Sorteres property.

sorters=\
/com/endeca/infront/cartridge/model/sort/Ratings


That’s It You will be getting the Sorting by Reviews, while fetching the Results. The Main Constarint is you have to define the Sorting Property as  the Double or the Alpha during indexing.