Jump to content

Cold Fusion Tutorials


Skemcin

Recommended Posts

Hello,I am in the early stages of planning the layout/content of a series of Cold Fusion tutorials that I plan on developing and submitting to w3schools.com whom I hope will consider adding them to their site. My outline, so far, is as follows:IntroductionInstallationSyntaxIncludes - Templates - ModulesConditionals - IsDefined - If - Elseif - ElseLooping - From/To - Delimited FileEmailing - Text - HTMLScopes - Form - Cookies - SessionsDatabaseQuery Output - Basic - GroupedXML - Parsing - RSSFunctionsUDFsCFCsFeedback is welcomed and appreciated.

Edited by Skemcin
Link to comment
Share on other sites

ColdFusion is a tagbased language very similar to html, only with more options as it is serverside. I would think you can develop in notepad just as in Macromedia ColdFusion, but I suppose Macromedia ColdFusion would have lots of useful help functions if you're new to it. But I'm sure Skemcin can tell you more, and with more certainty... :)

Link to comment
Share on other sites

And there we have something to answer in the introduction I guess :) .To say "Macromedia ColdFusion" is the same as to say "PHP". Both are server side scripting languages and both downloadable files (from the respective sites) contain what should be put on the server in order for the corresponding files to work. Both can be edited in any text editor just as HTML page.@Skemcin shouldn't you explain the basics at first, before going into the includes? Also, there should be a whole page describing the installation of ColdFusion and it's binding on an Apache server (hey, it took me a whole day before I was able to figure that out myself) right after the introduction.What's UDF and CFC btw?

Edited by boen_robot
Link to comment
Share on other sites

I would really love to have a tutorial for ColdFusion here. So i can expand my knowlege a bit more :)

Link to comment
Share on other sites

Here are a few responses to the posts made:

  • Cold Fusion can be coded using notepad or any other text editor - so there is no proprietary coding software requirement
  • Just like ASP and PHP, you will need to install the server engine that processes the cold fusion tags (every server side scripting language will require that)
  • Everything you need to develop cold fusion is free - yes FREE. Cold Fusion even has its own web server if you do not have IIS or Apache
  • The introduction will define what Cold Fusion is - here is where I am going to be developing this:http://www.iribbit.net/tutorials/
  • I will add an Installation page after the Introduction
  • I had decided on the order I selected in an attempt to walk through how poeple would most likely tend to try out a new scripting language. But I can always move the order around - I'm primarily making sure I have the basic topics covered.
  • UDF - user defined function. These are snippets of code that you can tuck away in a folder somewhere that perform any number of imaginable tasks. For instance, I use one to see if a student is enrolled in a course. It lookes like this <cfif checkenroll(userID,courseID) IS "Yes"> . . . where my UDF is "checkenroll" and I pass in the students userID and the courseID I want to see if he is enrolled in. Then I have a webpage called checkenroll.cfm that does all database calling and then returns a "Yes" or "No" off of which I build a condition - or whatever else.
  • CFC - Cold Fusion Component. This is very similar to a UDF but extended to another level. CFC's used the way they are designed to basically turns Cold Fusion into an OOP language. Basically speaking, a CFC is like a collection of UDFs stored in one place. With the additional capability of making all the enclosed functions available through a web service - simply by changing one attribute - access="remote" - and you have a web service that can be consumed by anyone.

Thanks for the feedback - please keep the questions, comments, and suggestions coming. Everything helps.

Link to comment
Share on other sites

I will surly look at that page alittle now and then when you got the tut's done Skemcin :)

Link to comment
Share on other sites

@SkemcinA note for the site itself: Don't be afraid to make links. Instead of " My personal choice is CrystalTech Web Hosting (http://www.crystaltech.com)" write " My personal choice is CrystalTech Web Hosting" for example.One more thing... remember to tell the difference between the ColdFusion Developer Edition and the Enterprise Edition in the introduction. It's hard for a person to believe that ColdFusion is free if he/she sees a price tag on the site. Explaing that Developer is free and enough for working and Enterprise is for servers is sure to clear all (ok... most) confusions.

Link to comment
Share on other sites

Good point about the servers, duely noted. - I haven't even linked navigation yet, but I will appropriately put as many inline links as possible. I'll be linking directly to the Cold Fusion Hosting Packages:http://www.crystaltech.com/cfmx_sharedhosting.htmBut I am currently speaking with CT to figure out a good way to give reseller credit on referring links - so there might be some other method used when all is said and done.Keep them coming and thanks.

Link to comment
Share on other sites

A question about the ColdFusion Developer Edition and the Enterprise Edition. Is it so that the Developer Edition is free, and is good for making a personal website? Or is it even just for developing and viewing results locally on your computer? If I wanted a personal website with ColdFusion stuff (serverside flash for instance, such as flash forms), would I still have to go for the Enterprise Edition?

