Our Forums are now closed. Please go to our Google Mailing List for help. This site will remain open for historical purposes.
ColdBox Framework Forums Home | Profile | Search | Login | RSS

 pdf Print PDF   Previous Page  Page: 1   Next Page

Thread: using json in config.xml?
Created on: 03/16/10 04:47 PM Replies: 1
cbuser35
Coronel

Joined: 03/04/09
Posts: 69
using json in config.xml?
03/16/10 4:47 PM

Hi,

I use json notation in my coldbox.xml file:

<Setting name="security_accessLevels" value="{'usermanagement':1,'addmenu':2,'deletemenu':2,'addpage':2,'deletePage':2,editmenu':3,'editpage':3};" />

When I request the value of this setting in a cfc

<cfproperty name="securityAccessLevels" type="coldbox:setting:security_accessLevels" scope="variables">

[...]

<cfdump var="#securityAccessLevels#">
<cfabort>

I get this response:

{'usermanagement':1,'addmenu':2,'deletemenu':2,'addpage':2,'deletePage':2,editmenu':3,'editpage':3};

I understood from the docs CB would convert this to a coldfusion struct instead of literally returning this string... Am I wrong? If so, what's the advantage of using Json in the config.xml??

I use CB 2.6.3


Thanks

Marc
Link | Top | Bottom
cbuser35
Coronel

Joined: 03/04/09
Posts: 69
RE: using json in config.xml?
03/17/10 2:26 AM

Ok, fixed. My json was invalid. Should be like this:

<Setting name="security_accessLevels" value="{usermanagement:'1',addmenu:'2',deletemenu:'2',addpage:'2',deletePage:'2',editmenu:'3',editpage:'3'}" />

Now I get a nice CF struct.

Coldbox rocks!

Marc
Link | Top | Bottom

Galleon Forums V1.7.008 was created by Raymond Camden