the singularity of being and nothingness
ColdBox
I’m Speaking at Into the Box 2014
Jan 23rd
Exciting times are upon us!
On May 13, 2014, Into the Box will be exploding onto the scene. ITB 2014 is a 1-day, 2-track conference focused on the family of ColdBox products, CFML, and web tech in general. It’s right before cf.Objective(), so if you’re already going, you literally have no excuse to miss it!
I’m super-excited because I have the opportunity to speak at Into the Box 2014!
My session is ColdBox + ORM: Pink Unicorns Do Exist! In this session, we’ll take a look at all the awesome ORM services that ColdBox brings to the table to help you super-charge your app development. Hope you can make it!
If you want to learn more about Into the Box 2014, be sure to check out the official site. And please help promote it by putting one of these shiny banners on your blog or web site.
Share this:
Parsing HTML with ColdFusion and jsoup
Aug 10th
Whether you’re scraping content from a website, or simply dealing with the “tag soup” generated from your own site’s WYSIWYG, you probably know that reliably parsing HTML is a pain at best, extremely difficult at worst. Not only do you have to contend with unpredictable content, but there’s no guarantee that the content you try to parse will be well-formatted.
In my first pass at CFGloss, I made a pretty big error in parsing the documentation from ColdFusion, namely, I tried to do it with regular expressions. Ultimately, it worked out *okay*, but it was inefficient, unpredictable, and resulted in miles and miles of regular expression soup. Now that I’m overhauling CFGloss, I want to revisit how I parsed the scraped content and try to make it better.
Enter jsoup. This is an awesome little Java library that takes the headache out of parsing HTML. Besides turning unpredictable, and potentially mal-formed HTML into something usable, jsoup is additionally packed with some awesome features, most notably leveraging CSS/jQuery-esque selectors for manipulating parsed HTML content.
An ExampleTo get a feel of the tip-of-the-iceberg of what jsoup can do, let’s take an example from the Railo documentation. Take a look at the source of this page: http://railodocs.org/index.cfm/function/each/version/current. Our More >
My CBDW.2 Sessions
Jun 19th
Wow, yesterday was awesome! My sessions went well (at least I think so), and I’ve received a lot of positive feedback from the discussions.
For everyone who attended, thanks very much for your participation…it definitely means a lot and I hope the sessions were as informative as they were fun to create.
If you didn’t get a chance to attend, the sessions recordings have been posted (see links below).
ColdBox Developers Week is not over, though–there are still a TON of great sessions through the remainder of the week, so be sure to check out the lineup and attend as many as you can. I promise you will not be disappointed!
Criteria Builder In Action Building CKEditor Plugins for ContentBoxShare this:
ColdBox Developers Week!
Jun 17th
If you haven’t already (what, you haven’t? FOR SHAME!), be sure to register for ColdBox Developer Week, starting…well…today! This is a great week of really great sessions covering ColdBox, ContentBox, WireBox, AOP, ORM…phew!
Even if you don’t use ColdBox (yet…), I’d still encourage you to check out some of the sessions. It will give a you a good insight into what you’re missing out on 🙂
I’m particularly exited about this CBW, as I have the privilege of presenting two sessions!
Criteria Builder in Action (6.17.2013 – 11:00 AM Central)With ColdBox’s CriteriaBuilder, you can build powerful and dynamic Hibernate criteria queries with very little code. But does it work in real life? To put that question to the test, we’ll explore some real life scenarios and see how CriteriaBuilder can help us
Building CKEditor Plugins for ContentBox (6.17.2013 – 3:00 PM Central)In this session, we’ll learn how to extend CKEditor within ColdBox to provide rich, custom content editing capabilities. We’ll also explore how custom CKEditor plugins can be integrated with ColdBox modules to take content editing to the next level.
Hope to see you there!
Share this:Criteria Builder Quickie: Disjunction
Mar 12th
If you use ColdBox’s awesome CriteriaBuilder at all, you know it’s dead simple to create complex AND dynamic criteria queries. If you’re like me, a lot of your criteria queries are a bunch of “and”s built together. For example, let’s imagine we’re trying to get all the cars from our database that have a make of Ford and a color of Red. A simple criteria query for this might look like:
// create criteria var c = newCriteria(); // add criteria c.isEq( "Make", "Ford" ) .isEq( "Color", "Red" ); // get result var result = c.list();
Pretty simple, right?
Of course, not all queries are “and“s. Sometimes, you need to do an “or“. Perhaps we want to get all the cars that are Ford OR Red. Again, this is very easy with CriteriaBuilder:
// create criteria var c = newCriteria(); // add criteria c.or( c.restrictions.isEq( "Make", "Ford" ), c.restrictions.isEq( "Color", "Red" ) ); // get result var result = c.list();
While this works, it’s not complete. Sure, there are some scenarios where you will know ahead of time what criteria you want to use in a criteria query. However, consider a scenario in which you have a search form in which a user can select from a list More >
CKEditor Plugin: Redux
Jan 21st
In my last post, I showed how it’s not only possible, but also pretty dang easy to make a custom CKEditor plugin that can interact seamlessly with a module. While it worked pretty well in modern browsers, it completely bombed on older versions of Internet Explorer (surprise, surprise).
The main *problem* with older IE support is the use of a custom html tag (<fiddle>) to store the complex data type in CKEditor. Not only does CSS styling on this unknown element fail in <IE8, but it’s insertion into CKEditor also fails completely, presumably because of the old DOM implementation.
While annoying, this is hardly a deal killer. The choice to use a “fiddle” element was hardly required…I did it because I wanted to. However, in the spirit of backward-compatibility, I’ve updated the plugin to work with a plain-old <div>.
Without further ado, here are a relevant pieces that I’ve updated:
EntryHelper.cfm (The File Where the Insertion Occurs)/* * Common method to prepare fiddles for insertion...and insert them * @inputs - collection of inputs */ function prepareFiddle( inputs ) { ... // create double-mustache syntax html += ' <div id="cbjsfiddle">jsFiddle - {1}'.format( vals[0], vals[1], vals[2], vals[3], vals[4], vals[5], vals[6], vals[7], vals[8] ); // insert into More >
ContentBox: Creating a CKEditor Plugin for Complex Data Types
Jan 19th
I recently developed a simple module for ContentBox called jsFiddle. Basically, it allows you to insert “fiddles” from the excellent http://jsfiddle.net into your posts and pages. In developing this module (and CKEditor plugin), I wanted to be able to insert complex data into the content editor, but then be able to re-edit that content after insertion. I’m pretty happy with how it turned out.
In the following paragraphs, I’m going to walk through the process of developing a ContentBox module that includes a CKEditor plugin which is capable of content re-editing. Hopefully this will inspire some others to develop some killer new ContentBox modules with helpful CKEditor plugins.
Some ContextNOTE: In this walkthrough, i will include snippets of code, but most of them will be severely trimmed for the purposes of this post. If you really want to follow along with the full code, please grab it from the GitHub repo. Furthermore, I’m not advocating that this is the “best” or “only” way to accomplish this. My only intention is to share some ideas about things that have worked for me. So if you have corrections or suggestions for how things can be done better, I’m always ready and willing for civil, constructive feedback 🙂
Before we More >
CKEditor and ContentBox: A Fun Editing Option
Jan 13th
Over the last two days, I’ve been playing around alot with a new plugin that I’ve been working on for inclusion in CKEditor, expressly for the purposes of creating a very handy way of inserting snippets of code, decorated by Syntax Highlighter, into ContentBox‘s content editor.
Some of the functionality I’ve been playing around with is the different ways in which you can trigger “edit” events on elements in CKEditor, primarily for the purpose of opening a modal window and allowing for editing of the element’s properties (such as href, title, class, etc.). This weekend, I brought the options in the new plugin I’m working on up to the following:
- Via link in context menu
- Double-clicking the element
- And the most interesting…using jQuery to help overlay an inline-tooltip (see below)
In my next post, i’ll describe how to do this…just wanted to put out a teaser before I sleep and prepare for the new week!
Share this:ContentBox: Editable Content Regions in CKEditor
Jan 2nd
I recently created a module for ContentBox that allows you to embed “fiddles” from the excellent http://jsfiddle.net. If you’ve not used this site before, you really should 🙂
In developing this module, I had very specific goals, particularly for the user interface in the rich HTML content editor, namely CKEditor. My goals were simple:
- Have toolbar icon for easy insert
- Allow easy insert from context menu (right-click) within the content editor area
- After content/config/whatever is inserted into content editor area, show something meaningful (other than ugly red iFrame box)
- Allow user to act on inserted content–particularly, be able to edit all the properties of the content that were configured pre-insert
The first two are really easy. If you look at the source of the PasteBin module, you’ll see really quickly how to do those, so I’m not going to dwell on that. In this post, however, I do want to show how simple it is to make inserted content regions richly editable, treating them like complex data, rather than just simply strings.
Insert Content RegionNOTE: In the following, I include code-snippets, but often omit unimportant or redundant bits. Be sure to grab the entire source to see everything in its full context 🙂
Before we look at creating the editable More >