Reputation: 282855
I just downloaded ColdFusion Builder (CFB), and now I'm trying to write a simple "Hello World" app. But I need some sort of server first, don't I? Now what exactly am I looking for here? Is "ColdFusion" like a module that would run on top of Apache, or is it a server itself? What's this JRun I see in CFB? Context Root? RDS User Name? I'm trying to Google for tutorials, but all I'm finding are new languages features in CF9 which don't really help me, and stuff that relates to "MX" which is from 2003 I believe.
Databases. Does ColdFusion use it's own database schema, or does it interface with something like MySQL?
What about frameworks? I understand CFML offers HTML-style tags and such, but does it offer any sort of MVC framework for developing websites?
I understand LAMP and Python/Apache/WSGI to some degree, but I'm not quite grasping this CF yet. Can someone point me in the right direction?
Upvotes: 8
Views: 5217
Reputation: 864
Checkout CFML in 100 minutes https://github.com/mhenke/CFML-in-100-minutes
It covers:
Upvotes: 3
Reputation: 11753
Coldfusion is a script processing server written in Java. Coldfusion requires a Java Server (like JRun), a web server (like Apache), and prior to Coldfusion 9, a database server if you will be using a database. Thankfully the Development Edition comes with all of that built-in for you.
For production, you'll need a separate web server such as IIS or Apache, as the built in web server is development-only. Most likely you'll need a separate database server such as MySQL or Microsoft SQL too. But unless you have a specific need, you can probably get along with the built in JRun Java server and not worry about that aspect of Coldfusion for now.
If you've done any PHP, Coldfusion will be somewhat similar in the way it is setup on the server and how the code and HTML is integrated together in a script page. (YES, there are differences, but that's a good enough comparison as opposed to the .Net setup)
Coldfusion has it's own built in database or you can choose from a wide variety of other databases. You should setup a connection to the database, called a 'datasource' in the Coldfusion Administrator and then it'll be really, really simple to use after that using the cfquery tag.
If you are new to Coldfusion, I would skip all the third party frameworks until you have a good handle of how Coldfusion and your existing app works first. That all adds unnecessary complexity if you're new and the documentation for the frameworks is a little sparse.
Look over the source code. Ask individual questions on here about what it means.
The fastest way to find the docs for a particular Coldfusion function is to Google:
'Coldfusion 8 cftagname' (e.g. 'Coldfusion 8 cfquery' or 'Coldfusion 8 cfqueryparam')
or
'Coldfusion 8 cffunctionname' (e.g. 'Coldfusion 8 structKeyExists')
Click on the resulting livedocs.adobe.com link. (Google works WAY better than the site's internal search engine and Coldfusion 8 seems to be the best linked to Google)
The cfdump tag is handy for simple debugging.
Finally, here's an example of Hello World:
index.cfm (standard Coldfusion pages use the .cfm extension)
<!--- All coldfusion tags begin with <cf
...and Coldfusion comments have three dashes.
These comments will be removed on the server side
before being sent to the browser
--->
<!--- Set a greeting variable using standard cfset tag --->
<cfset greeting = "Hello World!!">
<!--- Begin HTML --->
<html>
<head>
</head>
<body>
<!-- Normal HTML comment -->
<p>I could just say hello world with HTML</p>
<!--- In order to output Coldfusion within HTML,
wrap with the cfoutput tag. Variables in HTML are wrapped with hash marks:
Example: #varName#
--->
<cfoutput>
<p>More HTML, blah, blah, blah...</p>
<!--- Outputs: Hello World! --->
<p>#greeting#</p>
<!--- Or apply a Coldfusion function to the variable.
Wrap the variable name with a function name and
then wrap the function with hash marks to tell
the Coldfusion server to process the statement
--->
<!--- Outputs: HELLO WORLD! --->
<p>#ucase(greeting)#</p>
</cfoutput>
<!--- And another way to view the contents of a variable as a developer --->
<cfdump var="#greeting#>
<body>
</html>
Hope that helps.
Upvotes: 20
Reputation: 32905
Download ColdFusion and install the "developer version" (free). It can also work with its built-in web server (port 8500 by default). Optionally you can use almost any web server you want, like Apache or IIS.
RDS is...
a security component of ColdFusion Server used by the ColdFusion Administrator and ColdFusion Studio to provide remote HTTP-access to files and databases.
The installation wizard will ask if u want to enable it or not before installation.
You can either install CF on your local machine, or install it on a test/dev server, your choice. :)
Database connection is handled by DSN (datasource name). You can set it up once you have CF installed and log into the admin area. Then you can configurate CF to talk to MS-SQL/mySQL or any other DB supported by JDBC. CF also comes with a built-in DBMS, Apache Derby.
To learn ColdFusion, consider reading the wonderful doc: CF9, CF8 (CF9 is 99.9% backward compatible with earlier versions. However if you're maintaining an existing app, most likely it will be ver 8 or 7. So learn from the appropriate doc).
MVC Frameworks? Here's a list, but for small app, they're not really necessary.
Check out FW/1, ColdBox, or Mach-II. If you like RoR, you'll also like CFWheels. Good luck~
Upvotes: 7
Reputation: 17132
There are a number of MVC coldfusion frameworks out there:
Both are actively maintained and coming on strongly.
Upvotes: 4
Reputation: 10278
Just A question. Is this your first language? I gave up programming in cf when .net came out. Much larger job market for c# compared to cf.
Yes, you will need cf server. Fun language /platform for building web apps!
Upvotes: 0