Entries Tagged as "CFML"
Using the Coldfusion filemanager standalone as a file interface
Posted by Paul Klinkenberg in CFML , jQuery + Javascript on December 4, 2010
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.
CKeditor 3 with FREE coldfusion filemanager, version 2.1
Posted by Paul Klinkenberg in CFML , jQuery + Javascript on November 17, 2010
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.
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.
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!
Investigation on auto-configuring Apache vhosts in Tomcat for use with Railo
What I wanted to do, is create a cfml script which checks the Apache
configuration files, extracts all virtualhosts and the default hosts,
and adds them to the tomcat configuration, without any necessary user
interaction. That way, a web admin only needs to add his virtual host in
one place: his frontend webserver.
Background for trying to
accomplish this, is the problematic installation/configuration that
users (and myself in the beginning) often encounter when trying out
Railo.
Recent Comments