Site Network: Personal | Professional | Photography

Technical Blog

This blog will contain content related to Java, Seam, Security, my sites and projects, as well as other technical subjects I am interested in.

Comments and questions are welcome!

Archive for the ‘ATG’ Category

ATG Cache Header Control Module

Saturday, February 2nd, 2008

Many ATG application server static content, or semi-static content, from within the ATG application's .war file. It is often much simpler to package CSS, JavaScript, Flash, Images, and other files in your web application than to try to manage them separately and deploy correctly in development and production instances.

It is often desirable to set long cache times for static content and you may also want to ensure that certain other files or URIs are never cached. Unfortunately ATG does not provide a mechanism for tuning the cache headers.

I have created a new ATG Module which allows you to easily adjust cache header times based on mime-types and URIs, including parent directories. You can download it here: DSCacheControl ATG Cache Header Control Module.

I have built and tested it using ATG 7.1 I will be releasing one for ATG 2007.1 in a bit, which may be based on a Servlet Filter instead, but I haven't decided yet. This one may work on ATG 2007.1, I haven't been able to test it yet.

It is very simple, with two classes: a pipeline servlet and a custom comparator, and two config files: the pipeline servlet's configuration and an Initial.properties to start the servlet. The source code is included in the module.

It allows you to control the cache time used to build the cache related response headers based on the requested asset's mime-type and URI location. It has an order of precedence of a default setting of 0 seconds (do not cache at all), then the mime-type settings are used, and then the URICacheMap is examined to find the most specific entry which is the specific URI or a parent directory. This should allow you to setup basic settings, and override them for specific directories or files as needed.

Here are some example config settings to give you an idea:

mimeTypeCacheMap=image/png=604800, \
image/jpeg=604800, \
image/gif=604800, \
application/x-javascript=604800, \
application/x-Shockwave-Flash=604800, \
flv-application/octet-stream=604800, \
text/html=0, \
text/css=604800

URICacheMap=/myapp/images=2592000, \
/myapp/index.jsp=2342343, \
/myapp/other.jsp=1342342, \
/myapp/images/changing-image.jpg=3600, \
/myapp/huge-static-jsp.jsp=2592000

To install it, simply download the zip file, unzip it, copy the module into your ATG 7.1 root directory and add the module to the list of DYNAMO_MODULES in your environment.sh (or add it using the -m option on the command line when you start ATG). You will likely want to override the default configuration. The .properties file is heavily commented and should be simple to understand. You can edit it within the module if you like, although of course the better approach is to set your cache settings in your application module or in localconfig, depending.

If you try it, please give me your feedback. If you enhance it, please share the code back with me.

Spark::red Expands ATG Hosting Offering

Monday, December 17th, 2007

Today I'm shilling for an amazing company, Spark::red. They provide unparalleled managed ATG application hosting. I know and trust the folks running it, and have been working with them for a while now. They have really been stellar to deal with and have turned things around in hours and days, whereas I'd gotten used to waiting weeks and month with the previous hosting situation.

If you, or anyone you know, uses ATG, you owe it to yourself to check Spark::red out.

Here is the press release:

In PDF Form

In Text Form:

Spark::red Expands ATG Hosting Offering

SEATTLE, WA- December 17, 2007 - Spark::red LLC announced today that it will launch general availability of their ATG-specialized hosting solutions.

Spark::red has been providing hosting and technology services to an exclusive group of clients, including a Fortune-500 company.

"We made certain that we could respond to our clients' individual needs with the personal attention and quality that allows us to distinguish ourselves," said Russell Moore, spokesperson for Spark::red. "We have proven our capability, and are ready to expand our client base. ATG customers now have a premier hosting option, one that takes pride in delivery to the customer above all else."

About Spark::red LLC
Spark::red, a managed ATG hosting provider, focuses on providing a specialized hosting solution for ATG applications. The staff of experienced ATG architects allows Spark::red to deliver production environments in days, instead of weeks or months.
With competitive pricing, a Tier 4 data center, and every staff member boasting over eight years of experience working with some of the largest ATG installations in the world, launching a new site or migrating an existing application will be quick, secure and painless. With Spark::red you will enjoy expert support, the fastest servers, and peace of mind. They invite you to contact them and discover the superiority of their ATG-specific hosting solution.

