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 !!!!!