Skip to main content

Posts

ColdFusion 10: Accessing a REST service without specifying the Application name or Service mapping in URL

In my previous post, I’d explained how REST services can be created, published and accessed in ColdFusion 10 . Andy , asked me “Is there any way to avoid having the /rest/restapp/ in the URL?”. In short Yes. ‘rest’ in the URL lets the ColdFusion Server know that the incoming request is for a REST service. As mentioned in my previous post, you can update the servlet mapping defined in web.xml located at cfusion_home\wwwroot\WEB-INF directory. But it can't be avoided. Coming to the ‘restapp’ in the URL which indicates the Application name or the Servlet mapping. It can be removed from the URL by placing the CFCs in a default directory. While registering a REST service in the ColdFusion Administrator, there is an option to set the service as a default service, meaning all the CFCs placed in the directory would not require the Application name or Service mapping to be provided in the URL.

ColdFusion 10: RESTful WebServices in ColdFusion - Introduction

In ColdFusion 10, support for creating and publishing REST services has been added. The ColdFusion components can now be made available as REST services and these services can be consumed by various clients. REST stands for Representational State Transfer. It is an architectural style which is based on web standards and HTTP protocol. The idea here is to use HTTP protocol instead of complex mechanisms such as CORBA, RPC or SOAP to connect between the machines. In fact, the World Wide Web which is based on HTTP can be viewed as a REST based architecture.

ColdFusion 10: Using arrays in queryNew and queryAddRow

The queryNew() and queryAddRow() functions are used to create a query data structure and add empty rows to it. To add record sets to the query, function querySetCell() is used. If there are say three columns and you want to add say five rows to the query, then you would have about sixteen lines of code. That's huge and it will increase with number of columns and the number of records that you want to add. In ColdFusion 10 there's a third parameter introduced in queryNew() and queryAddRow() functions. The third parameter can accept either a struct,  an array of structs. Ray Camden had covered this in one of his POTW posts. One feedback that came from one of the ColdFusion users is to use an array or a two dimensional array to initialize or add rows to the query. This has now been implemented and is available in the public beta release. Here’s how it works:

ColdFusion 10: concatenate arrays using arrayAppend function

The arrayAppend function in ColdFusion is used to append an element to the end of the array. Now in ColdFusion 10, it is possible to concatenate two arrays using the same arrayAppend function. A third parameter of type boolean is added to the function; when it is set to true the two arrays are concatenated.

Now Showing - ColdFusion Zeus

After more than 20 months of research, planning, development and keeping  you all in suspense about the next version of ColdFusion, code named  Zeus; I'm finally proud to announce the release of the public beta version of none else than ColdFusion Zeus. You are free to download it here and report bugs here . This release comes with tonnes of new features and enhancements. It not only focuses on HTML5 features but also provides rich features such as RESTful WebServices, Closures, Java Integration, Security enhancements and many more. I wanted to create a picture that depicted all the new features in ColdFusion 10, like I did when public beta of  CFBuilder 2 was released. But I couldn't since its a massive release and capturing everything in one single picture was not possible at all. However, I managed to create an app (like a movie clip) and hence the title 'Now Showing - ColdFusion Zeus'. You can access the app here . Click on the chapters and learn what's

ColdFusion Tip: How to tell if path is file or directory

Today, one of the ColdFusion users asked me a question "Is there anyway I can find out whether a path is a directory or a file? There is no isDirectory() function available in ColdFusion and I don't want to write Java code to do this. Any help?" For a moment I thought really! is there no way that ColdFusion can tell you whether a given path is of a directory or file? But sooner, I came across the function 'getFileInfo' which takes the path as an argument and returns a struct data that contains various metadata properties of the file. The struct includes a key - 'type' whose value can either be a directory or file. The below code shows how you can determine whether the given path is of a directory or file:

2011 - A year full of surprises

I know it's been more than 15 days since the world celebrated new year and every one made some big and small resolutions which they hope they will live up to in this year. I had a fair 2011; there were a few ups and downs but in the end its gone and 2012 is here. Last year I presented ColdFusion Builder 2 at SOTR on the very day it was released to the public (how exciting!!). I was very much excited and nervous at the same time since this was my first talk at a conference. Nevertheless it went well, I have said this before and will say it again, 'Edinburgh is beautiful'.