cfvonner
07/25/2023, 11:24 PMWireBox.cfc, per the sample in the README. That works pretty well:
var baseURL = "https://[redacted]/LFRepositoryAPI/v1/Repositories/cccsdlf10";
map( "LaserficheAPI" )
.to( "hyper.models.HyperBuilder" )
.asSingleton()
.initWith(
baseURL = baseURL
);cfvonner
07/25/2023, 11:29 PMColdBox.cfc, including the baseURL that I hardcoded in above. Is there a way to access the ColdBox.cfc settings from within ireBox.cfc? I tried to inject the ColdBox settings, and then reference them in the first line above like so:
property name="LaserficheAPISettings" inject="coldbox:setting:LaserficheAPI";
...
function configure() {
var baseURL = LaserficheAPISettings.baseURL;
...
But that threw an error that LaserficheAPISettings.baseURL didn't exist.bdw429s
07/25/2023, 11:41 PMbdw429s
07/25/2023, 11:42 PMbdw429s
07/25/2023, 11:42 PMbdw429s
07/25/2023, 11:43 PMcfvonner
07/25/2023, 11:43 PMbdw429s
07/25/2023, 11:44 PMinitWith() to initArg()
https://wirebox.ortusbooks.com/configuration/mapping-dsl/dependencies-dslbdw429s
07/25/2023, 11:44 PMbdw429s
07/25/2023, 11:45 PMinitArg( name='baseURL', dsl='coldbox:setting:LaserficheAPI' )bdw429s
07/25/2023, 11:46 PMcfvonner
07/25/2023, 11:48 PMLaserficheAPI setting in ColdBox.cfc is a struct, and has keys like baseURL, username and password , would this work:
initArg( name='baseURL', dsl='coldbox:setting:LaserficheAPI.baseURL' )bdw429s
07/25/2023, 11:50 PMbdw429s
07/25/2023, 11:50 PMcfvonner
07/25/2023, 11:52 PMbdw429s
07/25/2023, 11:54 PMgetProperty( 'LaserficheAPI' )
returns the setting in the wirebox.cfccfvonner
07/26/2023, 5:05 PMLaserficheAPIURL), and then the other settings in LaserficheAPISettings. Then in WireBox.cfc I have:
initArg( name='baseURL', dsl='coldbox:setting:LaserficheAPIURL.baseURL')
That works just fine.bdw429s
07/26/2023, 5:06 PMbdw429s
07/26/2023, 5:06 PMcfvonner
07/26/2023, 5:06 PMcfvonner
07/26/2023, 5:08 PM