StarWars comes to the TomTom

Jibber Jabber 1 Comment »

After discovering my iPhone has no SatNav software, I was just looking on the tomTom web site and came across this. http://starwars.tomtom.com/voices/index-starwars.php?Lid=1

You can now have your directions read toyou in the voices of Darth Vader, C3PO or Yoda, very cool I do have to say, and I bet if Ray Camden doesn't already have a TomTom he will own one very soon :-)

By the way be sure to watch the Darth Vader video, quite entertaining.

cfmldeveloper upgraded to CF9

ColdFusion No Comments »

Last night I just completed upgrading cfmldeveloper.com to ColdFusion 9. For those that do not know cfmldeveloper.com is the FREE ColdFusion hosting service that I run for developer. Recently rebranded from cfdeveloper.co.uk.

 

What's new in ColdFusion 9

 

ColdFusion 9's list of new features is quite long, so I'll just mention a few items that I find most interesting. For a complete list of new features, go to Adobe's site.

 

One huge addition in ColdFusion 9 is the incorporation of the Java Hibernate object-relational mapping (ORM) library. ColdFusion abstracts much of the complexity of Hibernate away and offers a simple API to allow the loading and saving of CFCs to a relational database. This makes object-oriented development even easier, as you can build an object model without thinking about the database at all, and let Hibernate translate that model into a schema automatically. By providing nested transactions and hooks into the Hibernate event model, you can build robust domain models very quickly.

The next feature is sure to be a  favourite of anyone who has spent many hours building "export to Excel" logic in applications. Sometimes it is the simple approach of creating an HTML table and letting Excel convert it; other times, it is the much more tedious option of using Apache POI to build up worksheets and formulas. ColdFusion 9 includes the new cfspreadsheet tag, which finally puts an end to this chore. Along with the tag is a large set of functions to allow virtually any manipulation of a spreadsheet. These functions can be saved in Excel or OpenOffice format as well.

 

There are a lot of new goodies I could talk about, but here is a quick list:

 

|> Server API for SOAP and AMF (allowing remote use of core features such as charting, PDF creation, and email from Flex or other external systems)
|> Huge set of Microsoft SharePoint integration functions to leverage an existing SharePoint deployment
|> Seamless support for the Java portlet specifications, making integration with things like Liferay a breeze
|> Addition of Apache Solr to supply search services (a worthy replacement over Verity)
|> Addition of Ehcache to supply page and page-fragment caching, along with cache statistics and other cache manipulation functions
|> Big performance improvements over ColdFusion 8 and ColdFusion 7.

 

ColdFusion Builder

 

The next item isn't actually a feature of ColdFusion 9, but it's worth pointing out. Adobe has built a dedicated IDE for ColdFusion development called ColdFusion Builder. Back when ColdFusion was run by Allaire, there was a tool called CF Studio or Homesite. When Macromedia acquired Allaire, it dropped Studio development in favour of its Dreamweaver tool. Since then, many people have used Dreamweaver or migrated to the CFEclipse plug-in for the Eclipse IDE. Thankfully, Adobe has now released ColdFusion Builder, which is built on the Eclipse platform and offers tight integration with their Flash Builder tool for building Flash and Flex applications.

ColdFusion Builder offers a useful and predictable set of tools, which include code completion, server management, debugging, templates, snippets, etc. And since it is built on Eclipse, the world of Eclipse plug-ins is open; it includes things such as Git or Subversion integration, Mylyn, ANT, Maven, etc. ColdFusion developers have been vocal about wanting a real IDE from Adobe, so it is nice to see that Adobe is listening.

 

ColdFusion 9 Tutorials and Resources

 

Create Edit & Share Your Sitemaps Online

Product Reviews No Comments »

WriteMaps

Just found this rather handy tool I thought I would share.
WriteMaps is a free web-based tool that allows you to create, edit, and share sitemaps online. As a WriteMaps user, you and your team will be able to build and access your sitemaps from anywhere, without having to rely on proprietary desktop apps and static files. To get started, take the tour or sign-up for an account!

It is incredibly simple to use, just click the + to add nodes wherever you live and has a drag and drop interface to allow you to move nodes around. Certain a very quick and easy way to make a nice looking sitemap for your website.

MangoBlog: Adding a custom page title

ColdFusion 3 Comments »

l have recently decided to try out MangBlog for the new cfmldeveloper.com site and I have to say I really like it much better than BlogCFC (sorry Ray).

 

