Tuesday, May 29, 2012

Improving Page Compilation Performance

The first time a page is requested, it undergoes several conversions: from JSP/JHTML to Java code to HTML. That first transformation from JSP/JHTML to Java code causes a slight delay in performance that is easily avoided by precompiling your pages. There are several ways to precompile all files in a directory:

  1.  Use the Java compiler provided with your application server to precompile JSPs

  2.  Use the JHTML batch compiler to precompile JHTML pages.

You can precompile individual JSPs at application startup by specifying them in your Web application deployment descriptor. Here’s an example of what you’d add for a page called MyPage.jsp to web.xml in enclosing <web-app> tags:


<servlet>
  <servlet-name>MyPage.jsp</servlet-name>

  <jsp-file>/path/to/jsp/MyPage.jsp</jsp-file>

  <load-on-startup>1</load-on-startup>
</servlet>



An explanation of each tag is as follows:

    <servlet-name> identifies the servlet to be compiled

    <jsp-file>
identifies the path to the servlet

    <load-on-startup> identifies the order in which this servlet should be compiled

Tuesday, May 15, 2012

Changing Component Properties Manually : ATG


Changing Component Properties Manually


As an alternative to using the ACC or Configuration Manager, you can always edit properties files manually. A few configuration properties can only be configured manually, and are not accessible through the ACC or Configuration Manager.

Note, however, that when configuring properties manually, no errors are generated if you specify a property name incorrectly. The component may generate an error if it cannot find the value; in this case, check your properties file for typos.

To manually edit a properties file, do the following:

1.Create a new properties file in <ATG9dir>/home/localconfig with the same name and path structure as the original file. For example, the defaultFrom property in the /atg/dynamo/service/SMTPEmail component specifies the e-mail address from which messages will be sent via SMTP. To modify defaultFrom, create a new file called SMTPEmail.properties in the path <ATG9dir>/home/localconfig/atg/dynamo/service.

Note: Step 1 is not necessary for the Configuration.properties file because a file of this name is created in the <ATG9dir>/home/localconfig/atg/dynamo directory during the installation process.

2.Add the desired property to the new file. For example, to change the setting for defaultFrom, such as to test@example.com, add the following line to the SMTPEmail.properties file in <ATG9dir>/home/localconfig/atg/dynamo/service:

defaultFrom=test@example.com

For example, to change the port number of ATG’s RMI server to 8862 manually, open your <ATG9dir>/home/localconfig/atg/dynamo/Configuration.properties file and add (or modify) the following line:


rmiPort=8862


When specifying values for a property, you can add a manual line break using the backslash (\) line continuation character:

myList=valueOne,\
       valueTwo,\
       valueThree

This can help with readability when configuring lists of values.

Save the Configuration.properties file and restart the application. Because you made the change in the localconfig directory, the new port number will override the original value (still stored in the config/atg/dynamo/Configuration.properties file) and will be preserved when you install a new ATG platform distribution.

Accessing Configuration Layers in the ACC


Accessing Configuration Layers in the ACC


When you modify a component’s properties in the ACC, the updated properties file is stored in one of the following locations:

    1. The ACC’s default configuration directory, initially set to <ATG9dir>/home/localconfig

    2. A server-specific directory if the component already has a configuration in that layer. For example, if       you run an application that does not use the default ATG server, and you modify a component using the ACC, the updated properties file is stored in the localconfig directory for the ATG server used by that application.

Note: The ACC shows only the configuration layers used by the application to which you are currently connected.

Resetting the Default Configuration Layer


Unless you specify otherwise, the ACC editor saves all updates to a component’s configuration in the default configuration layer. Components that you create, duplicate, or paste are also placed there.

The installation initially sets the default configuration layer to <ATG9dir>/home/localconfig. You might want to change the default configuration directory if you have multiple servers running different applications. For example, you might have one server running a customer service application and another running an online store.

You can set any unlocked configuration layer as the default.

You can change the default configuration layer on the server, so it affects all server clients and persists across all editing sessions; or only on the local client. If you change the default layer locally, the setting remains in effect until you shut down the host.

1.Navigate to the configuration layer that is currently set as the default, and open its CONFIG.properties file, or create one if it does not yet exist.

For example, the ATG installation initially sets the default configuration layer to <ATG9dir>/home/localconfig/. Therefore, open this file:

<ATG9dir>/home/localconfig/CONFIG.properties

2.Set defaultForUpdates to false.

3.Navigate to the desired configuration directory and open its CONFIG.properties file.

For example, to set <ATG9dir>/home/servers/myNewServer as the default configuration directory, open this file:

<ATG9dir>/home/servers/moogus/CONFIG.properties

4.Set defaultForUpdates to true.

To temporarily reset the default configuration layer within the ACC:


1.In the ACC, select Set Update Layer from the Tools menu.

2.When the Set a Default Configuration Layer dialog opens, select the configuration layer that you want to open by default.

Changing a Component in a Non-Default Configuration Layer



To change a component in a non-default configuration layer:

1.Select the component to edit,

2.Choose File > Open Component in Layer.

The dialog box Select a Configuration Layer opens, listing the name and path of each configuration layer. Check marks identify the layers currently in use.

3.Select the layer to open and click OK. The component opens in a separate Component Editor window.

Friday, May 4, 2012

Default Shipping Pricing Engine : ATG

The ShippingPricingEngine component is a preconfigured implementation of the ShippingPricingEngineImpl class. It determines the price of shipping for an order by invoking a series of ShippingPricingCalculators. It uses the same mechanisms as the ItemPricingEngine component for determining which promotions to apply.

The following sample shows the contents of the ShippingPricingEngine.properties file:

# The ShippingPricingEngine service
#


$class=atg.commerce.pricing.ShippingPricingEngineImpl

defaultLocale^=PricingTools.defaultLocale
priceInfoClass=atg.commerce.pricing.ShippingPriceInfo
pricingModelProperties=PricingModelProperties
promotionTools=../promotion/PromotionTools
profileProperties=activePromotions
promotionsRepository=Promotions
promotionItemTypes=\
        Shipping Discount
globalPromotionsQuery=(global=true AND enabled=true AND (startDate IS NULL OR
startDate <= ?0) AND (endDate IS NULL OR endDate >= ?0))
preCalculators=\
        calculators/FreeShippingCalculator
scheduler=/atg/dynamo/service/Scheduler
updateSchedule=every 15 minutes in 15 minutes

Pricing Calculator Classes


 These classes are used by the ATG Commerce item, order, tax, and shipping pricing engines to calculateprices. They can be extended according to your pricing needs.

DiscountCalculatorService


Item Calculator Classes



      ItemPriceCalculator

      ItemDiscountCalculator

      ItemDiscountMultiplierCalculator

      ItemListPriceCalculator

      ItemSalePriceCalculator

      ConfigurableItemPriceCalculator


Order Calculator Classes



    OrderDiscountCalculator

    OrderSubtotalCalculator


Shipping Calculator Classes



    ShippingCalculatorImpl

    ShippingDiscountCalculator

    PriceRangeShippingCalculator

    DoubleRangeShippingCalculator

    FixedPriceShippingCalculator

    PropertyRangeShippingCalculator

    WeightRangeShippingCalculator


Tax Calculator Classes

 

    NoTaxCalculator

    TaxProcessorTaxCalculator


Price List Calculator Classes



    Price List ConfigurableItemPriceListCalculator

    Price List ItemListPriceCalculator

    Price List ItemPriceCalculator

    Price List ItemSalesPriceCalculator

    Price List ItemSalesTieredPriceCalculator

    Price List ItemTieredPriceCalculator

Popular Posts