Microsoft SQL Script to update BlogCFC 5.92

I just upgraded tonight to the latest release of BlogCFC, (what runs this blog) and realized that there is not an upgrade script for mssql. I edited the one provided for mysql and here it is:

ALTER TABLE tblblogcomments ADD killcomment varchar(35) NULL ALTER TABLE tblblogcomments ADD subscribeonly int NULL

ALTER TABLE tblblogentries ADD summary varchar(255) NULL

ALTER TABLE tblblogentries ADD subtitle varchar(100) NULL

ALTER TABLE tblblogentries ADD keywords varchar(100) NULL

ALTER TABLE tblblogentries ADD duration varchar(10) NULL

VMware and Linux

I have been a functional Windows bigot for most of my programming life. No more.

I had a server crash that happened to host the Resonant Media Technologies website. I took the time this time to really set it up right. I installed CentOS 5.2 and VMware 2, I will blog more, but the experience was incredible.

Simple SES

As I was deploying the latest version of the Resonant Media site (www.resonantmedia.com). It was important to do as much as possible to make it search engine friendly. I opted to use a custom 404 page that processes the the URL via simple CFC that I built.

I will be posting more about the way it works in a future post.

ModelGlue Version 3 - IN THE WORKS

I noticed Joe's IM display name today, "MG3: Game On!" and asked him what was up. Here are the details he would reveal.

- 90% New Code.
- Backward Compatible (As much as possible.)
- Less Complicated (Some of the xml files may go away).

I don't know about everybody else, but I am pumped. ModelGlue is without a doubt the best framework regardless of language.

Go Joe Go!!

Migrating to ColdFusion 8

Well, I have started migrating some of my apps to CF8 and am VERY impressed. There has not been any major hickups. Actually, I have had no problems.

I am very happy that it appears that we have a very solid and feature rich new version of CF to enjoy.

Dynamic FCKEditor Style Configuration

So, I have a CMS that now has multiple sites that it is managing. When there was only one site, FCKEditor could be set up statically now I need to dynamically assign a EditorAreaCSS and StylesXmlPath. The EditorAreaCSS is simple I just pass the correct css file into the config like this:


fckEditor.Config['EditorAreaCSS'] = '../styles/style.css';

The next step was a dynamic xml file for fckstyles.xml. What I wanted to do is to parse the css file for each site and dynamically display these styles in the drop down. So here is what I came up with:


<!---- fckstyles.xml.cfm --->
<cfsetting enablecfoutputonly=true>
<cfsetting showdebugoutput=false>
<cfsilent>
<cffile action="read" file="#ExpandPath('../Path/To/File/css/display.css')#" variable="css" />
<cfoutput>
<cfset variables.count= 0 />
<cfset variables.styleList = "" />
<cfloop list="#css#" delimiters="{" index="i">
<cfset variables.count = variables.count + 1 />
    <cfif variables.count eq 1>
        <cfset variables.styleList = i />
    <cfelse>
        <cftry>
        <cfset variables.thisClass = ListGetAt(ListGetAt(i,2,'}'),2,'.') />
            <cfif FindNoCase(':',variables.thisClass)>
                <cfset variables.thisClass = ListGetAt(variables.thisClass,1,':') />
                <cfif FindNoCase(' ',variables.thisClass)>
                    <cfset variables.thisClass = ListGetAt(variables.thisClass,1,' ') />
                </cfif>
            <cfelse>
                <cfif FindNoCase(' ',variables.thisClass)>
                    <cfset variables.thisClass = ListGetAt(variables.thisClass,1,' ') />
                </cfif>    
            </cfif>
        <cfif not ListFind(variables.styleList,variables.thisClass)>
            <cfset variables.styleList = trim(variables.styleList) & ',' & trim(variables.thisClass) />
        </cfif>
            <cfcatch type="any">
                <!-- fail silently --->
            </cfcatch>
        </cftry>
    </cfif>
</cfloop>
<cfset variables.ignoreList = "body" />
<cfsavecontent variable="FCKStyles"><?xml version="1.0" encoding="utf-8" ?>
<Styles>
    <cfloop list="#variables.styleList#" index="thisClass">
    <cfif not ListFindNoCase(variables.ignoreList,thisClass)>
    <Style name="#thisClass#" element="div">
        <Attribute name="class" value="#thisClass#" />
    </Style>
    </cfif>
    </cfloop>
</Styles>
</cfsavecontent>
</cfoutput>
</cfsilent>
<cfcontent type="text/xml" reset="true"><cfoutput>#FCKStyles#</cfoutput>

One of the keys is to rename the file with a .cfm extensions. This allows ColdFusion to process it. Once the file in generating correctly, you simply pass in that path.


fckEditor.Config['StylesXmlPath'] = '#basePath#fckstyles.xml.cfm';

I hope this helps.

ColdFusion and XML - An Important Reminder

I have been working on several examples of using ColdFusion with AJAX. Twice already I have received strange errors about the XML being malformed after I had it working just fine. Both times after debugging I realized that the error was related to the ColdFusion debugging info that was outputting at the bottom of the screen. ARGH!!

Now I am doing two simple things that make life much easier.

1. Explicitly disabling debugging on that page.

<cfsetting showdebugoutput="false" />

2. Simply use the docked version of the CF debugger.

Envoy for ColdFusion 1.0

After looking at some already available CFCs that Sean told me about, I decided to customize something I already had. Take a look:

http://www.resonantmedia.com/downloads/public/envoy/envoy.zip

Basically I had a factory pattern based service message cfc (or set of CFCs) that handled the messages for one of my applications. It worked very well. I had the "dictionary" stored in different "handler" cfcs. After seeing the dictionary xml docs that Joe and Doug use I decided to use that instead.

The reason I created "Envoy" (that is what I am calling it for lack of a better name) is because both Reactor and MG have error messaging dictionaries, but I wanted something to manage all messages regardless of type and regardless of framework. IT also supports multiple languages (i.e Spanish and English). If no language is passed in English is assumed.

It may not be useful to anyone but me, but let me know what you think. I am sure there are things that could be improved.

BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.002.