Jake Churchill

… on Flex, ColdFusion, FarCry, and much more …

  • Home
  • About
  • Projects

19

Mar

dmFlash Technique

Posted by Jake Churchill  Published in Farcry

I’ve had some requests that I blog a dmFlash technique that I use in both version 3 and verion 4 of Farcry. This sounds much more glamourous than it actually is. I really just use a container with a handpicked rule but here are the details you will need to use this for yourself:


continue reading "dmFlash Technique"

1 comment

17

Mar

Custom contentObjectGet Widget

Posted by Jake Churchill  Published in Farcry

Something about Farcry has bothered me for a while. It is difficult to link to content programatically, especially if you have a navigation node with multiple content items under it. For example, I have an application that I was writing which contained a calendar and a registration piece. Each was a separate dmInclude under the same dmNavigation node. So, how do I create a “Register Now” button from the calendar to the registration piece programmatically? Sure, I could hard-code the objectID but that just wasn’t cutting it for this. Sure, it would work, but would be easily broken. If the registration piece was ever deleted and re-created, there would be a new UUID for it and the user would not be able to recover the functionality without editing code or the database record. So, I came up with a better solution…


continue reading "Custom contentObjectGet Widget"

no comment

13

Mar

MS SQL IF EXISTS Technique

Posted by Jake Churchill  Published in SQL

I’ll be the first to admit that I’m not the greatest when it comes to database design, optimization, even query code when it comes right down to it. Sure, I can do the standard CRUD things withough a problem but really digging into a database is not my cup of tea. So, when I came up with something actually usable, I had to post it :) So, on with the shameless self-promotion…

So, I am using an IF EXISTS … ELSE block for an INSERT/UPDATE query and was having an issue with the message handler. Yeah, I could have added some additional ColdFusion logic, but who wants to do that??? I thought, It’d be really great if the query would give me back the results of what action was actually taken. So, Here’s the original query:

<cfquery name="addUpdate" datasource="#application.CaseInfoDsn#">
	IF EXISTS (		SELECT 	AreaCode
					FROM 	area_codes
					WHERE 	AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.originalAreaCode#">
			  		OR		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.AreaCode#">	)
		BEGIN
			UPDATE 	area_codes
			SET		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.AreaCode)#">,
					State_Region = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.State_Region)#">,
					Description = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.Description)#">
			WHERE 	AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.originalAreaCode#">
			OR		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.AreaCode#">

		END
	ELSE
		BEGIN
			INSERT
			INTO 	area_codes
					(
						AreaCode,
						State_Region,
						Description
					)
			VALUES
					(
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.AreaCode)#">,
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.State_Region)#">,
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.Description)#">
					)

		END
</cfquery>

And Here’s my addition:

<cfquery name="addUpdate" datasource="#application.CaseInfoDsn#">
	IF EXISTS (		SELECT 	AreaCode
					FROM 	area_codes
					WHERE 	AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.originalAreaCode#">
			  		OR		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.AreaCode#">	)
		BEGIN
			UPDATE 	area_codes
			SET		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.AreaCode)#">,
					State_Region = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.State_Region)#">,
					Description = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.Description)#">
			WHERE 	AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.originalAreaCode#">
			OR		AreaCode = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.AreaCode#">

			SELECT	TOP 1 'upd' AS actionTaken
			FROM	area_codes
		END
	ELSE
		BEGIN
			INSERT
			INTO 	area_codes
					(
						AreaCode,
						State_Region,
						Description
					)
			VALUES
					(
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.AreaCode)#">,
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.State_Region)#">,
						<cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(form.Description)#">
					)

			SELECT	TOP 1 'ins' AS actionTaken
			FROM	area_codes
		END
</cfquery>

After each action (Insert or Update) I select a random string with a random alias which I can then use for my message handler. Hopefully someone else out there thinks this is cool because I sure do :)

2 comments

29

Feb

Big Burger

Posted by Jake Churchill  Published in Random Posts

I don’t know why but the voices inside my head that are supposed to tell me when to stop have stopped talking. Now there’s nothing to stop me from going overboard.

To illustrate this point, I give you exhibit A. Exhibit A is a photograph from a recent fast food outing at Fuddruckers (that’s a burger joint if you don’t know). They offer the normal burgers but also have buffalo burgers and ostrich burgers. They also have burgers going up to a massive one pound!

Yes, your initial thought is correct. I had a one pound burger. Not only that but I had an order of fries and a huge soda along with it.

One Pound Cheeseburger: $8.00
Order of Fries: $3.00
Large Soda: $2.00
12 hours of regret: PRICELESS!

Just to give you an illustration of how big this burger was… The bun was not a normal bun, it was a small loaf of bread. It took 4 slices of cheese to cover it and 2 large pieces of lettuce.

Big Burger

no comment

27

Feb

CFEclipse (no need to fear)

Posted by Jake Churchill  Published in CFEclipse

A lot of people that I work with are stuck on Dreamweaver and Homesite for developing ColdFusion. I can understand that since I started out using Homesite. But, it always bugged me that they were not developing updates for it and I always like the biggest and the best.

I don’t like Dreamweaver because I feel like it is too bloated for coding. It’s a great tool for design but I tend to like my editors kept pretty simple when I am coding. That’s a topic for another post. Wait, Mark Kruger beat me to it (Read Here).


continue reading "CFEclipse (no need to fear)"

2 comments

13

Feb

CSS Rounded Corners

Posted by Jake Churchill  Published in CSS

One thing that I’ve learned a lot about in the last year and a half is CSS. Along with any other language, there is not one right way to do things in CSS. But, there’s usually one way that will make your life in the future much easier. The trick is finding it…


continue reading "CSS Rounded Corners"

