HOME     WEB DESIGN     WEB DEVELOPMENT     PORTFOLIO     ABOUT JS     CONTACT     BLOG
 

It's Blog...It's Blog...
...it's big, it's heavy, it's "good". For all of you who remember the Ren and Stimpy days, that was probably a flashback. For everyone else, sit back and enjoy our blog from the wide world of web development and design.


Justice Solutions LLC Blog
28 February 2008
Doug
Taming the Cat...Tomcat and Coldfusion 8
It is possible without JBOSS



Ok, this week on Thursday Tips Day, I have a rather unique situation I was working on for a client.  The issue:  To get Tomcat 6 working on a Windows 2003 server running IIS and have ColdFusion 8 running on the Tomcat install.

This is not as easy as it would seem.  According to the Adobe ColdFusion 8 site (www.adobe.com/coldfusion) Tomcat is not directly supported as is was in the past.  The only mention of Tomcat in any of the installation documentation is only in a JBOSS type instance.  So here's the first question...why would someone want to do this?

The client's decision is actually a very good one.  Those of us familiar with ColdFusion over the years would agree that JRun is not the best Java server around.  In fact it sometimes causes more harm than good.  And in some unique situations it really ends up crashing the server and causing all kinds of Coldfusion errors when it gets too bogged down.  Now in CF8's Enterprise Edition, the server monitoring tools are very good in letting you know what is causing the overloads.  Sometimes it's your own code doing it.  Sometimes it's not.  However for those of us not willing to spend the $4,000+ to purchase a copy of Enterprise Edition, we're back to the same page as always.

