CFLib 2008

This post is more than 2 years old.

So I've been talking about relaunching CFLib for over four years now, and I've finally gotten around to doing it. If you haven't visited CFLib today, take a quick peak.

So what's behind the change? First and foremost, I want to give credit to Justin Johnson. He not only did the design but provided me with simple templates to make my life easier. He also did all the jQuery work. So all credit really goes to him. With that said, let me talk abit about what I changed and why.

The main difference is that this version is a heck of a lot simpler than the old site. I wanted a design that focused on the UDFs and made it easier to get to the code. The site basically has three main pages: Home Page, Library Page, and UDF page. That's it (again, pretty much). You can also get the code for a UDF from the library page. I dropped all the other pages. There aren't comments anymore, but they have been disabled for quite sometime anyway. I also got rid of the user system completely. Again - the idea is that you can come in, get the UDF, and get out.

Behind the scenes I'm using Model-Glue 3, ColdSpring, and Transfer. It is completely stupid and irresponsible to use Alpha software for a production site. Make sure you get that. But that being said, I thought it would be really cool use MG3 and heck, it's my site, I'll be dumb if I want to. I really loved the "helpers" feature of Model-Glue 3. So for example, to generate my captcha random text, I did:

<cfset captcha = helpers.util.makeRandomString()>

To format required CF version into a nicer string, I did:

#helpers.util.formatVersion(udf.getCFVersion())#

And so on. You get the idea. I also made heavy use of the beans feature. So my UDFController has this at top:

<cfcomponent output="false" extends="ModelGlue.gesture.controller.Controller" beans="UDFService,LibraryService,config">

And here is an example of where I use it:

<cffunction name="getLatestUDFs" output="false"> <cfargument name="event" /> <cfset arguments.event.setValue("latestudfs", beans.udfService.getLatestUDFs()) /> </cffunction>

I did not use the new SES URL feature as I had a bit of trouble generating my links. Instead I simply used IIRF, a free IIS-based URL rewriter. Locally I used Apache rewrite. I ran into one problem with my SES URLs. When I did a redirect from an event at a SES url, it wanted to go to index.cfm, not /index.cfm. I added this to ColdSpring.xml to fix it:

<property name="defaultTemplate"><value>/index.cfm</value></property>

Notice the / in front. Also, note that the old site let you use URLs like this:

http://www.cflib.org/udf.cfm/isemail

Thew new site still supports that, but also lets you get even shorter with:

http://www.cflib.org/udf/isemail

The code coloring is done using ColdFish. jQuery is used on the library page to both animate and load it in via Ajax.

Outside of that it's a pretty simple site. I was lazy and didn't bother doing an admin. I'll just use the old site's admin for now. I did run into some Transfer problems, but I'll blog about that later.

Lastly - you may remember that I had said I was considering supporting custom tags and CFCs. While I think there is some merit to that - I really wanted to keep things simple. So for now, it's just UDFs (all 1k of them).

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Dan Vega posted on 6/9/2008 at 9:07 PM

Awesome upgrade, Congrats to you and Justin!

Comment 2 by charlie griefer posted on 6/9/2008 at 9:09 PM

dude. sweet!

Comment 3 by Will B. posted on 6/9/2008 at 9:37 PM

Nice, Ray...niiiiice! Looks supa-sharp!

Comment 4 by Edgar Soto posted on 6/9/2008 at 10:04 PM

Looks Super Good!

Comment 5 by Andrew Ekaett posted on 6/9/2008 at 10:39 PM

Looks great. Nice that we can get the source in one less click now. However...

[nit]
I much prefer seeing all of a library's funtions on one page instead of 20 at a time.
[/nit]

Comment 6 by Raymond Camden posted on 6/9/2008 at 10:46 PM

Andrew - it ended up being -way- too big for libraries like strLib.

Comment 7 by Mark Mazelin posted on 6/9/2008 at 10:55 PM

Ray:

