Viewing by month: March 2010
Spell checking in Flex with Squiggly - Part 1
Last year Adobe released their Squiggly spell checking engine for Adobe Flex and Adobe AIR and on December 18th, they updated that library to work with Flex 4 Spark components. (UPDATED: Shortly after this was posted, adobe released a third prerelease of Squiggly that contains support for additional languages and a number of significant code changes. The code samples in this post have been updated to work with the latest version. Most of the more significant code changes apply to the examples in the upcoming part 2.). Where I work, spell checking is a core requirement for our application, and as we are looking to rebuild the Flex portion of our application in Flex 4, I decided to put Squiggly through some some basic testing to see if it could meet our requirements. In the end it mostly met them with some key drawbacks that hopefully are addressed in future releases.
In this post I will discuss the previously available options for spellchecking, how to get started with Squiggly and how to implement it using the provided SquigglyUI class. Part 2, which will be posted next week, will delve into the SpellingDictionary and UserDictionary and how they can be used to create custom spellchecking functionality. Keep in mind, this is all based upon a proof-of-concept that is still to be considered a "work in progress" - so feel free to share your ideas, suggestions and experiences.
I've been using ColdFusion Builder exclusively for my ColdFusion development for months now. Nonetheless, there are still a ton of productivity features that I will admit to only just beginning to utilize. For instance, only recently have I begun to take advantage of the console and tail views. I'm sure someone must have blogged about these before but both are incredibly useful tools that are even more useful when you are doing Ajax and Flex development or working with ColdFusion ORM. Let me explain.
Given that I am finally delving deep into ORM for a real application rather tha proof-of-concepts or demos for articles, I am finally able to make idiotic mistakes in configuration that cause me days worth of grief. Thus why I am calling this post the first in a series on my dumb mistakes in the hopes that you don't have to follow suit. Today's issue had to do with configuring a one-to-one relationship and blindly overlooking what was properly in the documentation (I think I may have stared at it too long). Here are the key items in the configuration of Employee and OfficeCubicle from the documentation example (I will note what I screwed up and what it caused after):
- Property of child "officeCubicle" in parent "Employee" set to "one-to-one" and pointing to "OfficeCubicle" component (that one is easy I know)
- ID in child component (OfficeCubicle) set to generator="foreign"
- ID in child component (OfficeCubicle) set with params="{property='Employee'}" (this is not so clear, the property is the name of the one-to-one relationship property within the child component - not the name of the component necessarily)
- Child component (OfficeCubicle) has relationship property defined as "one-to-one" and points to parent CFC (Employee) (another easy one)
- Relationship property in child is set to constrained="true"
My dumb mistake? I had constrained="true" on the relationship property in the parent. This meant that anytime Hibernate tried to insert an Employee (in this case) that it would give me a "violation of foreign key constraint" error because a corresponding OfficeCubicle record did not yet exist. It's a totally simple and obvious rule to remember that the constraint should be on the child and not on the parent [smacks self in head]. Once I set that properly everything worked as advertised.
As a sidenote, I am using an Apache Derby Embedded database for some local testing when creating my objects (with Hibernate set to manage tables). Trying to change the objects to fix this issue caused me to get errors saying "could not export DDX." The issue, which I could see in the console, was that Hibernate created a Hibernate_Unique_Key table in my schema and it kept failing on the drop constraint and drop table for that table somehow (I think this table relates to my ID's being set to "native" but not totally sure). Anyway, simply deleting the Derby DB files and recreating them in the ColdFusion Admin seemed to resolve this (though that may not always be feasible it would be for a testing scenario like this).
Anyway, hopefully this post will stop others from repeating my stupidity...more dumb mistakes to follow I am sure. :)
ColdFusion Open Source Update - March 24, 2010
Five new projects and three updates this week in ColdFusion open source. With the release of ColdFusion Builder we're seeing a whole new group of projects built with CFML: ColdFusion Builder Extensions. It's already pretty impressive what people have come up with so far and I have even done a couple of minor extensions myself. This is an amazing feature that makes customizing your IDE to suit your preferences, your company's practices or to share with the ColdFusion community something that anyone with basic CFML skills can do. On that note, if you're in the Boston area tomorrow night and want to know more about ColdFusion Builder and extensions, be sure to come check out Adam Lehman speaking to my Boston CFUG.
At my office, we are working on a Mura CMS implementation for an major rewrite currently under developpment. One of the issues we needed to resolve was that front-end users in Mura, as in those people who could add comments and ratings to posts, needed to be validated against a user store that exists outside Mura. Thankfully, Mura makes it relatively easy to handle these sorts of issues through the long list of event hooks it supports. This post will cover how, with some guidance from Matt Levine at Blue River Interactive, I created and registered my event handler to handle user creation and authentication (and synced this with Mura's user store). Keep in mind this is still a proof-of-concept from a development standpoint, but everything is working nicely.
