I am pleased to be able to make the announcement that I've just rejoined Adobe and the ColdFusion team as the new Solution Consultant and product Evangelist. I'm extremely excited for this opportunity and can't wait to get started. I'll most likely be meeting many of you at any of the upcoming events or customer meetings if I don't know you already.
Thank you for the warm welcomes I've received from so many of you already!
We have had some valuable contributions to the ColdFusion 10 and ColdFusion Builder 2.0.1 pre-release. The participants showed a lot of interest in ensuring that they give maximum feedback to the product team. This just goes on to the show passion that you have for the product. Thanks to each and everyone one of you who participated in the pre-release program for ColdFusion 10. The product team values every contribution that was made. We will look forward to your contributions as we move towards building the next major version of ColdFusion.
Now to reward the top contributors of the pre-release.The top three contributors each will get a license for ColdFusion 10 Enteprise. The other two contributors following the three contributors will get a license for ColdFusion Builder.
Both the pre-release forum participation and the bugs filed were considered to identify the top contributions.
Here are the top three contributors who will get a license for ColdFusion 10 Enterprise.
Adam Cameron, Aaron Neff and Raymond Camden
The other two contributors who will get a license for ColdFusion Builder are:
David McGuigan and Charlie Arehart
Congratulations to all of you!
And thanks once again to everyone who took time to participate in the pre-release.
check complete tutorial here
Tutorial on REST: First REST Resource(cfc)
In first part we saw a simple example on REST to start off the things. So moving forward I will give another very simple example and will explain it.
<cfcomponent restpath="HelloWorld" httpmethod="post" rest="true">
<cffunction name="World" access="remote" output="false" returntype="string" httpmethod="get">
<cfreturn "Hello World!">
<cffunction name="HiWorld" access="remote" output="false" returntype="string" httpmethod="get" restpath="HiWorld">
<cfreturn "Hi World!">
<cfhttp url="http://127.0.0.1:8500/rest/IIT/HelloWorld" method="get" result="res">
<cfhttp url="http://127.0.0.1:8500/rest/IIT/HelloWorld/HiWorld" method="get" result="res">
- Every component and every function acts as a REST resource(if you are publishing them).
- A new attribute in cfcomponent 'restpath' OR 'rest' defines if a component can be published as a REST resource. Either of these should be present.
- Attribute 'httpmethod' should be there in cffunction tag or cfcomponent tag. 'httpmethod' in cffunction tag overrides the one in cffcomponent tag. To publish/expose a function as resource, this attribute is necessary. Valid values for this are 'GET', 'POST', 'PUT', 'DELETE', 'OPTION', 'HEAD'.
- Similar to 'httpmethod', 'restpath' can also be used in cffunction tag but it doesn't overrides the value of 'restpath' in cffcomponent tag , instead it appends to it. So if you want to call this function(resource), you need to give both the restpath's in URL. Check helloWorld.cfm's second http call for clearer picture
- Keeping other things simple like 'access=remote'(required for REST/WEB services) and 'returntype=string', lets see how can we call this service.
Note: After writing a cfc(at-least one) in webroot, you need to register the folder(in which that REST cfc is present) as REST application, otherwise you will not be able to call any resource. Please check previous chapter for that.
- Considering that you registered this application with name 'IIT', the URL to access first resource(function HelloWorld) will be: http://127.0.0.1:8500/rest/IIT/HelloWorld
- So to access that resource all you need to do is, use cfhttp tag and call this URL. Keep in mind that method in cfhttp tag will match to the httpmethod present in function.
- Similarly to call the second Resource in cfc(function HiWorld), the URL will be: http://127.0.0.1:8500/rest/IIT/HelloWorld/HiWorld
- To call this from a cfm you need to call this URL using cfhttp tag with httpmethod as get.
how the URL works:
Breaking the URL for better understading
- http://127.0.0.1:8500/ - protocol//ip:port/
- rest/ - Compulsary string to call a REST resource. You can change this 'rest' string in server.xml and restart the server for changes to take effect.
- Examples/ - Mapping name you give to register an application using Administrator or restInitApplication method(Check next example for this) .
- HelloWorld/ - RestPath to call a resource. This was given as 'restpath' attribute in cfcomponent level.
- HiWorld/ - If your function also has a restpath then after giving a restpath for your component you need to give restpath for function also to call that function.
check complete tutorial here
I have posted the Adobe ColdFusion Mobile and HTML5 survey here. Please spare a few minutes to help Adobe take the right steps to build the future of the product that you love - Adobe ColdFusion!