Atg Dynamo Tips

This page was extracted from ExtremeProgrammingWithAtgDynamo cos the page was getting too big.


One of the most useful things you can do for developing in Dynamo is to sprinkle your code liberally with debugging statements -- anywhere you would usually put a comment or an assertion in fact. Because you can turn loggingDebug off and on dynamically, you can see exactly what your code is doing without impacting performance.

Set up eclipse templates to help you do this (StuartJones)

  <?xml version="1.0" encoding="UTF-8" ?> 
  <templates>
  <template context="java" description="log debug" enabled="true" name="ld">if(isLoggingDebug()) { logDebug("${enclosing_method}(${enclosing_method_arguments})"); } ${cursor}</template> 
  </templates>

You can also use logDebug in JHTML pages by saying

<java> request.setLoggingDebug(true); request.logDebug("This is at the start of the JHTML page"); </java>

This works well when you're trying to debug a single page.


To comment out code or text in Dynamo, use the embedded Java comment

<java>/* comment */</java>

or the JSP comment

<%-- this is a comment --%>

Neither will show up in the page output.

Note that doing <java>// This is a comment </java>

will break the page! This is because the interpolation is done without a newline, which means the comment will probably be prepended to some working piece of code and all your _DARGS will magically stop working.


To find the scope of a particular component, use

<valueof bean="Component.serviceConfiguration.scope"></valueof>.

This is because most components inherit from GenericService?, which has a bean property of getServiceConfiguration, which has a Configuration interface which exposes many properties of the bean. Very useful when you just want to check out how something is configured.


To find the class of a component or param, use

<valueof bean="Component.class.name"/>


CategoryTips


EditText of this page (last edited December 16, 2014) or FindPage with title or text search