Sunday, September 20, 2009

Learn coldfusion and get coldfusion project

Hi All,

It's pleasure to invite you as a Coldfusion learner and get a project free with tutorials and all related queries and soled papper.
get prepared for certifications and other exams.

For more details
Please Contact
Kalyan Dhar
kalyan.cse.jis@gmail.com
+919007479716
03325817535
Location : Kolkata

Wednesday, September 9, 2009

How do we restart coldfusion server from command prompt ?

How do we restart coldfusion server from command prompt?
Restart in Unix/Linux:

1. /etc/init.d/coldfusion restart
2. /opt/coldfusionmx/bin/coldfusion restart
3. service coldfusion restart
4. /etc/init.d/coldfusionmx restart
Restart in Windows:
There is no direct restart service command available in windows.
we have to use stop & start commands.
net stop "ColdFusion MX Application Server"
net start "ColdFusion MX Application Server"

Common service names for varies CF versions
"ColdFusion MX ODBC Agent"
"ColdFusion MX ODBC Server"

"ColdFusion 8 Application Server"
"ColdFusion 8 ODBC Agent"
"ColdFusion 8 ODBC Server"
"ColdFusion 8 Search Server"

"ColdFusion Centaur .NET Service"
"ColdFusion Centaur Application Server"
"ColdFusion Centaur ODBC Agent"
"ColdFusion Centaur ODBC Server"
"ColdFusion Centaur Search Server"
"ColdFusion Centaur Solr Service"

Tuesday, September 8, 2009

Get last date of a month with SQL or Js( javascript )

I think SQL does a pretty good job with dates. Here is a very simple way to get the last day of any month. The example retreaves the last day of the current month.


SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))

Replace the GETDATE() with whatever date you need to find the last day of the month in.

We can write a simple function also in javascript to get last date of that month.

This function is useful for populating a client side last date operations

function daysInMonth(month,year)

{ var m = [31,28,31,30,31,30,31,31,30,31,30,31]; if (month != 2) return m[month - 1]; if (year%4 != 0) return m[1]; if (year%100 == 0 && year%400 != 0) return m[1]; return m[1] + 1; }

ColdFusion Returns UPPER CASE Struct Variables to Flex 3

If you have ever tried to return struct to Flex 3 from ColdFusion you may have run into this problem. If you use dot (.) notation to define your struct variable, the variable will get passed in UPPER CASE. This causes problems because Flex 3 and actionscript are case sensitive. Not knowing this little fact may cause you to bang your head on some walls.

Here is an example and a couple solutions:

{tag}cfset var myArray = ArrayNew(1){tag}
{tag}cfset var stItm = StructNew(){tag}

{tag}cfset stItm.upper = "test"{tag}
{tag}cfset stItm.lower = "test2"{tag}

{tag}cfset arrayAppend(myArray, stItm){tag}

The above code will return both the struct items in upper case to flex 3. IE (UPPPER = test, LOWER = test2)

{tag}cfset var myArray = ArrayNew(1){tag}
{tag}cfset var stItm = StructNew(){tag}

{tag}cfset stItm["UPPER"] = "test"{tag}
{tag}cfset stItm["lower"] = "test2"{tag}

{tag}cfset arrayAppend(myArray, stItm){tag}

Using the brackets "[ ]" to define your struct variables will return the variables to flex in the proper case. IE (UPPPER = test, lower= test2 ).

If you must use dot (.) notation for what ever reason you are still in luck with a little motification of the remoting-config.xml which is normally located by default here (C:\ColdFusion8\wwwroot\WEB-INF\flex). Inside the file all you need to do is locate the {tag}property-case{tag} tag inside the proper {tag}destination{tag} (default is {tag}destination id="ColdFusion"{tag}) and modify the properties within. I have highlighted below the code to modify.

Hope this helps someone out there.