I like the new look, but the items in the library view appear to be in some random order. They are certainly not alphabetical. Any hints as to what order you chose?

Comment 8 by John Allen posted on 6/9/2008 at 10:56 PM

What a handsome site. Thanks Ray for Cflib.org and the snippex server. You make my life better!

Comment 9 by Sami Hoda posted on 6/9/2008 at 11:01 PM

Does ColdFish allow you to pick the font? The code is in courier in the listing page, and in a different font on the specific udf page. Looking good though!

Comment 10 by Raymond Camden posted on 6/9/2008 at 11:03 PM

@Mark Mazelin: Um, I have no idea what you are talking about. I swear I didn't just fix the bug and clear the cache. Really. (Thanks.)

@Sami: It does, but it should be the same. I'll take a look at that a bit later though.

Oh I know what it is. On the library page the code is an Ajax request, so the CSS isn't loaded. Again though I'll look at it later.

Comment 11 by Sami Hoda posted on 6/9/2008 at 11:07 PM

Thanks Ray. Another note: Some lib listings show code comments with a yellow backgrounds, while others done.

Comment 12 by Raymond Camden posted on 6/9/2008 at 11:19 PM

@Sami - no, its not the Ajax, its slightly different html. I'll fix it though.

Comment 13 by Che posted on 6/9/2008 at 11:21 PM

Usability wise, I'd add a Previous 20 / Next 20 link at the bottom of the page as well... Nice job!

Comment 14 by Raymond Camden posted on 6/9/2008 at 11:25 PM

@Che: Done.

Comment 15 by James Moberg posted on 6/9/2008 at 11:31 PM

Any possibility to add better pagination at the bottom:
http://www.dopefly.com/proj...

As much as I appreciate simple Next/Prev links, they are too constraining when I want to go straight to the end of the list.

I liked it better before with all of the tags on a single page... I could easily use my browser's CTRL-F to find tags based on the brief description.

Comment 16 by James Edmunds posted on 6/9/2008 at 11:34 PM

One of my favorite resources, now looking spiffy in its new clothes!

Thanks from all of us....

Comment 17 by Raymond Camden posted on 6/9/2008 at 11:36 PM

@James M: We will have to agree to disagree here. I'm not going to put them all on and I tend to find multiple pagination options a bit confusing at times. One thing I didn't mention is that I got rid of the Google search - so the search now is a lot more effective. You can also just download the whole library if you want. :)

@JamesE (and all): Thanks and I'm happy you guys are liking it.

Comment 18 by James Moberg posted on 6/9/2008 at 11:48 PM

How is the whole library downloadable? Is there any information on the website regarding how to do that (or is it a manual task?)

I've mentioned this before, but when sending email to subscribers, please set a return-path/sender values to one of your internal email addresses so that SPF (Sender Policy Framework) does not block messages or mark it as spam. More information is available here:
http://www.openspf.org/Best...

BTW: I do like the new look, but it now takes me longer to find what I am looking for.

Comment 19 by Matt Williams posted on 6/9/2008 at 11:51 PM

Regarding pagination, what if you told us where we are? Or at least tell how many total there are. For example, the MathLib has 132 UDFs. But after clicking into the MathLib, I can't see that anywhere and forget.

If none of that is happening, fine, I'll survive. A note to others though, you can jump around from beginning to end or whatever by changing the url "/start/xx" where xx is the record number you would like to start on.

Comment 20 by sethron posted on 6/10/2008 at 12:00 AM

Very pleasing to the eyes, Ray.
Am I the only one who still uses the Studio CFLib UDFBrowser menu button?
I have the CFLIB.Org UDF Browser v1.1 and the ScriptX package installed and it was working. Would you have any insight to update this line in
C:\Program Files\Macromedia\ColdFusion Studio 5\udfbrowse\udfbrowse.htm?
var CFLIBURL = "http://www.cflib.org/cfcs/u...";

Comment 21 by Raymond Camden posted on 6/10/2008 at 12:19 AM

@Matt - Added the total to the top

