Jun 24 2009

Flush ColdFusion trusted cache from Farcry Webtop

On my Farcry production server I have enabled Trusted Cache to improve ColdFusion performance. But every time I deployed changes to my Farcry site, I would forget to flush the cache and would take my a moment ot two to realise why my changes have not taken affect.

So I have created an extension to the Farcry Admin Reload application so you flash the ColdFusion cache from the the WebTop.

You can see the code for Flush ColdFusion trusted cache from Farcry Webtop on FarcryCMS Docs.

Posted by AJ Mercer at 1:21 pm - Categories: ColdFusion | Farcry

May 27 2009

Setting up Google Mail in Railo

Another one for my notes that may help others. Here are the settings to uses Google mail Server for send emails from Railo.

SMTP: smtp.gmail.com
Username: email@gmail.com
Password: *********
Port: 587
TLS: checked
SSL: not checked

Posted by AJ Mercer at 7:45 pm - Categories: Railo

May 27 2009

Railo Express with Virtual Hosts

I wanted to play around with Railo's Extentions without too much messing around. So I thought I would use Railo Express, but I wanted a web site per application, so they could run from the web root. After a bit of Googling (with google cache to the rescure for www.railo-technologies.com/en/index.cfm?treeID=211) I found out how to get this working. This blog is mostly for my personal records, but if it helps others that is great too.

In /contexts directory you will see railo.xml. Make a copy of this file, eg railo-mangoblog.xml, and then edit it.
Find the following
    <Set name="resourceBase">
        <SystemProperty name="jetty.home" default="."/>/webroot/
    </Set>
and change webroot to a new name, eg webroot-mangoblog

In the same file, uncomment the virtual hosts section and add you domain. eg
  <Set name="virtualHosts">
    <Array type="String">
      <Item>mangoblog.railo.org</Item>
    </Array>
  </Set>

Save this file.

Next create the directory you just defined in the same directory as webroot.

(Re)Start Railo using the BAT file(s). You should see a WEB-INF directory being created for you. You can now administor you site for that domain, eg http://mangoblog.railo.org/railo-context/admin/index.cfm

Posted by AJ Mercer at 7:19 pm - Categories: Railo

May 14 2009

Population PDF Forms with ColdFusion 8

Now that Adobe owns ColdFusion, a lot of PDF functionality has been added to CF8. Amongst that is the ability to populate PDF Forms. This means you can pre-populate forms for clients / members - how many times have you had to fill out a form and think to yourself, 'they already know this stuff!!'

The client / member can then update any info if required. With the proper licencing, you can save the data in the PDF, or have the PDF submit the data back to the web server.

Recently I was given the job of reproducing Contract Notes for clients. The origion is produced by printing the data onto stationary; but as the client wont have the sationary, this is not going to work. No drama for me, I am a CF developer :-)

The first think I did was to open up the PDF in Adobe Acrobat and add fields to the document to create the PDF form. This document is not to be alter by the client so licencing was not an issue. In fact, I get ColdFusion to flatten the file after it is populated so the client can not modify that data and then print it.

In previous of CF, you would hvae to use CFPDF to read the document, then other CF tags to get the fields and poplaute and bluh bluh bluh - doesn't matter any more cos CF8 simplifies all that with a new tag - CFPDFFORM and it's buddy CFPDFFORMPARAM

<cfpdfform source="#pdfPath##pdfDoc#"
                 destination="#pdfPath##pdfTemp#"
                 action="populate"
                 overwrite="yes" >
    <cfpdfformparam name="Branch" value="#qryCnote.BranchName#" />
    <cfpdfformparam name="Advisor" value="#qryCnote.AdvisorName#" />
</cfpdfform>

Just add a CFPDFFORMPARAM for each form field and give it a value <hand in the air and shout> 'Clear!'

And to get rid of the form fields, just use the flatten attributes.

<cfpdf action="write"
           source="#pdfPath##pdfTemp#"
           destination="#pdfPath##pdfTemp#"
           flatten="yes"
           overwrite="yes" />

And finally, push it back to the browser

<cfheader NAME='Content-Disposition'
               VALUE='attachment;filename=#saveAsName#' />
<cfheader name="cache-control" value="" />
<cfheader name="pragma" value="" />

<cftry>
    <cfcontent type="application/pdf"
                    file="#pdfPath##pdfTemp#"
                    deletefile="yes"

                    reset="yes" />
    <cfcatch>
    <!--- prevent unnecessary log entries when user
           cancels download whilst it is in progress
    --->
    </cfcatch>
</cftry>

Posted by AJ Mercer at 3:48 pm - Categories: CFML | ColdFusion

Apr 8 2009

Cubs in Derby

In six hours I will be getting up and heading to the airport for a week long Cub camp to Derby, Fitzroy Crossing and Broome. Hampton Park are joining forces with Gin Gin to meet the Cubs in those towns - 60 Cubs all up.

I will be uploading some pix to Twitter along the way as a bit of a journal.

Posted by AJ Mercer at 9:00 pm - Categories: Scouts

Apr 1 2009

Railo 3.1 Open Source is here

The beta of Railo 3.1, the Open Source version, was released to day. I will update this blog entry once I have had a little play with this much anticipated release. One of the first things I will be checking out is the Extention Manager - download and install application from the Railo Administrator. Gert has been letting a few sneak peeks slip out that makes me think I will not be getting much sleep tonight (2am release in Perth).

Railo 3.1 LogoAlong with the engine, new web sites too.

If you want to know more about Railo, and will be in Sydney in May (21-22), make sure you see Gert Franz at webDU 2009.

I am offcially a Railo Fan - it says so right on their site ;-)

Posted by AJ Mercer at 2:00 am - Categories: CFML | ColdFusion | Railo

Mar 9 2009

webDU 2009

I want to go to webDU too

I am all booked in for another trip to Sydney, this time the familiy is coming as well. Fly in Wednesday lunch, check in, then on the ferry to Manly. If there is time will try and swing by Bondi too. We are planning on going to the Aqaurium one night.

Then two days for ColdFusion and web goodness for me while the family hits the Sydney town. Looking foward to catching up with CF buddies and finally get to meet Gert Franz.

After that it is off to the Blue Mountains for the weekend. Then one more look around Sydney before flying home Monday afternoon.

Posted by AJ Mercer at 2:37 pm - Categories: CFML | ColdFusion | Family Life | Railo