Entries Tagged as "CFML"

Railo custom tag CFDNS

I was actually surprised it was not in Coldfusion yet: the ability to do dns lookups. Since I'm the official Railo Extension Manager®™, I saw it as an excellent chance to create a new custom tag: CFDNS.
But, as seems to happen a lot with good ideas, someone else already thought of it. Just check www.cfdns.org :-/

The thing I could still do, was create the code to use it as a custom tag in Railo. I used the existing cfdns code with a few changes, and made a custom tag wrapper for it, and here it is: <CFDNS> for Railo!

6 Comments

Using the Coldfusion filemanager standalone as a file interface

Someone asked me today if you could use the Coldfusion filemanager plugin for CKeditor as a standalone application. That's a great idea, I thought. It can replace the regular file upload fields.

You can view a working example here.

14 Comments

CKeditor 3 with FREE coldfusion filemanager, version 2.1

I finally found time to update the coldfusion filemanager for the CKeditor 3. Check the long list of changes underneath! Also read the original blog post for more info on this filemanager.

I released the first versions in February/March 2010, as you can read in this blog post. Since publishing it, I noticed it had some user interface issues. These issues were mostly javascript-related, and were already existent in the original code by the Core Five labs. But nevertheless, they needed to be fixed.

78 Comments

RegexSafe() function for coldfusion

It will probably already be out there somewhere, but I couldn't find it: a function which makes a string regular-expression-safe to use.

[Skip skip delete remove etcetera]
Edit 15 nov. 2010: See Peter Boughton's comment underneath; the function I thought of could have been made a LOT simpler, so I am just posting his much appreciated code here:

<cffunction name="regExSafe" returntype="string" access="public" output="no">
<cfargument name="text" type="string" required="yes" />
<cfreturn rereplace(arguments.text, "(?=[\[\]\\^$.|?*+()])", "\", "all") />
</cffunction>

Thanks Peter!

Have tested this on ACF 8 and Railo 3.2.0.001.

3 Comments

Get windows %systemroot% in Railo

In case you need to get the value of the %systemroot% variable, which is the installation directory of windows, then you can use the following function:

	<cffunction name="getwindowsroot" access="public" returntype="string" output="no">
<cfset var systemPath = createObject('java','java.lang.System').getProperty('java.library.path') />
<cfset var winSysRoot = rereplaceNoCase(systemPath, '(.*;|^)([^;]+)[/\\]system(32|64)([;\\/].*|$)', '\2') />
<cfset var batchOutput = "" />
<!--- not found in system path? Then try it by using a batch file --->
<cfif winSysRoot eq systemPath>
<cffile action="write" file="getsystemroot.bat" output="echo $$$%systemroot%$$$" />
<cftry>
<cfexecute name="getsystemroot.bat" variable="batchOutput" timeout="2" />
<cfset winSysRoot = rereplace(batchOutput, '.*\$\$\$(.*?)\$\$\$.*', '\1') />
<cfcatch>
<cfset winSysRoot = "" />
</cfcatch>
</cftry>
</cfif>
<cfreturn winSysRoot />
</cffunction>

Full credit for the first check in the function goes to Peter Boughton, who mailed me this solution on the Railo mailing list. Thanks Peter!

No Comments

denominative-lowborn