Link to comment
Share on other sites

The developer edition is almost fully functional but only serves pages to ONE IP address. But let me back up a second. Out of the box (or from the download) the CF Server Installation is actually the fully functional Enterprise Edition. With all the bells and whistles - cross server session reduntacny, sand box settings, all that. Of course the catch is that only last for 30 days. Then, the server resorts to a single IP server. This means that you can set it up on your local desktop and create a fully functional cold fusion web site - cf flash forms and all - to your hearts content - but only your PC will be able to see the site - http://localhost/yourCFsite. All other IP addresses trying to access the site will be given a message saying that the server is not configured to deliver pages to this (clients) IP address.So. The way I tend to set things up is as follows:

  • Original Site on Development server on my local pc
  • Copy of site on Testing Server which is on the live server but in specific folder with all the mappings set to go there
  • Copy of site on Production Server which is (of course) the live server but in specific folder with all the mappings set to go there
  • Databases in all three places, test, development, and production respectively mapped to and programmed for.

I develop on my local PC, test it internally first. Promote the files to the TEST environment where my client reviews/tests the application. When all is signed off on - I move the files to the production folder.

Link to comment
Share on other sites

The developer edition is almost fully functional but only serves pages to ONE IP address. But let me back up a second. Out of the box (or from the download) the CF Server Installation is actually the fully functional Enterprise Edition. With all the bells and whistles - cross server session reduntacny, sand box settings, all that. Of course the catch is that only last for 30 days. Then, the server resorts to a single IP server. This means that you can set it up on your local desktop and create a fully functional cold fusion web site - cf flash forms and all - to your hearts content - but only your PC will be able to see the site - http://localhost/yourCFsite.  All other IP addresses trying to access the site will be given a message saying that the server is not configured to deliver pages to this (clients) IP address.

D'oh! :)
Link to comment
Share on other sites

But understand - this is only bad for the following two sceanrios:a.) you are planning on hosting your own cold fusion site opn your own PC to the general publicb.) you have multiple workstations setup that are working on the same project. and if you are, then you would also need something like Visual Source Safe to keep each other from overwriting each - and if your in that situation, then you can afford the license. On top of that, you could, theoritically, set up the redundant server installation within the first 30 days so that when they revert to single licenses you could point one workstation to its own server and if they had been setup properly, they would all server pages as one.Its really not THAT bad of a deal.:)

Link to comment
Share on other sites

Assuming that your server already has ColdFusion installed on it, is there a way to check all the info about the installation.With PHP it's <?php phpinfo(); ?>What would it be for ColdFusion (assuming you can check all the info)

Link to comment
Share on other sites

You would log into the Cold Fusion Administrator.http://localhost/cfide/administrator/Then you click on SYSTEM INFORMATION and you'll see everything, like this:

