betweenGo

Tag: ATG

Tweets for 2010-01 and 2010-02

by Frank Kim on Feb.28, 2010, under Miscellaneous

Ruby on Rails

  • Numeric data types and zerofill. Explains what all those int(11) columns are in your Ruby on Rails tables. http://bit.ly/9Tcf7q #
  • undefined local variable or method "acts_as_list"? – Ruby Forum. Do ruby script/plugin install acts_as_list http://bit.ly/9kFWbG #
  • ruby on rails : adding child records to an existing parent without visiting the parent – Stack Overflow http://bit.ly/cQiGSP #
  • Multi-Table Inheritance in Rails – When two tables are one… This is not easy and I wish it was. http://bit.ly/9fbzgk #
  • has_many :through – count vs length vs size. Use count if u don’t want to load the contents of association into memory. http://bit.ly/dtqXe1 #
  • A gentle reminder about pluralizations. config/initializers/inflections.rb to customize pluralizations in Ruby on Rails http://bit.ly/bN9GO5 #
  • Ruby on Rails – Rails Migrations Cheatsheet – Dizzy. Pretty helpful. http://bit.ly/9wNvRx #
  • RailsGuides Migrations. Nice guide, especially about explaining the naming convention which I don’t like. http://bit.ly/cjZ7aB #

ATG

  • Configuring ATG to Send Email via Comcast SMTP – betweenGo. Configuring your ATG app to use your ISP’s SMTP server. http://bit.ly/7M5bhx #
  • Enabling non-XA Resources in JBoss 4.2 with ATG – betweenGo. http://bit.ly/aDN3Po #
  • Combining XML in ATG – betweenGo. Combining XML files not as straight-forward as w/ properties files but more flexible. http://bit.ly/8kVwvA Jan 12 12:00 PM

Eclipse

  • Debugging Applications in IBM Rational Application Developer. Page 12 for how to set up server for debugging. http://bit.ly/aaYUHb #

JavaScript

  • How can I submit a form along with some parameters using JavaScript? (JSF forum at JavaRanch). Answer #3 was helpful. http://bit.ly/b17ymm #

JSP

  • Testing Which Page Loaded your JSP Page Fragment – betweenGo. Simple enough to do w/ JSTL but I always forget how. :-) http://bit.ly/cEh7IZ #

Miscellaneous

  • Cygwin 1.7.x, mounts and /etc/fstab – betweenGo. Mounts are no longer saved from session to session in Cygwin 1.7. http://bit.ly/bmaYEu #
  • Git in 5 Minutes http://bit.ly/bSt3dd and Git for the lazy – Spheriki http://bit.ly/aefD17 #
  • The Thing About Git. Nice article describing how flexible Git is, especially compared to SVN. I may never use SVN again http://bit.ly/bD0tuS #
  • I use DreamHost and am shamelessly plugging them both for a referral and to try to win an iPad. Honestly they’re great. http://bit.ly/ctYv3Z #
  • Share/Bookmark
Leave a Comment :, , , , , , , , , , , , more...

Enabling non-XA Resources in JBoss 4.2 with ATG

by Frank Kim on Jan.28, 2010, under Configuration

a dog and it's boss on Flickr
(Photo: a dog and it’s boss by Pixel Addict)

ATG documents how to enable non-XA resources in JBoss 4.2 for SOLID.  We ended up following the same instructions to work with Oracle.

JBoss Note: JBoss 4.2 by default assumes XA drivers, which some ATG applications use; however, there are no XA drivers for SOLID. To enable multiple non-XA resources in JBoss 4.2, add the property in bold text to the jbossjta-properties.xml file, under the <property depends="arjuna" name="jta"> tag:

<property depends="arjuna" name="jta">
  <property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>

You may still see warnings in your log file, but ATG applications will run correctly. To suppress these warnings, add the following to your jboss-log4j.xml file:

<category name="com.arjuna.atg.jta.logging">
  <priority value="ERROR"/>
</category>

For further reading please see Starting the SOLID SQL Database document in the Running Nucleus-Based Applications section of the ATG Installation and Configuration Guide.

  • Share/Bookmark
Leave a Comment :, , , more...

Running JBoss with Oracle

by Frank Kim on Sep.28, 2009, under JBoss

(Photo: oracle by you are the atman)

Most commercial websites that use JBoss also use Oracle.  To run JBoss with Oracle you simply need to tell JBoss where to find the Oracle JDBC drivers. To do this modify run.bat or run.sh and set the JBOSS_CLASSPATH to include the Oracle JDBC jar file before

set JBOSS_CLASSPATH=C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar

I did this right before run.bat checks to see if JBOSS_CLASSPATH is empty.

rem If JBOSS_CLASSPATH or JAVAC_JAR is empty, don't include it, as this will
rem result in including the local directory in the classpath, which makes
rem error tracking harder.
if not "%JAVAC_JAR%" == "" set RUNJAR=%JAVAC_JAR%;%RUNJAR%
if "%JBOSS_CLASSPATH%" == "" set RUN_CLASSPATH=%RUNJAR%
if "%RUN_CLASSPATH%" == "" set RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR%

After doing this you might need to tell your web application how to configure the data sources. I wrote a post about how to configure your data source for ATG web applications.

  • Share/Bookmark
Leave a Comment :, , more...

Update Profile in ATG Commerce

by Frank Kim on Sep.08, 2009, under Commerce

Wolf portrait 3 on Flickr
(Photo: Wolf portrait 3 by Tambako the Jaguar)

ProfileTools provides methods for updating a profile.  In ATG Commerce you can access the ProfileTools via the CommerceProfileTools.

Therefore to update a profile it is as simple as calling the update methods in ProfileTools.

getCommerceProfileTools().updateProperty(propertyName,
                                         property, getProfile());

getCommerceProfileTools().updateProperty(propertyTable, getProfile());

The update methods get the MutableRepositoryItem for the profile, set the property in the MutableRepositoryItem and then update the item in the ProfileRepository.

Pretty simple, eh? :-)

  • Share/Bookmark
Leave a Comment :, , more...

The Strangely Behaved ATG textarea Tag

by Frank Kim on Sep.03, 2009, under Page Development

Escalera al cielo / Stairway to heaven on Flickr 
(Photo: Escalera al cielo / Stairway to heaven by Davichi)

When I create a DSP textarea tag like this it outputs the value of the bean property in the text area box.

<dsp:textarea bean="MyFormHandler.foo" rows="5" cols="20"/>

Similarly if I create a DSP textarea tag like this I get the same output.

<dsp:textarea bean="MyFormHandler.foo" rows="5" cols="20"></dsp:textarea>

However when I leave some space between the textarea opening and closing tag I get a blank instead of the value of the bean property in the text area box.

<dsp:textarea bean="MyFormHandler.foo" rows="5" cols="20">
</dsp:textarea>

Anyone know why there is a difference?

Anyway after reading the documentation it turns out if I want to control what is output in the text box I can use the default attribute.

<dsp:textarea bean="MyFormHandler.foo" rows="5" cols="20" default="bar"/>

Maybe I should have read the documentation before writing this post. :-)

Update 2009-09-03: I also found this strange pattern of behavior with the DSP droplet tag.  When I invoked a droplet that took no parameters and had no open parameters like this:

<dsp:droplet name="MyDroplet"/>

or like this:

<dsp:droplet name="MyDroplet"></dsp:droplet>

the droplet would not be invoked.

However when I did this the droplet was invoked.  Strange …

<dsp:droplet name="MyDroplet">
</dsp:droplet>
  • Share/Bookmark
Leave a Comment :, more...

betweenGo Consults with Cineplex to Release Latest Version of Online Store on ATG

by Frank Kim on Sep.01, 2009, under Consulting

Cineplex Store

On Monday, August 30 Cineplex launched the latest version of its store running on ATG 2007.1 and JBoss 4.0.5.GA.

Cineplex ..:: Gift Cards betweenGo with Bell Canada was proud to be part of this release.  betweenGo implemented the handling of gift cards and product bundles and other eCommerce features.

Specific features we implemented for gift cards and product bundles included:

  • product listing
  • search listing
  • display in cart and throughout checkout
  • handling of taxes and shipping costs
  • promotions
  • inventory status
  • adding gift cards to the cart (required some JavaScript magic

Other features we implemented included:

betweenGo was proud to be part of this enjoyable project.  If you need expert ATG consulting please contact us.

  • Share/Bookmark
Leave a Comment :, , more...

How to Set an Array Property in an ATG Form

by Frank Kim on Aug.31, 2009, under Page Development

Cool Blue Hive on Flickr
(Photo: Cool Blue Hive by jurvetson)

In the Setting Property Values in Forms section of the ATG Page Developer’s Guide there are two examples for setting values of array properties in forms.

  1. Grouped Checkboxes
  2. Multiple-Selection List Box

Both examples are for a simple form.  But what if you are generating a form using a ForEach droplet and want to set an array property in each iteration of the loop.  Fortunately it turns out to be relatively easy.

Hidden or Text Inputs

<dsp:droplet name="/atg/dynamo/droplet/ForEach">
  <dsp:oparam name="output">
    <dsp:input type="hidden" paramvalue="element.id" bean="MyFormHandler.ids"/>
  </dsp:oparam>
</dsp:droplet>

Select Inputs

<dsp:droplet name="/atg/dynamo/droplet/ForEach">
  <dsp:oparam name="output">
    <dsp:select bean="MyFormHandler.answers">
     <dsp:option value="foo">foo</dsp:option>
     <dsp:option value="bar">bar</dsp:option>
    </dsp:select>
  </dsp:oparam>
</dsp:droplet>

By the way if you try to set the array element directly using the param:index notation as in the following example it will not work.

<dsp:droplet name="/atg/dynamo/droplet/ForEach">
  <dsp:oparam name="output">
    <dsp:select bean="MyFormHandler.answers[param:index]">
     <dsp:option value="foo">foo</dsp:option>
     <dsp:option value="bar">bar</dsp:option>
    </dsp:select>
  </dsp:oparam>
</dsp:droplet>

When submitting the above form you will get this exception.

atg.droplet.DropletException:
  Can't set an element of the array property without a set <name> (int index, Object value) method.

The exception message is a red herring, there is no way you can set the element of an array property no matter what kind of set method you create.  Trust me, I spent many hours delving into the ATG code to verify this. :-)

  • Share/Bookmark
Leave a Comment :, more...

Duplicating and Modifying Eclipse User Libraries

by Frank Kim on Aug.19, 2009, under Eclipse

Twilight books on Flickr

Eclipse user libraries are wonderfully convenient ways of packaging together related JAR files.  In my Eclipse I create user libraries for each ATG version I install.  As a consultant I am always installing different versions and today I installed ATG 9.0.

Normally I use the GUI to create the user library for the latest ATG server.  However I thought this is quite inefficient because I already have user libraries for previous versions of the ATG server.  I just need to duplicate one of the other ATG user libraries and then tweak the duplicate to have the right path to the JAR files.

Unfortunately the Eclipse GUI does not provide a way to duplicate a library.  So I searched in my workspace files and found in my .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs file the settings for all my user libraries.

I then edited that file and copied an entry for an older ATG library, org.eclipse.jdt.core.userLibrary.ATG\ 2007.1.  I renamed it org.eclipse.jdt.core.userLibrary.ATG\ 9.0 and updated the paths to where ATG 9.0 is installed and I was done!

  • Share/Bookmark
Leave a Comment : more...

ATGLogColorizer for Colorizing ATG Server Outputs and Logs

by Frank Kim on Aug.18, 2009, under ATG

ATGLogColorizer

Color is wonderful.  With color we can immediately recognize patterns, signals, warnings, etc.  By using a utility that color codes your logs and server outputs to highlight errors in red, warnings in yellow, etc. you can be much more efficient about how you monitor and search.

Back in the day we used to use DynamoFilter.exe to color code the output of running ATG on the Dynamo Application Server (DAS).  Now that people no longer use DAS that application is no longer useful.

Today though I found out about the open source project ATGLogColorizer.  This fantastic utility works with JBoss, WebLogic, DAS and WebSphere.  It works on Windows, Mac OSX, Solaris and other UNIX variants.  It even works on Cygwin.

This is how I start JBoss with ATGLogColorizer on Cygwin.

${ATG}/home/bin/startDynamoOnJBOSS.bat -f -run-in-place -c default -m Foo | ATGLogColorizer.exe'

Life has become a little better. :-)

For further reading please see and ATGLogColorizer and ATG Log Colorizer for JBoss.

  • Share/Bookmark
Leave a Comment :, more...

How to Add Products to Categories using Content Groups

by Frank Kim on Jul.31, 2009, under Commerce, Personalization

Typically after you create a category in your catalog you then add products to the category.  The simple way to do that in ATG eCommerce is to use the ACC and add products to the child products property of the category.  However there is another way.

In the ATG Commerce Guide to Setting Up a Store documentation you can see in the Viewing the Product Catalog section that a category can have child products but also child product groups.

Product Catalog

Child product groups are actually content groups which are described in the Creating Content Groups chapter of the ATG Personalization Guide for Business Users.

Targeting > Profile and Content Groups window

Though the documentation shows a content group composed of features you can easily create a content group using the ProductCatalog as a content source and product as a content type.

To create a content group follow the steps in the ATG documentation for Creating New Content Groups except use an item from the ProductCatalog when specifying the Content Type.  Then create the targeting rules for this Content Group.  Now you can specify this group in the Child products (group) property of a category.

  • Share/Bookmark
Leave a Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!