G'day:
I googled everywhere for how to do this, and drew a complete blank. I had to fall on the mercy of a friendly Adobe engineer to help me get it working, so I thought I would knock together a quick article so if anyone else ever needs to do this, there's something for Google to find.
Firstly, I gotta say that on the whole I probably would not create a RESTful web service which accepts a complex value... it seems to make more sense to me to work with simply types, and perhaps reflect any complex nature using collections of simple-value fields, or JSON or something. Still: I had this specific requirement which was out of my hands, so I needed to make it work.
Friday, 31 May 2013
Thursday, 30 May 2013
ColdFusion / Railo WebSockets: do you use 'em? (survey)
G'day:
I've just started looking at the technical side of the WebSocket offering in ColdFusion 10. It's an interesting-looking technology, but I'm just wondering what real world practical applications people are putting them to. I've seen plenty of "chat demos" and the like, but nothing that one would really want to do in the real world. So I'm just gauging the community's usage of them.
As far as I can tell Railo doesn't have WebSocket supprot built-in, but there's a WebSockets Extension. I've not tried it. But I will at some stage.
Anyway, I want to know about your usage of WebSockets, or also if you've not used them and/or have no interest in them at all. I've knocked together a quick survey (four questions). If you fancy filling it in: good for you, and thanks. If you feel like re-sending the Twitter message I will send out advising of said survey, that'd be cool too: the more responses the merrier.
Cheers.
--
Adam
I've just started looking at the technical side of the WebSocket offering in ColdFusion 10. It's an interesting-looking technology, but I'm just wondering what real world practical applications people are putting them to. I've seen plenty of "chat demos" and the like, but nothing that one would really want to do in the real world. So I'm just gauging the community's usage of them.
As far as I can tell Railo doesn't have WebSocket supprot built-in, but there's a WebSockets Extension. I've not tried it. But I will at some stage.
Anyway, I want to know about your usage of WebSockets, or also if you've not used them and/or have no interest in them at all. I've knocked together a quick survey (four questions). If you fancy filling it in: good for you, and thanks. If you feel like re-sending the Twitter message I will send out advising of said survey, that'd be cool too: the more responses the merrier.
Cheers.
--
Adam
Labels:
ColdFusion,
Railo,
Survey
Wednesday, 29 May 2013
CFML: Application.cfc look-ups and virtual directories (Appendix)
G'day:
Yesterday I did a bit of an investigation in to how ColdFusion looks for an Application.cfc / .cfm when it runs a request. This article is a continuation of that, and it won't make any sense if you don't read yesterday's article first.
In yesterday's article I had this directory structure set up:
And I covered the look-ups for Application.cfc from both local directories, and junctioned / linked directories.
Following my Twitter feed this evening, and Laura Springer (who I don't know, other than from following on Twitter: I hope you don't mind me using you as an inspiration, Laura) made an observation about Application.cfc file behaviour when called from a virtual directory.
And it occurred to me that this is:
Where C:\temp\virtual_subdir is a physical directory mapped into the site via a virtual directory /some_dir/virtual_subdir/.
I'll not do all the colour-coding and stuff from last night, but when browsing to /some_dir/virtual_subdir/test.cfm, ColdFusion looks for Application.cfc / .cfm files in the directories as listed below:
C:\temp\Application.cfc
C:\Application.cfc
C:\temp\Application.cfc
C:\Application.cfc
C:\apps\adobe\ColdFusion\10\cfusion\wwwroot\docroot\Application.cfc
So as you can see here: for the first two options it looks up in the physical directory structure, but in the latter example it looks in the immediate physical directory, and then looks in the web site's web root (and no further).
Another curious thing... you know how yesterday I said that the "web root" for the purposes of this look-up meant "the ColdFusion root", not the web server / site's web root? I tested that assertion three times last night, and was 100% confident I was correct in saying that (I checked because it seemed to be contradicting what I was reading elsewhere on the 'net, so presumed initially I was wrong). However this evening having seen what seemed like anomalous behaviour with that last path on the "in webroot" look-up, I tested again. And for the life of me I cannot replicate last night's behaviour this evening: this evening "web root" means "the web site's web root" not "ColdFusion's application root". There's a chance I screwed up last night, but I really don't think I did. Well: 80% sure I didn't. However I could have got something wrong. I'm gonna put a caveat on last night's article until I test more thoroughly, and make myself sure of what's what.
That's all I have to say on that. I had better go put a warning on y/day's article to the effect that I might be talking ballocks. Well: more so than usual, I mean ;-)
--
Adam
Yesterday I did a bit of an investigation in to how ColdFusion looks for an Application.cfc / .cfm when it runs a request. This article is a continuation of that, and it won't make any sense if you don't read yesterday's article first.
In yesterday's article I had this directory structure set up:
C:\
apps\
adobe\
ColdFusion\
10\
cfusion\
wwwroot\
docroot\
test.cfm
some_dir\
linked_subdir\
test.cfm
local_subdir\
test.cfm
temp\
linked_subdir\
test.cfm
And I covered the look-ups for Application.cfc from both local directories, and junctioned / linked directories.
Following my Twitter feed this evening, and Laura Springer (who I don't know, other than from following on Twitter: I hope you don't mind me using you as an inspiration, Laura) made an observation about Application.cfc file behaviour when called from a virtual directory.
And it occurred to me that this is:
- something I didn't cover in my previous article;
- another thing I didn't know the behaviour of.
C:\
apps\
adobe\
ColdFusion\
10\
cfusion\
wwwroot\
docroot\
test.cfm
some_dir\
linked_subdir\
test.cfm
local_subdir\
test.cfm
virtual_subdir\
test.cfm
temp\
linked_subdir\
test.cfm
virtual_subdir\
test.cfm
Where C:\temp\virtual_subdir is a physical directory mapped into the site via a virtual directory /some_dir/virtual_subdir/.
I'll not do all the colour-coding and stuff from last night, but when browsing to /some_dir/virtual_subdir/test.cfm, ColdFusion looks for Application.cfc / .cfm files in the directories as listed below:
Default
C:\temp\virtual_subdir\Application.cfcC:\temp\Application.cfc
C:\Application.cfc
Until Webroot
C:\temp\virtual_subdir\Application.cfcC:\temp\Application.cfc
C:\Application.cfc
In Webroot
C:\temp\virtual_subdir\Application.cfcC:\apps\adobe\ColdFusion\10\cfusion\wwwroot\docroot\Application.cfc
So as you can see here: for the first two options it looks up in the physical directory structure, but in the latter example it looks in the immediate physical directory, and then looks in the web site's web root (and no further).
Another curious thing... you know how yesterday I said that the "web root" for the purposes of this look-up meant "the ColdFusion root", not the web server / site's web root? I tested that assertion three times last night, and was 100% confident I was correct in saying that (I checked because it seemed to be contradicting what I was reading elsewhere on the 'net, so presumed initially I was wrong). However this evening having seen what seemed like anomalous behaviour with that last path on the "in webroot" look-up, I tested again. And for the life of me I cannot replicate last night's behaviour this evening: this evening "web root" means "the web site's web root" not "ColdFusion's application root". There's a chance I screwed up last night, but I really don't think I did. Well: 80% sure I didn't. However I could have got something wrong. I'm gonna put a caveat on last night's article until I test more thoroughly, and make myself sure of what's what.
That's all I have to say on that. I had better go put a warning on y/day's article to the effect that I might be talking ballocks. Well: more so than usual, I mean ;-)
--
Adam
Tuesday, 28 May 2013
CFML: Application.cfc look-ups and linked directories
G'day:
This is a pretty non-descript topic / article, sorry. Someone raised a question on the Adobe ColdFusion forums about the possibility of CF10 not getting along well with Application.cfc look-ups from within a symlinked directory. I doubted this would be an issue, but I wasn't 100% sure so I thought I'd check it out.
Anyway, that was a digression. Another side issue that came up from the original question is how does CF look for which Application.cfc (or .cfm in the case of the original question) to execute, for a given request. I'd forgotten that there were multiple "modes" for doing this settable in CFAdmin, and had never really paid much attention to them, so decided to roll both these concepts / questions into one investigation.
Firstly, lets look at the options on offer in CFAdmin:
As various people have blogged, docs on this setting are a bit thin on the ground, so I can reproduce it in its entirety without blowing out my word count:
To demonstrate each of these, I have set up the following directory structure on my box:
There are several significant elements to this:
This is a pretty non-descript topic / article, sorry. Someone raised a question on the Adobe ColdFusion forums about the possibility of CF10 not getting along well with Application.cfc look-ups from within a symlinked directory. I doubted this would be an issue, but I wasn't 100% sure so I thought I'd check it out.
Links / junctions
Before I start, just in case you're unsure about symlinks, here's what Wikipedia has to say about them. These are pretty prevalent on *nix systems, but they're under-utilised on Windows. Mostly because people are unaware they exist. Windows has actually been able to effect pretty much the same thing as a symbolic link since Windows 2000. Well: the Windows GUI shell couldn't, but the underlying NTFS file system has supported junction points since Windows 2000 came out. And a junction point amounts to the same thing.
Junction points are bloody handy. I have quite a number of CFML app servers running on this machine: CF5, CFMX7, CF8, CF9 (multiple instances), CF10 (multiple instances... Railo Express, some manner of OpenBD install (gathering dust)... and they all have their own discrete webroots for platform-specific stuff (eg: C:\webroots\cf5, C:\webroots\railo-express, etc). However I have a repository of all my common code @ C:\webroots\shared. Into each of my version-specific webroots I junction-in a reference to shared, so I have C:\webroot\cf10\shared etc. As far as CF10 is concerned, C:\webroot\cf10\shared is a discrete directory. And as far as Railo is concerned, C:\webroots\railo-express\shared is a discrete directory. But it's all the same place. Cool. I dunno how to create these things on *nix (something to do with ln comment), but , but on Windows it's just this:
C:\webroots\cf10> mklink /d shared c:\webroots\shared
Where obviously "shared" is what the junction ends up being called, and c:\webroots\shared is where it points to.
I've never had any problems with these on ColdFusion or Railo, and have been using them for a decade.
Before I start, just in case you're unsure about symlinks, here's what Wikipedia has to say about them. These are pretty prevalent on *nix systems, but they're under-utilised on Windows. Mostly because people are unaware they exist. Windows has actually been able to effect pretty much the same thing as a symbolic link since Windows 2000. Well: the Windows GUI shell couldn't, but the underlying NTFS file system has supported junction points since Windows 2000 came out. And a junction point amounts to the same thing.
Junction points are bloody handy. I have quite a number of CFML app servers running on this machine: CF5, CFMX7, CF8, CF9 (multiple instances), CF10 (multiple instances... Railo Express, some manner of OpenBD install (gathering dust)... and they all have their own discrete webroots for platform-specific stuff (eg: C:\webroots\cf5, C:\webroots\railo-express, etc). However I have a repository of all my common code @ C:\webroots\shared. Into each of my version-specific webroots I junction-in a reference to shared, so I have C:\webroot\cf10\shared etc. As far as CF10 is concerned, C:\webroot\cf10\shared is a discrete directory. And as far as Railo is concerned, C:\webroots\railo-express\shared is a discrete directory. But it's all the same place. Cool. I dunno how to create these things on *nix (something to do with ln comment), but , but on Windows it's just this:
C:\webroots\cf10> mklink /d shared c:\webroots\shared
Where obviously "shared" is what the junction ends up being called, and c:\webroots\shared is where it points to.
I've never had any problems with these on ColdFusion or Railo, and have been using them for a decade.
Anyway, that was a digression. Another side issue that came up from the original question is how does CF look for which Application.cfc (or .cfm in the case of the original question) to execute, for a given request. I'd forgotten that there were multiple "modes" for doing this settable in CFAdmin, and had never really paid much attention to them, so decided to roll both these concepts / questions into one investigation.
Firstly, lets look at the options on offer in CFAdmin:
As various people have blogged, docs on this setting are a bit thin on the ground, so I can reproduce it in its entirety without blowing out my word count:
Select the order in which ColdFusion searches for Application.cfm or Application.cfc if it is not found in the current project folder. You can set ColdFusion to search as follows:
default search order: ColdFusion looks for an Application.cfc/Application.cfm file from the current folder until the system root directory. On Windows, this could be C:\ and on UNIX, /opt.
till web root: ColdFusion looks for an Application.cfc/Application.cfm file from the current folder till web root.
in web root: ColdFusion looks for an Application.cfc/Application.cfm file in the current folder or web root.
To demonstrate each of these, I have set up the following directory structure on my box:
C:\
apps\
adobe\
ColdFusion\
10\
cfusion\
wwwroot\
docroot\
test.cfm
some_dir\
linked_subdir\
test.cfm
local_subdir\
test.cfm
temp\
linked_subdir\
test.cfm
There are several significant elements to this:
- The root
- The ColdFusion instance directory
- The ColdFusion app root - CF serves files from within here
- The web root - the web server serves files from within here
- A junction
- The directory that is junctioned
- Test files
Scotch on the Rocks: which sessions am I going to?
G'day:
Meself and a bunch of the bods from work are off up to Edinburgh for Scotch on the Rocks 2013 next Weds. I should be lurking about from about 2pm, I guess.
I've not even looked at the schedule yet, but "what are you going to see?" came up over cheap-steak-lunch-at-'Spoons just now, so I figured I'd better find out.
So in a similar vein to my cf.Objective() article on the subject... here's my thoughts on which sessions I might go it.
Meself and a bunch of the bods from work are off up to Edinburgh for Scotch on the Rocks 2013 next Weds. I should be lurking about from about 2pm, I guess.
I've not even looked at the schedule yet, but "what are you going to see?" came up over cheap-steak-lunch-at-'Spoons just now, so I figured I'd better find out.
So in a similar vein to my cf.Objective() article on the subject... here's my thoughts on which sessions I might go it.
Labels:
Conference,
SotR
Sunday, 26 May 2013
Ruby: doing a second tutorial @ codeschool.com
G'day:
OK, I'm coffee`d up and am gonna do the next Ruby tutorial. Yesterday I did "Try Ruby", and now I'm on the second leg of the Ruby path "Ruby Bits". As a recap: I'm suddenly doing these Ruby courses because codeschool.com is offering their services for free this weekend. I have 16hrs of freeness to go, so I hope to get through two courses.
OK, I'm coffee`d up and am gonna do the next Ruby tutorial. Yesterday I did "Try Ruby", and now I'm on the second leg of the Ruby path "Ruby Bits". As a recap: I'm suddenly doing these Ruby courses because codeschool.com is offering their services for free this weekend. I have 16hrs of freeness to go, so I hope to get through two courses.
Labels:
Ruby
Saturday, 25 May 2013
Ruby: stream-of-consciousness
G'day:
OK, so I'm fiddling around with Ruby (as per my previous post), and am typing this article as I explore.
Prior to starting this I googled "ruby IDE", and saw a lot of advice from people to just use a text editor. There are always people who claim they do all their code in notepad or vi etc, and I always figure they're just trying to sound cool. Whereas I think they just sound stupid, because whilst anyone can type code into a blank, featureless typing window (and we've all had to do emergency hacks on prod servers using vi or notepad, so it's good to not have to rely on code assist, etc), it's not exactly the most professionally productive way of going about one's business.
It seems like the general opinion is to use the plug-in for NetBeans, or a plug-in for Aptana. The plug-in for NetBeans has been discontinued (although someone's blogged how to install it anyway... I might need to look at that later on), so I have installed Aptana as a plug-in to Eclipse, adjacent to my ColdFusion Builder plug-in. This seems to have had the effect of slowing down Eclipse even more, and interfering with my Eclipse config, so this has not impressed me one bit.
One of the Aptana pages I landed on suggested install Ruby via RubyInstaller, which I duly have done, and that all seems to work, which is cool.
I dunno how to do all the IDE-y stuff yet, but I can create a Hello World file and run it from the command line.
OK, so I'm fiddling around with Ruby (as per my previous post), and am typing this article as I explore.
Prior to starting this I googled "ruby IDE", and saw a lot of advice from people to just use a text editor. There are always people who claim they do all their code in notepad or vi etc, and I always figure they're just trying to sound cool. Whereas I think they just sound stupid, because whilst anyone can type code into a blank, featureless typing window (and we've all had to do emergency hacks on prod servers using vi or notepad, so it's good to not have to rely on code assist, etc), it's not exactly the most professionally productive way of going about one's business.
It seems like the general opinion is to use the plug-in for NetBeans, or a plug-in for Aptana. The plug-in for NetBeans has been discontinued (although someone's blogged how to install it anyway... I might need to look at that later on), so I have installed Aptana as a plug-in to Eclipse, adjacent to my ColdFusion Builder plug-in. This seems to have had the effect of slowing down Eclipse even more, and interfering with my Eclipse config, so this has not impressed me one bit.
One of the Aptana pages I landed on suggested install Ruby via RubyInstaller, which I duly have done, and that all seems to work, which is cool.
I dunno how to do all the IDE-y stuff yet, but I can create a Hello World file and run it from the command line.
Labels:
Ruby
Subscribe to:
Posts (Atom)