Entries Tagged as 'Coldfusion9'

cfajaxproxy issue with ColdFusion 9.0.1

I was really happy when I heard about coldfusion 9.0.1 update and specially because of Amazon S3 could support. Recently I have started working with Amazon S3 Cloud service and writing function for all API call, when I see that new update for ColdFusion having amazon S3 cloud support and I can not stop myself to update it on my development server and my hard time start from here...

Read more...

New ColdFusion 9 Feature: CFMAP

Hello Friends,

One of our projects had a requirement for displaying a google map on one the webpages.
There are three options for setting google map key for your application.

1) You can use the cfajaximport tag and specify the map API key in the params attribute as follows :

<cfajaximport params="#{googlemapkey='Your Google Map Key Here'}#"/>

2) You can set googleMapKey in Application.cfc as follows:

<cfset this.googlemapkey="Your Google Map Key Here">

3) You can use the Settings page in the ColdFusion Administrator. Specify the map API key in the Google Map Key field.

Now you know that how to get started using maps, you’re ready to see examples. I have set up the API key in the application.cfc file. To get started all you need to know the street address or a longitude and latitude. In the below given example we are using the address for iSummation Technologies Pvt. Ltd. 304, Shapath-3 Bodakdev, Ahmedabad.
The following two lines of code will produce the same result.

<cfmap centeraddress="iSummation Technologies Pvt. Ltd. 304, Shapath-3 Bodakdev, Ahmedabad"/>
<cfmap centerlatitude="23.04039" centerlongitude="72.51605" />
 
 
When the user clicks on the marker, Generally you want to display more information about the location.
You can display this information statically by using the markerwindowcontent attribute or dynamically by using the markerbind attribute.



<cfsavecontent variable="content">
<strong>iSummation Technologies Pvt. Ltd</strong><br/>
304, Shapath-3<br/>
Ahmedabad, Gujarat 380054 <br/>
079 2685 3054<br/><br/>
<a href="http://www.isummation.com">iSummation.com</a>
</cfsavecontent>
<cfmap name="CFMAP" 
centeraddress="iSummation Technologies Pvt. Ltd. 304, Shapath-3 Bodakdev, Ahmedabad" 
height="500" width="700"
hideborder="false" zoomlevel="12"
collapsible="true"
title="iSummation Technology" markerwindowContent="#content#"/>


Please refer below screen shot.

cfmap

More : Adobe Article

Implicit Getters/Setters

Adobe ColdFusion 9 Supports Implicit Setters/Getters for Components.

Read more...

Loop Over A Structure Using CFScript

Loop Over A Structure Using CFScript

Read more...

cfquery using cfscript

Hello Friends,

Used to execute a query passing SQL statements to a data source using CFScript. We can execute sql statement using execute method with query object.

How to define query object in cfscript:

<cfscript>
queryObj = new Query();
<!--- 
OR 
--->
queryObj = 
createObject("component","query");
</cfscript>

Read more...

cfsavecontent in CF9 cfscript

Hi
We can use cfsavecontent in cfscript but only for CF9.
The cfsavecontent equivalent in CF9 script is "savecontent" which is used like this:

Syntax:


	savecontent variable="any_variable_name" {
		WriteOutput("Your Content");
	}	

For Example:


	savecontent variable="myVariable" {
		WriteOutput("Hello World");
	}	

Promote and support coldfusion on web - All CFers must have a look at this.

Hello all,

Yesterday i was just googling around and found very generous approach which can help CF community  to grow and expand as much as it can. If anybody has their CF powered website they can register too in this community. I urge all CFers to atleast visit GOT CFM and try to promote CF worldwide.

One more thing i found about coldfusion and the excerpt says :

Who's using coldfusion?

 'More than 770,000 developers at over 12,000 companies worldwide rely on Adobe® ColdFusion® software to rapidly build and deploy Internet applications. And with more than 125,000 ColdFusion servers deployed, ColdFusion is one of the most widely adopted web technologies in the industry.'

 

cffinally, finally

Hello Friends,

ColdFusion 9 introduced cffinally tag. Cffinally or finally blocks are used within cftry or completion of try block. It is generally used for cleanup i.e. close database connections, close some objects or excecute code whether it is exception or not.

Category

Data output tag and error handling.

CFML Syntax

<cftry>
    ......
    <cfcatch type="any">
        ......
    </cfcatch>
    <cffinally>
        ......
    </cffinally>
</cftry>

CFScript Syntax

<cfscript>
    try{
        ......    
    }catch(Any e){
        ......
    }finally{
        ......
    }
</cfscript>

Generally we use try and catch block to catch exception like application error, database error, custom error etc. But sometimes we need to run some code whether it is exception or not so generally we need to write both of it in catch block as well as after try block but now in ColdFusion 9 has introduced cffinally and many more useful tags. cffinally tag always use in try block. You can nest cftry/cfcatch/cffinally blocks. Cffinally tag executes code whether it is exception or not. You can also use finally in cfscript tag.  These tags are meant for error handling. I hope it may be useful for you.

CFML Example

<cftry>
    <cfset a = 10>
    <cfset b = 0>
    <cfset a = a / b>
    <cfoutput><b>Ans : </b>#a#</cfoutput>
    <cfcatch type="any">
        <cfdump var="#cfcatch.Message#">
    </cfcatch>
    <cffinally>
        <br /><b>Finally Block :</b>
        <cfdump var="#a#">
    </cffinally>
</cftry>


CFScript Example
<cfscript>
    a = 10;
    b = 0;
    try{
        a = a / b;
        writeOutput('<b>Ans : #a#</b>');
    }catch(Any e){
        writeDump(e.message);
    }finally{
        writeOutput('<br /><b>Finally Block : </b>');
        writeDump(a);
    }
</cfscript>

Output

Division by zero.
Finally Block : 10

 

Design by Mark Aplet | Powered by Mango Blog