Ticket #55 (closed defect: fixed)

Opened 20 years ago

Last modified 16 years ago

Dynamically load an XML config into a bean at runtime with ColdSpring from within MG

Reported by: d.nando@… Owned by: joe.rinehart
Priority: normal Milestone:
Version: Severity: normal
Keywords: XML config Cc:

Description

I'm looking for a way from within ModelGlue? of loading an XML config file to create a bean at runtime using ColdSpring?. So rather than statically declaring it in ColdSpring?.xml, i'd either dynamically provide a path to the XML config to the ColdSpring?, or dynamically generate the XML config, and get back a bean with values that can be vary.

The thread on the MG mailing list where we discussed this had the subject "Coldspring/MG - XML config at runtime?"

thanks, Nando

Change History

Changed 20 years ago by joe.rinehart

  • owner changed from somebody to joe.rinehart
  • status changed from new to assigned
  • milestone set to Feature Requests

The concrete service behind ORM is exposed via .getORMService() on ModelGlue?.cfc. It'd be logical to expose the IoC service (be it ColdSpring? or ChiliBeans?) through the same manner.

Therefore, you could do something like this:

<cfset cs = getModelGlue().getIOCService() /> <cfset cs.loadBeans("/my/great/beans.xml") />

Would that work?

Changed 20 years ago by Dave Ross

Joe,

I think that would work for this use-case. It would also allow dynamic bean values (e.g. <value>${some.value}</value>) by using BeanFactory?.setDefaultAttributes(struct)

Changed 20 years ago by joe.rinehart

  • status changed from assigned to closed
  • resolution set to fixed

GetBeanFactory?() on ModelGlue?.cfc exposes this - has for a while, actually.

Changed 16 years ago by cfgrok

  • milestone Feature Requests deleted

Milestone Feature Requests deleted

Note: See TracTickets for help on using tickets.