no comment

5

Feb

Farcry Typeadmin pagination trick

Posted by Jake Churchill  Published in Farcry

I was searching through typeadmin for something unrelated to this post and found something interesting that I thought I’d share.

It often annoys me that there are only 15 items displayed per page. Show me a site that’s been live for more than a month and I’ll show you an image library with WAY more than 15 items. Usually there are more than 15 pages.

Typeadmin takes a couple of attributes that I was not aware of until today (numitems and numPageDisplay). Here are their defaults:


continue reading "Farcry Typeadmin pagination trick"

no comment

5

Feb

Delete Core Webtop Links

Posted by Jake Churchill  Published in Farcry

I ran into a situation where I wanted to re-order an entire spot of the webtop. So, how do you do that. I know how to extend the webtop using customadmin.xml, can you get rid of things the same way?

The answer is yes, using the “mergetype” attribute. Here’s how…


continue reading "Delete Core Webtop Links"

no comment

1

Feb

Farcry Containers – Not Just For News

Posted by Jake Churchill  Published in Farcry

I’m sure many people, like me, have taken the short-sighted approach when it comes to pages and containers. Let me just say that the Handpicked Rule is definitely the almighty divine rule as far as I’m concerned.

I have had customers who want a contact form. Simple enough, right? Well, what if they want to add text at the top of the form and want control over it. A CMS should be able to handle that right? I actually went to the extreme of extending the dmHTML type and creating a custom webskin to allow the user to drop in an included object below their dmHTML content. That was a good 4 hours wasted!


continue reading "Farcry Containers – Not Just For News"

no comment

1

Feb

Learning Farcry – Ongoing Support

Posted by Jake Churchill  Published in Farcry, Farcry Users

I am in charge of training nearly all of our clients on Farcry once a site is ready for them to begin adding/editing content. At first this can be a very large obstacle for many people because they are simply not used to thinking about certain things. Before Farcry they simply called their web/IT staff and requested a change. The next thing they new, the change was there…like magic.

One of my biggest obstacles is getting people to THINK like a developer. No, they don’t need to understand coding practices but they DO need to think about layouts, templates, libraries, trees, etc. They need to begin to grasp the site as a whole in order to manage it and the relationships that exist within it.

Even months after a site that I’ve developed goes live, I get questions like “How do I change the order of my nav?” or “How do I change the images on a page?” I am more than happy to help anyone whenever they need it. However, I am a STRONG believer in the idea that struggles result in learning. If you are forced to struggle with something, you are more likely to retain the information so you don’t have to struggle with it again.

So, while I am not going to stop answering questions and helping people when necessary, I AM going to strongly recommend that end users of Farcry join a mailing list that was created specifically for them. It is the Farcry-User group on Google and I believe it is severely under-utilized and has a very high potential for not only promoting Farcry but developing skills of those who use it on a day-to-day basis. I have subscribed to the group to be able to answer any questions that people have. I strongly recommend that anyone using Farcry join the group. I also recommend that anyone developing in Farcry push their users in the same direction.

Here is a link: http://groups.google.com/group/farcry-user

2 comments

Search

Blog Feed

  • Add blog to any reader
  • Comments Rss
February 2012
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
272829  

 

February 2012
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
272829  

Subscribe to Blog

Your email:

Subscribe   Unsubscribe

Archives

Categories

  • Browsers (3)
  • CFEclipse (2)
  • ColdFusion (7)
  • CSS (9)
  • Farcry (33)
    • Farcry Examples (2)
    • Farcry Users (1)
  • Flash (1)
  • Flex (14)
  • Javascript (5)
  • Life & Fun (3)
  • Microsoft Office (1)
  • Misc (4)
  • Random Posts (1)
  • SQL (2)
  • Uncategorized (2)

Blogroll

  • Axel Jensen
  • Ben Forta
  • Coldfusion Muse
  • Fullasagoog
  • Nicole Rutter
  • Ray Camden
  • Sandy Clark
  • Stillnet Studios

Recent Posts

  • FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • ColdFusion using Java for regex replace
  • ColdFusion VirtualMerchant CFC
  • Farcry Navigation Move Permissions
  • Delete Mail via POP Script

Recent Comments

  • James Moberg on FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • Jake Churchill on ColdFusion using Java for regex replace
  • Ben Nadel on ColdFusion using Java for regex replace
  • Peter Boughton on ColdFusion using Java for regex replace
  • Peter Boughton on ColdFusion using Java for regex replace

Recent Post

  • FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • ColdFusion using Java for regex replace
  • ColdFusion VirtualMerchant CFC
  • Farcry Navigation Move Permissions
  • Delete Mail via POP Script
  • Flex 2 Datagrid not highlighting row (UPDATE)
  • Flex 2 Datagrid not highlighting row
  • Flex Dynamic casting of data
  • Reboot XP PC over Remote Desktop
  • Dynamically instantiate a class

Recent Comments

  • James Moberg in FCKEditor Firefox 3.6 Bug (Year 2010 Bug)
  • Jake Churchill in ColdFusion using Java for regex replace
  • Ben Nadel in ColdFusion using Java for regex replace
  • Peter Boughton in ColdFusion using Java for regex replace
  • Peter Boughton in ColdFusion using Java for regex replace
  • Matthew in ColdFusion using Java for regex replace
  • Matthew in ColdFusion using Java for regex replace
  • Jake Churchill in Flex Channel.Connect.Failed error NetConnection.Ca…
  • Flex Guy in Flex Channel.Connect.Failed error NetConnection.Ca…
  • Dexter in Flex Custom Preloader without SWF
© 2008 Jake Churchill is proudly powered by WordPress
Theme designed by Roam2Rome