Cost Effective Website and Network Monitoring
IPCheck Server Monitor -
Free Download

Recent Articles

Three Lines Of Code To Boost Your Search Engine Traffic
In the world of Web building, an opportunity to develop/code something quickly is a rare occasion. Mostly, you need to spend hours on research, planning and implementation (unless you code with CSS...

ColdFusion 8's Ajax Debug Works Well With Spry
Wow - this was a surprise. I was trying to debug a Spry issue this morning and not having any luck at all. I was using Spry's debug panel which you enable like so: Spry.Data.Region.debug = false; And I was...

What Facebook ToS Change Means For Developers
Facebook pulled the wildly popular music sharing Audio one week after it changed its terms of service. While this is a good for Facebook, it does put limits on what developers can put up as an application.

.NET - Beware Of The FileInfo.OpenText() Method
I'm a big fan of the System.IO.FileInfo object in .NET because it wraps the System.IO.File object nicely in a strongly typed way. It makes it easier to work with files. The FileInfo class has a method called OpenText...


09.19.07


Structure Versus Query

By Raymond Camden

Over the weekend and Monday, there was an interesting thread on CF-Talk. You can read the complete thread here.

The basic problem involved getting a particular piece of data to show up in the final feed xml, in this case, the GUID attribute for an RSS 2.0 feed.

One of the problems I have with CFFEED is that sometimes it is rather difficult to figure out what you have to feed it. (See this post for an example.)

Jayesh Viradiya of Adobe informed me of an interesting aspect of CFFEED. As you may or may not know, you can use either a structure of data or a query to create your feed.

Now I've spent most of my time using queries to build feeds - and I think most people will do the same. But you may - for whatever reason - need to create your feed with a structure.

Here is where things get interesting. When you work with a query that comes from a feed, you have a set of columns that always exist no matter what type of feed you read from.

Because you have one set of columns, sometimes the columns can mean different things based on the type of feed you read from. So for example, the ID column refers to the ID data of an Atom feed and the GUID data of a RSS feed.

Cost Effective Website and Network Monitoring
IPCheck Server Monitor -
Free Download

The same rules then apply when creating a feed. If I want to create an RSS 2 feed and have GUID data, I use the ID column of my query, or I use columnMap to point to it.

You can see the entire list of columns and the rules behind them in the CFML Reference, page 191. If you do anything with CFFEED, you need to take a look at the reference.

Now here is where it gets confusing a bit. If you are creating your feed from a structure, you specify the exact column name.

So instead of using ID for example, you would use GUID. Since GUID can be complex though this has to be a structure, as Jayesh demonstrates in the thread:

<cfset myStruct.item[i].guid = structnew()>
<cfset myStruct.item[i].guid.isPermaLink="YES/NO(anyone)">
<cfset myStruct.item[i].guid.value = "http://www.google.com">


Make sense yet? What is really needed I think is a bit more documentation.

As an FYI - I've worked a bit on Atom Metadata and hope to have a follow up to my other post soon.

Comments


About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

About TheDevWeb
TheDevWeb examines the best tools and techniques to help you keep up with all the latest trends in the fast paced world of web development. Excellence in Development Starts Here

TheDevWeb is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementNews.com



-- TheDevWeb is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2007 iEntry, Inc. All Rights Reserved Privacy Policy Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



Excellence in Development Starts Here TheDevWeb News Archives About Us Feedback TheDevWeb Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact