Galleon Forum Ports Comparisons

Client Customization Requests

back

Client customization requests are an important issue because of their significant negative impact on companies' finances and ability to work on continued development of their core products. Here are some examples of how client customizations can be accomodated quickly and easily using the onTap framework's HTML library.

Here's an example:

/_components/store/_local/100_store.cfm
<cf_html return="tap.view.mainmenu">
	<div id="mainmenu" xmlns:tap="xml.tapogee.com">
		<a tap:variable="links.home" href="index.cfm">Home</a>
		<a tap:variable="links.product" href="products.cfm">Products</a>
		<a tap:variable="links.about" href="about.cfm">Company</a>
		<a tap:variable="links.contact" href="contact.cfm">Contact Us</a>
	</div>
</cf_html>

After this tag executes you would have a couple of new variables - the tap.view.mainmenu variable, a structure containing meta-data for the entire menu, and a structure called "links" containing the metadata for each of the links in the menu. This isn't the most powerful example in part because this isn't the best use for the tap:variable. But let's say hypothetically that you had a client who wanted to change this menu to include a pipe or a bullet between all the links. Some day maybe there will be CSS to do that, but for now there's not. But now that you have this menu, you can add bullets between all the items in the menu like this:

/_components/_brand/widgetworld/store/_local/100_custom.cfm
<cfset request.tapi.html.event(tap.view.mainmenu,"childdelimiter","&bull;") />

What's special about this is that it can be done after the fact, without any complicated regular expressions. Which means that if you place this one line of code in the client customization directory (shown here), it will customize the view for that client quickly, seamlessly, safely, and separately from your application and all the other clients.

Or maybe they wanted to add a search form to the menu.

/_components/_brand/widgetworld/store/_local/100_custom.cfm
<cf_html parent="#tap.view.mainmenu#">
	<form action="search.cfm" tap:variable="tap.view.searchform" 
	xmlns:tap="xml.tapogee.com">
		<input type="text" name="search" />
		<input type="image" src="go.gif" />
	</form>
</cf_html>

Again -- this is inserted into the menu after the fact. No complicated regular expressions or string manipulation of any kind. Safe, seamless and separate.

Stay with me for a moment while I dig a little deeper. Let's say we've got a site that needs to be translated into a couple of different languages. Well the HTML library does most of this work for you actually. The first line in the following example gets localized strings for the menu in the current language from the directory /_components/_includes/mainmenu/ and stores them for use later in the request. The cf_html tag doesn't actually do anything with them - it's not until the HTML view is later rendered for display (much like an implicit-invocation architecture) that the content of these links is swapped out for the values shown in the resource bundle.

/_components/store/_local/100_store.cfm
<cf_translate file="/inc/mainmenu" /> 

<cf_html return="tap.view.mainmenu">
	<div id="mainmenu">
		<a tap:variable="links.home" href="index.cfm">%link_home</a>
		<a tap:variable="links.product" href="products.cfm">%link_product</a>
		<a tap:variable="links.about" href="about.cfm">%link_company</a>
		<a tap:variable="links.contact" href="contact.cfm">%link_contact</a>
	</div>
</cf_html>
/_components/_includes/mainmenu/en.rb (English text)
%link_home=Home
%link_product=Products
%link_about=Company
%link_contact=Contact Us

So if you have a client who wants to change the label of the Home link, this line of code will do that for them, again no regular expressions, no complicated string manipulation - it's safe, clean and separate.

/_components/_brand/widgetworld/store/_local/100_custom.cfm
<cfset request.tapi.ls("%link_home","Headquarters") />

Speaking of resource bundles, you might also want to check out Jason Sheedy's RBMan2 project for editing resource bundles using a Flex application.

Now lets say you've noticed that there's a lot of repetition in this menu (there are better examples, but I already wrote this one). ;) And you want to reduce some of the code by automating the repetitive aspects of it. You could use a cfloop and be done with it. Or if you wanted to keep your HTML template separate (or if you wanted to find a way to reuse the convention), you could create an XSL template to transform your HTML using a convention of your choosing to turn the above example into this:

<cf_translate file="/inc/mainmenu" /> 

<cf_html return="tap.view.mainmenu">
	<div id="mainmenu">
		<a>home</a>
		<a>product</a>
		<a>about</a>
		<a>contact</a>
	</div>
</cf_html>

back