Search Blog

Recent Comments
Re: Stats plugin ported to Model-Glue (by J.mihai at 12/14 8:52 AM)
Re: CFC DAO Generator (by rui at 7/04 5:42 AM)
Re: Updates to the DAO, Bean and Gateway generator (by rui at 7/04 4:49 AM)
Re: CFC DAO Generator (by fwscott at 6/22 7:03 PM)
Re: CFC DAO Generator (by dan at 6/22 12:38 PM)
Re: Trip to Thailand (by fwscott at 3/27 2:10 AM)
Re: CFC DAO Generator (by fwscott at 3/27 2:03 AM)
Re: CFC DAO Generator (by Garry Harstad at 3/26 12:30 PM)
Re: Trip to Thailand (by Niqui Merret at 3/23 4:51 PM)
Re: Adding a blogger ping utility to BlogCFM (by fwscott at 2/20 9:01 PM)
Categories
Annoucements (1 entries)
BlogCFM (3 entries)
CFC Generator (5 entries)
Coldfusion (11 entries)
Fusebox (2 entries)
Greasemonkey (1 entries)
Misc (3 entries)
Archives
November 2005 (2 entries)
October 2005 (1 entries)
August 2005 (1 entries)
July 2005 (4 entries)
June 2005 (5 entries)
May 2005 (7 entries)

Powered by
BlogCFM v1.01

June 2005
Old quote but still funny
Pretty old but someone just sent this to me today.

The difference between the Pope and your boss... the Pope only expects you to kiss his ring
Posted by fwscott at 10:31 AM | Comments (0)
June 2005
Updates to the DAO, Bean and Gateway generator
After a few suggestions coming by the way of emails, I decided to put them into the distribution of the CFC DAO, Bean and gateway creator for Coldfusion MX 6/7 . Also, it should correctly work with Microsoft SQL server.

Changes:
  1. Bean's setter functions now have two additional optional arguments: isNull and Validate
  2. Now the bean controls the length of fields and if something is nullable.  Initially the generator will create the configuration for you but you can modify later by changing the setBeanConfig() function inside the bean CFC.
  3. The bean setter functions perform validation on the data passed in according to the specs from bean config.
  4. Each property of the bean has an isNull{property name} function
  5. All data coming from the database is considered trusted and will not be validated when passing it back to the bean setters.
To see the changes in action, view the demo.

You can download it here. The downloadable version contains a transformsbasic directory that contains the original transforms.

I am not sure I will put any other changes in the distribution as other suggestions were more specific and could be implemented in other ways.  But, remember you can incorporate your changes just by modifying the XSL files.  If you need some help, just contact me via the email address in the readme file.
Posted by fwscott at 12:44 PM | Comments (35)
June 2005
Faking a null value
The more and more I am generating code with the CFC Bean, DAO and gateway creator

The more I am noticing the need to support a null value and I am trying not to go in and write work arounds for each bean / dao / gateway CFCs to support nulls.

So, would defining a default bogus null value per bean be the way to go?

Example:
<cfcomponent displayname="myBean" hint="I model a single myBean.">

    <cfset variables.NumericNull = -99999 />
    <cfset variables.StringNull = "null" />
    <cfset variables.DateNull = CreateDate(1877,01,01) />
    <cfset variables.BinaryNull = toBinary(toBase64("null")) />

Now in the DAOs have something like:
    <cffunction name="update" returntype="void" output="false" hint="CRUD method">
        <cfargument name="myBean" type="myBean" required="true" />   
        <cfset var myBeanUpdate = 0 >
        <cfset var numericNull = arguments.myBean.getNumericNull() />
        <cfset var DateNull = arguments.myBean.getDateNull() />
        <cfset var StringNull = arguments.myBean.getStringNull() />
        <cfset var BinaryNull = arguments.myBean.getBinaryNull() />

        <cfquery name="myBeanUpdate" datasource="#variables.dsn#" >
            UPDATE myBean
            SET
               myBeanValue1 =
                <cfif arguments.myBean.getmyBeanValue1() NEQ stringNull>
                     <cfqueryparam cfsqltype="cf_sql_vchar" value="#arguments.myBean.getmyBeanValue1()#" maxlength="10" />
                <cfelse>
                     <cfqueryparam cfsqltype="cf_sql_vchar" null="yes" />
                </cfif>
            WHERE
                   id = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.myBean.getmyBeanID()#" />       
        </cfquery>
    </cffunction>

I uploaded new transforms to the demo CFC Creator script to reflect these changes if you want to see how a fully generated CFC looks using the above.

Thoughts?

Think I should use the new transforms in the downloadable version of CFC Creator?
Posted by fwscott at 3:19 PM | Comments (5)
June 2005
Adding a blogger ping utility to BlogCFM
Since MXNA is aggregating my feed now, I needed to have BlogCFM notify MXNA when a new post was done.

Previously , I showed how to add your own configuration options to BlogCFM.  This time I added a PING_ON_UPDATE configuration option, along with adding the field to the admin screen.

My SendPings function is very simple but could use some work for error checking and stuff.  Perhaps I will work in some error checking later but since it is only me using this function currently, I know I will type in the correct ping URLs.

I added the following to the BlogCFM.cfc but could be used in any blog really. It accepts one argument, a list of URLs to send to seperated by ";"

<cffunction name="SendPings" access="public" output="false" returntype="void">
    <cfargument name="UrlLIST" type="string" required="yes" hint="A list of URLs seperated by ;">
    <cfloop from="1" to="#listlen(arguments.UrlList,";")#" index="listindex">
        <cfhttp url="#listgetat(arguments.UrlList,listindex,";")#" throwonerror="no"></cfhttp>
    </cfloop>
</cffunction>


Next was to tell BlogCFM to send the pings.
I put the following below the notifications area of SaveEntry()

<cfif getBlogConfigValue(arguments.blog_id, "PING_ON_UPDATE") NEQ "">
   <cfset SendPings(getBlogConfigValue(arguments.blog_id, "PING_ON_UPDATE"))>
</cfif>
       

That did it!  Now BlogCFM will ping whatever URLs I type into the admin screen (MXNA).
Posted by fwscott at 9:47 PM | Comments (2)
Greasemonkey!

Well, this is probably not new technology to most but I just read about it the other evening.

http://greasemonkey.mozdev.org/

For anyone that doesnt know what it does, it basically allows you to make any webpage look how you want it to look.  Lots of cool examples at http://dunck.us/collab/GreaseMonkeyUserScripts.

Anyways....  after reading over all this stuff I decided I wanted to make something.  The best thing I could think of was a minor annoyance I had with some websites not offering their own search feature.

So I figured every site should at least have a google search on it.  Now I just needed a decent way to show the form and I found http://www.xs4all.nl/~jlpoutre/BoT/Javascript/RSSpanel/rsspanel.html as a starting point of my project.  It offers a user draggable interface for a floating window.

After mangling his code and inserting some of my own, I came up with:
Search this site picture

Couple key things added to his code.
  1. It saves the location/visibility of the search box for the site you are currently visiting.
  2. Has a user command to force the search box to show for the current site.
  3. You can restore the default location of the search box via the user command menu.
So, now whenever I visit a site, I can always search the site directly from the webpage.  If the webpage has a form that contains the text "search", the search box will not display unless I force the search box to display.

If interested, you can install the Greasemonkey script at http://www.franciswscott.com/downloads/searchthissite.user.js

To sum up Greasemonkey..... very very nice idea!


Posted by fwscott at 7:31 PM | Comments (0)