@sethron - Sorry - but I'm no longer supporting the Homesite/CFS browser. You are probably one of two people left on the planet still using it. :) I do, however, support the SnipEx browser still

Comment 22 by Chad Stander posted on 6/10/2008 at 3:05 AM

Awesome! You guys did a great job on the new look and feel of this site. I have always been a big fan of this site, but am now even more so.

Comment 23 by Charlie Arehart posted on 6/10/2008 at 6:53 AM

Great job, Ray. I'm really glad to see the libraries listed so prominently on the front page. I always lamented that the old site instead had only a link to the word libraries buried in its opening paragraph. The new look will be much more useful for new visitors.

As for your comment to Sethron, that he was "probably one of two people left on the planet still using CFS/HS+", hey, I resemble that remark. :-) Seriously, I don't want to hijack this thread to reopen a debate on that can of worms, but let's please not perpetuate the mistaken assumption that "no one uses those anymore". They have their place, and not just for luddites and newbies!

Comment 24 by Charlie Arehart posted on 6/10/2008 at 6:56 AM

Sorry, should have said that the old site's link to libraries was also in the top nav bar. Still, I do like much better the new look's listing of all libraries on the front page. :-)

Comment 25 by Raymond Camden posted on 6/10/2008 at 5:43 PM

@sethron: This is NOT supported, but you can try this.

Ping www.cfib.org.
Note the IP
Edit your hosts file and add a record for the IP and hostname, old.cflib.org

Try to open old.cflib.org. You should see the old site. If so, edit the HomeSite code and change that CFLIBURL to use old.cflib.org.

Again, this SHOULD work, but I'm not officially supporting it.

Comment 26 by Bruce Stenberg posted on 6/10/2008 at 7:22 PM

The new cflib.org site looks awesome. GREAT JOB!

Comment 27 by Tyler Clendenin posted on 6/11/2008 at 7:28 AM

+1

Pagination: thumbs down. As a user I must suggest removing pagination altogether. I can't see any situation where I would want pagination, I know I need to view the full list when I am browsing for a UDF I would like.

Comment 28 by Tyler Clendenin posted on 6/11/2008 at 7:49 AM

Oooo, feature requests/ideas:

1. RSS feed per Lib.
2. RSS feed per UDF.
3. Whole library as SVN Repo.
4. More labels for UDFs (i.e. Arrays could be tagged as "ArrayLib" and "DataLib").
5. Generate your own library: let users tag udfs and allow them to generate their own custom library download.
6. Let users post "upgrades" to existing UDFs, letting them know that any "upgrades" must be fully backward compatible. (to ensure this youcan allow users who post udf's to include some sort of test case materials.
7. What about UDFs that need to be cffunctions because they need to use tags that don't have cfscript equivalents.
8. Could cflib also be used to share custom tags?
9. API

BTW meant to post before, site looks good, nods to Justin Johnson.

Comment 29 by Raymond Camden posted on 6/11/2008 at 3:15 PM

@Tyler/Pagination: Well, again, it comes down to speed. If more people ask, I'll consider a way to get them all on one page, but with download right there, and search, I'm not going that way.

1. RSS feed per Lib.
2. RSS feed per UDF.

Last two items: Note that I update UDFs like once a week or so. So this would make for RSS files that never/rarely change, and I don't think 2 makes sense.

3. Whole library as SVN Repo.

Maybe.

4. More labels for UDFs (i.e. Arrays could be tagged as "ArrayLib" and "DataLib").

This one doesn't make sense to me.

5. Generate your own library: let users tag udfs and allow them to generate their own custom library download.

We used to have that actually.

6. Let users post "upgrades" to existing UDFs, letting them know that any "upgrades" must be fully backward compatible. (to ensure this youcan allow users who post udf's to include some sort of test case materials.

We already kind of support this - you are allowed to send me an update to a UDF. However - I only want one version of a UDF. I don't want 5 isEmail UDFs.

7. What about UDFs that need to be cffunctions because they need to use tags that don't have cfscript equivalents.

Eh? We support tag based UDFs already. :) Have since they came out.

8. Could cflib also be used to share custom tags?

If you read the announcement, you know this was considered. It may still happen.

9. API

We have multiple APIs already. An RSS feed, and the SnipEx API.

Comment 30 by Tyler Clendenin posted on 6/12/2008 at 8:42 AM

I apologize I was running on very little sleep when I wrote that list. =] Was just jamming out suggestions and I forgot the things that had already been there.

