Swap between SES and traditional URLs on the fly

This feature may exist, but I'm unable to find it in the
documentation. My apologies to Luis if he's already documented such a
feature. :slight_smile:

With another framework, it was simple to swap the entire application
between traditional URLs and SES URLs. I know we can turn on/off the
SES interceptor rather easily. However, this doesn't correct all of
the links I've created in a CB application. For example...

SES URL:
<a href="#event.buildLink('user.edit')#/user/#someVar#">Edit User #someVar#</a>

That link has a "query string" that can't (reasonably) be altered at
runtime. It would be nice to modify buildLink() to accept a structure
containing query string key/value pairs.

NEW URL:
<cfset qstring = {userID="55", context="foobar"} />
<a href="#event.buildLink(event: 'user.edit', qs: qstring)#">Edit User
#qstring.userID#</a>

Then, we could switch between the following two URLs with a simple setting...

<a href="index.cfm/user/edit/userid/55/context/foobar">Edit User 55</a>
.......or.......
<a href="index.cfrm?event=user.edit&userid=55&context=foobar">Edit User 55</a>

For comparison's sake, the framework I previously used simply used
application variables to compose the link...
<a href="#xit.editUser##myFramework.getApplication().queryStringSeparator#user#myFramework.getApplication().queryStringEqual#55#myFramework.getApplication().queryStringSeparator#context#myFramework.getApplication().queryStringEqual#foobar">Edit
User 55</a>

Jason,

We added this to 3.0. There is an argument called “queryString” in the buildLink method. You pass in a query string and the method will convert it to ses or leave it as is.

Luis

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