Monday 13 October 2014

Discountable/Non -Discountable SKUs in ATG 10.2


Today I came to know the interested attribute (discountable) of SKU added in ATG 10.2. Oracle introduced this boolean attribute at SKU and Product level. The attribute value true means it is discountable. The false value means non-discountable. By default SKUs and Products are discountable.

Non-discountable items do act as qualifiers for the promotion but they will not receive the discount.

Example : There is an Order Level Promotion say Spend 100$ get 20% Off.

Case 1 : If Order contains only non-discountable SKUs. In this case customer won't get any discount.
Case 2 : If Order contain non-discountable SKUs worth 60$.And discountable SKUs worth 40$.Here customer will get only 8$ discount (20% off 40). Both (discountable and non discountable) SKUs will contribute the amount required to trigger the promotion.

Thursday 2 October 2014

Indexing As Part of a Deployment

You can configure your environment so that when you run a deployment in Content Administration, indexing is automatically started after the deployment is finished. To make this automatic triggering occur, add the following three components and their configuration to the localconfig layer for your Content Administration server.

  1. /atg/commerce/endeca/index/CategoryToDimensionOutputConfig
      Specify the following property for this component.

      targetName=Production

     2.  /atg/commerce/search/ProductCatalogOutputConfig

      Specify the following property for this component.

      targetName=Production

   3.   /atg/search/SynchronizationInvoker

      Specify the following properties for this component.

      host=atg-production-server-host
      rmi=8860

Saturday 6 September 2014

Indexing hanged/stucked at CLEANING

After completion of catalog data import into BCC. I triggered the baseline indexing from dyn/admin (/atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin). 

After initial steps it hanged at CLEANING step.

The solution to this issue is execute below query on production schema.

truncate table srch_update_queue

Sunday 31 August 2014

Associating a site with Catalog in ATG

Today while importing the catalog data in BCC. I faced one issue.After completion of data load into BCC I realized that site information is missing from catalog items (category,product and SKUs).

Here is the list of steps I followed from ATG documentation to resolve this issue.


Note : Before following these steps.Run a full deployment fololwoed by Catalog Update Service (This will also create project in BCC.You need to deploy the project). 

Steps to register/create a site and associate it with a catalog.
  1. In the Business Control Center, expand Site Administration, then click Manage Site Assets.
  2. Enter a name and optional description for the project and click Continue.
  3. Create a new site and assign the existing application’s catalog as the default catalog for the new site. During this step, the site ID for the new site is assigned to the existing catalog. The same ID is also assigned to any of the catalog’s categories and sub-catalogs.
  4. At this point, existing catalog folders will appear in Merchandising as unsited items. If you want to keep them, these folders also need a site ID. Follow the steps below to assign a site ID to your catalog folders:
    • In the Business Control Center, expand Merchandising, then click Manage Commerce Assets.
    • Enter a name and optional description for the project and click Continue.
    • Navigate to Site Catalogs, then to Unsited Items.
    • Click the split screen icon at the bottom left of the window.
      BCC Split Screen Icon
      BCC Split Screen Icon
    • In the bottom portion of the split screen, navigate to Site Catalogs.
    • Drag a catalog folder from the top pane to the site you want it affiliated with in the bottom pane. The catalog folder is now affiliated with the site and has that site’s ID assigned to it.
  5. Deploy the project. During deployment, the site ID you assigned to the catalog is propagated from the catalog down to its constituent products and SKUs (by the CatalogMaintenanceService, which runs automatically on deployment).

Saturday 23 August 2014

Configure Users and Groups in Endeca Workbench

Here are the steps to configure Users and Groups for Endeca Workbench.
  1. Login into to Endeca Workbench as admin user.
  2. On first drop down menu (application selection menu), select Administrative Tools.
  3. Go to User Management section.
  4. Here you will see two tabs.
                 1.  Users
                 2.  Group.

1. User Configuration.

To create user click on Add User link on Users tab.

Workbench Users Tab
Workbench Users Tab
Create User pop up will display.

Create User Pop Up
Create User Pop Up
Enter the user details, here you can associate user with existing group.Then click on permissions tab select the permissions for user.

2. Group Configuration.

To create a group click on click on Group Tab on User Management page.

Now click on Add Groups button on this tab.

Workbench Group Tab
Workbench Group Tab

Create Group pop up will display.Enter the group details,click on permission tab to enter the permissions.Click on membership tab to select a sub group or user.

Group Detail Pop Up
Group Detail Pop Up


Sunday 17 August 2014

Introduction to Endeca Tools and Framework

