interceptor with nested properties in coldbox.cfc

3 views
Skip to first unread message

Doug Boude

unread,
Dec 13, 2009, 7:37:20 AM12/13/09
to col...@googlegroups.com
Can someone give me a quick example of an interceptor entry using the new coldbox.cfc where the interceptor has additional properties to declare? I think a great example to use would be the sidebar interceptor's config entry since it has a lot of properties, some whose values are arrays.

So, what would the following look like as a coldbox.cfc entry:

<Interceptor class="coldbox.system.interceptors.coldboxSideBar">
  <Property name="yOffset">50</Property>
  <Property name="isScroll">false</Property>
  <Property name="slideSpeed">15</Property>
  <Property name="waitTimeBeforeOpen">500</Property>
  <Property name="waitTimeBeforeClose">250</Property>
  <Property name="links">
 [
 {"desc":"LOG OUT","href":"index.cfm?event=security.logout"}
 ,{"desc":"ColdBox API","href":"http:\/\/www.coldboxframework.com\/api\/"}
 ,{"desc":"ColdBox SideBar Help","href":"http:\/\/ortus.svnrepository.com\/coldbox\/trac.cgi\/wiki\/cbSideBar"}
 ,{"desc":"ColdBox Credits","href":"http:\/\/ortus.svnrepository.com\/coldbox\/trac.cgi\/wiki\/cbCredits"}
 ]
  </Property>
  <Property name="width"></Property>
  <Property name="visibleWidth"></Property>
  <Property name="imagePath"></Property>
  <Property name="imageVAlign"></Property>
  <Property name="cssPath"></Property>
</Interceptor>

Thanks!

Doug

Dorioo

unread,
Dec 13, 2009, 9:53:10 AM12/13/09
to col...@googlegroups.com
The code below is working for me. Basically,

1. The whole thing is a struct with "class" and "properties" keys
2. The "properties" key is also a struct
3. The "links" sub key becomes an array of structs with "desc" and "href" keys

I tried to paste into pastebin but the whitespace was way off. So I
hope sending it by email is at least decent in appearance.

- Gabriel

***

{
class = "coldbox.system.interceptors.coldboxSideBar",
properties = {
yOffset = "",
isScroll = "",
slideSpeed = "",
waitTimeBeforeClose = "",
links = [
{
desc = "ColdBox API",
href = "http://www.coldboxframework.com/api/"
},

{
desc = "ColdBox Credits",
href =
"http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbCredits"
},

{
desc = "ColdBox SideBar Help",
href =
"http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbSideBar"
}

],
width = "",
visibleWidth = "",
imagePath = "",
imageVAlign = "",
cssPath = ""
}
},
> --
> You received this message because you are subscribed to the Google Groups
> "ColdBox: A ColdFusion Framework" group.
> To post to this group, send email to col...@googlegroups.com
> To unsubscribe from this group, send email to
> coldbox-u...@googlegroups.com
> For more options, visit this group at
> http://groups-beta.google.com/group/coldbox
> For more information, visit http://www.luismajano.com/projects/coldbox
> For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi

Doug Boude

unread,
Dec 13, 2009, 10:03:41 AM12/13/09
to col...@googlegroups.com
Thanks! That's exactly what i needed. :)

Luis Majano

unread,
Dec 13, 2009, 6:56:26 PM12/13/09
to col...@googlegroups.com
You guys like the new programmatic approach? It is so much more
flexible now. Also configuring logbox is soo much nicer
> --
> You received this message because you are subscribed to the Google Groups "ColdBox: A ColdFusion Framework" group.
> To post to this group, send email to col...@googlegroups.com
> To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
> For more options, visit this group at http://groups-beta.google.com/group/coldbox
> For more information, visit http://www.luismajano.com/projects/coldbox
> For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi

--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Dorioo

unread,
Dec 13, 2009, 9:24:24 PM12/13/09
to col...@googlegroups.com
Yeah, it's really slick.

One, love less XML.
Two, more complex settings like queries, arrays, and structs are a breeze.
Three, if I need to get funky, it's just a component so manipulating
the data is much more flexible

My first love, as a concept, is the private request scope. But this
implementation is so clean and sexy that the concept is growing into
my top 5.

- Gabriel
Reply all
Reply to author
Forward
0 new messages