Anyway, by choosing a Java server such as Tomcat, which has plenty of public support and has been running Java apps for quite some time very reliably on both Linux and Windows platforms (and even a Macintosh here and there I've seen), the client will be able to run their JSP apps, plus leverage Tomcat's excellence in running CF8's Java based programming technology.  Therefore a very lean and mean system and as the client puts it, "a smaller footprint" on their server.

The Installation Sequence

Ok, so to start, go ahead and download the latest version of Tomcat (http://tomcat.apache.org/download-60.cgi) and install it on your Windows2003 Server.  You can do the direct services install or the longer more in depth binary install, but both work just fine.  After the installation is complete.  You should easily be able to browse to http://localhost:8080 to get the nice little Tomcat welcome page.

Next download a copy of CF8 from Adobe's website (http://www.adobe.com/products/coldfusion/) and install that on your server next by using the "Deploy as J2EE, and as a .WAR" installation.  When the installation is complete you should have a .WAR file most likely if you used the defaults in your C:\ColdFusion8 root directory.

Stop the Tomcat Server via your services or direct command line. 

Now copy the .WAR file into your {TomcatRoot}\webapps directory. 

Start the Tomcat Server and within a few minutes, Tomcat should have expanded all of your directories into the webapps folder.  So at the end you should have a /cfusion directory sequence in your webapps directory.

Stop the Tomcat Server again. 

Ok, now for a fun part.  Open up notepad and create a .bat file called setenv.bat and place it in the {TomcatRoot}\bin folder.  Place the following code in that .bat file making sure to change the bolded areas to your exact folder structure:

rem Set a few variables.
set JAVA_HOME=C:\Program Files\Java\jre1.5.0_14
set CF_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\cfusion
set CF_WEB_INF=%CF_HOME%/WEB-INF

rem Concatenate binary file directories into a single variable.
set CF_SHARED_LIB=%CF_WEB_INF%/cfusion/lib
rem The following variable must be on a single line.
set CF_SHARED_LIBS=%CF_SHARED_LIB%;%CF_SHARED_LIB%/_nti40/bin;
%CF_WEB_INF%/cfusion/jintegra/bin;
%CF_WEB_INF%/WEB-INF/cfusion/jintegra/bin/international

rem Add libraries for binary files to the Windows system path.
set PATH=%PATH%;%CF_SHARED_LIBS%

rem Set JVM options to enable sandbox security (all on one line).
set CF_SECURITY_JVM_OPTIONS=-Djava.security.manager
-Djava.security.policy="%CF_WEB_INF%/cfusion/lib/coldfusion.policy"
-Djava.security.auth.policy="%CF_WEB_INF%/cfusion/lib/neo_jaas.policy"

rem Set JVM options for CORBA. Uncomment this line if vbjorb.jar is not in
rem your JRE's lib/ext directory.
rem set CF_CORBA_JVM_OPTIONS=-Xbootclasspath/a:"%CF_WEB_INF%/lib/vbjorb.jar"

rem Consolidate JVM options.
rem * Uncomment this line if you've configured CORBA
rem set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS% %CF_CORBA_JVM_OPTIONS%
rem * Uncomment this line if you haven't configured CORBA
set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS%

rem Populate JAVA_OPTS, which will be used by the catalina.bat file
rem when starting the JVM.
set JAVA_OPTS=%CF_JVM_OPTIONS%

Ok, go ahead and start Tomcat back up, and browse to localhost:8080/cfusion/cfide/administrator and with any luck, you should have the nice welcome screen of the ColdFusion 8 admin staring you in the face.  Go ahead and configure your instance with datasources, etc. and place any .cfm files you want to run in the /cfusion/cfide/ directory.

That's it.  I'm now in the process of getting the .cfm files to render in other directories and folder structures in the rest of the Tomcat so you can browse to other directories with .cfm files and get them to render.  Until next week!

Posted by dougjustice at 12:00 AM | Link | 0 comments
26 February 2008
Doug
Testing the Waters...or Web
Why sites fail



If I had to single out a reason why sites fail that really can be avoided, it would be the lack of testing.  It always seems as though sites are up against the wall to go live and do...only to fail when their users can't use the site for the sole reason it was created.  If adequate testing had been done on the site prior to launch the users' experience would be much more pleasant and better conversion rates would result.  However, it's not as simple as it seems.

What I've discovered over the years is coming up with testing scenarios, while a key to the success of the site, really comes down to how well the client really knows its own clients or potential users. While you are building a site for a client, it would be helpful to have your client coming up with scenarios to test the site.  The typical user scenario is pretty easy.  The ones that are difficult are the unusual users who may be coming to the site.  Now, my friends....I am not saying "unusual" meaning strange.  I mean unusual in the sense that they are not the typical user a client will expect to use their site. 

If you want to help find out what is the atypical user, consider these questions:

1.  Who would your typical user be, and who would your typical user be most likely to tell about your site.

2.  Consider geographical areas, meaning terms you would use that someone from another part of the country wouldn't.

3.  Consider ages.  A person who uses your site could potentially tell their elderly parent who is somewhat new at the internet...would they know exactly what to do on your site...could they get to the parts of the site you want them to.

4.  Consider gender.  Lowe's has increased the amount of sales, and sales decisions by females almost 30% more than its known competitor, Home Depot.  Why?  Because Lowe's considered the female perspective for what would make going to a hardware store (for all intensive purposes) more enjoyable for women, but yet still cater to their target market.  So they were able to keep their focus on the target market of males 25 - 40+ and still increase their sales.  So consider the fact that you may in fact have other genders visiting your site, and consider their perspective.

I don't expect you to be able to test every type of scenario, but perhaps by considering the atypical user, you may actually be able to have a much more stable application/website and really take advantage of those new site surge visitors.

 

 

 

Posted by dougjustice at 10:51 PM | Link | 0 comments
21 February 2008
Doug
Getting the CRUD out in your code
How some free online tools makes development easier



Ok, it's Thursday Tips Day, and I wanted to show you a very handy tool you can be using to speed along your development time, or help your web department speed their development time along at your own company.

The tool is called an Object Generator or an O/R Mapper.  Some also like to call them "CRUD" Tools.  CRUD is an acronym we geeky coders like to use that stands for:  Create, Read, Update, Delete.  In almost every basic web application out there today, we are asked to interface with some type of database or datasource.  And in almost every instance of that interfacing we (the coders) are doing some type of call to the database.  It could be reading one record, getting several records, updating a record, or even deleting one. 

Writing these calls can be very mundane.  Ones I usually save for my new coders to do <insert evil laugh here>.  However, these CRUD or Object Generator tools can help things along tremendously in development time, which then allows us or your web developers, time to focus on things that are usually overlooked or zipped through at the end of a project such as field validation, styles, SEO, etc.

For ASP.net we personally like to use O/R Mapper (www.ornetmapper.com).  The thing I personally like about this open source tool is the simple fact that the developer continues to really improve this tool with newer and more awesome releases than its prior.  As of this updated blog, the latest version is version 6, and it's come a long way and really could be the easiest most comprehensive way to develop the business logic for your next .NET project.


A Screen Shot of O/R Mapper (the ASP.NET Object Mapper Tool)
O/R Mapper Screen Shot

And using the code is even easier than using the tool itself in .NET.  So here's a quick example.  Let's say you have a table called Users and in your datagrid you have your typical select button which triggers your onSelect event in your code behind.  So now you want to populate a few text boxes in your form for editing.  Here it goes....in C#.net

          Users u = new Users();
          UsersAssembler a = new UsersAssembler();
          UsersCriteria c = new UsersCriteria();
          c.Set_Username(CriteriaBase.AVAILABLE_STRING_OPERATORS.EQUALS, "doug");
          u.ReadSingle(c);
         
Now that you have the information loaded into the "u" object...you just assign your textboxes accordingly....

          tbUsername.Text = u.Username;
          tbPassword.Text = u.Password;
          tbFirst.Text = u.FirstName;
          tbLast.Text = u.LastName;
      
          etc.

Did you blink and missed it?  Yes it's that quick.  You can also retrieve lists of results and do things like auto-bind it to your gridview, etc.  Really really cool.


For PHP, we personally like to use POG.  (www.phpobjectgenerator.com) This nifty little online tool will allow you to not only create the code classes you'll need to interface easily with your web application, but also build your tables for you.

      
A Screen Shot of POG (the PHP Object Generator Tool)
POG Screen Shot

Once all of your code and tables are built, its a snap to interface with them.  Let's say you have a table which has your user's vital information in it and you want to retrieve a list of users that have signed up in the past week.

       <?PHP
                  
                   // Create a new instance of our POG class for Users
                   $u = new users();

                   // Call the GetList Function to bring us back a list of users meeting our criteria
                   $userList = $u->GetList(array(array("signupdate",">=","2008-02-16 00:00:00")));

                   // Now loop through the results and display them for the end user to view
                   foreach($userList as $user)
                   {
                         echo '<p>User Name: ' . $user->username . ' <br />Name: ' . $user->first . ' ' . $user->last . '<br />Signup: ' . $user->signupdate . '</p>';
                   }
          ?>

Pretty simple huh?  And you can send as many criteria you want in additional arrays all in that same GetList() function.  So the speed at which you get results and have the ability to update them are fast and easy.

So take some time to check out POG or send this blog link to your favorite PHP coder.  They very well may thank you for it, however knowing most coders they'll probably say they already knew about it, thanks for the link, and then when people aren't looking will start to use it all the time.  Ha!!  Happy coding!

Doug.




                  
Posted by dougjustice at 8:44 AM | Link | 0 comments
17 February 2008
Doug
Going Green by Going Red
How on the fly PDF's can help save the trees



Going Green LiterallyI've seen about as much "going green" marketing as I think I can take...however there are a few things that we've recently been doing for some customers which actually falls into the whole less paper, less waste basket.  So I thought I'd share accordingly.

If your company uses any type of printed materials for either contracts, sales orders, forms, etc. you should consider perhaps going with a more dynamic solution of taking your contracts and forms to PDF's which can be signed digitally pretty easily now, and emailed back without a single sheet of green gold being wasted. 

Companies like eFax (www.efax.com) have really stepped it up and have even added a free service to their monthly subscribers by allowing them to upload and store and then use their scanned in digital signature for even more paperless processing.

ColdFusion FlashDocs/PDF
If your website or web application is ColdFusion based, you're just about as close as you can get to already having this functionality added to your system.  Simply by using ColdFusion 7&8's <cfdocument> tag like the following will instantly transform your page into a PDF which can be enhanced with dynamic data from your application/forms very quickly:

<cfdocument format="pdf" name="mydocument">
<cfloop index="x" from="1" to="40">
<p>
doloras lorem upsom doloras paris hilton is my hero loreum ipsom dsoio foom an to dht end of the world
will anyone actually read this probably not but let me put more realtext in so it flows a bit nicely
<cfloop index="y" from="1" to="#randRange(1,9)#">This sentence will appear a random amount of time.</cfloop>
</p>
</cfloop>
</cfdocument>

.NET and Tall Components
If you're a .NET firm or company, there's quite a number of solutions out there for you as well.  We've personally just worked on a project for Westcor Land Title www.ewestcor.com where all of their jackets and other assorted loan closing documents are generated on the fly.  Thereby reducing their need to request hundreds of these jackets and documents from a printer, thus reducing paper.

For that project we worked with TallComponents www.tallcomponents.com/ to accomplish this task which really allows for quite a bit of customization even more so in some respects than Adobe's solution.

For you PHP and Ruby folks, I did find a few quick and free solutions to generate PDF's from PHP.  The one that seems to be the easiest to use, but doesn't do a whole lot of fancy effects is www.fpdf.org
So you're in good shape as well.

Wow Gas Prices Go Green By Going Red
So you can go a bit greener by using the "Red" logo Adobe PDF format in a host of different ways on almost every type of web programming language in use today.  So save a tree...plant a PDF on your web app today.
Posted by dougjustice at 10:00 PM | Link | 0 comments
15 February 2008
Doug
At least I have a website...isn't that enough?
Why Image is Still Everything in Business



Image is Everything!

Ok, it's Friday and it's my birthday...so woo hoo for me.  However, I wanted to quickly make a blog about how many times I've heard people say, "Well at least I have a website" or "It's not a great site, but at least I have a website."  These are the same companies that can't understand why they are getting low conversions and low sales.

The simple fact of the matter is, image is everything.  Whether your site is just a few pages, or a full fledged application portal, it must look and behave as though it cost a million bucks.  Otherwise, people will quickly dismiss your site feeling as though you probably don't have the ability to either service their needs, or deliver the products or services you are selling.

Take for example these two BBQ style restaurants: 

www.thehornytoad.com

www.santanflat.com

as you can see they are similar in the style of restaurant and even most of the items on the menu are pretty similar.  However, which one are you more likely to take your family to?  I'm assuming you said San Tan Flat....and I'm assuming that most of you reading this blog have never been to either establishment before.  But faced with the tantalizing decision as to which BBQ restaurant you'll be taking your family to on Friday night, chances are you'd first try San Tan Flat before you'd try the Horny Toad. 

As a side note, you definitely want to check out the video San Tan Flat has on its home page.  Drew Carey did a spot on Reason.TV about this restaurant recently.  Apparently there's a "Footloose" type drama going on between the restaurant and the county for get this..... "The patrons dancing to the music".  The appear to be charging them $5,000.00 per violation.

This is also the case for many companies who even may outrank some of their competitor's sites in the search engines.  Why?  Because the site says it all.  One is a site that clearly has taken the time to give itself a very professional appearance, and the other, well just wants to have  website that they can put on their take out menus and coasters.

Keeping your site fresh, up to date, and professional looking is just as important as the quality of products and services your business is trying to promote or sell on the web.  You'd also be amazed that many times a site "facelift" isn't as expensive as you would think.  So when you're looking to either create a new website, or have its look changed...please keep this example in mind.  It could mean the difference between a successful business and a failing one.

Have a great weekend everyone.


Doug.
Posted by dougjustice at 5:30 PM | Link | 0 comments
14 February 2008
Doug
The Valentine Day Sprint
What Not to Do this Valentine's Day



Ok, how many of you have been out at the store at the last minute getting those flowers for Valentine's Day, grabbed the box of chocolates, and then suddenly remembered that you needed a card as well?  To top it all off you were running late in getting back to your house for that special V-Day dinner?  Arrggh....panic is starting to set in.

So you quickly run down to the greeting card aisle, quickly survey the demilitarized zone of Valentine's Day cards, find one that looks nice and has words that seem appropriate and zip over to the checkout counter.  Ok, we're nearly complete...but wait....we need to write something inside of the card and sign it....oh no!

So we look frantically through the glove compartment box, flip the sun visors, look in the change drawer, the middle console, under the seat, all in the hopes of finding that single writing implement that is most likely missing a cap, has a glob of ink dangling from the tip and has been severely chewed on the end so much that you could dislodge a penny from the ashtray by using it as a chisel.

This is usually the moment where for some strange reason you've luckily managed to hit all of the green lights for a change and are actually hoping for a red light for that mere 30 seconds you need to write those unending words of love and compassion that will sweep your honey right off of her feet. 

Ok so you get a red light finally and then warped pen in hand you stroke those loving words on the open side of the card right on the steering wheel.  However you then push too hard on the Love...Me....which of course beeps the horn at the car in front of you and awards you the friendly one finger wave from the driver ahead of you.

So you get back to the house in time to go out to dinner, you calmly stroll on into the house, flowers, chocolates, and your novelette of a Valentine's Day card in hand, and proudly give the items of your affection to your sweetheart.

She gasps for a moment, just so happy she has married a man who still likes to make Valentine's Day special...grabs the flowers, the chocolates and the card sets them down to give a very welcomed and very earned Valentine's Day smooch.

Finally without another word, she sniffs the elegant scent of the roses, mouth waters over the chocolate treats she'll be enjoying later tonight, and then opens the card...which magically says on the front....

"This Valentine's Day I wanted to say Something Special..."

and on the inside...

"You'll Do."


Funny enough...I don't think she ever read the other side of the card I wrote on.  Happy Valentine's Day Everyone!



Posted by dougjustice at 5:29 PM | Link | 0 comments
13 February 2008
Doug
The Best Web Testers Are Paid in Cookies
Why Six Year Olds Are Great Website Testers



I had one of those very strenuous days today.  These are the ones that as a web developer you just feel like taking your computer and throwing it from the highest location you can find.  The problem?  A website checkout process that was failing over 50% of the time with its users. 

I sat back and said a prayer for a moment since I believed that getting angry was not going to solve my problem.  And just like that I had a thought....approach this problem as if I were my 6 year old son using the form.  Within minutes I had the problem figured out, put in a quick javascript validator to make sure the values would be entered correctly and just like that...the problem was solved.

So I decided to blog about this since many times not only developers, but business owners will have their websites so complex that it will cause more problems than successes simply because they are not thinking like a user who's prime source of income would be a nice chocolate chip cookie.

I've actually had my son test quite a few of my websites and even though I may have to read the form to him to fill out, he has discovered some issues with my sites and I've coded appropriately to deal with them.  So the next time you're ready to launch a new form, or a new functionality of your site, think to yourself....if I were 6 how would I look at this.  Or better yet, if you can snag a youngster from your family or your close friends, use them to test it themselves and pay them with a nice big cookie for their good work.

Happy Coding!

Doug.
Posted by dougjustice at 12:00 AM | Link | 0 comments