ColdFusion (5)  /  ColdFusion Jobs (2)  /  General (4)  /  JQuery (6)  / 
Search Blog

 

Archives
RSS

 

Adobe Community Expert in ColdFusion

 

Adobe Ceritfied Instructor

 

CTT+ Certified Technical Trainer

Hosted By:

Alurium Hosting

Powered by BlogCFM v1.14

30 July 2010

My first "official" JQuery Plugin

jquery.alaxPost.js
I have written my first JQuery plugin, it basically ties up the code that I've blogged about before into a plugin wrapper. You can download it here: http://www.sstwebworks.com/apps/jquery.ajaxPost.js feel free to use it under the GNU Lesser General Public License.

 

I've also created a ColdFusion custom tag with this code and it's here CF_AjaxPost at RIAForge
Share |
Posted by admin at 11:56 AM| Link  |  0 comments |

 

28 July 2010

New Web Host

goodbye Daily Razor
I've switched hosting providers.. I was done with Daily Razor, for two reasons:
  1. The mysterious price increase from $10.00 to $32.95/month without so much as an email
  2. Their Draconian sandboxing, while not as restrictive as GoDaddy, I was still prevented from getting basic things in the blog to work as expected.
So I packed up my virtual bags and moved to Alurium. The price can't be beat ($6.75 a month) and I can pretty much do what I want because the sandboxing is set up correctly.

and.. It runs on Railo
Share |
Posted by admin at 6:03 AM| Link  |  0 comments |

 

18 June 2010

Complex Queries in ColdFusion ORM

compound wheres and aggregate functions

 

I was asked a question by one of my students in the Advanced ColdFusion 9 class, the other day.
"How does ColdFusion ORM handle things like compound where clauses and aggregate functions".

We need to start out by defining what each is:

A"compound where clause" is a where clause with multiple elements

SELECT *
FROM tbl_table
WHERE (a=b) and (c=d) orx=y
In this case a=b and c=d must be true, otherwise x=y.

An aggregate function is a calculation that is made on several records or cells of data. SUM, AVG, MAX, MIN and COUNT are examples of aggregate functions that are used in spreadsheets and database programs.

A where clause with an "and" is done pretty easily:

<cfset orderDetail = EntityLoad('orderdetails', {OrderID=100,
ProductID=1}, true)>
where orderdetails is the "table" (a mapped persistant CFC) and the "where" clause is {OrderID=100, ProductID=1}.

If we need to do anything more complex than this then we need to use Hibernate's HQL query language.

from Adobe "ColdFusion lets you use HQL (Hibernate Query Language) to run queries directly on the database. If you are familiar with HQL, you can use it for running complex queries.

In general, use HQL in the following scenarios:

  • The query is not specific to a particular object but only to some fields in the object.
  • To retrieve some fields of the object without loading the object.
  • When you use table joins.
  • When you use aggregate functions like min, max, avg, and count.
  • To retrieve entities by specifying a filter that needs to use operators other than AND."

So how do we begin applying HQL?

ColdFusion ORM has abstracted HQL Calls into: ORMExecuteQuery() with the following syntactical possibiltites:

  • ORMExecuteQuery(hql, [params] [,unique])
  • ORMExecuteQuery(hql, [,unique] [, queryoptions])
  • ORMExecuteQuery(hql, params [,unique] [,queryOptions])
  • ORMExecuteQuery (hql, params, boolean unique, Map queryOptions)
  • ORMExecuteQuery(hql, [,unique] [, queryoptions])

for a compound where it would look something like this