System InformationServer DetailsServer Product  ColdFusion MXVersion  7,0,1,116466  Edition  Standard  Serial Number  xxxxxx-xxxxxx-xxxxxx-xxxxxx  Operating System  Windows 2003  OS Version  5.2  JVM DetailsJava Version  1.4.2_05  Java Vendor  Sun Microsystems Inc.  Java Vendor URL  [url="http://java.sun.com/"]http://java.sun.com/[/url]Java Home  f:\CFusionMX7\runtime\jre  Java File Encoding  Cp1252  Java Default Locale  en_US  File Separator  \  Path Separator;  Line Separator  Chr(13)User Name  SYSTEM  User Home  C:\Documents and Settings\Default User  User Dir  f:\CFusionMX7\runtime\bin  Java VM Specification Version  1.0  Java VM Specification Vendor  Sun Microsystems Inc.  Java VM Specification Name  Java Virtual Machine Specification  Java VM Version  1.4.2_05-b04  Java VM Vendor  Sun Microsystems Inc.  Java VM Name  Java HotSpot(tm) Server VM  Java Specification Version  1.4  Java Specification Vendor  Sun Microsystems Inc.  Java Specification Name  Java Platform API Specification  Java Class Version  48.0  Java Class Path  CF Classpath;f:/CFusionMX7/runtime/../lib/ant-launcher.jar;  f:/CFusionMX7/runtime/../lib/ant.jar;  f:/CFusionMX7/runtime/../lib/axis.jar;  f:/CFusionMX7/runtime/../lib/bcel.jar;  f:/CFusionMX7/runtime/../lib/cdo.jar;  f:/CFusionMX7/runtime/../lib/cdohost.jar;  f:/CFusionMX7/runtime/../lib/cf4was.jar;  f:/CFusionMX7/runtime/../lib/cf4was_ae.jar;  f:/CFusionMX7/runtime/../lib/cfmx-ssl.jar;  f:/CFusionMX7/runtime/../lib/cfusion.jar;  f:/CFusionMX7/runtime/../lib/commons-beanutils-1.5.jar;  f:/CFusionMX7/runtime/../lib/commons-collections-2.1.jar;  f:/CFusionMX7/runtime/../lib/commons-digester-1.3.jar;  f:/CFusionMX7/runtime/../lib/commons-discovery-0.2.jar;  f:/CFusionMX7/runtime/../lib/commons-discovery.jar;  f:/CFusionMX7/runtime/../lib/commons-logging-1.0.2.jar;  f:/CFusionMX7/runtime/../lib/commons-logging-api-1.0.2.jar;  f:/CFusionMX7/runtime/../lib/commons-net-1.2.2.jar;  f:/CFusionMX7/runtime/../lib/crystal.jar;  f:/CFusionMX7/runtime/../lib/flashgateway.jar;  f:/CFusionMX7/runtime/../lib/httpclient.jar;  f:/CFusionMX7/runtime/../lib/ib61patch.jar;  f:/CFusionMX7/runtime/../lib/ib6addonpatch.jar;  f:/CFusionMX7/runtime/../lib/ib6core.jar;  f:/CFusionMX7/runtime/../lib/ib6swing.jar;  f:/CFusionMX7/runtime/../lib/ib6util.jar;  f:/CFusionMX7/runtime/../lib/im.jar;  f:/CFusionMX7/runtime/../lib/iText.jar;  f:/CFusionMX7/runtime/../lib/iTextAsian.jar;  f:/CFusionMX7/runtime/../lib/izmado.jar;  f:/CFusionMX7/runtime/../lib/jakarta-oro-2.0.6.jar;  f:/CFusionMX7/runtime/../lib/java2wsdl.jar;  f:/CFusionMX7/runtime/../lib/jaxrpc.jar;  f:/CFusionMX7/runtime/../lib/jdom.jar;  f:/CFusionMX7/runtime/../lib/jeb.jar;  f:/CFusionMX7/runtime/../lib/jintegra.jar;  f:/CFusionMX7/runtime/../lib/ldap.jar;  f:/CFusionMX7/runtime/../lib/ldapbp.jar;  f:/CFusionMX7/runtime/../lib/log4j.jar;  f:/CFusionMX7/runtime/../lib/macromedia_drivers.jar;  f:/CFusionMX7/runtime/../lib/mail.jar;  f:/CFusionMX7/runtime/../lib/msapps.jar;  f:/CFusionMX7/runtime/../lib/pbclient42RE.jar;  f:/CFusionMX7/runtime/../lib/pbembedded42RE.jar;  f:/CFusionMX7/runtime/../lib/pbserver42RE.jar;  f:/CFusionMX7/runtime/../lib/pbtools42RE.jar;  f:/CFusionMX7/runtime/../lib/poi-2.5.1-final-20040804.jar;  f:/CFusionMX7/runtime/../lib/poi-contrib-2.5.1-final-20040804.jar;  f:/CFusionMX7/runtime/../lib/ri_generic.jar;  f:/CFusionMX7/runtime/../lib/saaj.jar;  f:/CFusionMX7/runtime/../lib/smack.jar;  f:/CFusionMX7/runtime/../lib/smpp.jar;  f:/CFusionMX7/runtime/../lib/STComm.jar;  f:/CFusionMX7/runtime/../lib/tools.jar;  f:/CFusionMX7/runtime/../lib/tt-bytecode.jar;  f:/CFusionMX7/runtime/../lib/vadmin.jar;  f:/CFusionMX7/runtime/../lib/verity.jar;  f:/CFusionMX7/runtime/../lib/vparametric.jar;  f:/CFusionMX7/runtime/../lib/vsearch.jar;  f:/CFusionMX7/runtime/../lib/wc50.jar;  f:/CFusionMX7/runtime/../lib/webchartsJava2D.jar;  f:/CFusionMX7/runtime/../lib/wsdl2java.jar;  f:/CFusionMX7/runtime/../lib/wsdl4j-1.5.1.jar;  f:/CFusionMX7/runtime/../lib/wsdl4j.jar;  f:/CFusionMX7/runtime/../lib/xalan.jar;  f:/CFusionMX7/runtime/../lib/xercesImpl.jar;  f:/CFusionMX7/runtime/../lib/xml-apis.jar;  f:/CFusionMX7/runtime/../lib/;  f:/CFusionMX7/runtime/../gateway/lib/examples.jar;  f:/CFusionMX7/runtime/../gateway/lib/;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-awt-util.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-css.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-ext.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-transcoder.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-util.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/commons-discovery.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/commons-logging.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/concurrent.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/flex.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jakarta-oro-2.0.7.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jcert.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jnet.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jsse.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/oscache.jar;  f:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/;  Server Classpathf:\CFusionMX7\runtime\servers\lib;f:\CFusionMX7\runtime\servers\lib\jrun-patch.jar;f:\CFusionMX7\runtime\..\lib\macromedia_drivers.jar;f:\CFusionMX7\runtime\lib\cfmx_mbean.jar;f:\CFusionMX7\runtime\lib;f:\CFusionMX7\runtime\lib\cfmx_mbean.jar;f:\CFusionMX7\runtime\lib\instutil.jar;f:\CFusionMX7\runtime\lib\java2wsdl.jar;f:\CFusionMX7\runtime\lib\jrun-ant-tasks.jar;f:\CFusionMX7\runtime\lib\jrun-xdoclet.jar;f:\CFusionMX7\runtime\lib\jrun.jar;f:\CFusionMX7\runtime\lib\jspc.jar;f:\CFusionMX7\runtime\lib\migrate.jar;f:\CFusionMX7\runtime\lib\oem-xdoclet.jar;f:\CFusionMX7\runtime\lib\sniffer.jar;f:\CFusionMX7\runtime\lib\webservices.jar;f:\CFusionMX7\runtime\lib\wsconfig.jar;f:\CFusionMX7\runtime\lib\wsdl2java.jar;f:\CFusionMX7\runtime\lib\xmlscript.jar;f:\CFusionMX7\runtime\lib\jrun.jarJava Ext Dirs  f:\CFusionMX7\runtime\jre\lib\ext  

