Logger Mechanism in ATG

Types of log message:
  1. error
  2. warning
  3. info
  4. debug (Disabled)
  • atg.nucleus.GenericService is the ATG class which provides logging feature by default
  • Default error, warning and info is enabled
  • In Production, disable info and debug
  • Global.properties - used to set logging level at directory level or set of components 
  • ATG Developer can use(ATGLogColorizer.exe) tools to color log output   

Log files found in below location:
    /ATGDIR/home/logs
    /JBOSS/server/atg/logs

Endeca Utility - How to restore Endeca Dgraph?

An Endeca index can be recovered by reverting to a particular baseline/delta or partial update.  To do so, restart the MDEX Engine on the index files that were backed up after a particular baseline/delta and roll forward using any partial update files accrued since that baseline/delta.

To revert to a previously applied update:

1. Stop the MDEX Engine

2. Clean up the active dgraph_input directories

3. In the backup directory, locate the files from the last successful update.   This is the dgidx_output directory backup on the ITL server.

4. Copy the files into dgraph_input

5. If partial updates need to be applied, see instructions below on “Applying partial updates between last baseline/delta or snapshot and present”. Otherwise, restart the MDEX Engine.

Applying partial updates between last baseline/delta and present:

1. In the backup directory for partial update XML files (the cumulative_partials backup directory), locate the files representing the updates that occurred since the update you are reverting to. 

2. Copy all backed-up partial update XML configuration files from all partial updates that occurred since the update to which you want to revert into the dgraph_input/updates directory on the MDEX server.

3. Restart the MDEX Engine. Upon restarting, the Engine will load the current index and then apply all updates loaded into its updates directory.

ATG Shipping Groups, methods and calculators

Adding shipping information to shopping carts involves the following sub-processes:
1) Creating a list of shipping groups for potential use in the current order
2) Specifying the shipping groups to use with the current order
3) Selecting the shipping methods, such as Ground or Next Day, for the order’s shipping groups 


What is Shipping Group?
A ShippingGroup contains information on the shipping address and delivery method for a group of commerce items. 

By default, a new Order has one defaultShippingGroup. As items are added to the Order, these items automatically become part of the default ShippingGroup. Once a second ShippingGroup is added to theOrder, all the items in the Order are removed from the default ShippingGroup and must be explicitly added to one of two shipping groups. 
 
How to create new Shipping Groups?
You can create a list of shipping groups for potential use in an Order in one of two ways:
  • from information gathered from the user via forms

  • from information stored in the user’s profile
 Below two form handlers allow user to add new shipping groups  
  • /atg/commerce/order/purchase/CreateHardgoodShippingGroupFormHandler
  • /atg/commerce/order/purchase/CreateElectronicShippingGroupFormHandler
 Both extends PurchaseProcessFormHandler 

How to add Shipping Group to an Order?
Steps:
1) Create Shipping Group
2) Make any changes to the Shipping Group, such as setting the address
3) Add the Shipping Group to the Order


 Here is the code snippet:
// Get a reference to the OrderManager 
OrderManager orderManager = (OrderManager)   request.resolveName("/atg/commerce/order/OrderManager");  
// Create the ShippingGroup 
ShippingGroup shippingGroup shippingGroupManager.createShippingGroup(); 
// Add the ShippingGroup to the Order shippingGroup.addShippingGroupToOrder(pOrder, shippingGroup);

How to find available Shipping methods for a particular Shipping Group?
Use droplet  /atg/commerce/pricing/AvailableShippingMethods


How to initiate Shipping group from Profile?
Use droplet /atg/commerce/order/purchase/ShippingGroupDroplet
 
What is Shipping method? 
Each Shipping method is represented by ShippingCalculator component class.

Shipping methods examples are:
  • Ground
  • 2 day delivery
  • Overnight
  • Calculate Shipping price based on couriers web service
  • etc...
Different types of Shipping calculators are:
  • FixedPriceShippingCalculator - Flat rate for shipping
            Ex: Ground shipping is always $15
  • PriceRangeShippingCalculator - Define shipping price based price range
             Ex: $0 - $50  ($5)
                   $51 - $100  ($10)
                   $101 - $1000  (FREE)
  • WeightRangeShippingCalculator - Weight Property added at SKU level and price set based on weight
  • PropertyRangeShippingCalculator - Shipping price decided Based on SKU property
          Ex: Volume
    How to Filter Shipping methods?
    In few scenarios, All shipping methods should not be available. To limit shipping methods developer can sub-class Shipping calculator and override the getAvailableMethods().

    Ex: Courier shipping not allowed for PO boxes

    How to write custom shipping calculator?
    Here are the steps:
    1. Create a new custom calculator component 
    /com/commerce/shipping/FixedPriceServiceCaclulator.properties 
    $class=com.xxx.commerce.pricing.calculators.FixedPriceShippingCalculator
    # name of shipping method
    shippingMethod=DEMO
    # costs 
    amount=10.0

    2. Create a custom Java class and this should extends the shippingCalculatorImpl class
    ShippingCalculatorImpl class have two method for override.
    1.getAmount()  - calculate the shipping price

    2.getAvailableMethods()  - Used to restrict your custom shipping method

    public class FixedPriceShippingCalculator extends ShippingCalculatorImpl { 

    protected double getAmount(Order order, ShippingPriceInfo priceQuote, ShippingGroup shippingGroup, RepositoryItem pricingModel, Locale locale, RepositoryItem profile, Map extraParameters) throws PricingException { }

    public void getAvailableMethods(List pMethods, ShippingGroup pShippingGroup, RepositoryItem pPricingModel, Locale pLocale, RepositoryItem pProfile, Map pExtraParameters) throws PricingException {
    }
    }
    3. Add the shipping calculator to Shipping Engine
    /atg/commerce/pricing/ShippingPricingEngine.properties 
    preCalculators+=/com/commerce/shipping/FixedPriceServiceCaclulator

    How to Hide the list of applications on the login page? - Endeca Workbench

    By default, Workbench shows all available Endeca applications in a drop-down list on the login page. Business users can log in to any application that an administrator has added them to.

    In cases where you do not want Workbench users to see all available Workbench applications on the login page, you can hide the drop-down list of applications.

    To hide the drop-down list of applications on the login page:

    1) Stop the Endeca Tools Service

    2) Open the webstudio.properties file located in %ENDECA_TOOLS_CONF%\conf (on
    Windows) or $ENDECA_TOOLS_CONF\conf (on UNIX)

    3) Locate the com.endeca.webstudio.hide.login.application.dropdown property:

    # Hides the dropdown for selecting an application
    # on the default login page.
    com.endeca.webstudio.hide.login.application.dropdown=false


    4. Set the value of the property to true:com.endeca.webstudio.hide.login.application.dropdown=true

    5. Save and close the file

    6. Start the Endeca Tools Service

    Interaction between MDEX Engine and Workbench

    Endeca Workbench queries the MDEX Engine for information and publishes configuration to it.

    Experience Manager queries the MDEX Engine for record and dimension information that a content administrator can use to configure dynamic content.
    Examples:

    1. Specifying a navigation state as part of a location trigger
    2. Selecting records or a navigation state for content spotlighting
    3. Selecting records or dimension values for boost and bury
    Workbench publishes configuration to the MDEX Engine, including:
    1. Content item configuration from Experience Manager
    2. Content collections
    3. Thesaurus entries