ColdBox Forums Notification: Post to Coldspring datasource

Title: RE: Coldspring datasource
Thread: Coldspring datasource
Forum: Need Help?
Conference: ColdBox
User: lmajano

The only thing I can see is that Coldspring 1.0 supports complex variables, the
one in the CVS does not.

So the property:

[code]
<value>${Datasources.Unify.name}</value>
[/code]

Might not work. I really do
not like that they will not support complex variables and just simple variables.
Anyways, its a very quick fix to add to coldspring, open BeanProperty.cfc
[code]
<cffunction name="parseValue" access="private" returntype="string"
output="false"
      hint="I parse a <value/>">
  <cfargument name="rawValue"
type="string" required="true" />
  
  <!--- grab the default properties out of
the enclosing bean factory --->
  <cfset var beanFactoryDefaultProperties =
getParentBeanDefinition().getBeanFactory().getDefaultProperties() />
  <!---
resolve anything that looks like it should get replaced with a beanFactory
default property --->
  <cfif left(rawValue,2) eq "${" and right(rawValue,1) eq
"}">
    <!--- look for this property value in the bean factory (using
isDefined/evaluate incase of "." in property name--->
    <cfif
isDefined("beanFactoryDefaultProperties.#mid(rawValue,3,len(rawValue)-3)#")>
<cfreturn
evaluate("beanFactoryDefaultProperties.#mid(rawValue,3,len(rawValue)-3)#")/>
</cfif>
  </cfif>
  <cfreturn rawValue />
</cffunction>
[/code]

However, if
you do not feel comfortable doing this. I recommend using simple settings:
[code]
<Setting name="datasource.name" value="myApp" />
[/code]

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=B9458AEC-FF65-CEF6-659832953E213F04