I made the changes I proposed last November. I didn't receive any feedback, so I assumed my approach was perfect in every way. ;)

The parser now supports three new styles of values. For example, consider the following chunk of XML:

<bean id="parseTestBean" class="machii-skeleton.model.ParseTestBean">
  <property name="simpleProperty">
    <value>simpleProperty</value>
  </property>
  <property name="simpleSubstitution">
    <value>${applicationRoot}</value>
  </property>
  <property name="mixedSingleSubstitution">
    <value>abcd_${maxEvents}_efgh</value>
  </property>
  <property name="mixedMultipleSubstitution">
    <value>${eventParameter}_xyz_${parameterPrecedence}_qrs</value>
  </property>
  <property name="cfmlSubstitution">
    <value>${#now()#}</value>
  </property>
</bean>

The values created after substitution are the following:
  simpleProperty
  /machii-skeleton
  abcd_10_efgh
  event_xyz_form_qrs
  {ts '2007-01-23 22:37:40'}

I did a fair amount of testing to make sure this worked. If anyone finds a problem, please let me know. There are improvements that I could make, but I thought I'd get some feedback before sinking more time into it. The diff from r1.17 is attached.

My particular use case is that I have a single application hosting path, and a bunch of directories based on that value. It would also be possible to use the CFML substitution to have different values be defined per hostname, yet have the same ColdSpring file be checked into SCC.

--
Joseph Lamoree



On 7 Nov 2006, at 20:15, Joseph Lamoree wrote:

I would like to have ColdSpring perform substitution on a value like "${myProp}/moreText" as it would with "${myProp}". It seems that the only change necessary would be to coldspring.beans.BeanProperty in parseValue. Do values only get substituted if the string starts with "${" and ends with "}" so ColdSpring mimics the way Spring does it?

--
Joseph Lamoree


Attachment: BeanProperty.cfc.diff
Description: Binary data

Reply via email to