If you want any of this information, plus more, then you can dump any of the scopes in which information is stored:<cfdump var="#server#"><cfdump var="#application#"><cfdump var="#cgi#"><cfdump var="#session#"><cfdump var="#cookie#">...

Link to comment
Share on other sites

Oh I see, ok.One more question just out of curiosity. If you wanted to use the installation to allow multiple IPs access to it forever, you have to buy it from Macromedia?It's not really free like PHP in the long run?So the likelyhood of my host ever getting ColdFusion installed is slim since they'd have to buy it, rather than it being free like PHP?

Link to comment
Share on other sites

Buy from Macromdia?Correct. If you want the enterprise edition of Cold Fusion (serving multiple IPs), you have to buy it through Adobe (formerly Macromedia) or through one of their distribution partners - prices range from $1,300 to $6,000 depending on which type of server license you buy.You can see the differences between the two here:http://www.macromedia.com/software/coldfus...oduct_editions/If a host doesn't support cold fusion, it is a pretty safe assumption that it won;t in the future unless they expand their internal knowledge base ot include staff that have experience administering a Cold Fusion server environment.Host ImplementationIf a host doesn;t offer it, it is safe to assume that it will not in the near future. This, alone, of course should not be discouraging to anyone interested in trying it out. Since development and testing it is still something that can be done locally, there would be no need to have your existing hosting service offer Cold Fusion unless you intend to convert your site to Cold Fusion.Every Cold Fusion host I have come across offers ASP and PHP along with and/or along side Cold Fusion - so there is always the option/choice to switch providers to one that does support any or all three languages - like Crystal Tech does.As far as hosting environments, the only effect Cold Fusion has on any hosting provider aside from the additional technical support knowledge any additional language would require, is the fact that the licensing fees the provider must pay only makes it unprofitable for them to offer an cheap low ball package. Where asp and php might have a level 1, 2, 3 hosting package, the same provider might only offer a level 2, and level 3 package for cold fusion.Correction Upon further review, I have found out that the newest version of Cold Fusion Developer server that I had mentioned are only accessable to the localhost is actually also available to two additional IP addresses.Note If you really wanted to do something on your own, you could get away with the standard (cheaper) version of Cold Fusion. The enterprise edition is a much more heaftier applicaition intended for the larger server environments.

Link to comment
Share on other sites

Let's clear something up(I noticed it after looking into the ColdFusion manual in Dreamwaver): Are you going to include a basic explanation about CF tags and functions in the syntax section or you are going to make separate sections explaining each one's syntax?

Link to comment
Share on other sites

My plan was to give a general overview of the basic syntax Cold Fusion uses.

  • tag based commands :: <cfset xxx="xxxxxx">
  • calling a variable :: #variablename#
  • calling built in functions :: #dateformat(now(),"mm/dd/yy")#

Just explaining the general way to visualize how a page is composed so that when the person goes through the other sections they are not lost completely.I'm loosely basing this off of the PHP tutorial offered here on w3schools.comhttp://www.w3schools.com/php/I'll have a Reference section at the very end that will link to the Cold Fusion Live Documents that have examples and definitions of all the tags, functions, and attributes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...