Oracle Endeca Tools and Frameworks enable the dynamic presentation of content across all channels.
Deployments That Use Oracle Endeca Experience Manager Require the Tools and Frameworks package for  Oracle Endeca Commerce with Experience Manager. Deployments That Do not include Experience Manager Require the Tools and Frameworks package for Oracle Endeca Commerce with Guided Search.

Both versions of the package include the Following:

• Oracle Endeca Workbench, a tools suite That enables merchandising Content Spotlighting, and search  Configuration for cross-channel applications.
• The Endeca Assembler, an API for controlling the presentation of commerce sites and collecting usage information across all channels.
• The Endeca Tools Service.
• The Endeca Deployment Template, A Collection of operational components That Provides a Starting Point  for Developing and deploying Endeca applications.
• The Discover Electronics Reference Application.

Tuesday 29 July 2014

Introduction to Endeca Content Acquisition System (CAS)

The Endeca Content Acquisition System (CAS) is a set of Components That add, configure, and crawl data sources for use in an application.The Endeca Content Acquisition System crawls data sources, Converts documents and files to Endeca records, and stores them for Use in an Forge pipeline.Output of CAS is number of Record Store instances (one per data source).

Below are Important Points Related to CAS.



  • The Endeca CAS service is a servlet container That runs the CAS Server, the Component Instance.Manager, and any number of Record Store instances (one per data source).
  • The CAS Server is the component That Manages all file systems and CMS crawling operations.
  • The CAS Console Endeca Workbench is a Web-based application used to crawl various data sources including file systems and content management systems.
  • The CAS Server API allows users to write programs That Communicate With The CAS server.The Server API has a WSDL interface and a CAS Server Command-Line Utility.
  • The Dimension Value Id Manager is a CAS Component That Creates, stores dimension value identifiers.
  • The Endeca Web Crawler manages all Web crawl-related operations.
  • The Component Instance Manager Creates, lists, and deletes Record Store instances. The Component Instance Manager has a WSDL interface and overpriced a CIM Command-Line Utility.
  • The Endeca Record Store Provides persistent storage for generation of Records. The Record Store has a WSDL interface and Also a Record Store Command-line Utility.The CAS Server writes crawl output from each data source to a unique Record Store instance.
  • Endeca CMS connectors are available for use in the CAS Console Endeca Workbench or the CAS Server API. CMS Connectors Provide a means to access and crawl data sources in a wide variety of CMS types.
  • List and Remove Endeca application flags

    Below are useful eaccmd command options to list and remove Endeca application flags.

    1. List all flags.
              Syntax    : eaccmd list-flags --app AppicationName

              Example : eaccmd list-flags --app Discover

        2.   Remove particular flag.

              Syntax    : eaccmd remove-flag --app AppicationName --flag <flagName>

              Example : eaccmd remove-flag --app Discover --flag setbaselinedatareadyflag

        3.   Remove all flags.

             Syntax   : eaccmd remove-flag --app AppicationName 

            Example : eaccmd remove-flag --app Discover 

    Sunday 29 June 2014

    Price Generation in ATG

    ATG Commerce pricing services are based on below two complementary elements:
    1. Pricing engines.
    2. Pricing calculators.
    1. Pricing engines.
    •     Retrieving any promotions that are available to site visitors.
    •     Determining which pricing calculators generate prices.
    •     Invoking the calculators in the correct order.
     2. Pricing calculators.
    •     Looking up the price.
    •     Using information they receive from the pricing engines, promotions, and the qualifier service to determine prices. 

    Before pricing happens, the following steps take place:

    1. On a scheduled basis, the pricing engines load global promotions (those defined as applying automatically to all customers). An engine builds its list by using its globalPromotionsQuery property to query the Promotions repository, searching for any promotion where the Automatically Give to All Customers (global) property is set to true.

    2. At the start of the customer session, a PricingModelHolder instance is created. PricingModelHolder calls each pricing engine’s getPricingModels() method.

    3. The pricing engine getPricingModels() method gets any promotions listed in the activePromotions property of the current customer’s profile and merges them with the global promotions list it previously created.

    4. PricingModelHolder periodically updates both the global and active promotions.

    The result is that PricingModelHolder has a merged list of global and active promotions for each pricing engine. When the customer performs an action that prompts a pricing operation, such as adding an item to their cart, the following steps are performed:

    1. The business layer logic (such as a PriceItem servlet bean in a page) invokes a pricing engine.

    2. The pricing operation invokes PricingTools which then gets the PricingModelHolder for that customer.

    3. PricingTools gets the promotions from the PricingModelHolder and calls the pricing engine’s priceItems method, passing in the promotions as a list.

    4. The pricing engine applies its configured precalculators in the order in which they appear in its preCalculators property. A precalculator modifies a price without using any associated promotions. Each type of engine calls its corresponding type of precalculator.

    5. The pricing engine then takes the promotions list that was passed in and can again veto promotions from that list. The remaining promotions are sorted by priority and then evaluated.

    For each available promotion, ATG Commerce does the following:
    • The pricing engine calls the appropriate helper method (findQualifyingItems, findQualifyingOrder, or findQualifyingShipping) in the Qualifier class to determine which items should be discounted. The pricing engine passes the current pricing context into the helper method’s input parameters.
    • The findQualifyingItems() method calls evaluateTarget(), which returns a Collection of QualfiedItem objects, representing CommerceItem objects. The findQualifyingOrder() and findQualifyingShipping() methods return a single MatchingObject.
    • The QualifiedItem and MatchingObject include discount information such as the PMDL discount structure. 
    • The QualifiedItem or MatchingObject information is returned to the pricing engine, which uses the discount information to determine which calculator to use.
    • The pricing engine calls the calculator and passes in the items to be discounted and the discount information.
    • The calculator marks items that have received a discount, which might not be eligible for further promotions.
    • The qualifier marks items that have already been used as qualifiers for the promotion. This prevents the qualifier items from being used again during the same price calculation.
    • The calculator applies the discount to the list of objects.

    6. The pricing engine applies its configured PostCalculators, which make any necessary modifications to the price after discounts have been applied. Each pricing engine calls postcalculators of its own type.
    7. The pricing engine returns an updated PriceInfo object.

    Note : This process is repeated every time a price is requested. Price requests are resource-intensive, and should be performed only when necessary.


      Sunday 15 June 2014

      ATG 10.2 BCC transaction issue

      While setting up the CRS (ATG 10.2, MySQL and JBoss 5.1), I have faced few issues.Here I am sharing the solution of one of them.The execution of initial (first) deployement on BCC failed due to below exception.

      CONTAINER:atg.repository.RepositoryException; SOURCE:org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:c41a:5395f5cb:a16b status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:c41a:5395f5cb:a16b status: ActionStatus.ABORT_ONLY >)) at atg.adapter.gsa.GSAItemDescriptor.getPersistentItem(GSAItemDescriptor.java:5549) at atg.adapter.gsa.GSAItemDescriptor.getOrWaitForPersistentItem(GSAItemDescriptor.java:5053) at atg.adapter.gsa.GSAItemDescriptor.getItem(GSAItemDescriptor.java:3275) at atg.adapter.gsa.GSARepository.getItem(GSARepository.java:353) at atg.deployment.repository.ReferenceItemGenerator.findReferenceItemInRepository(ReferenceItemGenerator.java:699) at ........................................

      The soltion to this issue is to update jboss connection datasource file (atg-ds.xml) for xa-datasource (replace local-tx-datasource with xa-datasource).Update the other elements of the file accordingly.

      Below is the sample connection detail.

      <xa-datasource>
      <jndi-name>ATGProductionDS</jndi-name>
      <xa-datasource-property name="URL">
                             jdbc:mysql://localhost:3306/Production
              </xa-datasource-property>
      <xa-datasource-class>
                             com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
              </xa-datasource-class>
      <xa-datasource-property name="User">CRS_Production</xa-datasource-property>
      <xa-datasource-property name="Password">CRS_Production</xa-datasource-property>
      <min-pool-size>5</min-pool-size>
              <!-- The maximum connections in a pool/sub-pool -->
             <max-pool-size>300</max-pool-size>
        <!-- To avoid deadlocks you need set this -->
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </xa-datasource>

      Saturday 17 May 2014

      Resolving access denied issue while running install_service script in windows.

      After installing Tools and Framework you need to run install_service script to install tools and framework as windows service.If you run this script as normal user(non administrator). You will face access denied issue.

      To resolve this issue run the script as administrator.Right click on script file then select run as administrator option.Now script will execute successfully.

      Wednesday 7 May 2014

      Endeca CSV Indexing Issues

      I used csv file for indexing.Sometime I faced data corruption or indexing failure issues.Below are the possible reasons.

      Indexing fails due to any one of the below reasons.
      1.In csv format data,data contains extra column due to delimeter character presence in source data.
      2.In the case property length exceeds the configured value.

      Solution : Write the encoded delimeter from source data to csv file.Control the property length during csv file extraction.

      Data corruption issues are happening due to improper handling of empty columns in the csv file.Due to missing columns subsequent column values are assigned to missing column header property.For example you are having three column A,B and C in csv file.If some record r is not having value for column A then column B value is assigned to column A header and column C value is assigned to column B header source property.In this way it results in data corruption.In the case Endeca is not behaving as expected then verify the generated csv file.

      Note : When you are using csv file the number of column in each line of file must match the number of column in the header(source property values) line.For every empty or missing value put the empty column with proper delimeter. CSV file generation(extraction) code must be robust enough to handle these scenarios.

      Sunday 16 March 2014

      Dyn/admin home page issue in ATG10.2

      I encountered below error while trying to open the home page of dyn/admin in ATG10.2.

      Unable to execute the command javac -classpath C:\apps\java\jre\lib\resources.jar;C:\apps\java\jre\lib\rt.jar;C:\apps\java\jre\lib\sunrsasign.jar;C:\apps\java\jre\lib\jsse.jar;C:\apps\java\jre\lib\jce.jar;........................................................................................................................./atg/dynamo/servlet/pagecompile/PageCompileServlet The detailed exception is: java.io.IOException: Cannot run program "javac": CreateProcess error=206, The filename or extension is too long.

      Follow below steps to resolve this issue.

      Add ExtendedJhtmlPageProcessor component at atg\dynamo\servlet\pagecompile\ location and restart the sever.
      Steps

      1. Navigate to ATG_HOME\localconfig directory.

      2. Create atg\dynamo\servlet\pagecompile directory structure there.

      3. CreateExtendedJhtmlPageProcessor.properties file with below content in that directory.

           #atg\dynamo\servlet\pagecompile\ExtendedJhtmlPageProcessor.properties
           $class=atg.servlet.pagecompile.jsp11.JSPPageProcessor
           javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler

      Saturday 15 March 2014

      WebLogic Server getting boot identity from the user issue solution

      I have just started using WebLogic Server. I tried to start one of the managed server from command line it stucked at. 

      getting boot identity from the user

      I entered admin username followed by password then it continued.In this way every time you need to enter username/password.

      With below small  and easy configuration you can resolve this issue (Avoid authentication prompt).

      1. Create boot.properties in $DOMAIN_HOME/servers/[server_name]/security directory.

      2. Put content in below format in the file.
            username=[superuser with admin role]
            password=[password of user(admin role)]

      3. Alternatively you can copy boot.properties from  $DOMAIN_HOME/servers/AdminServer/security,then alter the file accordingly.

      Note : WebLogic only prompts for username/password when running in Production mode it won't prompt for username/password in development mode.


      Sunday 9 March 2014

      Introduction to Endeca Application Controller (EAC)

      The EAC provides the infrastructure to support Endeca application.Endeca Application Controller (EAC) is a control system used to control, manage,and monitor components in Endeca implementation.

      There are two types of EAC instances.

      1. EAC Central Server
      2. EAC Agent

      1. EAC Central Server

      One instance of the EAC serves as the EAC Central Server.The EAC Central Server also contains a repository that stores provisioning information — such as, data about the hosts, components, applications and scripts.This instance includes and WSDL enabled public interface.Other applications communicates with EAC using this interface.EAC central server works as an controller of EAC agents.EAC central server communicates with EAC agents using internal web service interface.

      2. EAC Agents 

      EAC instances other then EAC Central server are EAC agents.These EAC agents instruct host machine for execution of actual task such Forging or Indexing.

      There are 3 ways to communicate with EAC.

      1. Endeca Workbench.
      2. The command line utility, eaccmd.
      3. Endeca WSDL-enabled interface(using language that supports web services).Endeca workbench and Endeca deployment template utilize this method.

      You can use below scripts to start and stop EAC from commandline.
      1. EAC start script.
         $ENDECA_ROOT/tools/server/bin/startup.sh
      2. EAC stop script.
         $ENDECA_ROOT/tools/server/bin/shutdown.sh
      Note : On windows EAC is created,configured and registered as "Endeca HTTP service".

      EAC configuration file
      EAC reads configuration from eac.properties file.This file is located in the $ENDECA_CONF/conf directory.

      EAC log file.
      EAC log file is located in the $ENDECA_CONF/logs directory.You can update EAC logging related configuration in the logging.properties file.This file is located under $ENDECA_CONF/conf.

      Tuesday 4 February 2014

      Useful Linux Commands

      Sometimes we need to work on Linux environment during development specially on Linux box hosting the server.As we know Linux is bundled with lots of useful commadline features, file handling is one of them.Here is small list of commands which I feel very useful while working on Linux.

      Note : Command syntax/example given below are based on requirements/assignment I worked upon.Every command below may have multiple options,which can be used in different combination based on scenarios(requirement).For example I am redirecting output to a file which can also be displayed on console.

            1.  Secure File Copy.

                Using this feature you can securely copy file from one machine to another machine without login into any of the machine. 
                  Syntax : scp user1@machine1:Path of source file user2@machine2:Path of the destination directory
                  Example :scp admin@192.168.0.101:/opt/file/Test.jar jboss@192.168.0.109:/opt/jboss/app/lib

            2.  Fetching the specific line range from file and write result to another file.

                 Syntax : sed -n 'startLineNumber,EndLineNumberp' fileToBeSearch > resultFile
                 Example : sed -n '1,500p' Data.csv > SmallData.csv
       
            3. Fetching the line containing given text from file.
                Syntax :grep searchText SourceFile > FileContainingResultData
                Example : Search For single String
                  grep nike BrandData.csv > NikeData.csv

                Example : Search For 2 Strings with OR operation
                  grep 'nike\|adidas' BrandData.csv > NikeORAdidasData.csv

                Example : Search For 2 Strings with AND operation  
                 grep nike BrandData.csv  | grep shoe > NikeANDShoeData.csv 
       
            4.  Changing file or directory (folder) permissions.
              Sometimes it required to change the permissions of an file or directory in order to perform certain operations.
                  Syntax : chmod permissionOctalCode fileOrDirectoryName
                  Example : chmod 777 data
                  chmod 777 Record.csv
                  Note : Use -R option to recursively change the permission of the directory.
                 
            5.  Searching file by name.
                  find command is very useful to search files.
                  Syntax : find directoryToSearch -name fileName
                  Example : find / -name 'eaccmd.sh'

            6.  Access environment as different user.
                  Using below command you can access the environment as an different user.Mostly it is used to access the environment as more privileged user(root). 
                  Syntax : sudo su - userName
                  Example : sudo su - admin

            7.  Navigate to previous directory.
                   Using below command you can navigate to previous directory from where you have navigated to current directory.
                   Syntax : cd - 

            8. Create a zip file.
                  Using below command you can add single or multiple files to zip.
                  Syntax : zip nameOfZip.zip file1 file2 ...
                  Example : zip Log.zip server.log console.log

            9. Unzip the zipped file.
                 Use below command to unzip the zipped file.
                 Syntax : unzip nameOfZip.zip
                 Example : unzip Log.zip
               
          10.  Display content of zip file without extracting it.
                 You can display the content of zip file without extracting it.
                 Syntax : unzip -l nameOfZip.zip

                 Example : unzip -l Log.zip

           11.  Delete all lines containing specific text from a file.Without opening the file.
                 You can delete all lines containing 'some string' from a file without opening it.
                 Syntax : sed 
      --in-place '/some string/d' myfile
                 Example : sed --in-place '/nike/d' Brand.csv

      For more detail on any of the above commands use man command(manual pages or man pages).

      Monday 3 February 2014

      Solution for signer information error (occuring at server startup or on browsing) for ATG 10.1 CRS

      I have configured CRS (Commerce Reference Store) for ATG 10.1 using CIM (Configuration and Installation Manager). After server startup I tried to browse the application but only header was displaying.Server was throwing below exception.

      ERROR [[jsp]] Servlet.service() for servlet jsp threw exception java.lang.SecurityException: class "atg.commerce.order.OrderHolder$$EnhancerByCGLIB$$e9ab456d"'s signer information does not match signer information of other classes in the same package
           at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)
           at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)
           at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)
           at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
           at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 


      Solution :  Replace the jboss-eap-5.0/jboss-as/common/lib/cglib.jar with the unsigned version, which can be downloaded from the following URL : http://repository.jboss.com/maven2-brew/cglib/cglib/2.2/cglib-2.2.jar or http://search.maven.org/remotecontent?filepath=cglib/cglib/2.2.2/cglib-2.2.2.jar.
      This is due to a problem with the JBoss cglib library.For more details see the JBoss bug https://jira.jboss.org/jira/browse/JBPAPP-2971.

      Thursday 2 January 2014

      Removing (uninstalling) a deployed Endeca application

      Use below steps to remove Endeca application properly. Endeca application must be removed before deleting the application directory in order to avoid side effects.

      1. Remove application from the EAC(Endeca Application Controller).
      • List the current applications using below command.
                   $ENDECA_ROOT/bin/eaccmd list-apps
      • Remove the application by running runcommand --remove-app from application's control directory. 
      • Verify the removed application by running above eaccmd list-apps script.Removed application won't be listed now.    
          2.   Navigate to apps directory and delete the selected(removed above) application directory.

      Note : These steps I have used for application which is running without CAS. For application using CAS you need to remove related record stores.