When I spoke of more labels for UDFs I meant that even though DataManipulationLib is a logical and good place to store UDFs, I always found that more often then not when i was looking for a UDF I already knew which data type I wanted to manipulate. So say the Array() UDf would be tagged as DataManipulationLib and ArrayLib (perhaps ArrayLib as a sub label of the DataManipulationLib) Currently it's not a big deal, there aren't really enough UDFs to be a burden to find the right one, without paging of course =].

Also I hope that you didn't take my comment i the wrong way. We all know how poorly intent comes across over the internet. I wanted to say great job and thank you for reinvigorating the best CF resource on the net (aside from the livedocs).

Comment 31 by Raymond Camden posted on 6/12/2008 at 3:03 PM

@Tyler: Believe it or not - we actually do have categories for UDFs, so a UDF can be in library X, category Y, and that would probably cover what you want. We just don't use it in the new design. ;)

No worries (re: your last paragraph) - I know it's all just ideas here going back and forth. :)

Comment 32 by James Moberg posted on 6/12/2008 at 6:02 PM

Concerning searches, what is the reason behind limiting the results to only 50? I searched on a generic keyword and more than 50 results are available, but I am limited to only the first 50. How are the results sorted to determine which 50 results are displayed first?

Also, I like the integration of SIFR. We've been using it for a while and it really helps to brand a website using non-traditionally installed fonts.
http://www.google.com/searc...

You should add a favicon for the site. We do this for every client website. The good (and free) Windows program to create favicons is IcoFX at http://icofx.ro/ (I can make one for you if you wish.)

Comment 33 by Raymond Camden posted on 6/12/2008 at 6:30 PM

The search is simple sql, ordered by name. I'll look into adding pagination.

If you want to send over a favicon, be my guest. I'm not going to launch VMWare just for that Windows app. ;)

Comment 34 by James Moberg posted on 6/12/2008 at 6:41 PM

Re: Search pagination. Great!

Re: favicon. Here it is:
http://www.ssmedia.com/temp...

There may be a Mac favicon programs available... not sure. I know there are plenty of online services that will do the conversions, but the application that I recommended is incredibly feature rich (and portable) and I thought that any designer/developer with access to Windows could benefit from it.

Comment 35 by Raymond Camden posted on 6/12/2008 at 6:47 PM

favicon is up. Thanks!

I'll get search pagination in next build. I have code to support nicer URLs for libraries (www.cflib.org/library/strlib) but I'm waiting on a bug to be fixed in MG3 before I push it.

Comment 36 by James Moberg posted on 6/12/2008 at 7:01 PM

Great!

When you update the URLs, could you add the UDF URL to the comments of the UDF itself so that it can be easily looked up instead of searched for? Before I fix a slight bug or add a new feature, I search CFLib for the UDF to see if there has been an update. If a direct URL is part of the comments (like many .js libraries), it will make the process much easier to check as well as re-review the posted example.

Comment 37 by Raymond Camden posted on 6/12/2008 at 7:02 PM

search pagination is done. Just not pushed. But will be in next update.

Comment 38 by Raymond Camden posted on 6/12/2008 at 7:26 PM

That one is a bit more complex. I actually store the UDFDoc (JavaDoc) in the database. This makes rendering a bit quicker. I could do a regex on it to add the URL. I'll have to think about it.

Comment 39 by Raymond Camden posted on 6/13/2008 at 10:23 PM

Everything (but the javadoc mod) I described is now pushed.