Skin Spider : Another Bell And Whistle

Posted November 20, 2006 at 4:16 PM by Ben Nadel

To learn all about Skin Spider, click here.

To view the most updated application, click here.

To view the current code base, click here.

Just a minor update here. I have updated the videorating.cfm ColdFusion custom tag to have a toggle for whether or not the video clip is a favorite of the user. It works pretty much the same way as the rating (1 to 10) in that it uses a Javascript Image SRC attribute to call the application's API. I have included this as part of the videorating.cfm ColdFusion custom tag because it's sort of a rating and because the tag already existed; however, I could just have easily made a separate custom tag to do just the "favorite" functionality.

If you look at the search.cfm and the favorites.cfm ColdFusion templates, you will see that the only modifications that I have made are that I now get "is_favorite" from the database and use the "isfavorite" attribute of the ColdFusion custom tag. Everything else on those pages remains the same. This is the beauty of the custom tag - it helps protect or minimize the damage that variation can have on the system.

The two major changes of this update were made to the api.cfm ColdFusion template (our system API) and to the videorating.cfm ColdFusion custom tag. If you look at api.cfm, you will see that I have added another CFCase statement for the action "set_favorite". Like the "rate_video" action, "set_favorite" also takes the ID of the video in question. It also takes a boolean indicating whether or not the video is a favorite. It then takes this information and updates the database.

If you look at the videorating.cfm ColdFusion custom tag, you will see that I just added another link that says "Favorite." This link calls the Javascript method SetVideoFavorite(). This Javascript method is defined in the custom.js file. Like I said before, this method just uses the SRC attribute of a Javascript image to ping the system's API (api.cfm). In addition to pinging the API, this method also changes the CSS class of the Favorite link. If you try out the page, you will see that this CSS class defines the format and the gold star (background-image) of the link. Not very complicated stuff here. I have decided to make the gold start part of the CSS class, rather than an inline image because this way does not require the ColdFusion custom tag to know anything about the paths to the images folder. Right now, all the ColdFusion custom tag has to know about is what attributes it gets and what Javascript methods are available. I am trying to keep the coupling as low as possible.

So now, there is an inline way to rate the video clips and flag them as favorites. I have been trying to take care of these "low hanging" fruits - the easy changes - before I move on to the final, more complicated changes of Iteration 2. Hopefully over the holidays, I will have time to start thinking about the referential navigation, the biggest of the remaining Iteration 2 changes.



Reader Comments

There are no comments posted for this web log entry.

Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 23, 2013 at 9:52 PM
Preventing Links In Standalone iPhone Applications From Opening In Mobile Safari
@Muhmmadibn Did you figure out a solution to launching PDFs? I am running into the same issues myself. There is no way to close the PDF or go back once you launch it. Thanks in advance! ... read »
May 23, 2013 at 6:06 PM
The Girl Who Broke My Heart, And Made Me A Better Person
Good day,ladies and gentle men, my name is Dr AMADI the great spell caster in Africa, i have help so many people for different kind of problems,who say there is no solution to problems on earth, that ... read »
May 23, 2013 at 4:26 PM
ColdFusion QueryAppend( qOne, qTwo )
@Heather, Glad people are still getting value out of this! ... read »
May 23, 2013 at 3:49 PM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@WebManWalking, I meant the code at the bottom (not the video). I did try to experiment with an intermediary variable, like: value = users.id[ i ]; arrayContains( userIDs, value ); ... but t ... read »
May 23, 2013 at 11:06 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, Are you talking about As Number: YES As String: YES As Java: YES? If so, that's with 3 different ways of referencing the constant 1, not users.id[1]. Query object references(*) are what seem ... read »
May 23, 2013 at 9:55 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Dan, According to the CF Admin, I'm running Java "1.6.0_45". As far as the DB column, in the database it's an INT. I'll see if I can dig into what CF sees it as. @WebManWalking, But h ... read »
May 23, 2013 at 9:49 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, I think the problem is that we're used to loose typing in ColdFusion, like JavaScript. If a value is a number but it's needed in an expression to be a string, noooo problem. I've encountered ... read »
May 23, 2013 at 9:47 AM
ColdFusion QueryAppend( qOne, qTwo )
You rock! Thank you, thank you, thank you!!! ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools