Thanks to the Railo documentation on Github, I finally found the answer I was searching for...
Question: how to call an inner Java class of a Java class with Railo?
Answer: use a $ sign: createObject("java", "main.java.class$innerClass")
Long version: I was busy implementing the javaEWSApi (MS Exchange Web Services API) into a new mobile project, but got stuck on getting the unread-count for the user’s Inbox. An example online showed ...
For anyone using the Railo log analyzer, there is an update out!
Update 2.2.0 contains:
- Added View option, to view the log file inline in the admin.
- Fixed a bug with Railo 4.0.x, which prevented the display of log files. Reason: cfdirectory filter attribute doesn't respect pipe character as delimiter anymore.
- Updated the styling, so tables and other layout looks normal again.
Posted by Paul Klinkenberg in CFML on May 13, 2013
I needed to incorporate a news feed from yammer.com, which was pretty easy using their API. The return format is JSON, so all looked great. Except for the "rich text" they sent back:
As you can see, there are a lot of "\u00.." occurences in the rich text. I searched Google for a standard CFML solution to convert these character sequences, but found nothing for CFML. So I wrote the following function, which tries to convert the string as fast as possible:
<cffunction name="unicodeEscape" returntype="string" output="no">
<cfargument name="s" type="string"/>
<!--- If no unicode-escapes present in the string: return --->
<cfif not find('\u', arguments.s)>
<cfreturn arguments.s />
<!--- If % is present in the string: url-encode it. Otherwise, urlDecode would choke on it --->
<cfif find('%', arguments.s)>
<cfset arguments.s = replace(arguments.s, '%', urlEncodedFormat('%'), 'all') />
<!--- Ascii characters (\u0000 - \u00FF) can be translated as %00-%FF --->
<cfset arguments.s = replace(arguments.s, "\u00", "%", "all") />
<!--- Higher characters (\u0100 - \uFFFF) can be translated as %01%00 - %FF%FF.
Only do this regex if there is something to replace. --->
<cfif find('\u', arguments.s)>
<cfset arguments.s = rereplace(arguments.s, "\u([0-9A-F][0-9A-F])([0-9A-F][0-9A-F])", "%\1%\2", "all") />
<cfreturn urldecode(arguments.s) />
If there is a built-in way in CFML to decode unicode-escapes, then please leave a comment. I'd be happy to learn :)
I recently joined the CFUG-NL team, which had been a bit silent for the last few years. To start off, and hear about your ideas for upcoming CFUG meetings, we would like to invite you all to a networking event on March 22, 2013 in Utrecht.
Please see www.cfugnl.nl for full details, and don't forget to register. See you at Cafe Olivier!