<cfset filterTable = ORMExecuteQuery("from ARTIST where a
= b and c = d or x = ?", [40])>
In this example the question mark represents a dynamic value, 40 is that value passed in as a one dimentional array it could easily be
[#form.value#]. If we were to pass in multiple values they would be evaluated and assigned in order.  

In the case of aggregate functions HQL supports the following:

  • avg(...)
  • sum(...)
  •  min(...)
  • max(...)
  • count(*)
  • count(...)
  • count(distinct ...)
  • count(all...)

These would be applied in the same manner as the compound where

<cfset aggTable = ORMExecuteQuery( "SELECT COUNT(*)
FROM tbl_table", {tblID=1})>
So in a nutshell, for complex SQL use HQL
Share |
Posted by admin at 12:11 PM| Link  |  0 comments |

 

25 May 2010

NCDevCon Presentation

Link to the PPT
I've posted my NCDevCon presentation to SlideSix, you can view it here: http://slidesix.com/view/Hands-on-ColdFusion-Unit-2
Share |
Posted by admin at 7:50 AM| Link  |  0 comments |

 

05 May 2010

Speaking at NCDevCon

Part of the Hands On ColdFusion 101 series

I will be speaking at NCDevCon, the weekend of May 22, at the NC State College of Textiles on the main campus of NC State in Raleigh, NC.

I will be conducting a two hour long hands on session, covering ColdFusion Database integration, manipulation and outputting.

And just for fun I'll throw in some Ajax-y goodness.

Details are here: http://www.ncdevcon.com...

and by the way.. this conference is FREE, as in zero cheap, nada, nothing, just register..

Share |
Posted by admin at 2:08 PM| Link  |  0 comments |

 

04 April 2010

A quick note to potential spammers

I won't make it easy

A note to potential spammers, you've probably noticed that your comment spam isn't showing up on this blog.

ALL comments require my approval before they're posted, obviously I'm not going to approve your viagra or porn postings..or your World of Warcraft hacks/sites/add ons. So do me a favor, just don't bother.

On another note, if you've subsribed to this blog and your email address and/or website look suspect I will delete your subscription.

This is a technical blog, read by an audience that's a little more computer savvy than what you're probably used to from your *ahem* "customer base", so the chances of you making a sale from spam are slim and none.

Lastly I do monitor IP addresses, so I can find you, and if you did make a sale from spamming my site, you owe me money, oh say 95% as a fee for using my site for your sale.. i will make every attempt to collect..

Share |
Posted by admin at 7:01 PM| Link  |  0 comments |

 

21 March 2010

cfajaxproxy and JQuery

The agnostic nature of cfajaxproxy
Untitled Document

The agnostic nature of cfajaxproxy.

I always thought that cfajaxproxy was inexorably tied to the Ajax functions built into ColdFusion.. I recently found out that
I was wrong.

CFAjaxproxy is used to create a javascript proxy of a ColdFusion Component (cfc) for use in the web client. This means any javascript,
not just ColdFusion based AJAX components.

Lets take the AJAX post code from my last post and see how it would work with cfajaxproxy.

This is the original code: It's calling action pages to execute ColdFusion components.


$("#getTOByWeek").live("click", function(){
   $.ajax({
         type:"post",
         url:"webapps/hr/admin/actions/act_adminHR_Handler.cfm",
        data:$("#toByWeek").serialize(),
        cache:"false",
        success: function(){
            $("#content-box").load("webapps/hr/admin/display/dsp_TOList.cfm");
        },
       error: function(){
           alert("data");
       }
   });
   return false;
});

If I use cfajaxproxy it would look something like this, to achieve the same functionality

<cfajaxproxy cfc = "CFC name" jsclassname = "JavaScript proxy class name">

The CFC property instantiates the entire component, using dot notation (com.foo.bar.component), jsclassname is the name that is given to the function
inside javascript:

<cfajaxproxy cfc="hr.cfc.hr_dao" jsclassname="hr_dao">

This gives me a javascript representation of my hr_dao.cfc that can be used in any javascript case.
//instantiate the ColdFusion Function
<cfajaxproxy cfc="hr.cfc.hr_dao" jsclassname="hr_dao">

//capture the click event
<script>
$("#getTOByWeek").click(function(objEvent){
         //call the ColdFusion method directly

         hr_dao.getTimeOffStatus(objEvent);
        //trigger the success function based on return
       return false;
      });
<script>

Share |
Posted by admin at 5:50 PM| Link  |  0 comments |

 

09 March 2010

Posting this for a friend

not a CF Position... LAMP, Drupal
Job Title: Principle Software Engineer

Job Description

Candidate should have more than eight years of professional and software design and development experience. The candidate should also have extensive experience in designing the architecture and managing future enhancements for an enterprise wide web based solution in the federal arena. Further, the candidate should have proven track record of proposing system innovations and advancement in order to keep up with the new technology.

Functional Responsibilities:

  • Propose innovative design or alternative solutions to meet the technical requirements while ensuring that the solution remains flexible and extensible.
  • Prepare and maintain architectural diagram and supporting documentation.
  • Design and maintain data model for the solution and assist in populating the data dictionary.
  • Provide oversight on the development and maintenance activities across the complete Software Development Life Cycle.
  • Conduct code review to ensure the appropriate coding convention is followed and the code is optimized for performance.
  • Provide technical guidance to junior developers
  • Contribute in the development knowledge base.
  • Participate and contribute in process improvement activities at the project and corporate level.
  • Mentor and train software Engineers on best practices.
  • Assist in recruitment, mentoring team members and other back office functions
  • Evaluate, prototype and incorporate new technologies to improve development platform
Minimum/General Experience:
  • A minimum of five years of in LAMP architecture
  • Strong analytical skills and demonstrated success working in a team-based environment
  • Experience in Drupal is required
  • Experience in database design and SQL is required
  • Must be able to independently design solution architecture to meet requirements
  • Experience in development high volume internet application is a plus
  • Experience in cloud solution and Web 2.0 solutions is desired
Minimum Education:
  • A bachelor's degree in computer science, information systems, physics, engineering, math or related field is required.

Jared Hayes

Recruiting Manager, Public Sector
| RCM Technologies || 1445 Research Blvd., Suite 120, Rockville, MD 20850 |
| Office: 301-354-8035|| Mobile: 240-286-1013 || Facsimile: 301-354-8036|
| jared.hayes@rcmt.com || www.rcmt.com |

Share |
Posted by admin at 10:09 AM| Link  |  0 comments |

 

Short Term CF Gig in Atlanta

3-4 Weeks in Atlanta

I received this the other day, I have a full time gig, but if you're looking contact Nathan directly.

"I am seeking a ColdFusion Consultant for my client in Atlanta. 3 to 4 week assignment implementing CF and migrating several applications over. Caveat is that the resource have a background in clinical research and/or public health and/or healthcare. Does this sound like you or someone you know?

Feel free to call me at c) 404.502.8487 to discuss further.

Best regards,

Nathan O'Neill
Synergis, Account Executive
w) 770.346.7231"

Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

04 March 2010

Updates

Times they are a changin'

It's been a while since I've posted anything, but that's actually been a good thing.. I've take a bit of a career turn, as of the 17th of February I am a Senior Software Instructor / Developer with Figleaf Software in Washngton DC. I wll be teaching sessions on Adobe products across the spectrum.

I'm in the process of getting all of my teaching certifications. I can report however that I am now an Adobe Certified Expert in ColdFusion. I have many more certification exams to take, including Dreamweaver, Flex and Contribute.

This is an amazing opportunity to work for one of the most prestigious Adobe development / training houses in the country if not the world.

Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

22 February 2010

JQuery Nuts and Bolts

The "Ajax Post"

This entry is about the "Ajax Post", sending data to a form action and returning results to a receiving div. I want to throw out big mad props to John Arrowwood from the JQuery List for parameterizing and wrapping my code in a function.

What this piece does is take form data from a named form, post it to an action page which can point to (or contain business logic), and then display a sucess page in a desgnated div.

The form exists within a global div called 'content-box'.

The original code:

$("#getTOByWeek").live("click", function(){
$.ajax({
type:"post",
url:"webapps/hr/admin/actions/act_adminHR_Handler.cfm",
data:$("#toByWeek").serialize(),
cache:"false",
success: function(){
$("#content-box").load("webapps/hr/admin/display/dsp_TOList.cfm");
},
error: function(){
alert("data");
}
});
return false;
});


#getTOByWeek is the button that triggers the post., act_adminHR_Handler.cfm is the called action which in this case invokes a ColdFusion component which contains the business logic.. The form data is contained in #toByWeek and is serialized in the post.

When you look at the sucess function it loads dsp_TOList.cfm in #content-box,. Dsp_TOList.cfm, contains a generated table based on a query who's results are modified by the business logic invoked by the action template.

What I was running into, being a JQuery noob at the time was that I had working code but it wasn't parameterized or reusable, a brief post to the JQuery list brought the following:

(function($){
var defaults = {
button: '#buttonId',
form: '#formId',
target: '#targetId',
url: '/change/me',
page: '/change/me/too',
};
clickToLoad = function( options ) {
var o = $.extend({},defaults,options);
$(o.button).live('click',function(){
$.ajax({
type: 'post',
url: o.url,
data: $(o.form).serialize(),
cache: false,
success: function(){$(o.target).load(o.page)},
error: function(){alert('data');},
 });
return false;
});
})(jQuery);
and it's called this way
clickToLoad({
button: '#theButton',
form: '#theForm',
target: '#theDiv',
url: '/path/to/data/handler',
page: '/page/to/load',
});
This gives you a reusable Ajax form handler..
Share |
Posted by admin at 10:19 PM| Link  |  0 comments |

 

01 February 2010

JQuery Nuts and Bolts

a quick entry, the loader graphic
The infamous spinner as done by JQuery:

Create a div that contains the image that you want to use as a "loader" image.

<div id="loader">
<img alt="" src="path/to_graphic" />
</div>

It just takes a small piece of Javascript (JQuery) to make the magic happen

$('#loader').hide() //this initially hides the div
.ajaxStart(function(){
$(this).show(); // show the div when the Ajax call starts
)}
.ajaxStop(function(){
$(this).hide(); //hide the div when the Ajax call stops
)};
Place the loader div within the div that's receiving the results of the ajax call, and JQuery code with the rest of your JQuery code and you have a quick and dirty loader
Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

Addressing the death of ColdFusion

yet again...sigh

Terry  Ryan posted a link to a StackOverflow thread asking about the merits of ColdFusion… while the thread itself is closed, I’m going to post my own commentary here.

Many fellow CF devs came out in support of the product, which we should. What surprised me was the incredible lack of knowledge on the part of the naysayers. One in particular, a humorless little Frenchman named Pascal Thivent…

Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

29 January 2010

JQuery Nuts and Bolts: Part 1

What is Jquery Anyways

For the one or two of you that don't know what JQuery is....

from JQuery.com:
"jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript."

and it does...

How does it do the voodoo that it does so well?
In the 30,000 ft. view, JQuery converts the entire rendered HTML document to Javascript, which gives it access to the DOM and events.. Now that you know that, store it in the back of your mind somewhere, because the only time you'll need it is if someone asks you, "How does JQuery work?".

There are a few things that you do need to be concerned with in order to implement JQuery, whether you're using ColdFusion or not.

Concept 1. when does the magic happen
JQuery handles things differently than Javascript traditonaly does, under normal circumstances you'd wrap up your Javascript in a window.onLoad() event, and wait until the page rendered, before anything happens.

JQuery circumvents this with the ready event. this checks the document and starts once it is ready to be manipulated. it looks like this:


$(document).ready(function(){
  // Your code here
});

Concept 2: selectors
a selector can be a tag ("a") or an id (id="foo"). We'll build on the existing code

$(document).ready(function(){
  $("a").click(function() {
   alert("Hello world!");
  });
});

In this case we're using the tag "a" we could've just as easily used an ID

$(document).ready(function(){
  $("#IDName").click(function() {
   alert("Hello world!");
  });
});

 

If you''ve not used JQuery before, here's the place to start:
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery

Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

27 January 2010

I am currently seeking new opportunities

I am currently seeking new ColdFusion development opportunities,eitherfull time or telecommuting in the Raleigh/Durham/RTP area or in the Washington DC Metro area.

I have over ten years of experience from v. 3.1 through 9.0.

 Summary of expertise:

ColdFusion:

  • Components
  • Functions
  • Basic OO development
  • Fusebox, FuseQ
  • cfscript

Databases:

  • MSSQLServer versions 7 through 2005, including stored procedures and some administration
  • Sybase, queries
  • Oracle, querie
  •  MySQL, queries, stored procedures, importation from other formats

Scripting:

  • Javascript,
  • JQuery,
  • JQuery UI Libraries,
  • HTML CSS
  • ASP 2.0

 I am willing to relocate to the DC Metro Area for the right opportunity.  My resume is here http://www.sstwebworks.com/docs/scott_stewart_current_resume.doc

Salary requirements and other details available upon request

Share |
Posted by admin at 12:00 AM| Link  |  0 comments |

 

 

© 2010 Scott Stewart / SSTWebworks
Design by Contented Designs