Because MangoBlog allows you to add custom pages you can pretty much use it to create your entire web site with a basic CMS as long you don't need to do anything complex on your pages, at which point you may find the tinyMCE editor too restrictive.

 

When you add a custom page to MangoBlog the "title" is used not only on the page but also on the navigation menu, which I didn't find too useful as I did not want the menu text and page title to be the same. So I was instantly thrown in at the deep end with a requirement to customise MangoBlog, which thankfully turned out to be very easy as it is very well written and easy to understand.


MangoBlog is written in classic CFML style using imported tag libraries and <mango: mytag attributes> syntax as apposed to using the OO style frameworks that are popular these days.

 

Adding a custom page title is a snip.

 

When adding a new page, simply add a new custom field like this

 

label:    page title
key:      pagetitle
Value:   My Page Title

 

Now edit the page.cfm file in your skin folder and edit the code that displays the <mango:Blog title />, it will look something like this depending on your skin.

 

<h1 id="banner-header"><a href="<mango:Blog url />" accesskey="1"><mango:Blog title /></a></h1>

 

and change it to this

   <mango:PageProperty ifHasCustomField="pageTitle" customField="pageTitle" />
<mango:PageProperty ifNOTHasCustomField="pageTitle"><mango:PageProperty title />
</mango:PageProperty>

 

This checks for the existance of the "pageTitle" custom field on each page, it is exists then it will display that value, otherwise it will display the title.

You can use the same method to insert any custom field values on any page.

Fix the DNS caching in ColdFusion

ColdFusion 2 Comments »

It has been a well known fact for many years (to some of us at least) that ColdFusion (or rather the JRE) caches DNS look-ups forever until the service is next restarted.

The caveat of this is that if any domain name you are connecting to from CFML has had a DNS change such as a change of IP address then code will suddenly stop working until you next restart CF.

 

Areas that will affect include:-

  • SMTP servers in the CFADMIN
  • Database Servers in your Datasources
  • CFHTTP calls
  • Web Services
  • CFFTP, CFPOP, CFEXCHANGEMAIL, CFIMAP, CFMAIL

 

Plus any other tag, CFX tag, java class that allows you to connect to a remote server.

 

This has never really caused us any major issues, occasionally we had had a customer complain that CFHTTP calls have mysteriously stopped working, or that they could no longer connect to their payment gateway after the provider made some updates, but it has been so rare that restarting CF was an acceptable solution.

 

Recently we got a notice from our payment gateway provider (SagePay formerly ProtX) telling us that their IP addresses would change. Knowing this would affect CF and that we have several customers who also used SagePay I knew we would have to restart CF on every server to make sure their ecommerce stores did not break.

This prompted me to look into this problem, find out why the JRE cached DNS look-ups and see if I could change it.

 

After some investigation I learned that the class used to lookup host names for HTTP operation is the Java InetAddress class

If You read the above page you can see that the result of positive host name resolutions is cached forever, it also advises how to override the default behaviour with the following property.

 

networkaddress.cache.ttl
Indicates the caching policy for successful name lookups from the name service. The value is specified as as integer to indicate the number of seconds to cache the successful lookup. The default setting is to cache for an implementation specific period of time. 

 

In a standard ColdFusion installation you would find this in the following file:-

 

C:\ColdFusion8\runtime\jre\lib\security\java.security

 

If you are using a custom JRE in a J2EE type installation then the path may be something like:-

 

C:\Program Files\Java\jdk1.6.0_12\jre\lib\security\java.security

 

In a CF multi-server installation:-

 

C:\JRun4\jre\lib\security\java.security

 

Find the following line

 

#networkaddress.cache.ttl=-1 

and change it to

 

networkaddress.cache.ttl=14400

 

This sets the TTL to 14400 seconds (4 hours).

 

Now you will note that there are various warnings about DNS cache poisoning and the security manager which may scare you. So also note that InetAddress by default resolves against localhost, so if there was a cache poisoning problem then the problem is with your local machine or DNS server thus any application that resolves DNS lookup-up against localhost will be affected, which includes ASP, PHP, local services etc, so ColdFusion/Java is really not where you area of concern should be when it comes to DNS, but rather that your local machine is secure and that your DNS server is protected against cache  poisoning. Plus the problem would still exist when you restart CF anyway, and this is probably a fairly common occurrence  for most people, so I personally would not worry about it and I think this is a pretty daft and pointless reason for this default setting. Some may disagree, but hey that's their prerogative.

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds