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

May 2005
Adding "Pods" to BlogCFM
Adding a "pod" (side item) to BlogCFM proved to be very easy.

All you have to do is duplicate one of the pods in the "pod" directory and modify the contents.

To finally include it on your webpage open up the below.cfm and add an

<cfinclude template="#variables.mapping#pods/<podfilename>.cfm">

Next pod I add will be a managed pod probably containing links stored inside the database.  We shall see how that goes.
Posted by fwscott at 12:22 PM | Comments (0)
May 2005
CFC DAO Generator: Take two
Since my first post of the CFC DAO Generator I have made a few changes.

  1. Reorganized my CFCs to read table information.
  2. Added a tableindex CFC to hold an index of a table.
  3. Interface now generates a gateway CFC for the table based on indexes.
  4. Added the ability to save the generated CFCs.
With the above changes, I am now able to automatically generate all my database CFCs with little to no changes.  The gateway CFC now contains querys based on every index of the table being shown, so assuming I built the table correctly, all searchable fields should have a query generated for them.

Also, this should work with all databases supported by ColdFusion which makes it a big plus.

Again, you can demo the CFCCreator here and download the source here.

Please read the README file inside the zip for installation instructions.

Any further suggestions to make this better, leave some comments.
Posted by fwscott at 5:50 PM | Comments (12)
May 2005
First experience with BlogCFM
Bugs found:
  1. FckEditor shipped with BlogCFM would not work with Firefox with the default toolbar turned on.
  2. Couldnt edit a post over a certain length. (damn typos)
  3. If blogCFM is not installed to the root of your website and/or the site does not have access to /CFIDE all the cfform validation will fail and will generate tons of 404 errors in the web server log.
Fixes:
  1. Downloaded and installed the latest version of FCKEditor.  It was simple, the only changes I had to make were in the FCKEditor config files so it would work with ColdFusion.
  2. lines 857-858 of blogcfm.cfc had the wrong cfsqltype, had to change it to cfsqltype="cf_sql_longvarchar"
  3. Had to modify all cfform tags and add an attribute of scriptsrc="#variables.blogConfig.webRoot#/CFIDE/scripts/cfform.js".  This sounds bad but Dreamweaver's advanced find and replace makes it easy.
Now that I had everything fixed that I found wrong. It was time to do see how easy it was to make modifications.

First thing I didnt like was to have the basic toolbar show by default for the FCKEditor and I couldnt find an option to change the default.  This seemed like a great first experiment.
  1. ALTER TABLE blog_config ADD HTML_EDITOR_DEFAULT_STYLE varchar(25)
  2. Added HTML_EDITOR_DEFAULT_STYLE to the getBlogConfig query in blogcfm.cfc
  3. Added HTML_EDITOR_DEFAULT_STYLE=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.details.HTML_EDITOR_DEFAULT_STYLE#"> in the update statement of saveblogconfig()
  4. changed <cfparam name="toolbarSet" default="#variables.blogConfig.HTML_EDITOR_DEFAULT_STYLE#"> in entry_edit.cfm
  5. added <cfparam name="FORM.HTML_EDITOR_DEFAULT_STYLE" default="Basic"> under the isDefined("form.blogConfig") in edit_entry.cfm
  6.  added
    <br>
    <b>HTML Editor Options</b><br>
    Default style: <select name="HTML_EDITOR_DEFAULT_STYLE">
        <option value="Basic"<cfif blogConfig.HTML_EDITOR_DEFAULT_STYLE IS 'Basic'> SELECTED</cfif>>Basic</option>
      <option value="Default"<cfif blogConfig.HTML_EDITOR_DEFAULT_STYLE IS 'Default'> SELECTED</cfif>>Default</option>
    </select>
    to admin/index.cfm
That was all I had to do to make a new setting show up in the admin screen and have it be applied to every instance of the blog entry editor/creator. 

Considering I knew nothing about BlogCFM before, these changes were easy to make and find where to put the correct new code.

Next on the list will be creating a Links section, will keep you posted on how that works out.
Posted by fwscott at 10:43 PM | Comments (1)
CFC Generator and my first real use
So, I thought the CFC generator would be a perfect match for my coding needs till I started coding with the generated CFCs.  I found myself having to create a gateway CFC for each table.

 I knew I would need gateway objects but at first I did not think I could automate what I needed. Then I noticed that most of my gateway querys were based on indexes created in the database. 

Well, the CFC Generator already can read all indexes on a database but I was only taking advantage of the primary key index. So, I just had to add a new class of tableindex and feed the other indexes into the class.   I already have some changes made to my private version of the generator and will upload them to my site soon.

Can already tell you that the table to XML structure has changed a little.

It now looks like

<table>
    <name>tablename</tablename>
   <dbtype>Database type</dbtype>
   <columns>
        <column>
            <name>column name1</name>
            <length>column length</length>
            etc
            etc
            etc
        </column>
        <column>
            <name>column name2</name>
            <length>column length</length>
            etc
            etc
            etc
        </column>
     </columns>

<!--This is where new stuff and the beauty of XML/XSL come into play -->

   <indexes>
      <index>
         <name>Index name</name>
         <type>index type</type>
           <columns>
            <column>
                <name>column name1</name>
                <length>column length</length>
                etc
                etc
                etc
            </column>
            <column>
                <name>column name2</name>
                <length>column length</length>
                etc
                etc
                etc
            </column>
         </columns>
      </index>
   </indexs>
</table>

         
I imagine the default generated gateway CFC will have functions something like:
<cffunction name="get#Tablename#by#indexname#" returntype="query">
    <cfargument name="#indexfield1#" type="#indexfield1type#" required="true">
    <cfargument name="#indexfield2#" type="#indexfield2type#" required="true">

    <cfquery .....................

   </cfquery>

   <cfreturn thequery>
</cffunction>


and a getAll function to read all rows from the table.

Also, the next version should work with any database supported by CF with no changes made to code.
Posted by fwscott at 10:18 PM | Comments (0)
CFC DAO Generator
Since my blog was not up while developing this application I will not go into the details of what all I had to overcome, only why I created this application.

Why?
I am in the process of migrating an existing application that has over 200 tables in the database.  We do not have any of the queries or access to the source code of the existing application.  The closest thing I could find that would do something similar, did not support my database type.

What I needed:
The ability to generate DAO/Bean CFCs from analyzing a table structure.

What I came up with was:
A multi-database CFC DAO generator.  Its all based on XML and is easy to generate a CFC if you know XSL.
I have uploaded a demo here, the demo only runs off the cfsnippets datasource and the downloadable version displays all datasources registered with CF Admin.

Results:
Amazing for me, I was able to generate over 45 files in about 10 minutes.  These CFCs fitted the database structure we were working with and allowed me to create a standard base DAO factory with ease.

If you download this, please make sure you read the README file in the zip file for instructions on installing / customizing.  The frontend is nothing to brag about but the results are just great.

Tell me what you think.
Posted by fwscott at 12:27 PM | Comments (5)
May 2005
Trip to Thailand
View Blog EntryView Blog Entry View PhotosView Photos View ThumbnailsView Thumbnails
These pictures are from when I visited Thailand a few months back.

I am in the process of uploading others but I wanted to test out how the photo galleries worked.
Posted by fwscott at 11:52 PM | Comments (2)
Welcome to my new website
Well I finally went out and did it.

I bought a domain name for me to use.

You might ask why would I do this?
  1. I wanted a place to post my thoughts.
  2. I enjoy reading other people's blog, so I hope you will enjoy reading mine.
  3. I wanted a place that I could share coding problems and maybe some tips.
  4. I wanted a place that I could test certain code.
  5. I like learning new things and this gives me a reason to learn.
This site is currently running BlogCFM and I must say I am very happy with how easy it was to setup.  Next on my list is to dig into BlogCFM and customize the site.  I plan to blog my experience so anyone that is curious about BlogCFM stay tuned.

Now to tighten up on my writing skills and get to sharing

Enjoy!
Posted by fwscott at 10:51 PM | Comments (0)