existdissolve.com

the singularity of being and nothingness

Follow me on TwitterRSS Feeds

  • Home
  • About
  • CFAviary
  • ContentBox Modules
    • jsFiddle
  • Gloss

Subqueries with ColdBox CriteriaBuilder

Aug 20th

Posted by existdissolve in ColdBox

1 comment

Here is the code on GitHub, if you want it.

Over the last several months, I’ve been working heavily in a brand-new environment (to me): one that is built upon ColdBox and leverages all of the awesome goodies that ColdBox provides in the way of rapidly and easily developing ORM-driven applications. If you spend more than 3 minutes in a ColdBox ORM app, you’ll quickly come to rely upon–and LOVE–ColdBox’s CriteriaBuilder, which lets you easily build intensely complicated HIbernate criteria queries…without the nonsense of string concatenation.

The other day, however, I ran into a bit of a wall. Before I explain the issue, let me give a quick summary of the context.

In my app, I have a good number of concrete services that extend the uber-handy Virtual Entity Services. Since my app is driven largely by an AJAX frontend, there are lots of cases in which I not only want to return a JSON-representation of a result set, but also important meta-data about the result set (e.g., total record count for paging, etc.). Obviously, since I want that bundled into one single response, I have lots of methods that do something like so in one of my concrete services:

function getResults( event, rc, prc More >
ColdBox, CriteriaBuilder, Subquery

Sometimes a Forehead Smack is Warranted

Jun 23rd

Posted by existdissolve in Sencha Touch

1 comment

Over the last several days, I’ve been trying to use Sencha Command to package a Sencha Touch 2 app as a native app. Honestly, for most of the process, everything worked perfectly…until I actually had to package the app. I ran the build command, like so:

sencha app build native

Throughout the build process, everything seemed to be going well, until the minification of the actual app.js file. Here’s the error I received:

[ERROR] Error: Command failed:
[ERROR] 28305:18:missing variable name
[ERROR] 28305:20:syntax error
[ERROR] 28306:25:syntax error
[ERROR] 28318:14:identifier is a reserved word
[ERROR] 28420:21:identifier is a reserved word
[ERROR] 1:0:Compilation produced 5 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 5 syntax errors. at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154) at org.mozilla.javascript.Parser.parse(Parser.java:392) at org.mozilla.javascript.Parser.parse(Parser.java:337) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533) at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)

Pretty helpful, right?

Well, I *finally* figured it out. I emphasize “finally”, as the issue was actually a code error on my part. In my app, I used the word “final” as a variable in one of my controllers. Apparently, this is a reserved word (or something like that), and so the minifier blew up. Changing the variable name resolved all the issues.

So how many hours of frustration was that? I am stupid.

Share More >
Native Packaging, Sencha Command

DragonVale 2.0 Wishlist

Jun 5th

Posted by existdissolve in Cool Stuff

No comments

With the recent updates to DragonVale v1.8, the app has seen some impressive evolution since its inception. The app now has a thriving community, and despite its ridiculous freemium business model, the updates keep coming…so money is being made off of it.

As we get closer to the 2.0 release (not suggesting it’s imminent), I thought I’d share some ideas about what should be done to really take this game to the next level. With dot releases, you don’t expect a revolution…nice touches here, a new feature there, but nothing off the chain. With the release of a whole version, though, it’s a chance to reinvent and make a play for a whole new set of players. So without further introduction, here are some things I’d like to see in the 2.0 release.

More Robust Management Tools

Currently, the app only really allows you to manage your world on an item-by-item basis. There is literally no way to get a “high” view of what’s going on. Version 2.0 needs to fix this. So what does this look like? One idea is global interfaces for managing common “types”–dragons, buildings, farms, etc. It’s tremendously annoying to have to go to each habitat in order More >

Dragonvale

Gloss Updated with ColdFusion 10 Documentation

May 16th

Posted by existdissolve in ColdFusion

No comments

On the heels of yesterdays’s official release of ColdFusion 10, I’ve updated Gloss with support for both ColdFusion 10 AND ColdFusion 9 reference guides.

Enjoy!

