|
Coldfusion 9 to integrate with Microsoft office, Open Office and SharePoint |
Adobe keeps 'leaking' sneaky bits of information about the next platform release for Coldfusion Server, Version 9.
The latest release info is that it will be out of the box compatible with both Microsoft Office, and Open Office. This means that you will be able to read, write and create office documents from a coldfusion application.
Hand in hand with this is the new ability to talk directly to office documents is a new API for interfacing directly into SharePoint server, and update data directly. This is an interesting development for the ColdFusion community, as there really isn't any bespoke .Net functionality left that CF can't handle after this.
|
Upgrading Blog CFC from 5.8.001 to 5.9.3.006 |
I've been having the odd database login problem, and RSS feed issue when this site gets spidered by search bots. I can't really give my web host much grief about it as I don't know if either of these issues have been fixed in newer releases of Blog CFC.
So last night I set about upgrading to the newest release. Now like most developers I rarely find that an application does exactly what I want out of the box, so I had modified several small areas of the installation to suit my needs. This left me with the dilemma of not being able to just copy the new code over the top.
There is a tool I have used in the past called Beyond Compare from Scooter software http://www.scootersoftware.com/. It is a file and folder comparison tool that allows you to enter individual files and resolve potential conflicts at line level if need be.
After an hour or so of running through the newest release of Blog CFC, which you can get here, http://blogcfc.riaforge.org/ I had merged in all the new change sets into my base code, and run the database scripts and bingo! I was up-to-date. Far more easily done than I would have thought.
My only gripe is that he wrote SQL change scripts for mySQL rather than MSSQL, but then that's just personal preference.
It would be nice to have an entirely separate skinning module, that way you could just replace code bases, but if you are running your Blog then chances are you can deal with that.
|
Cfscript looping over lists |
I really like cfscript, but as with any skill I don't use it often in my current role (its not 'standard') so I find that my knowledge of it is on the wane.
I do develop extensively outside of a working environment, so I find myself deliberately writing cfscript code rather than 'normal' coldfusion. I think it is because it is more like javascript, actionScript or .Net, I like the script formatting.
So I find myself looping over a series of lists in a form action template, I thought I would experiment with the different ways of doing the loop, cfscript and non script. So I create a simple list.
Now loop over it in the traditional way.
2 <cfloop from="1" to="#listLen(variables.myList)#" index="L">
3 #ListGetAt(variables.myList, L)#<br/>
4 </cfloop>
5</cfoutput>
And now the cfscript way.
2 For (i=1;i LTE ListLen(variables.myList); i=i+1)
3 writeoutput(ListGetAt(variables.myList, i)&'<BR>');
4</cfscript>
Both code blocks give the same output, I much prefer the code style of the second block though.
|
Basic fusebox fuseaction to handle security references |
I am a big fan of fusebox, I like the way it handles inheritance, and I love the fact that it instinctively lends itself to a modular approach.
Part of the strength in using fusebox is in knowing exactly when each of the framework fuse actions run, and just what sort of functionality you can embed in them. In this case I'm using the "Pre fuse Action" to perform a basic security validation on any fuseactions in that circuit.
2 <cfargument name="myFusebox" />
3 <cfargument name="event" />
4
5
6 </cffunction>
Above is a blank prefuseaction, insert any code you want to perform on any of the other fuseactions in that circuit here. Note that it runs before the circuit action.
A basic session validation script could be something like:
2 <cfif NOT isdefined('session.loggedIn')>
3 <cfset session.logoutMsg = "Your session has timed out, please login again">
4 <cflocation url="index.cfm">
5
6 <cfif NOT isdefined('session.superadmin')>
7 <cfset session.logoutMsg = "You do not have sufficient rights to view Super admin functions">
8 <cflocation url="index.cfm">
9 </cfif>
10
11 </cfif>
In the code above I am checking for a valid session variables, and if it is not there sets an error message and redirects to the homepage.
This is a pretty basic "catch all - are you logged in?" type query, but if you have an administration circuit then it provides good basic fuseaction protection. I've extended it out one step further by creating a cfc call to this code which just returns true/false. Something like this:
I am currently extending this further with more robust security, and user roles and groups.