Tag: ATG
SQL Delete in One Table Based on Values in Another Table
by Frank Kim on Mar.14, 2011, under Oracle
Delete From One Table Whose Values Don’t Appear in Another Table
Sometimes you will find that you have items in a table whose values reference items in another table that no longer exist. For example in ATG you may have orders that reference profiles that no longer exist. This could happen if an order is for an anonymous profile that was deleted.
Here is an example of how to delete items in a table whose values reference items in another table that no longer exist, in this case ATG orders whose profiles no longer exist.
DELETE FROM dcspp_order WHERE profile_id NOT IN ( SELECT id FROM dps_user );
This example does not actually work because of the dependencies on the dcspp_order table so please don’t try it. ![]()
Delete From One Table Based on Values in Another Table
Sometimes you want to delete items in one tables based on values in another table. You can do this similarly to the previous case.
DELETE FROM dcspp_order WHERE profile_id IN ( SELECT id FROM dps_user WHERE id LIKE '6%' );
This example also does not actually work because of the dependencies on the dcspp_order table so please don’t try it. ![]()
For further reading please see How to delete records from a SQL Server database and SQL Delete Rows Based on Another Table.
Configuring JBoss for HTTPS
by Frank Kim on Feb.16, 2011, under JBoss
This is how I configured JBoss to handle HTTPS requests for secure ATG applications.
- Create the keystore and private key.
$ cd /opt/jboss/jboss-eap-4.3/jboss-as/server/atg/conf $ keytool -genkey -alias jbosskey -keyalg RSA -keystore server.keystore
- Generate and store the certificate.
$ keytool -export -alias jbosskey -file server.crt -keystore server.keystore $ keytool -import -alias jbosscert -file server.crt -keystore server.keystore
- Enable HTTPS.
$ vi /opt/jboss/jboss-eap-4.3/jboss-as/server/atg/deploy/jboss-web.deployer/server.xml
Uncomment SSL HTTP/1.1 Connector section and edit. For example:
<Connector port="8443" address="${jboss.bind.address}" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="${jboss.server.home.dir}/conf/server.keystore" keystorePass="letmein" /> - Start JBoss with keystore specified. On UNIX you can do this by updating run.conf. For example:
JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=128m -Djavax.net.ssl.trustStore=/opt/jboss/jboss-eap-4.3/jboss-as/server/atg/conf/server.keystore -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
Note that if you are using service bindings (i.e. uncommented service bindings section of conf/jboss-service.xml) then the bindings in the XML configuration file (e.g. sample-bindings.xml) will take precedence. In this case the secure port becomes 8543.
For further reading please see HOWTO Configure JBoss for HTTPS.
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 #
Enabling non-XA Resources in JBoss 4.2 with ATG
by Frank Kim on Jan.28, 2010, under Configuration
(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.
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.
Update Profile in ATG Commerce
by Frank Kim on Sep.08, 2009, under Commerce
(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?
The Strangely Behaved ATG textarea Tag
by Frank Kim on Sep.03, 2009, under Page Development
(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>
betweenGo Consults with Cineplex to Release Latest Version of Online Store on ATG
by Frank Kim on Sep.01, 2009, under Consulting
On Monday, August 30 Cineplex launched the latest version of its store running on ATG 2007.1 and JBoss 4.0.5.GA.
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:
- lightbox to display after login if user’s cart has been modified to include items from their last session
- fixed order transaction issues
betweenGo was proud to be part of this enjoyable project. If you need expert ATG consulting please contact us.
How to Set an Array Property in an ATG Form
by Frank Kim on Aug.31, 2009, under Page Development

(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.
- Grouped Checkboxes
- 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.
Duplicating and Modifying Eclipse User Libraries
by Frank Kim on Aug.19, 2009, under Eclipse
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!



