Omniture Web Services API Code For ColdFusion

December 10, 2009 by dugsmith

We’ve been working on a ColdFusion application that uses the Omniture Web Services API. Omniture’s documentation is pretty light in this area, and the examples were not very applicable to ColdFusion. After pulling together several different blogs, docs, and some trial & error, I have created the following incantation. Hopefully it’ll save another Omniture/ColdFusion user a few minutes.

<cfsilent>
    <cffunction name="getOmnitureWsseRequestHeader" access="private" returntype="Any" output="false"
                hint="Return the header needed to make an Omniture web service request as a SOAPHeaderElement object">
        <cfargument name="strUsername" type="String" required="true" />
        <cfargument name="strSecret" type="String" required="true" />
        <cfscript>
            // Unique random number
            var strNonce = createUUID();
            // Date created in Omniture's required format
            var strCreated  = DateFormat(Now(),'YYYY-mm-dd H:mm:ss');
            // Password encoded according to Omniture's requirements
            var strPassword = ToBase64(Hash("#strNonce##strCreated##arguments.strSecret#", 'SHA').toLowerCase());
            // Start to build header
            var objHeader = CreateObject("java", "org.apache.axis.message.SOAPHeaderElement");
            var nodeUserToken = "";
            var nodePassword = "";
            // Construct XML structure with code
            objHeader.init("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "wsse:Security");
            objHeader.setMustUnderstand(1);
            objHeader.setActor("");
            nodeUserToken = objHeader.addChildElement("wsse:UsernameToken");
            nodeUserToken.setAttribute("wsu:Id", "User");
            nodeUserToken.addChildElement("wsse:Username").setValue(arguments.strUsername);
            nodePassword = nodeUserToken.addChildElement("wsse:Password");
            nodePassword.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0##PasswordDigest");
            nodePassword.setValue(strPassword);
            nodeUserToken.addChildElement("wsse:Nonce").setValue(strNonce);
            nodeUserToken.addChildElement("wsu:Created").setValue(strCreated);
        </cfscript>
        <cfreturn objHeader />
    </cffunction>

    <cfscript>
        objHeader = getOmnitureWsseRequestHeader("your-username", "your-secret-code");
        objService = CreateObject("webservice", "your-omniture-wsdl-file-url");
        objService.setHeader(objHeader);
    </cfscript>

</cfsilent>

<cfoutput>
<p>objService.companyGetTokenCount(): #objService.companyGetTokenCount()#</p>
</cfoutput>

To use this test code, do the following:

  1. Copy the code to a .cfm file
  2. Replace “your-username” and “your-secret-code” with your Omniture web service user name & shared secret code
  3. Replace”your-omniture-wsdl-file-url” with the URL to your .wsdl file
  4. Run it — it should work!

Don’t forget to use cfdump on the objService variable to see all of the methods you can call with the API!

“…BY EXAMPLE”

November 12, 2009 by katiegirl2112

DSC_3658webdevretreat09_1

We had a Web Development Leaders Weekend Retreat this fall and it went great.  The guys headed down there Friday after lunch, for a weekend of team building, leadership training, male bonding, and some chillin’ n’ grillin’…  Oh and there was some golfing too!  Can you say FORE?!  The retreat was also to give a big “thank you” to the leaders for working so hard on the new site and to show them how much we appreciate their willingness to serve the team in so many ways.

the-five-dysfunctions-of-a-teamDuring the retreat the guys discussed the book The Five Dysfunctions of a Team by Patrick Lencioni, and took the team assessment associated with the book.  After they reviewed their survey results, the team went over what they could work on improving as everyone was given a voice to share their ideas and opinions.  Later on in the weekend they also discussed vision and plans for the future.

side-shot-of-chalet

Friday night, the guys barbecued some hamburgers and hot dogs and just had a good time hanging out with each other.  That night, Jon gave the guys a special gift he purchased for the team of an engraved picture frame for each of the team leaders that had a group shot of the guys in it and had engraved “…BY EXAMPLE” on the bottom half of the frame.  This phrase is a model these guys go by to remember to lead their teams “by example.” With the frame also came hand-written notes to the team leaders from their team members.  I believe it was a great boost for their relaxing weekend to hear how much they were appreciated from the teams they lead.

Saturday morning they headed to Blackberry Ridge Golf Course and played 9 holes!  They had a total blast!  Some had never golfed before so it was a fun experience for all.

Sounds like the trip was a success!  Thanks goes to God that we are we able to do what we do everyday!  Each day is a gift and to be cherished.

DSC_0041_cropped

Bflex/Bfusion 09

November 12, 2009 by katiegirl2112

Nine of our team members went to Bloomington, Indiana for the 2009 Bfusion/Bflex Conference.  Here is some of their feedback about their awesome experience!

“BFusion/BFlex 09 was an opportunity for me to get the latest on the technologies we use daily. It’s inspiring and motivating to be around folks who are passionate about those technologies. This was a fun conference; Bloomington’s a nice town, and the facility at Indiana University was first-rate.”  - Ron Coffman | Web Marketing Developer

“I think the BFlex/BFusion conference was a great opportunity to learn from others who are doing some really cool stuff with ColdFusion and Flex.  This included coding best practices, latest server stack solutions, options for MVC frameworks, performance tuning points, and integration suites.  It also gave our team the ability to connect with some developers who can give us expertise as we move forward with some of our new projects in the next year.”   – Jim Ebert | Team Lead – ELP Web Development

“It was good conference. I learned a few new things and got to see some of the stuff other people in our industry are doing.” – Jon Fouss | ELP Web Developer

“The conference was very worthwhile. My favorite was the Mach-II 1.8 session with Peter Farrell, Kurt Wiersma, and Matt Woodward. Even though we have been using Mach-II 1.8 for several months, they shared very helpful things that will directly improve our applications. That session alone was worth the trip. My favorite Flex session was on Practical Cairngorm by T. Scot Clausing. Not only did he do a great job of showing how Cairngorm can improve project organization and productivity, he showed a very clean overall project structure and also took time to answer questions.” – Doug Smith | ELP Web Developer

“Bfusion/Bflex was a good event, well worth attending. It is very much focused on “hands-on” learning.  The facility at IU was fantastic.  They had some registration problems that contributed to low attendance. I think next year they will have it ironed out and I would definately attend again next year.” –Jason York | FPU Church Web Programmer

Picture 014Picture 019bfusion-dinnerPicture 024

User Error + QBQ → User Interface Error

November 7, 2009 by jonwolski

About once a day, I sift through our aggregated Web server error messages.  My usual sorting goes something like “this needs to be addressed, that one is novel, this one is my personal test and can be ignored.”  Usually there’s at least one issue where my first reaction is “Oh, that’s just user error.”

One particular error kept coming up from our internal users to the point that it became a nuisance, and I cried out “Why can’t they get that right?!” Immediately, I was convicted by what I had read in QBQ: The Question Behind the Question (a must-read for the Dave Ramsey team).  That wasn’t a ‘QBQ’ question. What can I do so that my internal users will get that right? In this case, a drop-down list contained an invalid option entitled “Select an Option”   The solution was obvious, remove the invalid option and enhance the then-arcane validation message. This process can be generalized to the following:

User Error + QBQ → User Interface Error

Don’t get me wrong, some times a user behavior is just too bizarre to code around it.  (The customer isn’t always right.) Sometimes a customer just needs some education.  The point is that as the solution developer, I’m responsible (at least in part) for my end-users’ actions. It is neglect of this truth that yields the bad reputation programmers get for their people skills.

Let’s do better. The next time you’re faced with a “PEBKAC” error, before you write it off as ID-10-T, consider the UI or the UX or the messaging or the training. You’ll ultimately wind up with a better product.  Who knows, maybe you’ll even create documentation.

Zooming like a pro with MapQuests AS3 api!

October 21, 2009 by mqguru

Wow, so I have had a ticket sitting in my queue for some time now that I didn’t think would be easy. What we had to do was zoom into a location while leaving that location in the same relative position for the user. After much thinking (about two hours) I came up with my solution. We use MapQuests AS3 api to interact with our maps.

The principle is simple. Figure out where the users mouse is. Get the XY, zoom in, figure out what LatLng is in that XY Position, and get the difference. Then apply the difference to the center point and set the new center point.

public function zoomMapKeepingXYCoords():void
{
var mouseXY:IPointXY = new PointXY(myMap.mouseX, myMap.mouseY);
var mouseLL:IPointLL = myMap.pixToLL(new PointXY(myMap.mouseX, myMap.mouseY));
setZoom(myMap.getZoomLevel() + 1);
var newLLatXY:IPointLL = myMap.pixToLL(mouseXY);
var latDiff:Number = mouseLL.lat – newLLatXY.lat;
var lngDiff:Number = mouseLL.lng – newLLatXY.lng;
var centerAftZoom:IPointLL = myMap.getCenter();
var newCenter:IPointLL =
       new PointLL(myMap.getCenter().lat + latDiff,myMap.getCenter().lng + lngDiff );
myMap.setCenter(newCenter);
}

Have Fun!

Take that, TicketMa$ter!

September 1, 2009 by jonwolski

What’s the coolest project you’ve ever worked on? When that question was posed to me, one project immediately came to mind.

  • 2-D bar-code scanner-equipped, wireless, hand-held computers.
  • Portable wireless network that spans any arbitrary venue (including 15,000 seat arenas).
  • Online event registration and e-ticketing.
  • Three months.
  • One developer.

When I started working with Dave Ramsey’s LIVE Events team, we were manually fulfilling about 30,000 paper tickets each year.  Event attendance growth looked to out-pace our capacity to fulfill tickets.  Electronic ticketing was not merely on Dave’s wish list, it was a necessity for my department to meet growing demand.  It was, to be dramatic, the reason I was hired.  It was also due to launch in 4 fewer months than the Web team had planned!

Looming deadlines are great for killing scope-creep.  We wound up using our existing antiquated event registration system with an appendage for emailing PDFs.  I figured we could distribute e-tickets in November for a February event, with the hope that we would have a way of scanning them by the time we got there.

At break-neck pace, we researched bar codes scanners, bar code generator libraries, wireless LAN gear, and vendors to quote on all that stuff.  This was a lot like laying down train tracks while rolling at full speed.  In fact, for the first event, migrating the data from the Web systems database to the gate control database required a few command line tricks and manually stopping and starting Tomcat.

Throughout the course of the events season, much of my manual intervention was automated until I was no longer needed on the road.  During our second season, the system matured to the point where events could happen without my even knowing about it.  It has been an awesome experience to pull this off with the aid of a great team, and with the trust from leadership to architect this and plan my releases as I saw necessary and feasible.  All in all, it looks like the decision to build in house, however rapidly it had to be done, has yielded 20-25 fold compared to the cost of [utilizing some other ticketing service].

FPU CONFERENCE CENTER AVAILABLE

August 7, 2009 by katiegirl2112

To give back to the local tech community, we’re making the FPU Conference Center available to user groups for upcoming conferences, meetings, etc.

This beauty of a building is located behind Financial Peace Plaza in Cool Springs Brentwood, TN.  Capacity of 300 with sound system, projectors, and dining area.

Please contact us for more information!

615-515-3223 ext. 5566

Conference Center (1 of 21)

Conference Center (1 of 1)

Conference Center (3 of 21)

Conference Center (7 of 21)

Conference Center (19 of 21)

Independence Delay

July 3, 2009 by jonwolski

W3C announced today the end of the XHTML 2 working group charter.  It has long been apparent that HTML 5 would become a reality, much to my chagrin, but I had hoped deep down that XHTML2 would not die.  You see, HTML 5 is a great tactical move to progress HTML making multimedia easier (among other things) for content authors. However, strategically, I feel this sets back the Web, particularly the semantic Web. I am disappointed, not because XHTML 2 has better features than HTML 5, but because the promotion of HTML 5 over XHTML 2 moves the Web in the wrong direction.

What’s so great about XHTML2

What’s so great about XHTML2? There are some nice cleanups, like replacing <h1-6> with a simple <h>.  The <hr> is replaced with a more semantically-named <separator>. The generalization of the href and src attributes were also pretty exciting. However, the biggest thing is decentralized extensibility. In fact, the W3C mentioned this in their FAQ regarding the end of XHTML2. The very existence of HTML 5 exemplifies why this is a big deal. Decentralized extensibility means we can create our own vocabularies independent of browser implementations.

The current state of things

As a developer, you’re stuck with the elements a user-agent implements.  With HTML, you are limited to what a consortium managed to agree upon and browser authors implemented (somewhat) consistently. The needs of content authors and the capabilities browsers have outgrown the existing centralized vocabularies of HTML 4 and XHTML 1.  HTML 5 addresses this problem with a brute force method: keep improving the centralized vocabulary, and try to keep up with the developer community.

Where we could be headed

If we currently live in the era of the Web browser, we ought to be headed toward the era of the XML browser.With XML, we have more liberty. We can create XML documents with our own vocabularies. We can even define the vocabularies through DTDs or other schemata.  We can mix and match our vocabularies with others. We can define the layout and presentation of new languages with CSS and XSL-FO. Better still, we can define what our new elements and attributes mean through RDF and its related technologies. This is the key.

Every time I mention this, I get the same question, “How would a browser know that my attribute mynamespace:foo@fetcherator is the same as html:a@href?” This is where RDF comes in. With semantic technologies, we can define our vocabularies in such a way that a browser will know.

Why can’t we head there with HTML 5?

We can. In fact, I believe we will (though perhaps more slowly now). My concern is the motivation behind the HTML enhancements in HTML 5 vs XHTML 2. XHTML 2 was a continuation of the W3C’s efforts to bring the benefits of XML into HTML, while HTML 5 seems to bring the benefits of new user agent capabilities into HTML. We need to decouple the user agent capabilities from our document vocabularies. This is true independence.

We can still do this.  The future may still be bright. I hope that we do not lose the vision as we postpone liberty for the comforts afforded by the latest iteration of a centralized HTML.

Adobe ColdFusion Rocks Lampo

July 1, 2009 by katiegirl2112

On June 18th we were honored to have had the 2009 Adobe ColdFusion User Group Tour on our very own stomping grounds in Brentwood, TN.  The event was held in our conference center and we had a great turn out.  Greg Wilson, an Adobe Product Evangelist, demo’ed many new features in the upcoming release of ColdFusion 9.  The majority of our crew attended and took a lot away from it.  Here are some of their thoughts and photos with highlights from the exciting night!

“I’m particularly pleased with the ability to do much more in <cfscript /> that ever before. As a Java developer, it makes ColdFusion much more appealing. Also, Hibernate integration is particularly interesting – that should improve productivity for data-driven apps dramatically.”

Doug Smith – Sr. Web Programmer

“It was great to see how much Adobe has their finger on the pulse of the development community.  Many of the new features for CF9 are things that just in the past week I had heard someone say, ‘Wouldn’t it be great if you could do that in Coldfusion?’ and sure enough, soon you’ll be able to.  Getting that behind-the-scenes perspective from Greg was really cool.”

Ty DeLong – Web Programmer

“The most interesting parts of the event for me were seeing the demonstration of the new, long-awaited Bolt IDE.  It has a lot of nice features that should improve development.  I also enjoyed the new features of the next version of the ColdFusion language. The presenter explained that Adobe has added a lot of little features to make syntax more consistent throughout ColdFusion. They’ve also added some interesting controls, ie. the DataGrid, which might help us to do some standard things more quickly.”

Ron Coffman – Marketing Web Programmer

“The event was a great example of Adobe stepping up once more and retooling ColdFusion into an industry-leading Rapid Application Development language. It was awesome to hear first-hand about some features that I’ve wanted to see for quite a while!”

Tim Kucejko – Web Programmer

“Several great features were presented. Bolt looks like a nice upgrade to CFEclipse. I like the new tags that simplify using JavaScript interface components. I also like the enhancements being made to the cfscript tag. But best of all: ternary operator …”

Jon Fouss – Sr. Web Programmer


DSC_0390

DSC_0405DSC_0396DSC_0320DSC_0355DSC_0349DSC_0400

IMG_4241 DSC_0372

Ugly Shirt Day 2009

June 18, 2009 by katiegirl2112

Ugly Shirt Day 2009

Our team has been working really hard lately on redesigning the Dave Ramsey site (which is going to look amazing!  keep an eye out!!!).  The other day, a few of us were discussing the new site when one of the guys complimented another on his choice of attire for the day.  The recipient of the adulation was our very own Jon Wolski.  He is the embodiment of retro chic and that particular day was sporting a fabulous Hawaiian button-up.

In a half-joking, half-serious manner it was suggested that we sponsor a Hawaiian shirt day in honor of those who are “encouraged” to do so regularly by corporate america to support “team spirit.”  The idea bloomed to wearing some silly shirt every Friday for the month of June.

Well, last Friday we had Ugly Shirt Day 2009!  Don’t we look awesome?  :) So with all this shirt ugliness going around we decided to vote for the worst.

Here are the results!IMG_4065

That cool dude posing in the front, Jim, WON with his “Dream” shirt and Kelly, off to the far right received Runner-Up with his amazing “Three Wolves” shirt.  For the prize Jim received an official “Ug Mug” and ugly bird figurine trophy!  Kelly won an ugly hat.  Congratulations boys for making ugly look easy!  I didn’t do too bad myself, ehhh?!IMG_4077

Cheers to all,

Katie

“An Untamed Spirit” (It’s on my classy Sturgis 2001 shirt) :)

Have a great week everybody!

P.S. Chris took these radical photos!  Way to go dude!

You know... just being ourselves!

You know... just being ourselves!