Share this:
  • Click to share on Google+ (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Share on Facebook (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
  • More
  • Click to share on StumbleUpon (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
ColdFusion 10, Gloss

ColdFusion Bug? EntityToQuery() and Unknown Data Type

May 2nd

Posted by existdissolve in ColdFusion

No comments

I ran into an interesting issue today. To make a long story a little less uninteresting, I was basically trying to go from an array of ORM entities to an Excel dump of the data in those entities. Obviously, the easiest way to accomplish this is to first convert the array of entities to a query, and then pass the query result set off to the built-in CF Excel manipulation functions.

Easy enough. With one little line of code, you can very simply convert ORM entities to a ColdFusion query…just like so:

// get the orm entities
ormstuff = EntityLoad( "Art" );
// convert the orm goodness to a CF query
anicequery = EntityToQuery( ormstuff );

Cake, right? If I were to hand this query off to CF’s spreadsheet functions, I could easily prepare and export a nice Excel file full of the data I just converted. But of course, nothing is that simple…and that’s where the potential bug announced itself.

A Dark Foreboding

You see, instead of simply dumping all the data for all the columns of the query-which-was-once-an-entity, I wanted to pare down the list of columns that would be output in the Excel export. Since I already had a query handy, More >

Bug, EntityToQuery, ORM

ColdFusion Bug: SerializeJSON() and ORM Entities

Apr 26th

Posted by existdissolve in ColdFusion

No comments

Recently, I’ve been messing around quite a bit with ORM in ColdFusion. I really like the benefits that it brings to developing applications. However, I noticed a very big bug yesterday while attempting to user serializeJSON() on a an entity using a one-to-many relationship.

Some Context

Let’s say that you have two entities that are related via a one-to-many relationship (Artists and Art, for example). You can easily create this relationship in your model by doing something like the following:

property name="art" fieldtype="one-to-many" fkcolumn="artistid" cfc="Art" remotingfetch="true";

If we were to dump the result of an EntityLoad() of “Artists”, we’d see a nice structured relationship: First, an array of all Artist entities, and then an array of all Art entities related to the particular ArtistID. Additionally, I’ve specified remotingfetch=true, which will force CF to load the Art entities for each Artist.

The Bug

The bug, however, comes into play when you try to serialize the result of EntityLoad(). While it properly composes the relationships, it represents the first two entities in the “art” array; any subsequent entities in the given array are returned simply as “{}”.  Whether you have 3 “Art” entities for an artists, or 20, only the first 2 will ever be serialized properly.

See More >

Dump, SerializeJSON

ExtJS 4: Applying Model Validations to Forms

Apr 23rd

Posted by existdissolve in ExtJS

6 comments

One of my absolute favorite things about ExtJS’ data model is how simple it is to apply a Model instance to a form. If you’ve never done this before, consider the following data model:

Ext.define('Validations.model.Person', {
    extend: 'Ext.data.Model',
    fields: [
        {name:"name", type:'string'},
        {name:"age", type:"int"},
        {name:"hobby", type:"string"}
    ]
})

Also, assume we have a form defined like so:

Ext.define('Validations.view.people.Form', {
    extend: 'Ext.form.Panel',
    alias: 'widget.peopleform',
    bodyPadding: 10,
    border: false,
    initComponent: function() {
        var me = this;
        Ext.applyIf(me, {
            defaults: {
                width: 250,
                labelWidth: 70
            },
            items: [
                {
                    xtype: 'textfield',
                    name: 'name',
                    fieldLabel: 'Name'
                },
                {
                    xtype: 'numberfield',
                    name: 'age',
                    fieldLabel: 'Age',
                    value: 20
                },
                {
                    xtype: 'textfield',
                    name: 'hobby',
                    fieldLabel: 'Hobby'
                }
            ]
        });
        me.callParent(arguments);
    }
})

NOTE: Notice that the “name” properties of each form field maps 1:1 with the “name” properties in my Model.

Now, let’s say that we want to edit a Model instance. We could, of course, manually set the value of each form field to that of the corresponding field in the Model. However, this is clunky and unnecessary, given that the form itself has a method for doing this automatically. Consider the following:

// get More >
ExtJS, Model Validations, Sencha

Quick Thoughts on Sencha Architect 2

Apr 21st

Posted by existdissolve in ExtJS

2 comments

A few days ago, Sencha rolled out Sencha Architect 2, the major overhaul and rebranding of what was formerly Sencha Designer. You can check out the release blog post to get the low-down on all the new features.

When I saw the news about the release, I have to say I was a bit hesitant to look much further. I’ve tried Sencha Designer several times in the past, and I’ve been somewhat disappointed with it. Sure, it was great for laying out apps, but when you actually needed to *code*, it was lackluster at best. But even worse, I found it to be very buggy; it would crash at random times, and overall I found the process of trying to mockup an app to be more frustrating than anything else.

So initially, I wasn’t planning on even trying out the newest iteration. But then I noticed that one of the biggest additions to the product is  support for creating a full ExtJS or Touch app–not just the UI. I felt I had to take a closer look, and I’m glad I did.

UI

Out of the box, Architect 2 is worlds better than its previous iterations. The interface is slick and responsive, and the way More >

Architect 2, Sencha

PHP Diversion: Making Nested Arrays from Query Data

Mar 1st

Posted by existdissolve in PHP

7 comments

As if the title doesn’t give away the whole plot, I’m currently working on a project that uses PHP–gasp! No, I’ve not abandoned ColdFusion, and too be completely honest, I’m kind of a PHP noob.

Sure, I can do a fair amount of things in PHP…you know, querying databases, echoing content, that kind of stuff. Where I really get hurt, though, is when things start to get complex.

NOTE: If you don’t particularly feel like reading and just want to see some code, be sure to check out my GitHub repo for this.

Some Context

For example, I recently needed to build out an ExtJS View, and I wanted to have some pretty heavily-nested data. My ideal outcome would print something to the page like so:

Main Group 1
   Category 1
      Name 1
      Name 2
         Fav Color 1
         Fav Color 2
Main Group 2
   Category 1
      Name 1
      Name 2
Main Group 3
   Category 2
      Name 1
   Category 3
      Name 1

And so on. In other words, each step in the “tree” can have multiple children, which can themselves have multiple children, ad infinitum.

Now in ExtJS, creating a View is dead simple. You simply have to pass the View a JSON structure wherein each level is More >

Array, Nested Data

ColdFusion 10 Beta Examples are Live

Feb 25th

Posted by existdissolve in ColdFusion

1 comment

I recently created a free ColdFusion 10 Beta hosting account with Hostek.com. It’s pretty awesome, so you should create one too!

Anyway, with that in place, I’ve uploaded my examples of ArrayEach(), StructEach(), and ArrayFilter(). I’ve also put them out on GitHub, so feel free to take a look if it suits you.

Enjoy!

Share this:
  • Click to share on Google+ (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Share on Facebook (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
  • More
  • Click to share on StumbleUpon (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
ColdFusion 10 Beta
« First...«56789»102030...Last »
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • Adobe (1)
    • Audio (10)
    • Books (8)
    • Chrome (1)
    • ColdFusion (64)
      • ColdBox (13)
        • ContentBox (7)
    • Cool Stuff (42)
    • Ext JS 5 (7)
    • Flex (5)
    • General (28)
    • Into the Box (1)
    • JavaScript (95)
      • AJAX (2)
      • CKEditor (3)
      • ExtJS (59)
        • ExtJS 4.2. App Walkthrough (16)
      • jQuery (1)
      • Sencha Fiddle (3)
      • Sencha Touch (9)
      • Spry Framework (18)
    • Microsoft (8)
    • Mobile (4)
      • Sencha Touch (4)
    • Music (26)
    • Parse.com (1)
    • Philosophy (16)
    • PHP (2)
    • Ruby (6)
    • SharePoint (8)
    • Sitecore (5)
    • Social Media (5)
    • Theology (81)
    • Travel (1)
    • Uncategorized (9)
    • Video Games (4)
    • Web Design (45)
      • CSS3 (3)
      • HTML5 (9)
    • Web Development (12)
    • WordPress (1)
    Adobe AIR AJAX Anthropology API Athanasius Atonement Theology Auto-Tune Blog Action Day CD Review CFScript CFSharePoint Christology CKEditor ColdFusion ColdFusion 9 ContentBox CSS Eschatology ExtJS ExtJS 4 Facebook Forgiveness General HTML HTML5 Javascript Koans Linguistics Music Origins ORM Probability Ruby Sencha Sencha Touch SharePoint Sitecore Spry Spry Framework theming Theology Web 2.0 Web Design WordPress
    • September 2017 (1)
    • May 2015 (1)
    • January 2015 (1)
    • November 2014 (2)
    • September 2014 (2)
    • August 2014 (3)
    • May 2014 (1)
    • March 2014 (1)
    • February 2014 (2)
    • January 2014 (2)
    • December 2013 (2)
    • October 2013 (1)
    • August 2013 (2)
    • July 2013 (5)
    • June 2013 (7)
    • May 2013 (11)
    • March 2013 (1)
    • January 2013 (6)
    • December 2012 (2)
    • November 2012 (4)
    • September 2012 (2)
    • August 2012 (2)
    • June 2012 (2)
    • May 2012 (2)
    • April 2012 (3)
    • March 2012 (1)
    • February 2012 (6)
    • January 2012 (10)
    • November 2011 (2)
    • October 2011 (1)
    • September 2011 (5)
    • August 2011 (11)
    • July 2011 (3)
    • June 2011 (1)
    • May 2011 (4)
    • April 2011 (4)
    • March 2011 (4)
    • February 2011 (4)
    • January 2011 (3)
    • December 2010 (7)
    • November 2010 (10)
    • October 2010 (9)
    • September 2010 (8)
    • August 2010 (19)
    • July 2010 (16)
    • June 2010 (17)
    • May 2010 (7)
    • April 2010 (3)
    • March 2010 (4)
    • February 2010 (3)
    • January 2010 (7)
    • December 2009 (2)
    • November 2009 (4)
    • October 2009 (8)
    • September 2009 (3)
    • August 2009 (3)
    • July 2009 (1)
    • May 2009 (5)
    • April 2009 (2)
    • March 2009 (1)
    • February 2009 (1)
    • January 2009 (1)
    • December 2008 (3)
    • November 2008 (3)
    • October 2008 (4)
    • September 2008 (2)
    • August 2008 (5)
    • July 2008 (6)
    • June 2008 (6)
    • May 2008 (13)
    • April 2008 (4)
    • March 2008 (11)
    • February 2008 (3)
    • January 2008 (5)
    • December 2007 (5)
    • November 2007 (2)
    • October 2007 (10)
    • September 2007 (10)
    • August 2007 (9)
    • July 2007 (8)
    • June 2007 (28)
    • May 2007 (2)
    • April 2007 (2)
    • March 2007 (2)
    • January 2007 (2)
    • December 2006 (2)
    • August 2006 (2)
    • July 2006 (3)
    • June 2006 (4)
    • May 2006 (3)
    • April 2006 (4)
    • March 2006 (3)
    • February 2006 (4)
    • Dragonvale Tips and Tricks (60)
    • A Study Bible to End All Study Bibles (42)
    • ExtJS 4.2 Walkthrough — Part 4: Steppin’ in Some CRUD (33)
    • A Little Taste of Spry 1.6 Goodness (22)
    • The Closing of the Evangelical Mind (21)
    • Where No Man Has Gone Before (19)
    • ExtJS 4.2 Walkthrough – Part 3: Under Control(ler) (19)
    • Thoughts on Christian Ecumenism (17)
    • ExtJS 4.2 Walkthrough — Part 11: Executive Dashboard (17)
    • Sencha Touch Theming: Building Our Custom Stylesheet with SASS (15)
    • Uga: Proverbs 17:15 He that justifieth the wicked, and he that condemneth the just, even they both are...
    • existdissolve: You should be able to find it here: https://forgebox.io/view/jsFiddle
    • Terry Riegel: Hello, Do you have a demo?
    • existdissolve: I enjoy cake. Please send it to me.
    • existdissolve: Your request for permission to my RSS feed has been denied.
    • Lipstick Queen: Just want to say your article is as astounding. The clarity to your post is just cool and that i...
    • sahib: Hey So where can i find that checkLogin Method? i mean in what file. i am trying to implement a...
    • Niall O'Brien: Have the routing issues you mention improved with the latest version of ExtJS?
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.