http://sparkred.com

Contacts:
Russell Moore
Spark::red LLC
russell@sparkred.com

Sales Inquiries
sales@sparkred.com

Design Pattern for Updating an ATG Order

Monday, October 22nd, 2007

This is from a post Jeremy Sears made here on the ATG_Tech Google Group, but I thought it was nice and clear and worth reposting. All credit to Jeremy for this:

"In general, the design pattern for updating an order is as follows:

  1. Acquire lock-manager write lock on profile id from the /atg/commerce/order/LocalLockManager
  2. Begin Transaction
  3. Synchronize on the Order object.
  4. Modify Order
  5. Call ((OrderImpl) pOrder).updateVersion();
  6. Call OrderManager.updateOrder()
  7. Release Order synchronization
  8. End Transaction
  9. Release lock-manager write lock on profile id from the /atg/commerce/order/LocalLockManager

If you extend atg.commerce.order.purchase.PurchaseProcessFormHander, then steps 1,2,8 & 9 are done for you in the beforeSet and afterSet method implementations. Steps 3&7 are no longer strictly necessary, but are still good practice. Steps 3-7 should be performed manually in your application code. Calling step 6 within the transaction is mandatory and the lock manager work should always wrap the transaction to prevent some rare transaction race conditions. "

ATG Installation on OS X

Tuesday, October 9th, 2007

While ATG runs fine on OS X, and while many people inside and outside of ATG use OS X as their primary operating system, the ATG installer STILL doesn't work under OS X. It "mostly" works. It seems to work, it installs things, however if you try to do stuff, like patch, or like adding other ATG modules, things don't work. The culprit is the installconfig/config.xml. If you install on Solaris for instance, you get one that looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="*">
<install xmlns="">
<product name="ATG Adaptive Scenario Engine" version="2006.3">
<configure>false</configure>
</product>
<product name="ATG Consumer Commerce" version="2006.3">
<configure>false</configure>
</product>
<product name="ATG Content Administration" version="2006.3">
<configure>false</configure>
</product>
<product name="ATG Portal" version="2006.3">
<configure>false</configure>
</product>
<product name="ATG Business Commerce" version="2006.3">
<configure>false</configure>
</product>
</install>
<systemEnv xmlns="">
<locale>en</locale>
<rootDir>/opt/atg/versions/ATG2006.3</rootDir>
<jBossListenPort>8080</jBossListenPort>
<docRoot>/opt/atg/versions/ATG2006.3/home/doc</docRoot>
<platform>Darwin</platform>
<rmiPort>8860</rmiPort>
<appServer>JBoss</appServer>
<jBossHome>/opt/jboss/root/</jBossHome>
<jBossVersion>4.0.3</jBossVersion>
<baseLevel>ATG2006.3_8095</baseLevel>
<ATGJRE>/Library/Java/Home/bin/java</ATGJRE>
<patchLevel>2006.3p4</patchLevel>
</systemEnv>
</config>

when you install under OS X you end up with an atrophied little file like this:

(more...)

ATG Dynamo - back to basics

Thursday, September 20th, 2007

I worry that ATG has mis-focused it's energy.

In the last few years, ATG has introduced (or purchased) a number of new products which sit on the existing stack. Ticketing Features, Search, Merchandising, Campaign Optimizer, Knowledge, Self Service, Response Management, Commerce Service Center, Outreach, and Customer Intelligence). I haven't had a chance to play with all of them yet. I'm sure they're all very neat. I'm more sure that they help sell license dollars to marketing and business people.

I'm not trying to undercut the value in that. I see it. I totally think ATG should be expanding their offering, meeting customer needs, making money, etc... What bothers me is that if you look at the same time period which all of those new product were introduced, you'd see almost no changes or enhancements to the underlying product stack, what they now call the ATG Adaptive Scenario Engine (or ASE) which consists of DAS (ATG Dynamo Application Server) or DAF (Dynamo Application Framework), DPS (Dynamo Personalization Server), and DSS (Dynamo Scenario Server). Sure, there are some bug fixes, a little feature here and there (like adding forgot password support in 2006.3). But nothing significant. The programmers guides for ATG 7.0, 7.1, 2006.3, and 2007.1 look REALLY similar.

(more...)